You are here

public function LegacyDefinitionTest::testSetGetFactoryClass in Service Container 7

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

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/LegacyDefinitionTest.php, line 26

Class

LegacyDefinitionTest
@group legacy

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testSetGetFactoryClass() {
  $def = new Definition('stdClass');
  $this
    ->assertNull($def
    ->getFactoryClass());
  $this
    ->assertSame($def, $def
    ->setFactoryClass('stdClass2'), "->setFactoryClass() implements a fluent interface.");
  $this
    ->assertEquals('stdClass2', $def
    ->getFactoryClass(), "->getFactoryClass() returns current class to construct this service.");
}