ApiPlatform\Core\Tests\Metadata\Property\Factory\ExtractorPropertyMetadataFactoryTest::testCreateWithParentPropertyMetadataFactoryXml PHP Method

testCreateWithParentPropertyMetadataFactoryXml() public method

public testCreateWithParentPropertyMetadataFactoryXml ( PropertyMetadata $expectedPropertyMetadata )
$expectedPropertyMetadata ApiPlatform\Core\Metadata\Property\PropertyMetadata
    public function testCreateWithParentPropertyMetadataFactoryXml(PropertyMetadata $expectedPropertyMetadata)
    {
        $configPath = __DIR__ . '/../../../Fixtures/FileConfigurations/resources.xml';
        $decorated = $this->prophesize(PropertyMetadataFactoryInterface::class);
        $decorated->create(FileConfigDummy::class, 'foo', [])->willReturn(new PropertyMetadata(null, null, null, null, true, null, null, false, null, null, ['Foo']))->shouldBeCalled();
        $propertyMetadataFactory = new ExtractorPropertyMetadataFactory(new XmlExtractor([$configPath]), $decorated->reveal());
        $propertyMetadata = $propertyMetadataFactory->create(FileConfigDummy::class, 'foo');
        $this->assertInstanceOf(PropertyMetadata::class, $propertyMetadata);
        $this->assertEquals($expectedPropertyMetadata, $propertyMetadata);
    }