public function testReturnsTheResultOfTheDecoratedInstantiatorIfTheFixtureHasNotBeenInstantiated()
{
$fixture = new DummyFixture('dummy');
$set = ResolvedFixtureSetFactory::create();
$context = new GenerationContext();
$context->markIsResolvingFixture('foo');
$decoratedInstantiatorProphecy = $this->prophesize(InstantiatorInterface::class);
$decoratedInstantiatorProphecy->instantiate($fixture, $set, $context)->willReturn($expected = $set->withObjects((new ObjectBag())->with(new SimpleObject('dummy', new \stdClass()))));
/** @var InstantiatorInterface $decoratedInstantiator */
$decoratedInstantiator = $decoratedInstantiatorProphecy->reveal();
$instantiator = new ExistingInstanceInstantiator($decoratedInstantiator);
$actual = $instantiator->instantiate($fixture, $set, $context);
$this->assertSame($expected, $actual);
$decoratedInstantiatorProphecy->instantiate(Argument::cetera())->shouldHaveBeenCalledTimes(1);
}