FactoryGirl\Tests\Provider\Doctrine\Fixtures\BasicUsageTest::acceptsGeneratorFunctionsInEntityDefinitions PHP Method

acceptsGeneratorFunctionsInEntityDefinitions() public method

    public function acceptsGeneratorFunctionsInEntityDefinitions()
    {
        $name = "Star";
        $this->factory->defineEntity('SpaceShip', array('name' => function () use(&$name) {
            return "M/S {$name}";
        }));
        $this->assertEquals('M/S Star', $this->factory->get('SpaceShip')->getName());
        $name = "Superstar";
        $this->assertEquals('M/S Superstar', $this->factory->get('SpaceShip')->getName());
    }