FactoryGirl\Tests\Provider\Doctrine\Fixtures\SingletonTest::throwsAnErrorWhenCallingGetSingletonTwiceOnTheSameEntity PHP Method

throwsAnErrorWhenCallingGetSingletonTwiceOnTheSameEntity() public method

    public function throwsAnErrorWhenCallingGetSingletonTwiceOnTheSameEntity()
    {
        $this->factory->defineEntity('SpaceShip', array('name' => 'Alpha'));
        $this->factory->getAsSingleton('SpaceShip');
        $self = $this;
        $this->assertThrows(function () use($self) {
            $self->factory->getAsSingleton('SpaceShip');
        });
    }