ApiPlatform\Core\Tests\Metadata\Resource\Factory\AnnotationResourceMetadataFactoryTest::testCreate PHP Method

testCreate() public method

public testCreate ( Prophecy\Prophecy\ProphecyInterface $reader, Prophecy\Prophecy\ProphecyInterface $decorated = null, $expectedShortName, $expectedDescription )
$reader Prophecy\Prophecy\ProphecyInterface
$decorated Prophecy\Prophecy\ProphecyInterface
    public function testCreate(ProphecyInterface $reader, ProphecyInterface $decorated = null, $expectedShortName, $expectedDescription)
    {
        $factory = new AnnotationResourceMetadataFactory($reader->reveal(), $decorated ? $decorated->reveal() : null);
        $metadata = $factory->create(Dummy::class);
        $this->assertEquals($expectedShortName, $metadata->getShortName());
        $this->assertEquals($expectedDescription, $metadata->getDescription());
        $this->assertEquals('http://example.com', $metadata->getIri());
        $this->assertEquals(['foo' => ['bar' => true]], $metadata->getItemOperations());
        $this->assertEquals(['baz' => ['tab' => false]], $metadata->getCollectionOperations());
        $this->assertEquals(['a' => 1], $metadata->getAttributes());
    }
AnnotationResourceMetadataFactoryTest