|
@@ -164,12 +164,15 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase
|
|
|
* @covers Symfony\Component\DependencyInjection\Definition::addTag
|
|
|
* @covers Symfony\Component\DependencyInjection\Definition::getTag
|
|
|
* @covers Symfony\Component\DependencyInjection\Definition::getTags
|
|
|
+ * @covers Symfony\Component\DependencyInjection\Definition::hasTag
|
|
|
*/
|
|
|
public function testTags()
|
|
|
{
|
|
|
$def = new Definition('stdClass');
|
|
|
$this->assertEquals(array(), $def->getTag('foo'), '->getTag() returns an empty array if the tag is not defined');
|
|
|
+ $this->assertFalse($def->hasTag('foo'));
|
|
|
$this->assertSame($def, $def->addTag('foo'), '->addTag() implements a fluent interface');
|
|
|
+ $this->assertTrue($def->hasTag('foo'));
|
|
|
$this->assertEquals(array(array()), $def->getTag('foo'), '->getTag() returns attributes for a tag name');
|
|
|
$def->addTag('foo', array('foo' => 'bar'));
|
|
|
$this->assertEquals(array(array(), array('foo' => 'bar')), $def->getTag('foo'), '->addTag() can adds the same tag several times');
|