FactoryGirl\Tests\Provider\Doctrine\Fixtures\SingletonTest::allowsOverwritingExistingSingletons PHP Метод

allowsOverwritingExistingSingletons() публичный Метод

    public function allowsOverwritingExistingSingletons()
    {
        $this->factory->defineEntity('SpaceShip');
        $ss1 = new TestEntity\SpaceShip("The mothership");
        $ss2 = new TestEntity\SpaceShip("The battlecruiser");
        $this->factory->setSingleton('SpaceShip', $ss1);
        $this->factory->setSingleton('SpaceShip', $ss2);
        $this->assertSame($ss2, $this->factory->get('SpaceShip'));
    }