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

Commit 6f45707

Browse filesBrowse files
committed
Fix review points
1 parent 3fb8edd commit 6f45707
Copy full SHA for 6f45707

File tree

Expand file treeCollapse file tree

2 files changed

+10
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-4
lines changed

‎src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,16 @@ public static function register($mode = 0)
116116
}
117117

118118
if (isset($trace[$i]['object']) || isset($trace[$i]['class'])) {
119-
if (isset($trace[$i]['class']) && 'Symfony\Bridge\PhpUnit\SymfonyTestsListener' === $trace[$i]['class']) {
119+
if (isset($trace[$i]['class']) && in_array($trace[$i]['class'], ['Symfony\Bridge\PhpUnit\SymfonyTestsListener', 'Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListener'], true)) {
120120
$parsedMsg = unserialize($msg);
121121
$msg = $parsedMsg['deprecation'];
122122
$class = $parsedMsg['class'];
123123
$method = $parsedMsg['method'];
124124
} else {
125125
$class = isset($trace[$i]['object']) ? get_class($trace[$i]['object']) : $trace[$i]['class'];
126126
$method = $trace[$i]['function'];
127-
$Test = $UtilPrefix.'Test';
128127
}
128+
$Test = $UtilPrefix.'Test';
129129

130130
if (0 !== error_reporting()) {
131131
$group = 'unsilenced';

‎src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ public function endTest($test, $time)
264264
unlink($this->runsInSeparateProcess);
265265
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
266266
if ($deprecation[0]) {
267-
trigger_error(serialize(array('deprecation' => $deprecation[1], 'class' => $deprecation[2], 'method' => $deprecation[3])), E_USER_DEPRECATED);
267+
trigger_error(serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false))), E_USER_DEPRECATED);
268268
} else {
269-
@trigger_error(serialize(array('deprecation' => $deprecation[1], 'class' => $deprecation[2], 'method' => $deprecation[3])), E_USER_DEPRECATED);
269+
@trigger_error(serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false))), E_USER_DEPRECATED);
270270
}
271271
}
272272
$this->runsInSeparateProcess = false;
@@ -326,6 +326,12 @@ public function handleError($type, $msg, $file, $line, $context = array())
326326

327327
return $h ? $h($type, $msg, $file, $line, $context) : false;
328328
}
329+
// If the message is serialized we need to extract the message. This occurs when the error is triggered by
330+
// by the isolated test path in \Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait::endTest().
331+
$parsedMsg = @unserialize($msg);
332+
if (is_array($parsedMsg)) {
333+
$msg = $parsedMsg['deprecation'];
334+
}
329335
if (error_reporting()) {
330336
$msg = 'Unsilenced deprecation: '.$msg;
331337
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.