public function DefinitionTest::testSetGetFactory in Service Container 7
Same name and namespace in other branches
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php \Symfony\Component\DependencyInjection\Tests\DefinitionTest::testSetGetFactory()
@covers Symfony\Component\DependencyInjection\Definition::setFactory @covers Symfony\Component\DependencyInjection\Definition::getFactory
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ DefinitionTest.php, line 34
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testSetGetFactory() {
$def = new Definition('stdClass');
$this
->assertSame($def, $def
->setFactory('foo'), '->setFactory() implements a fluent interface');
$this
->assertEquals('foo', $def
->getFactory(), '->getFactory() returns the factory');
$def
->setFactory('Foo::bar');
$this
->assertEquals(array(
'Foo',
'bar',
), $def
->getFactory(), '->setFactory() converts string static method call to the array');
}