If you install phpunit/phpunit package in Symfony 4 application, you get the message:
Adding phpunit/phpunit as a dependency is discouraged in favor of Symfony's PHPUnit Bridge.
- Instead:
- Remove it now:
composer remove --dev phpunit/phpunit- Use Symfony's bridge:
composer require --dev phpunit
So, I installed symfony/phpunit-bridge package.
It created bin/phpunit file and vendor/bin/simple-phpunit.
- If I run
bin/phpunit, it downloads phpunit project and installs its dependencies inbin/.phpunit/phpunit-6.5. - If I run
vendor/bin/simple-phpunit, it downloads phpunit project and installs its dependencies invendor/bin/.phpunit/phpunit-5.7.
Note that the versions are not the same. Why?
And why to not use composer and its autoloader? Now we have troubles with it and other tools like PHPStorm (broken phpunit debugging, etc).
I know, that I can add phpunit path to main composer autoload, but this method seems very dirty.
How to use phpunit in Symfony 4 proper way, with all debugging integrations, etc?