You are here

public function DefinitionTest::testLegacySetIsSynchronized in Service Container 7

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

@covers Symfony\Component\DependencyInjection\Definition::setSynchronized @covers Symfony\Component\DependencyInjection\Definition::isSynchronized @group legacy

File

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

Class

DefinitionTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testLegacySetIsSynchronized() {
  $this
    ->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
  $def = new Definition('stdClass');
  $this
    ->assertFalse($def
    ->isSynchronized(), '->isSynchronized() returns false by default');
  $this
    ->assertSame($def, $def
    ->setSynchronized(true), '->setSynchronized() implements a fluent interface');
  $this
    ->assertTrue($def
    ->isSynchronized(), '->isSynchronized() returns true if the service is synchronized.');
}