Symfony: How to correctly switch from phpunit/phpunit to phpunit bridge

3.4k Views Asked by At

Using Symfony 4, I have recently come across the message "Adding phpunit/phpunit as a dependency is discouraged." which seems to have been added in this PR. The message says to "Run php bin/phpunit" which then seems to download PHPUnit to the bin/ directory. However, I don't see why it is placed there and not in the vendor/ directory. I can see I can change the path using an ENV variable, but I don't want to do that every time I run my tests. I have tried looking up the documentation around this recipe, but there isn't much to go on.
Am I mis-understanding something?
Or is the documentation incomplete/misleading?

1

There are 1 best solutions below

1
On

They now recommend using ./vendor/bin/simple-phpunit which will be installed with phpunit-bridge: https://symfony.com/doc/current/testing.html

The first call to simple-phpunit installs some requirements.