Nelmio\Alice\Generator\Hydrator\SimpleHydratorTest::testThrowsAGenerationThrowableIfResolutionFails PHP Method

testThrowsAGenerationThrowableIfResolutionFails() public method

    public function testThrowsAGenerationThrowableIfResolutionFails()
    {
        $object = new SimpleObject('dummy', new \stdClass());
        $set = ResolvedFixtureSetFactory::create(null, $fixtures = (new FixtureBag())->with($fixture = new SimpleFixture('dummy', \stdClass::class, new SpecificationBag(null, (new PropertyBag())->with(new Property('username', $usernameValue = new FakeValue()))->with(new Property('group', $groupValue = new FakeValue())), new MethodCallBag()))));
        $resolverProphecy = $this->prophesize(ValueResolverInterface::class);
        $resolverProphecy->resolve(Argument::cetera())->willThrow(RootResolutionException::class);
        /** @var ValueResolverInterface $resolver */
        $resolver = $resolverProphecy->reveal();
        $hydrator = new SimpleHydrator(new FakePropertyHydrator(), $resolver);
        try {
            $hydrator->hydrate($object, $set, new GenerationContext());
            $this->fail('Expected exception to be thrown.');
        } catch (GenerationThrowable $throwable) {
            // Expected result
        }
    }