Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Ensure DeprecationErrorHandler::collectDeprecations() is triggered #24696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Ensure DeprecationErrorHandler::collectDeprecations() is triggered if…
… SYMFONY_DEPRECATIONS_SERIALIZE is set
  • Loading branch information
alexpott committed Oct 26, 2017
commit f337a667a639764df1e42ab21d0f0d28b27fd1f4
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public function endTest($test, $time)
if ($this->runsInSeparateProcess) {
$deprecations = file_get_contents($this->runsInSeparateProcess);
unlink($this->runsInSeparateProcess);
putenv('SYMFONY_DEPRECATIONS_SERIALIZE=');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the = should be removed, to really remove the env var (the = makes it the empty string, where we want to delete it, isn't it?)

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);
Expand Down
11 changes: 7 additions & 4 deletions 11 src/Symfony/Bridge/PhpUnit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.