8000 bug #13075 [Config] fix error handler restoration in test (nicolas-gr… · symfony/symfony@cad7f0e · GitHub
[go: up one dir, main page]

Skip to content

Commit cad7f0e

Browse files
committed
bug #13075 [Config] fix error handler restoration in test (nicolas-grekas)
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
2 parents e2762f6 + 266afeb commit cad7f0e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,17 @@ public function testLoadWrongEmptyXMLWithErrorHandler()
160160

161161
$file = __DIR__.'/../Fixtures/foo.xml';
162162
try {
163-
XmlUtils::loadFile($file);
164-
$this->fail('An exception should have been raised');
165-
} catch (\InvalidArgumentException $e) {
166-
$this->assertEquals(sprintf('File %s does not contain valid XML, it is empty.', $file), $e->getMessage());
163+
try {
164+
XmlUtils::loadFile($file);
165+
$this->fail('An exception should have been raised');
166+
} catch (\InvalidArgumentException $e) {
167+
$this->assertEquals(sprintf('File %s does not contain valid XML, it is empty.', $file), $e->getMessage());
168+
}
169+
} catch (\Exception $e) {
170+
restore_error_handler();
171+
error_reporting($errorReporting);
172+
173+
throw $e;
167174
}
168175

169176
restore_error_handler();

0 commit comments

Comments
 (0)
0