ApiPlatform\Core\Tests\Metadata\Property\Factory\AnnotationPropertyMetadataFactoryTest::testCreateProperty PHP Method

testCreateProperty() public method

public testCreateProperty ( Prophecy\Prophecy\ProphecyInterface $reader, Prophecy\Prophecy\ProphecyInterface $decorated = null, string $description )
$reader Prophecy\Prophecy\ProphecyInterface
$decorated Prophecy\Prophecy\ProphecyInterface
$description string
    public function testCreateProperty(ProphecyInterface $reader, ProphecyInterface $decorated = null, string $description)
    {
        $factory = new AnnotationPropertyMetadataFactory($reader->reveal(), $decorated ? $decorated->reveal() : null);
        $metadata = $factory->create(Dummy::class, 'name');
        $this->assertEquals($description, $metadata->getDescription());
        $this->assertTrue($metadata->isReadable());
        $this->assertTrue($metadata->isWritable());
        $this->assertFalse($metadata->isReadableLink());
        $this->assertFalse($metadata->isWritableLink());
        $this->assertFalse($metadata->isIdentifier());
        $this->assertTrue($metadata->isRequired());
        $this->assertEquals('foo', $metadata->getIri());
        $this->assertEquals(['foo' => 'bar'], $metadata->getAttributes());
    }