Skip to content

Commit

Permalink
bug #13075 [Config] fix error handler restoration in test (nicolas-gr…
Browse files Browse the repository at this point in the history
…ekas)

This PR was merged into the 2.3 branch.

Discussion
----------

[Config] fix error handler restoration in test

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

266afeb [Config] fix error handler restoration in test
  • Loading branch information
fabpot committed Dec 23, 2014
2 parents e2762f6 + 266afeb commit cad7f0e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php
Expand Up @@ -160,10 +160,17 @@ public function testLoadWrongEmptyXMLWithErrorHandler()

$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();
Expand Down

0 comments on commit cad7f0e

Please sign in to comment.