bug #31962 Fix reporting unsilenced deprecations from insulated tests (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

Fix reporting unsilenced deprecations from insulated tests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Introduced while fixing CS in batch.

Commits
-------

48093f4a13 Fix reporting unsilenced deprecations from insulated tests
This commit is contained in:
Nicolas Grekas 2019-06-09 18:16:23 +02:00
commit a1d07a99cd
2 changed files with 4 additions and 2 deletions

View File

@ -284,7 +284,8 @@ class SymfonyTestsListenerTrait
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
$error = serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => isset($deprecation[2]) ? $deprecation[2] : null));
if ($deprecation[0]) {
@trigger_error($error, E_USER_DEPRECATED);
// unsilenced on purpose
trigger_error($error, E_USER_DEPRECATED);
} else {
@trigger_error($error, E_USER_DEPRECATED);
}

View File

@ -361,7 +361,8 @@ abstract class Client
unlink($deprecationsFile);
foreach ($deprecations ? unserialize($deprecations) : [] as $deprecation) {
if ($deprecation[0]) {
@trigger_error($deprecation[1], E_USER_DEPRECATED);
// unsilenced on purpose
trigger_error($deprecation[1], E_USER_DEPRECATED);
} else {
@trigger_error($deprecation[1], E_USER_DEPRECATED);
}