`SYMFONY_DEPRECATIONS_HELPER` has no effect when using the `WrapperRunner`
MatTheCat opened this issue · 4 comments
Q | A |
---|---|
ParaTest version | 6.10.0 |
PHPUnit version | 9.6.12 |
PHP version | 8.2.8 |
Summary
I wanted to try SYMFONY_DEPRECATIONS_HELPER
’s logFile
option, but it only worked when I removed the --runner=WrapperRunner
option from paratest
’s CLI.
How to reproduce: command, code and error stack trace
In your PhpUnit configuration file, add or update SYMFONY_DEPRECATIONS_HELPER
as such:
<server name="SYMFONY_DEPRECATIONS_HELPER" value="logFile=var/log/deprecations.test.log" />
then run eg. vendor/bin/paratest --runner=WrapperRunner
(I confirmed the --processes
option does not make any difference).
Current behavior
The var/log/deprecations.test.log
file is not created.
Expected behavior
The var/log/deprecations.test.log
file is created and filled with collected deprecations.
It seems when the WrapperRunner
is used, PHPUNIT_COMPOSER_INSTALL
is not defined when Symfony’s PHPUnit Bridge’s bootstrap runs, thus preventing the registration of the DeprecationErrorHandler
. https://github.com/symfony/symfony/blob/9767270b34e97d1bbf340f9ab3358a0178dccb8a/src/Symfony/Bridge/PhpUnit/bootstrap.php#L25
Ahah Symfony’s PHPUnit Bridge’s bootstrap is run when the autoloader is required, but phpunit-wrapper
sets PHPUNIT_COMPOSER_INSTALL
after that.
So switching these two lines fixes my issue:
paratest/bin/phpunit-wrapper.php
Lines 18 to 19 in c2243b2
Nice, would you like to create a PR please?
That was fast! Thanks 🚀