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:
Fabien Potencier 2014-12-23 18:36:02 +01:00
commit aaf4c84557
3 changed files with 18 additions and 4 deletions

View File

@ -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';
}

View File

@ -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();

View File

@ -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();