Merge branch '2.3' into 2.5
* 2.3: [FrameworkBundle] forward error reporting level to insulated Client [Config] fix error handler restoration in test
This commit is contained in:
commit
aaf4c84557
@ -160,9 +160,13 @@ class Client extends BaseClient
|
||||
$profilerCode = '$kernel->getContainer()->get(\'profiler\')->enable();';
|
||||
}
|
||||
|
||||
$errorReporting = error_reporting();
|
||||
|
||||
$code = <<<EOF
|
||||
<?php
|
||||
|
||||
error_reporting($errorReporting);
|
||||
|
||||
if ('$autoloader') {
|
||||
require_once '$autoloader';
|
||||
}
|
||||
|
@ -163,10 +163,17 @@ class XmlUtilsTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$file = __DIR__.'/../Fixtures/foo.xml';
|
||||
try {
|
||||
XmlUtils::loadFile($file);
|
||||
$this->fail('An exception should have been raised');
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->assertEquals(sprintf('File %s does not contain valid XML, it is empty.', $file), $e->getMessage());
|
||||
try {
|
||||
XmlUtils::loadFile($file);
|
||||
$this->fail('An exception should have been raised');
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->assertEquals(sprintf('File %s does not contain valid XML, it is empty.', $file), $e->getMessage());
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
restore_error_handler();
|
||||
error_reporting($errorReporting);
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
restore_error_handler();
|
||||
|
@ -102,10 +102,13 @@ class Client extends BaseClient
|
||||
$r = new \ReflectionClass('\\Symfony\\Component\\ClassLoader\\ClassLoader');
|
||||
$requirePath = str_replace("'", "\\'", $r->getFileName());
|
||||
$symfonyPath = str_replace("'", "\\'", realpath(__DIR__.'/../../..'));
|
||||
$errorReporting = error_reporting();
|
||||
|
||||
$code = <<<EOF
|
||||
<?php
|
||||
|
||||
error_reporting($errorReporting);
|
||||
|
||||
require_once '$requirePath';
|
||||
|
||||
\$loader = new Symfony\Component\ClassLoader\ClassLoader();
|
||||
|
Reference in New Issue
Block a user