浏览代码

[DependencyInjection] fixed unit tests when using phar and suhosin

Fabien Potencier 14 年之前
父节点
当前提交
4a8f10192f
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      tests/Symfony/Tests/Component/DependencyInjection/Loader/XmlFileLoaderTest.php

+ 6 - 1
tests/Symfony/Tests/Component/DependencyInjection/Loader/XmlFileLoaderTest.php

@@ -33,7 +33,6 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
         require_once self::$fixturesPath.'/includes/foo.php';
         require_once self::$fixturesPath.'/includes/ProjectExtension.php';
         require_once self::$fixturesPath.'/includes/ProjectWithXsdExtension.php';
-        require_once self::$fixturesPath.'/includes/ProjectWithXsdExtensionInPhar.phar';
     }
 
     public function testLoad()
@@ -251,6 +250,12 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
 
     public function testExtensionInPhar()
     {
+        if (extension_loaded('suhosin') && false === strpos(ini_get('suhosin.executor.include.whitelist'), 'phar')) {
+            $this->markTestSkipped('To run this test, add "phar" to the "suhosin.executor.include.whitelist" settings in your php.ini file.');
+        }
+
+        require_once self::$fixturesPath.'/includes/ProjectWithXsdExtensionInPhar.phar';
+
         // extension with an XSD in PHAR archive
         $container = new ContainerBuilder();
         $container->registerExtension(new \ProjectWithXsdExtensionInPhar());