Ensure DeprecationErrorHandler::collectDeprecations() is triggered
This commit is contained in:
parent
3e3e74c3fa
commit
e7da1606f0
@ -262,6 +262,7 @@ class SymfonyTestsListenerTrait
|
||||
if ($this->runsInSeparateProcess) {
|
||||
$deprecations = file_get_contents($this->runsInSeparateProcess);
|
||||
unlink($this->runsInSeparateProcess);
|
||||
putenv('SYMFONY_DEPRECATIONS_SERIALIZE');
|
||||
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
|
||||
if ($deprecation[0]) {
|
||||
trigger_error(serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false))), E_USER_DEPRECATED);
|
||||
|
@ -12,12 +12,15 @@
|
||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
||||
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
|
||||
|
||||
// Detect if we need to serialize deprecations to a file.
|
||||
if ($file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
|
||||
DeprecationErrorHandler::collectDeprecations($file);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Detect if we're loaded by an actual run of phpunit
|
||||
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !class_exists('PHPUnit_TextUI_Command', false) && !class_exists('PHPUnit\TextUI\Command', false)) {
|
||||
if ($ser = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
|
||||
DeprecationErrorHandler::collectDeprecations($ser);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user