public function testThrowsAGenerationThrowableIfResolutionFails()
{
$specs = SpecificationBagFactory::create(new SimpleMethodCall('__construct', [$firstArg = new VariableValue('firstArg'), $secondArg = new VariableValue('secondArg')]));
$fixture = new SimpleFixture('dummy', 'stdClass', $specs);
$set = ResolvedFixtureSetFactory::create();
$resolverProphecy = $this->prophesize(ValueResolverInterface::class);
$resolverProphecy->resolve(Argument::cetera())->willThrow(RootResolutionException::class);
/** @var ValueResolverInterface $resolver */
$resolver = $resolverProphecy->reveal();
$instantiator = new InstantiatorResolver(new FakeInstantiator(), $resolver);
try {
$instantiator->instantiate($fixture, $set, new GenerationContext());
$this->fail('Expected exception to be thrown.');
} catch (GenerationThrowable $throwable) {
// Expected result.
}
}