You are here

public function DefinitionTest::testSetIsLazy 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::testSetIsLazy()

@covers Symfony\Component\DependencyInjection\Definition::setLazy @covers Symfony\Component\DependencyInjection\Definition::isLazy

File

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

Class

DefinitionTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testSetIsLazy() {
  $def = new Definition('stdClass');
  $this
    ->assertFalse($def
    ->isLazy(), '->isLazy() returns false by default');
  $this
    ->assertSame($def, $def
    ->setLazy(true), '->setLazy() implements a fluent interface');
  $this
    ->assertTrue($def
    ->isLazy(), '->isLazy() returns true if the service is lazy.');
}