Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Consider deprecating this bundle #67

Closed
stof opened this issue Feb 29, 2016 · 6 comments
Closed

Consider deprecating this bundle #67

stof opened this issue Feb 29, 2016 · 6 comments

Comments

@stof
Copy link
Member

stof commented Feb 29, 2016

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:

  • the mink sessions are prototype-scoped, leading to a weird usage pattern
  • the bundle couples the sessions to the driver types, which does not make much sense (Behat MinkExtension 1.x inherited this mistake, which was fixed in 2.0)
  • the bundle does not support configuring Mink drivers properly (its Goutte configuration is totally outdated for instance, and would break when using Goutte 2 or newer, which happens by default when installing the driver, but other drivers are also outdated)
  • the remote code coverage feature misuses Mink (setting a cookie before visiting a URL is not a supported usage)
  • the remove code coverage feature relies on the Selenium extension for PHPUnit being available in the include path of the server, which is very unlikely as PHPUnit is not installed through PEAR anymore
  • the bundle is incompatible with Symfony 3
  • the bundle is hardly maintained
  • the bundle testsuite does not make sense. It does not actually test the bundle, but Mink drivers (which is why there is a functional test per driver). But we already have the driver-testsuite for that in Mink.

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 ?

@bkosborne
Copy link

@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.

@aik099
Copy link
Member

aik099 commented Apr 28, 2016

However, I don't see an easy way to get access to the container during tests using that library.

What you mean by container? There is no container when you're running PHPUnit test suite.

@bkosborne
Copy link

I mean Symfony's dependency injection container. Symfony provides a class KernelTestCase which extends PHPUnit's PHPUnit_Framework_TestCase. This class makes the Symfony Kernel available (and therefore the DI container).

@aik099
Copy link
Member

aik099 commented Apr 28, 2016

Doesn't it have something like trait, that can be added to any base test case file?

@bkosborne
Copy link

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.

@stof
Copy link
Member Author

stof commented Sep 6, 2021

I now marked the bundle as abandoned on Packagist

@stof stof closed this as completed Sep 6, 2021
@stof stof pinned this issue Sep 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants