Nelmio\Alice\Generator\Resolver\Value\Chainable\FixturePropertyReferenceResolverTest::testTestResolutionWithSymfonyPropertyAccessor PHP Method

testTestResolutionWithSymfonyPropertyAccessor() public method

    public function testTestResolutionWithSymfonyPropertyAccessor()
    {
        $value = new FixturePropertyValue($reference = new FakeValue(), $property = 'publicProperty');
        $instance = new Dummy();
        $instance->publicProperty = 'foo';
        $set = ResolvedFixtureSetFactory::create();
        $valueResolverProphecy = $this->prophesize(ValueResolverInterface::class);
        $valueResolverProphecy->resolve(Argument::cetera())->willReturn(new ResolvedValueWithFixtureSet($instance, $set));
        /** @var ValueResolverInterface $valueResolver */
        $valueResolver = $valueResolverProphecy->reveal();
        $expected = new ResolvedValueWithFixtureSet('foo', $set);
        $resolver = new FixturePropertyReferenceResolver(PropertyAccess::createPropertyAccessor(), $valueResolver);
        $actual = $resolver->resolve($value, new FakeFixture(), $set, [], new GenerationContext());
        $this->assertEquals($expected, $actual);
    }