|
@@ -185,4 +185,16 @@ class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
|
|
|
$this->assertStringStartsWith('A "tags" entry is missing a "name" key for service ', $e->getMessage(), '->load() throws an InvalidArgumentException if a tag is missing the name key');
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public function testTagWithAttributeArrayThrowsException()
|
|
|
+ {
|
|
|
+ $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml'));
|
|
|
+ try {
|
|
|
+ $loader->load('badtag3.yml');
|
|
|
+ $this->fail('->load() should throw an exception when a tag-attribute is not a scalar');
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar');
|
|
|
+ $this->assertStringStartsWith('A "tags" attribute must be of a scalar-type for service ', $e->getMessage(), '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar');
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|