Skip to content

Commit e682868

Browse files
committed
Add test case
1 parent b3bfdf9 commit e682868

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" ?>
2+
<container xmlns="http://symfony.com/schema/dic/services"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
5+
6+
<services>
7+
<service id="foo" class="BarClass">
8+
<tag name="name_attribute">tag_name</tag>
9+
</service>
10+
</services>
11+
</container>

src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php

+10
Original file line numberDiff line numberDiff line change
@@ -1194,4 +1194,14 @@ public static function dataForBindingsAndInnerCollections()
11941194
['bar8', new IteratorArgument(['item.1', 'item.2', ['item.3.1', 'item.3.2']])],
11951195
];
11961196
}
1197+
1198+
public function testTagNameAttribute()
1199+
{
1200+
$container = new ContainerBuilder();
1201+
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml'));
1202+
$loader->load('tag_with_name_attribute.xml');
1203+
1204+
$definition = $container->getDefinition('foo');
1205+
$this->assertSame([['name' => 'name_attribute']], $definition->getTag('tag_name'));
1206+
}
11971207
}

0 commit comments

Comments
 (0)