[BrowserKit] Handle deprecations triggered in insulated requests
This commit is contained in:
parent
ff379efb59
commit
ca0fedd9e3
@ -343,9 +343,23 @@ abstract class Client
|
|||||||
*/
|
*/
|
||||||
protected function doRequestInProcess($request)
|
protected function doRequestInProcess($request)
|
||||||
{
|
{
|
||||||
|
$deprecationsFile = tempnam(sys_get_temp_dir(), 'deprec');
|
||||||
|
putenv('SYMFONY_DEPRECATIONS_SERIALIZE='.$deprecationsFile);
|
||||||
$process = new PhpProcess($this->getScript($request), null, null);
|
$process = new PhpProcess($this->getScript($request), null, null);
|
||||||
$process->run();
|
$process->run();
|
||||||
|
|
||||||
|
if (file_exists($deprecationsFile)) {
|
||||||
|
$deprecations = file_get_contents($deprecationsFile);
|
||||||
|
unlink($deprecationsFile);
|
||||||
|
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
|
||||||
|
if ($deprecation[0]) {
|
||||||
|
trigger_error($deprecation[1], E_USER_DEPRECATED);
|
||||||
|
} else {
|
||||||
|
@trigger_error($deprecation[1], E_USER_DEPRECATED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$process->isSuccessful() || !preg_match('/^O\:\d+\:/', $process->getOutput())) {
|
if (!$process->isSuccessful() || !preg_match('/^O\:\d+\:/', $process->getOutput())) {
|
||||||
throw new \RuntimeException(sprintf('OUTPUT: %s ERROR OUTPUT: %s', $process->getOutput(), $process->getErrorOutput()));
|
throw new \RuntimeException(sprintf('OUTPUT: %s ERROR OUTPUT: %s', $process->getOutput(), $process->getErrorOutput()));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user