Nelmio\Alice\Generator\Resolver\Fixture\TemplatingFixtureBagTest::testIsImmutable PHP Method

testIsImmutable() public method

public testIsImmutable ( )
    public function testIsImmutable()
    {
        $fixture = new MutableFixture('user0', 'Nelmio\\Alice\\Entity\\User', SpecificationBagFactory::create());
        $originalFixture = deep_clone($fixture);
        $bag = (new TemplatingFixtureBag())->with($fixture);
        // Mutate injected value
        $fixture->setSpecs(SpecificationBagFactory::create(new FakeMethodCall()));
        // Mutate retrieved fixture
        $bag->getFixtures()->get('user0')->setSpecs(SpecificationBagFactory::create(new NoMethodCall()));
        $this->assertEquals($originalFixture, $bag->getFixtures()->get('user0'));
    }