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:
- Set SYMFONY_PHPUNIT_VERSION in the phpunit.xml/phpunit.xml.dist file in the project root folder.
- Set SYMFONY_PHPUNIT_VERSION in .env.test file.
- Set SYMFONY_PHPUNIT_VERSION to 7.5 in the /bin/phpunit file.
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?