|
@@ -29,6 +29,7 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
|
|
require_once self::$fixturesPath.'/includes/foo.php';
|
|
require_once self::$fixturesPath.'/includes/foo.php';
|
|
require_once self::$fixturesPath.'/includes/ProjectExtension.php';
|
|
require_once self::$fixturesPath.'/includes/ProjectExtension.php';
|
|
require_once self::$fixturesPath.'/includes/ProjectWithXsdExtension.php';
|
|
require_once self::$fixturesPath.'/includes/ProjectWithXsdExtension.php';
|
|
|
|
+ require_once self::$fixturesPath.'/includes/ProjectWithXsdExtensionInPhar.phar';
|
|
}
|
|
}
|
|
|
|
|
|
public function testLoad()
|
|
public function testLoad()
|
|
@@ -240,6 +241,24 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function testExtensionInPhar()
|
|
|
|
+ {
|
|
|
|
+ // extension with an XSD in PHAR archive
|
|
|
|
+ $container = new ContainerBuilder();
|
|
|
|
+ $container->registerExtension(new \ProjectWithXsdExtensionInPhar());
|
|
|
|
+ $loader = new ProjectLoader2($container, self::$fixturesPath.'/xml');
|
|
|
|
+ $loader->load('extensions/services6.xml');
|
|
|
|
+
|
|
|
|
+ // extension with an XSD in PHAR archive (does not validate)
|
|
|
|
+ try {
|
|
|
|
+ $loader->load('extensions/services7.xml');
|
|
|
|
+ $this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
|
|
|
|
+ } catch (\Exception $e) {
|
|
|
|
+ $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
|
|
|
|
+ $this->assertRegexp('/The attribute \'bar\' is not allowed/', $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @covers Symfony\Component\DependencyInjection\Loader\XmlFileLoader::supports
|
|
* @covers Symfony\Component\DependencyInjection\Loader\XmlFileLoader::supports
|
|
*/
|
|
*/
|