Tests added, the arguments were simply mismatched.
@@ -107,7 +107,7 @@ class XmlFileLoader extends FileLoader
foreach ($imports as $import) {
$this->setCurrentDir(dirname($file));
- $this->import((string) $import['resource'], (Boolean) $import->getAttributeAsPhp('ignore-errors'));
+ $this->import((string) $import['resource'], null, (Boolean) $import->getAttributeAsPhp('ignore-errors'));
}
@@ -97,7 +97,7 @@ class YamlFileLoader extends FileLoader
foreach ($content['imports'] as $import) {
- $this->import($import['resource'], isset($import['ignore_errors']) ? (Boolean) $import['ignore_errors'] : false);
+ $this->import($import['resource'], null, isset($import['ignore_errors']) ? (Boolean) $import['ignore_errors'] : false);
@@ -0,0 +1,9 @@
+<?xml version="1.0" ?>
+
+<container xmlns="http://symfony.com/schema/dic/services"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
+ <imports>
+ <import resource="foo_fake.xml" ignore-errors="true" />
+ </imports>
+</container>
@@ -0,0 +1,2 @@
+imports:
+ - { resource: foo_fake.yml, ignore_errors: true }
@@ -104,6 +104,9 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
$expected = array('a string', 'foo' => 'bar', 'values' => array(true, false), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'bar' => '%foo%', 'imported_from_ini' => true, 'imported_from_yaml' => true);
$this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files');
+ // Bad import throws no exception due to ignore_errors value.
+ $loader->load('services4_bad_import.xml');
public function testLoadAnonymousServices()
@@ -90,6 +90,9 @@ class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
$actual = $container->getParameterBag()->all();
$expected = array('foo' => 'bar', 'values' => array(true, false), 'bar' => '%foo%', 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'imported_from_ini' => true, 'imported_from_xml' => true);
+ $loader->load('services4_bad_import.yml');
public function testLoadServices()