8000 Set back libxml settings after testings. · symfony/symfony@29d6969 · GitHub
[go: up one dir, main page]

Skip to content

Commit 29d6969

Browse files
committed
Set back libxml settings after testings.
1 parent e62d98e commit 29d6969

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ public function testLoadFile()
6363

6464
public function testLoadFileWithInternalErrorsEnabled()
6565
{
66-
libxml_use_internal_errors(true);
66+
$internalErrors = libxml_use_internal_errors(true);
6767

6868
$this->assertSame(array(), libxml_get_errors());
6969
$this->assertInstanceOf('DOMDocument', XmlUtils::loadFile(__DIR__.'/../Fixtures/Util/invalid_schema.xml'));
7070
$this->assertSame(array(), libxml_get_errors());
71+
72+
libxml_clear_errors();
73+
libxml_use_internal_errors($internalErrors);
7174
}
7275

7376
/**
@@ -144,7 +147,7 @@ public function getDataForPhpize()
144147
public function testLoadEmptyXmlFile()
145148
{
146149
$file = __DIR__.'/../Fixtures/foo.xml';
147-
$this->setExpectedException('InvalidArgumentException', 'File '.$file.' does not contain valid XML, it is empty.');
150+
$this->setExpectedException('InvalidArgumentException', sprintf('File %s does not contain valid XML, it is empty.', $file));
148151
XmlUtils::loadFile($file);
149152
}
150153

src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testLoad()
3030

3131
public function testLoadWithInternalErrorsEnabled()
3232
{
33-
libxml_use_internal_errors(true);
33+
$internalErrors = libxml_use_internal_errors(true);
3434

3535
$this->assertSame(array(), libxml_get_errors());
3636

@@ -41,6 +41,9 @@ public function testLoadWithInternalErrorsEnabled()
4141
$this->assertEquals('en', $catalogue->getLocale());
4242
$this->assertEquals(array(new FileResource($resource)), $catalogue->getResources());
4343
$this->assertSame(array(), libxml_get_errors());
44+
45+
libxml_clear_errors();
46+
libxml_use_internal_errors($internalErrors);
4447
}
4548

4649
public function testLoadWithResname()

0 commit comments

Comments
 (0)
0