ApiPlatform\Core\Tests\JsonLd\ContextBuilderTest::testResourceContext PHP Method

testResourceContext() public method

public testResourceContext ( )
    public function testResourceContext()
    {
        $this->resourceMetadataFactoryProphecy->create($this->entityClass)->willReturn(new ResourceMetadata('DummyEntity'));
        $this->propertyNameCollectionFactoryProphecy->create($this->entityClass)->willReturn(new PropertyNameCollection(['dummyPropertyA']));
        $this->propertyMetadataFactoryProphecy->create($this->entityClass, 'dummyPropertyA')->willReturn(new PropertyMetadata(new Type(Type::BUILTIN_TYPE_STRING), 'Dummy property A', true, true, true, true, false, false, null, null, []));
        $contextBuilder = new ContextBuilder($this->resourceNameCollectionFactoryProphecy->reveal(), $this->resourceMetadataFactoryProphecy->reveal(), $this->propertyNameCollectionFactoryProphecy->reveal(), $this->propertyMetadataFactoryProphecy->reveal(), $this->urlGeneratorProphecy->reveal());
        $expected = ['@vocab' => '#', 'hydra' => 'http://www.w3.org/ns/hydra/core#', 'dummyPropertyA' => '#DummyEntity/dummyPropertyA'];
        $this->assertEquals($expected, $contextBuilder->getResourceContext($this->entityClass));
    }