-
Notifications
You must be signed in to change notification settings - Fork 18
Consider deprecating this bundle #67
Comments
@stof phpunit-mink seems like a great library. However, I don't see an easy way to get access to the container during tests using that library. All test cases must extend from its provided base class, so I cannot extend from Symfony's built in WebTestCase which does some heavy lifting to boot the kernel so I can get access to the container. A lot of my tests require setting up some data via Doctrine first, so getting access to the entity manager before making page requests w/ mink is important. |
What you mean by |
I mean Symfony's dependency injection container. Symfony provides a class KernelTestCase which extends PHPUnit's |
Doesn't it have something like trait, that can be added to any base test case file? |
It doesn't have a trait. Maybe I will open an issue with the Symfony project to see if that's something that can be done. For the time being I've just created my own base testing class that extends from the phpunit-mink one and copied in the code from the Symfony base class. |
I now marked the bundle as abandoned on Packagist |
This bundle was written in the early days of Behat and Mink, when @everzet thought that the proper way to make Behat and Symfony work together was to bring Behat and Mink into Symfony through bundles.
This has since be considered as a mistake. BehatBundle has been deprecated years ago already. and Mink is integrated into Behat through MinkExtension. We also have a much better way to use Mink in PHPUnit through phpunit-mink instead of booting a Symfony kernel into your tests to get a Mink instance from it and start using it.
Thus, this bundle suffers from many issues:
Rather than trying to update the bundle to fix all these points (which would require BC breaks for several of them), I suggest deprecating it and suggest people to use the right tool for the job, i.e. phpunit-mink (which also has more features btw).
what do you think @minkphp/core-team @minkphp/minkbundle ?
The text was updated successfully, but these errors were encountered: