You are here

public function DefinitionTest::testClearTag in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/dependency-injection/Tests/DefinitionTest.php \Symfony\Component\DependencyInjection\Tests\DefinitionTest::testClearTag()

@covers Symfony\Component\DependencyInjection\Definition::clearTags

File

vendor/symfony/dependency-injection/Tests/DefinitionTest.php, line 229

Class

DefinitionTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testClearTag() {
  $def = new Definition('stdClass');
  $this
    ->assertSame($def, $def
    ->clearTags(), '->clearTags() implements a fluent interface');
  $def
    ->addTag('1foo1', array(
    'foo1' => 'bar1',
  ));
  $def
    ->addTag('2foo2', array(
    'foo2' => 'bar2',
  ));
  $def
    ->addTag('3foo3', array(
    'foo3' => 'bar3',
  ));
  $def
    ->clearTag('2foo2');
  $this
    ->assertTrue($def
    ->hasTag('1foo1'));
  $this
    ->assertFalse($def
    ->hasTag('2foo2'));
  $this
    ->assertTrue($def
    ->hasTag('3foo3'));
  $def
    ->clearTag('1foo1');
  $this
    ->assertFalse($def
    ->hasTag('1foo1'));
  $this
    ->assertTrue($def
    ->hasTag('3foo3'));
}