Skip to content

Commit 4c938fc

Browse files
authored
chore: remove backward compatibility configuration (#4826)
1 parent 30add35 commit 4c938fc

File tree

1 file changed

+13
-96
lines changed

1 file changed

+13
-96
lines changed

tests/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php

Lines changed: 13 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
use ApiPlatform\GraphQl\Resolver\MutationResolverInterface;
5555
use ApiPlatform\GraphQl\Resolver\QueryCollectionResolverInterface;
5656
use ApiPlatform\GraphQl\Resolver\QueryItemResolverInterface;
57+
use ApiPlatform\GraphQl\Serializer\SerializerContextBuilderInterface as GraphQlSerializerContextBuilderInterface;
5758
use ApiPlatform\GraphQl\Type\Definition\TypeInterface as GraphQlTypeInterface;
5859
use ApiPlatform\JsonSchema\SchemaFactoryInterface;
5960
use ApiPlatform\JsonSchema\TypeFactoryInterface;
@@ -409,10 +410,7 @@ public function testMetadataConfiguration(): void
409410

410411
// metadata/property.xml
411412
'api_platform.metadata.property.identifier_metadata_factory',
412-
413-
// metadata/property_name.xml
414-
'api_platform.metadata.property.name_collection_factory',
415-
PropertyNameCollectionFactoryInterface::class,
413+
'api_platform.metadata.property.metadata_factory',
416414

417415
// metadata/resource.xml
418416
'api_platform.metadata.resource.metadata_collection_factory',
@@ -422,9 +420,6 @@ public function testMetadataConfiguration(): void
422420
// metadata/resource_name.xml
423421
'api_platform.metadata.resource.name_collection_factory',
424422
ResourceNameCollectionFactoryInterface::class,
425-
426-
// metadata/backward_compatibility.xml
427-
'api_platform.metadata.property.metadata_factory',
428423
];
429424

430425
$this->assertContainerHas($services, $aliases);
@@ -481,9 +476,6 @@ public function testSwaggerConfiguration(): void
481476
'api_platform.swagger.listener.ui',
482477
'api_platform.swagger_ui.context',
483478
'api_platform.swagger_ui.action',
484-
485-
// v3/swagger_ui.xml
486-
'api_platform.swagger_ui.action',
487479
];
488480

489481
$aliases = [
@@ -494,12 +486,10 @@ public function testSwaggerConfiguration(): void
494486
// openapi.xml
495487
OpenApiNormalizer::class,
496488
Options::class,
489+
OpenApiFactoryInterface::class,
497490

498491
// swagger_ui.xml
499492
'api_platform.swagger_ui.listener',
500-
501-
// v3/openapi.xml
502-
OpenApiFactoryInterface::class,
503493
];
504494

505495
$this->assertContainerHas($services, $aliases);
@@ -667,8 +657,6 @@ public function testGraphQlConfiguration(): void
667657
'api_platform.graphql.subscription.subscription_identifier_generator',
668658
'api_platform.graphql.cache.subscription',
669659
'api_platform.graphql.command.export_command',
670-
671-
// v3/graphql.xml
672660
'api_platform.graphql.resolver.stage.write',
673661
'api_platform.graphql.resolver.stage.read',
674662
'api_platform.graphql.type_converter',
@@ -697,8 +685,8 @@ public function testGraphQlConfiguration(): void
697685
];
698686

699687
$aliases = [
700-
// v3/graphql.xml
701-
\ApiPlatform\GraphQl\Serializer\SerializerContextBuilderInterface::class,
688+
// graphql.xml
689+
GraphQlSerializerContextBuilderInterface::class,
702690
];
703691

704692
$this->assertContainerHas($services, $aliases);
@@ -712,81 +700,12 @@ public function testGraphQlConfiguration(): void
712700
$this->assertServiceHasTags('api_platform.graphql.fields_builder_locator', ['container.service_locator']);
713701
$this->assertServiceHasTags('api_platform.graphql.cache.subscription', ['cache.pool']);
714702
$this->assertServiceHasTags('api_platform.graphql.command.export_command', ['console.command']);
715-
716-
// v3/graphql.xml
717-
$this->assertServiceHasTags('api_platform.graphql.normalizer.item', ['serializer.normalizer']);
718-
$this->assertServiceHasTags('api_platform.graphql.normalizer.object', ['serializer.normalizer']);
719-
$this->assertServiceHasTags('api_platform.graphql.normalizer.error', ['serializer.normalizer']);
720-
$this->assertServiceHasTags('api_platform.graphql.normalizer.validation_exception', ['serializer.normalizer']);
721-
$this->assertServiceHasTags('api_platform.graphql.normalizer.http_exception', ['serializer.normalizer']);
722-
$this->assertServiceHasTags('api_platform.graphql.normalizer.runtime_exception', ['serializer.normalizer']);
723-
}
724-
725-
public function testGraphQlConfigurationMetadataBackwardCompatibilityLayer(): void
726-
{
727-
$config = self::DEFAULT_CONFIG;
728-
$config['api_platform']['graphql']['enabled'] = true;
729-
(new ApiPlatformExtension())->load($config, $this->container);
730-
731-
$services = [
732-
// graphql.xml
733-
'api_platform.graphql.executor',
734-
'api_platform.graphql.resolver.factory.item',
735-
'api_platform.graphql.resolver.factory.collection',
736-
'api_platform.graphql.resolver.factory.item_mutation',
737-
'api_platform.graphql.resolver.factory.item_subscription',
738-
'api_platform.graphql.resolver.stage.read',
739-
'api_platform.graphql.resolver.stage.security',
740-
'api_platform.graphql.resolver.stage.security_post_denormalize',
741-
'api_platform.graphql.resolver.stage.serialize',
742-
'api_platform.graphql.resolver.stage.deserialize',
743-
'api_platform.graphql.resolver.stage.write',
744-
'api_platform.graphql.resolver.stage.validate',
745-
'api_platform.graphql.resolver.resource_field',
746-
'api_platform.graphql.query_resolver_locator',
747-
'api_platform.graphql.mutation_resolver_locator',
748-
'api_platform.graphql.iterable_type',
749-
'api_platform.graphql.upload_type',
750-
'api_platform.graphql.type_locator',
751-
'api_platform.graphql.types_container',
752-
'api_platform.graphql.type_converter',
753-
'api_platform.graphql.type_builder',
754-
'api_platform.graphql.fields_builder',
755-
'api_platform.graphql.fields_builder_locator',
756-
'api_platform.graphql.schema_builder',
757-
'api_platform.graphql.action.entrypoint',
758-
'api_platform.graphql.action.graphiql',
759-
'api_platform.graphql.action.graphql_playground',
760-
'api_platform.graphql.normalizer.item',
761-
'api_platform.graphql.normalizer.object',
762-
'api_platform.graphql.normalizer.error',
763-
'api_platform.graphql.normalizer.validation_exception',
764-
'api_platform.graphql.normalizer.http_exception',
765-
'api_platform.graphql.normalizer.runtime_exception',
766-
'api_platform.graphql.serializer.context_builder',
767-
'api_platform.graphql.subscription.subscription_manager',
768-
'api_platform.graphql.subscription.subscription_identifier_generator',
769-
'api_platform.graphql.cache.subscription',
770-
'api_platform.graphql.command.export_command',
771-
];
772-
773-
$this->assertContainerHas($services, []);
774-
775-
// graphql.xml
776-
$this->assertServiceHasTags('api_platform.graphql.query_resolver_locator', ['container.service_locator']);
777-
$this->assertServiceHasTags('api_platform.graphql.mutation_resolver_locator', ['container.service_locator']);
778-
$this->assertServiceHasTags('api_platform.graphql.iterable_type', ['api_platform.graphql.type']);
779-
$this->assertServiceHasTags('api_platform.graphql.upload_type', ['api_platform.graphql.type']);
780-
$this->assertServiceHasTags('api_platform.graphql.type_locator', ['container.service_locator']);
781-
$this->assertServiceHasTags('api_platform.graphql.fields_builder_locator', ['container.service_locator']);
782703
$this->assertServiceHasTags('api_platform.graphql.normalizer.item', ['serializer.normalizer']);
783704
$this->assertServiceHasTags('api_platform.graphql.normalizer.object', ['serializer.normalizer']);
784705
$this->assertServiceHasTags('api_platform.graphql.normalizer.error', ['serializer.normalizer']);
785706
$this->assertServiceHasTags('api_platform.graphql.normalizer.validation_exception', ['serializer.normalizer']);
786707
$this->assertServiceHasTags('api_platform.graphql.normalizer.http_exception', ['serializer.normalizer']);
787708
$this->assertServiceHasTags('api_platform.graphql.normalizer.runtime_exception', ['serializer.normalizer']);
788-
$this->assertServiceHasTags('api_platform.graphql.cache.subscription', ['cache.pool']);
789-
$this->assertServiceHasTags('api_platform.graphql.command.export_command', ['console.command']);
790709
}
791710

792711
public function testDoctrineOrmConfiguration(): void
@@ -1004,23 +923,21 @@ public function testDataCollectorConfiguration(): void
1004923
(new ApiPlatformExtension())->load($config, $this->container);
1005924

1006925
$services = [
1007-
// v3/data_collector.xml
926+
// data_collector.xml
1008927
'api_platform.data_collector.request',
1009928

1010929
// debug.xml
1011930
'debug.var_dumper.cloner',
1012931
'debug.var_dumper.cli_dumper',
1013-
1014-
// v3/debug.xml
1015932
'debug.api_platform.debug_resource.command',
1016933
];
1017934

1018935
$this->assertContainerHas($services, []);
1019936

1020-
// v3/data_collector.xml
937+
// data_collector.xml
1021938
$this->assertServiceHasTags('api_platform.data_collector.request', ['data_collector']);
1022939

1023-
// v3/debug.xml
940+
// debug.xml
1024941
$this->assertServiceHasTags('debug.api_platform.debug_resource.command', ['console.command']);
1025942
}
1026943

@@ -1037,13 +954,13 @@ public function testMercureConfiguration(): void
1037954
// mercure.xml
1038955
'api_platform.mercure.listener.response.add_link_header',
1039956

1040-
// v3/doctrine_orm_mercure_publisher
957+
// doctrine_orm_mercure_publisher
1041958
'api_platform.doctrine.orm.listener.mercure.publish',
1042959

1043-
// v3/doctrine_odm_mercure_publisher.xml
960+
// doctrine_odm_mercure_publisher.xml
1044961
'api_platform.doctrine_mongodb.odm.listener.mercure.publish',
1045962

1046-
// v3/graphql_mercure.xml
963+
// graphql_mercure.xml
1047964
'api_platform.graphql.subscription.mercure_iri_generator',
1048965
];
1049966

@@ -1052,10 +969,10 @@ public function testMercureConfiguration(): void
1052969
// mercure.xml
1053970
$this->assertServiceHasTags('api_platform.mercure.listener.response.add_link_header', ['kernel.event_listener']);
1054971

1055-
// v3/doctrine_orm_mercure_publisher
972+
// doctrine_orm_mercure_publisher
1056973
$this->assertServiceHasTags('api_platform.doctrine.orm.listener.mercure.publish', ['doctrine.event_listener']);
1057974

1058-
// v3/doctrine_odm_mercure_publisher.xml
975+
// doctrine_odm_mercure_publisher.xml
1059976
$this->assertServiceHasTags('api_platform.doctrine_mongodb.odm.listener.mercure.publish', ['doctrine_mongodb.odm.event_listener']);
1060977

1061978
$this->assertEquals([

0 commit comments

Comments
 (0)