Browse Source

make unit tests assume a disabled entity loader

Rob Bast 9 years ago
parent
commit
d59115d7fa
1 changed files with 12 additions and 0 deletions
  1. 12 0
      tests/Composer/Test/Downloader/PearPackageExtractorTest.php

+ 12 - 0
tests/Composer/Test/Downloader/PearPackageExtractorTest.php

@@ -18,12 +18,16 @@ class PearPackageExtractorTest extends \PHPUnit_Framework_TestCase
 {
     public function testShouldExtractPackage_1_0()
     {
+        $state = libxml_disable_entity_loader(true);
+
         $extractor = $this->getMockForAbstractClass('Composer\Downloader\PearPackageExtractor', array(), '', false);
         $method = new \ReflectionMethod($extractor, 'buildCopyActions');
         $method->setAccessible(true);
 
         $fileActions = $method->invoke($extractor, __DIR__ . '/Fixtures/Package_v1.0', array('php' => '/'), array());
 
+        libxml_disable_entity_loader($state);
+
         $expectedFileActions = array(
             'Gtk.php' => array(
                 'from' => 'PEAR_Frontend_Gtk-0.4.0/Gtk.php',
@@ -49,12 +53,16 @@ class PearPackageExtractorTest extends \PHPUnit_Framework_TestCase
 
     public function testShouldExtractPackage_2_0()
     {
+        $state = libxml_disable_entity_loader(true);
+
         $extractor = $this->getMockForAbstractClass('Composer\Downloader\PearPackageExtractor', array(), '', false);
         $method = new \ReflectionMethod($extractor, 'buildCopyActions');
         $method->setAccessible(true);
 
         $fileActions = $method->invoke($extractor, __DIR__ . '/Fixtures/Package_v2.0', array('php' => '/'), array());
 
+        libxml_disable_entity_loader($state);
+
         $expectedFileActions = array(
             'URL.php' => array(
                 'from' => 'Net_URL-1.0.15/URL.php',
@@ -68,12 +76,16 @@ class PearPackageExtractorTest extends \PHPUnit_Framework_TestCase
 
     public function testShouldExtractPackage_2_1()
     {
+        $state = libxml_disable_entity_loader(true);
+
         $extractor = $this->getMockForAbstractClass('Composer\Downloader\PearPackageExtractor', array(), '', false);
         $method = new \ReflectionMethod($extractor, 'buildCopyActions');
         $method->setAccessible(true);
 
         $fileActions = $method->invoke($extractor, __DIR__ . '/Fixtures/Package_v2.1', array('php' => '/', 'script' => '/bin'), array());
 
+        libxml_disable_entity_loader($state);
+
         $expectedFileActions = array(
             'php/Zend/Authentication/Storage/StorageInterface.php' => array(
                 'from' => 'Zend_Authentication-2.0.0beta4/php/Zend/Authentication/Storage/StorageInterface.php',