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?
Asked
Active
Viewed 3,344 times
1

Votemike
- 762
- 1
- 10
- 28
-
After further investigation it seems that the recipe is supposed to add the .phpunit directory to the .gitignore file which didn't happen in my project for some reason, possibly because the .gitignore file already had the `###> symfony/phpunit-bridge ###` comments in it. – Votemike Dec 20 '17 at 11:19
1 Answers
2
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.

Thomas
- 89
- 2
- 5
-
Thank you. Thank you. Thank you. I did not find the answer in the manual and anywhere on the net... Do I run the phpunit before I write a test? Why? :) Thanks! – TrX Sep 04 '18 at 17:42