Skip to content

Commit 701c24e

Browse files
committed
Set back libxml settings after testings.
1 parent 0b4a8e9 commit 701c24e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

0 commit comments

Comments
 (0)