Reputation: 851
I'm using Symfony 4.2 with test-pack which includes symfony/phpunit-bridge 4.2.
The default version of PHPUnit is 6.5, but I want to upgrade it to 7.5.
On the Symfony PHPUnit Bridger doc, it says:
Set the SYMFONY_PHPUNIT_VERSION env var to e.g. 5.5 to change the base version of PHPUnit to 5.5 instead of the default 5.3.
It's also possible to set this env var in the phpunit.xml.dist file.
I tried three ways:
And then, I removed the /bin/.phpunit folder and ran /bin/phpunit command to reinstall the PHPUnit.
Only the 3rd way worked on upgrading the PHPUnit version.
What have I done wrong here?
Where is the best place to set SYMFONY_PHPUNIT_VERSION?
Upvotes: 3
Views: 2812
Reputation: 221
I had the same problem and stumbled across your post, thanks for your hint with this env var.
In my case, I put the SYMFONY_PHPUNIT_VERSION into my docker-compose.yml to my container environment definition. It was not necessary to delete the bin/.phpunit folder because re-running bin/phpunit takes care that the required version is installed.
If you don't use docker you could could try this:
SYMFONY_PHPUNIT_VERSION=7.5 bin/phpunit
or
export SYMFONY_PHPUNIT_VERSION=7.5
bin/phpunit
Upvotes: 3