private function getApiLoaderWithResourceMetadata(ResourceMetadata $resourceMetadata) : ApiLoader
{
$routingConfig = __DIR__ . '/../../../../src/Bridge/Symfony/Bundle/Resources/config/routing';
$kernelProphecy = $this->prophesize(KernelInterface::class);
$kernelProphecy->locateResource(Argument::any())->willReturn($routingConfig);
$possibleArguments = ['api_platform.action.get_collection', 'api_platform.action.post_collection', 'api_platform.action.get_item', 'api_platform.action.put_item', 'api_platform.action.delete_item'];
$containerProphecy = $this->prophesize(ContainerInterface::class);
foreach ($possibleArguments as $possibleArgument) {
$containerProphecy->has($possibleArgument)->willReturn(true);
}
$containerProphecy->getParameter('api_platform.enable_swagger')->willReturn(true);
$containerProphecy->has(Argument::type('string'))->willReturn(false);
$resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class);
$resourceMetadataFactoryProphecy->create(DummyEntity::class)->willReturn($resourceMetadata);
$resourceNameCollectionFactoryProphecy = $this->prophesize(ResourceNameCollectionFactoryInterface::class);
$resourceNameCollectionFactoryProphecy->create()->willReturn(new ResourceNameCollection([DummyEntity::class]));
$operationPathResolver = new CustomOperationPathResolver(new UnderscoreOperationPathResolver());
$apiLoader = new ApiLoader($kernelProphecy->reveal(), $resourceNameCollectionFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), $operationPathResolver, $containerProphecy->reveal(), ['jsonld' => ['application/ld+json']]);
return $apiLoader;
}