bin/phpunit file check following env parameters at runtime :
- SYMFONY_DEPRECATIONS_HELPER
- SYMFONY_PHPUNIT_REMOVE
- SYMFONY_PHPUNIT_VERSION
- SYMFONY_PHPUNIT_DIR
and set a default value if they're not already defined.
Values defined in phpunit.xml are not defined as env values at this point, so default values will apply.
vendor/symfony/phpunit-bridge/bin/simple-phpunit file do not apply phpunit.xml values if env variables are already set.
So basically it is impossible to set the 4 env variables using phpunit.xml
Step to reproduce :
Add
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled" force="true"/>
to phpunit.xml
run bin/phpunit
SYMFONY_DEPRECATIONS_HELPER value will be 999999