diff --git a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php index 900e6b0f75..f592e571c2 100644 --- a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php +++ b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php @@ -160,10 +160,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();