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 ca0fedd

Browse filesBrowse files
[BrowserKit] Handle deprecations triggered in insulated requests
1 parent ff379ef commit ca0fedd
Copy full SHA for ca0fedd

File tree

1 file changed

+14
-0
lines changed
Filter options

1 file changed

+14
-0
lines changed

‎src/Symfony/Component/BrowserKit/Client.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/Client.php
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,23 @@ public function request($method, $uri, array $parameters = array(), array $files
343343
*/
344344
protected function doRequestInProcess($request)
345345
{
346+
$deprecationsFile = tempnam(sys_get_temp_dir(), 'deprec');
347+
putenv('SYMFONY_DEPRECATIONS_SERIALIZE='.$deprecationsFile);
346348
$process = new PhpProcess($this->getScript($request), null, null);
347349
$process->run();
348350

351+
if (file_exists($deprecationsFile)) {
352+
$deprecations = file_get_contents($deprecationsFile);
353+
unlink($deprecationsFile);
354+
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
355+
if ($deprecation[0]) {
356+
trigger_error($deprecation[1], E_USER_DEPRECATED);
357+
} else {
358+
@trigger_error($deprecation[1], E_USER_DEPRECATED);
359+
}
360+
}
361+
}
362+
349363
if (!$process->isSuccessful() || !preg_match('/^O\:\d+\:/', $process->getOutput())) {
350364
throw new \RuntimeException(sprintf('OUTPUT: %s ERROR OUTPUT: %s', $process->getOutput(), $process->getErrorOutput()));
351365
}

0 commit comments

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