|
14 | 14 | namespace ApiPlatform\Tests\Symfony\Routing;
|
15 | 15 |
|
16 | 16 | use ApiPlatform\Core\Api\IdentifiersExtractorInterface;
|
17 |
| -use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface; |
18 |
| -use ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface; |
19 |
| -use ApiPlatform\Core\Metadata\Property\PropertyNameCollection; |
20 |
| -use ApiPlatform\Core\Operation\UnderscorePathSegmentNameGenerator; |
| 17 | +use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface; |
| 18 | +use ApiPlatform\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface; |
| 19 | +use ApiPlatform\Metadata\Property\PropertyNameCollection; |
21 | 20 | use ApiPlatform\Metadata\ApiProperty;
|
22 | 21 | use ApiPlatform\Metadata\ApiResource;
|
23 | 22 | use ApiPlatform\Metadata\Delete;
|
|
30 | 29 | use ApiPlatform\Metadata\Resource\Factory\ResourceNameCollectionFactoryInterface;
|
31 | 30 | use ApiPlatform\Metadata\Resource\ResourceMetadataCollection;
|
32 | 31 | use ApiPlatform\Metadata\Resource\ResourceNameCollection;
|
33 |
| -use ApiPlatform\PathResolver\CustomOperationPathResolver; |
34 |
| -use ApiPlatform\PathResolver\OperationPathResolver; |
35 | 32 | use ApiPlatform\Symfony\Routing\ApiLoader;
|
36 | 33 | use ApiPlatform\Tests\Fixtures\DummyEntity;
|
37 | 34 | use ApiPlatform\Tests\Fixtures\RelatedDummyEntity;
|
|
46 | 43 | /**
|
47 | 44 | * @author Antoine Bluchet <[email protected]>
|
48 | 45 | * @author Amrouche Hamza <[email protected]>
|
49 |
| - * |
50 |
| - * TODO: in 3.0 just remove the IdentifiersExtractor |
51 |
| - * @group legacy |
52 | 46 | */
|
53 | 47 | class ApiLoaderTest extends TestCase
|
54 | 48 | {
|
@@ -255,6 +249,7 @@ private function getApiLoaderWithResourceMetadataCollection(ResourceMetadataColl
|
255 | 249 | $kernelProphecy = $this->prophesize(KernelInterface::class);
|
256 | 250 | $kernelProphecy->locateResource(Argument::any())->willReturn($routingConfig);
|
257 | 251 | $possibleArguments = [
|
| 252 | + 'some.service.name', |
258 | 253 | 'api_platform.action.get_collection',
|
259 | 254 | 'api_platform.action.post_collection',
|
260 | 255 | 'api_platform.action.get_item',
|
@@ -284,15 +279,9 @@ private function getApiLoaderWithResourceMetadataCollection(ResourceMetadataColl
|
284 | 279 | $propertyMetadataFactoryProphecy->create(RelatedDummyEntity::class, 'id')->willReturn(new ApiProperty());
|
285 | 280 | $propertyMetadataFactoryProphecy->create(DummyEntity::class, 'id')->willReturn(new ApiProperty());
|
286 | 281 |
|
287 |
| - $operationPathResolver = new CustomOperationPathResolver(new OperationPathResolver(new UnderscorePathSegmentNameGenerator())); |
288 |
| - |
289 | 282 | $resourceMetadataFactory = $resourceMetadataFactoryProphecy->reveal();
|
290 | 283 |
|
291 |
| - $identifiersExtractorProphecy = $this->prophesize(IdentifiersExtractorInterface::class); |
292 |
| - $identifiersExtractorProphecy->getIdentifiersFromResourceClass(Argument::type('string'))->willReturn(['id']); |
293 |
| - $identifiersExtractor = $identifiersExtractorProphecy->reveal(); |
294 |
| - |
295 |
| - return new ApiLoader($kernelProphecy->reveal(), $resourceNameCollectionFactoryProphecy->reveal(), $resourceMetadataFactory, $operationPathResolver, $containerProphecy->reveal(), ['jsonld' => ['application/ld+json']], [], null, false, true, true, false, false, $identifiersExtractor); |
| 284 | + return new ApiLoader($kernelProphecy->reveal(), $resourceNameCollectionFactoryProphecy->reveal(), $resourceMetadataFactory, $containerProphecy->reveal(), ['jsonld' => ['application/ld+json']], [], false, true, true, false, false); |
296 | 285 | }
|
297 | 286 |
|
298 | 287 | private function getRoute(string $path, string $controller, ?bool $stateless, string $resourceClass, array $identifiers, string $operationName, array $extraDefaults = [], array $methods = [], array $requirements = [], array $options = [], string $host = '', array $schemes = [], string $condition = ''): Route
|
|
0 commit comments