You are here

public function DefinitionTest::testSetIsAbstract in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php \Symfony\Component\DependencyInjection\Tests\DefinitionTest::testSetIsAbstract()

@covers Symfony\Component\DependencyInjection\Definition::setAbstract @covers Symfony\Component\DependencyInjection\Definition::isAbstract

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php, line 197

Class

DefinitionTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testSetIsAbstract() {
  $def = new Definition('stdClass');
  $this
    ->assertFalse($def
    ->isAbstract(), '->isAbstract() returns false by default');
  $this
    ->assertSame($def, $def
    ->setAbstract(true), '->setAbstract() implements a fluent interface');
  $this
    ->assertTrue($def
    ->isAbstract(), '->isAbstract() returns true if the instance must not be public.');
}