ApiPlatform\Core\Tests\Bridge\Symfony\Routing\IriConverterTest::testGetItemFromIri PHP Method

testGetItemFromIri() public method

public testGetItemFromIri ( )
    public function testGetItemFromIri()
    {
        $propertyNameCollectionFactoryProphecy = $this->prophesize(PropertyNameCollectionFactoryInterface::class);
        $propertyMetadataFactoryProphecy = $this->prophesize(PropertyMetadataFactoryInterface::class);
        $itemDataProviderProphecy = $this->prophesize(ItemDataProviderInterface::class);
        $itemDataProviderProphecy->getItem('AppBundle\\Entity\\User', 3, null, ['fetch_data' => true])->willReturn('foo')->shouldBeCalledTimes(1);
        $routeNameResolverProphecy = $this->prophesize(RouteNameResolverInterface::class);
        $routerProphecy = $this->prophesize(RouterInterface::class);
        $routerProphecy->match('/users/3')->willReturn(['_api_resource_class' => 'AppBundle\\Entity\\User', 'id' => 3])->shouldBeCalledTimes(1);
        $converter = new IriConverter($propertyNameCollectionFactoryProphecy->reveal(), $propertyMetadataFactoryProphecy->reveal(), $itemDataProviderProphecy->reveal(), $routeNameResolverProphecy->reveal(), $routerProphecy->reveal());
        $converter->getItemFromIri('/users/3', ['fetch_data' => true]);
    }