[Config] fix error handler restoration in test
This commit is contained in:
parent
ff52a9f928
commit
266afeb161
|
@ -160,10 +160,17 @@ class XmlUtilsTest extends \PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
$file = __DIR__.'/../Fixtures/foo.xml';
|
$file = __DIR__.'/../Fixtures/foo.xml';
|
||||||
try {
|
try {
|
||||||
XmlUtils::loadFile($file);
|
try {
|
||||||
$this->fail('An exception should have been raised');
|
XmlUtils::loadFile($file);
|
||||||
} catch (\InvalidArgumentException $e) {
|
$this->fail('An exception should have been raised');
|
||||||
$this->assertEquals(sprintf('File %s does not contain valid XML, it is empty.', $file), $e->getMessage());
|
} 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();
|
restore_error_handler();
|
||||||
|
|
Reference in New Issue