Skip to content

Commit

Permalink
bug #39226 [PhpUnitBridge] Fix disabling DeprecationErrorHandler from…
Browse files Browse the repository at this point in the history
… PHPUnit configuration file (fancyweb)

This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fix disabling DeprecationErrorHandler from PHPUnit configuration file

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #38239
| License       | MIT
| Doc PR        | -

The linked issue description is right, the bridge's bootstrap is hit before the env variables from the phpunit.xml file are read and set. So the easiest solution is to read it ourselves in the root script (like we already do for some of them).

Commits
-------

41158b8 [PhpUnitBridge] Fix disabling DeprecationErrorHandler from phpunit configuration file
  • Loading branch information
nicolas-grekas committed Dec 8, 2020
2 parents 1ea5a8c + 41158b8 commit cba70a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php
Expand Up @@ -146,6 +146,10 @@
}
}

if ('disabled' === $getEnvVar('SYMFONY_DEPRECATIONS_HELPER')) {
putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
}

$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
|| ($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
|| ($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
Expand Down

0 comments on commit cba70a6

Please sign in to comment.