Symfony\Component\DependencyInjection\Tests\DefinitionTest::testSetGetFactory PHP Method

testSetGetFactory() public method

public testSetGetFactory ( )
    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');
    }