FactoryGirl\Tests\Provider\Doctrine\Fixtures\TransitiveReferencesTest::transitiveReferencesWorkWithSingletons PHP Method

transitiveReferencesWorkWithSingletons() public method

    public function transitiveReferencesWorkWithSingletons()
    {
        $this->simpleSetup();
        $this->factory->getAsSingleton('SpaceShip');
        $badge1 = $this->factory->get('Badge');
        $badge2 = $this->factory->get('Badge');
        $this->assertNotSame($badge1->getOwner(), $badge2->getOwner());
        $this->assertSame($badge1->getOwner()->getSpaceShip(), $badge2->getOwner()->getSpaceShip());
    }