Set back libxml settings after testings.
This commit is contained in:
parent
e62d98ef30
commit
29d696944c
@ -63,11 +63,14 @@ class XmlUtilsTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testLoadFileWithInternalErrorsEnabled()
|
public function testLoadFileWithInternalErrorsEnabled()
|
||||||
{
|
{
|
||||||
libxml_use_internal_errors(true);
|
$internalErrors = libxml_use_internal_errors(true);
|
||||||
|
|
||||||
$this->assertSame(array(), libxml_get_errors());
|
$this->assertSame(array(), libxml_get_errors());
|
||||||
$this->assertInstanceOf('DOMDocument', XmlUtils::loadFile(__DIR__.'/../Fixtures/Util/invalid_schema.xml'));
|
$this->assertInstanceOf('DOMDocument', XmlUtils::loadFile(__DIR__.'/../Fixtures/Util/invalid_schema.xml'));
|
||||||
$this->assertSame(array(), libxml_get_errors());
|
$this->assertSame(array(), libxml_get_errors());
|
||||||
|
|
||||||
|
libxml_clear_errors();
|
||||||
|
libxml_use_internal_errors($internalErrors);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -144,7 +147,7 @@ class XmlUtilsTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testLoadEmptyXmlFile()
|
public function testLoadEmptyXmlFile()
|
||||||
{
|
{
|
||||||
$file = __DIR__.'/../Fixtures/foo.xml';
|
$file = __DIR__.'/../Fixtures/foo.xml';
|
||||||
$this->setExpectedException('InvalidArgumentException', 'File '.$file.' does not contain valid XML, it is empty.');
|
$this->setExpectedException('InvalidArgumentException', sprintf('File %s does not contain valid XML, it is empty.', $file));
|
||||||
XmlUtils::loadFile($file);
|
XmlUtils::loadFile($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class XliffFileLoaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testLoadWithInternalErrorsEnabled()
|
public function testLoadWithInternalErrorsEnabled()
|
||||||
{
|
{
|
||||||
libxml_use_internal_errors(true);
|
$internalErrors = libxml_use_internal_errors(true);
|
||||||
|
|
||||||
$this->assertSame(array(), libxml_get_errors());
|
$this->assertSame(array(), libxml_get_errors());
|
||||||
|
|
||||||
@ -41,6 +41,9 @@ class XliffFileLoaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals('en', $catalogue->getLocale());
|
$this->assertEquals('en', $catalogue->getLocale());
|
||||||
$this->assertEquals(array(new FileResource($resource)), $catalogue->getResources());
|
$this->assertEquals(array(new FileResource($resource)), $catalogue->getResources());
|
||||||
$this->assertSame(array(), libxml_get_errors());
|
$this->assertSame(array(), libxml_get_errors());
|
||||||
|
|
||||||
|
libxml_clear_errors();
|
||||||
|
libxml_use_internal_errors($internalErrors);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLoadWithResname()
|
public function testLoadWithResname()
|
||||||
|
Reference in New Issue
Block a user