Nelmio\Alice\PropertyAccess\StdPropertyAccessorTest::testUsesDecoratedAccessorToDertermineIfPropertyIsWritableIfObjectIsNotAnStdClassInstance PHP Method

testUsesDecoratedAccessorToDertermineIfPropertyIsWritableIfObjectIsNotAnStdClassInstance() public method

    public function testUsesDecoratedAccessorToDertermineIfPropertyIsWritableIfObjectIsNotAnStdClassInstance()
    {
        $object = new DummyWithPublicProperty();
        $property = 'val';
        $decoratedAccessorProphecy = $this->prophesize(PropertyAccessorInterface::class);
        $decoratedAccessorProphecy->isWritable($object, $property)->willReturn($expected = true);
        /** @var PropertyAccessorInterface $decoratedAccessor */
        $decoratedAccessor = $decoratedAccessorProphecy->reveal();
        $accessor = new StdPropertyAccessor($decoratedAccessor);
        $actual = $accessor->isWritable($object, $property);
        $this->assertEquals($expected, $actual);
        $decoratedAccessorProphecy->isWritable(Argument::cetera())->shouldHaveBeenCalledTimes(1);
    }