4040use Symfony \Component \DependencyInjection \Reference ;
4141use Symfony \Component \DependencyInjection \ServiceLocator ;
4242use Symfony \Component \HttpFoundation \Session \Storage \Handler \PdoSessionHandler ;
43- use Symfony \Component \HttpKernel \Kernel ;
4443use Symfony \Component \Security \Core \User \UserInterface ;
4544
4645use function array_filter ;
4746use function array_intersect_key ;
4847use function array_keys ;
49- use function array_merge ;
5048use function array_values ;
5149use function assert ;
5250use function class_exists ;
5755use function sprintf ;
5856use function sys_get_temp_dir ;
5957use function uniqid ;
60- use function version_compare ;
6158
6259use const DIRECTORY_SEPARATOR ;
6360
@@ -543,40 +540,30 @@ public function testSingleEntityManagerMultipleMappingBundleDefinitions(): void
543540 self ::markTestSkipped ('This test requires ORM ' );
544541 }
545542
546- $ container = $ this ->loadContainer ('orm_single_em_bundle_mappings ' , ['YamlBundle ' , 'AnnotationsBundle ' , ' XmlBundle ' , 'AttributesBundle ' ]);
543+ $ container = $ this ->loadContainer ('orm_single_em_bundle_mappings ' , ['YamlBundle ' , 'XmlBundle ' , 'AttributesBundle ' ]);
547544
548545 $ definition = $ container ->getDefinition ('doctrine.orm.default_metadata_driver ' );
549546
550547 $ this ->assertDICDefinitionMethodCallAt (0 , $ definition , 'addDriver ' , [
551- new Reference (version_compare (Kernel::VERSION , '7.0.0 ' , '< ' ) ? 'doctrine.orm.default_annotation_metadata_driver ' : 'doctrine.orm.default_attribute_metadata_driver ' ),
552- 'Fixtures\Bundles\AnnotationsBundle\Entity ' ,
553- ]);
554-
555- $ this ->assertDICDefinitionMethodCallAt (1 , $ definition , 'addDriver ' , [
556548 new Reference ('doctrine.orm.default_attribute_metadata_driver ' ),
557549 'Fixtures\Bundles\AttributesBundle\Entity ' ,
558550 ]);
559551
560- $ this ->assertDICDefinitionMethodCallAt (2 , $ definition , 'addDriver ' , [
552+ $ this ->assertDICDefinitionMethodCallAt (1 , $ definition , 'addDriver ' , [
561553 new Reference ('doctrine.orm.default_yml_metadata_driver ' ),
562554 'Fixtures\Bundles\YamlBundle\Entity ' ,
563555 ]);
564556
565- $ this ->assertDICDefinitionMethodCallAt (3 , $ definition , 'addDriver ' , [
557+ $ this ->assertDICDefinitionMethodCallAt (2 , $ definition , 'addDriver ' , [
566558 new Reference ('doctrine.orm.default_xml_metadata_driver ' ),
567559 'Fixtures\Bundles\XmlBundle ' ,
568560 ]);
569561
570562 $ attrDef = $ container ->getDefinition ('doctrine.orm.default_attribute_metadata_driver ' );
571563 $ this ->assertDICConstructorArguments ($ attrDef , [
572- array_merge (
573- ! version_compare (Kernel::VERSION , '7.0.0 ' , '< ' ) ? [
574- __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures ' . DIRECTORY_SEPARATOR . 'Bundles ' . DIRECTORY_SEPARATOR . 'AnnotationsBundle ' . DIRECTORY_SEPARATOR . 'Entity ' ,
575- ] : [],
576- [
577- __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures ' . DIRECTORY_SEPARATOR . 'Bundles ' . DIRECTORY_SEPARATOR . 'AttributesBundle ' . DIRECTORY_SEPARATOR . 'Entity ' ,
578- ],
579- ),
564+ [
565+ __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures ' . DIRECTORY_SEPARATOR . 'Bundles ' . DIRECTORY_SEPARATOR . 'AttributesBundle ' . DIRECTORY_SEPARATOR . 'Entity ' ,
566+ ],
580567 ! class_exists (AnnotationDriver::class),
581568 ]);
582569
@@ -600,21 +587,15 @@ public function testMultipleEntityManagersMappingBundleDefinitions(): void
600587 self ::markTestSkipped ('This test requires ORM ' );
601588 }
602589
603- $ container = $ this ->loadContainer ('orm_multiple_em_bundle_mappings ' , ['YamlBundle ' , 'AnnotationsBundle ' , ' XmlBundle ' , 'AttributesBundle ' ]);
590+ $ container = $ this ->loadContainer ('orm_multiple_em_bundle_mappings ' , ['YamlBundle ' , 'XmlBundle ' , 'AttributesBundle ' ]);
604591
605592 $ this ->assertEquals (['em1 ' => 'doctrine.orm.em1_entity_manager ' , 'em2 ' => 'doctrine.orm.em2_entity_manager ' ], $ container ->getParameter ('doctrine.entity_managers ' ), 'Set of the existing EntityManagers names is incorrect. ' );
606593 $ this ->assertEquals ('%doctrine.entity_managers% ' , $ container ->getDefinition ('doctrine ' )->getArgument (2 ), 'Set of the existing EntityManagers names is incorrect. ' );
607594
608- $ def1 = $ container ->getDefinition ('doctrine.orm.em1_metadata_driver ' );
609- $ def2 = $ container ->getDefinition ('doctrine.orm.em2_metadata_driver ' );
610- $ def1Id = version_compare (Kernel::VERSION , '7.0.0 ' , '< ' ) ? 'doctrine.orm.em1_annotation_metadata_driver ' : 'doctrine.orm.em1_attribute_metadata_driver ' ;
595+ $ def1 = $ container ->getDefinition ('doctrine.orm.em1_metadata_driver ' );
596+ $ def2 = $ container ->getDefinition ('doctrine.orm.em2_metadata_driver ' );
611597
612598 $ this ->assertDICDefinitionMethodCallAt (0 , $ def1 , 'addDriver ' , [
613- new Reference ($ def1Id ),
614- 'Fixtures\Bundles\AnnotationsBundle\Entity ' ,
615- ]);
616-
617- $ this ->assertDICDefinitionMethodCallAt (1 , $ def1 , 'addDriver ' , [
618599 new Reference ('doctrine.orm.em1_attribute_metadata_driver ' ),
619600 'Fixtures\Bundles\AttributesBundle\Entity ' ,
620601 ]);
@@ -629,17 +610,6 @@ public function testMultipleEntityManagersMappingBundleDefinitions(): void
629610 'Fixtures\Bundles\XmlBundle ' ,
630611 ]);
631612
632- if (version_compare (Kernel::VERSION , '7.0.0 ' , '< ' )) {
633- $ annDef = $ container ->getDefinition ($ def1Id );
634- $ this ->assertDICConstructorArguments ($ annDef , [
635- new Reference ('doctrine.orm.metadata.annotation_reader ' ),
636- [
637- __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures ' . DIRECTORY_SEPARATOR . 'Bundles ' . DIRECTORY_SEPARATOR . 'AnnotationsBundle ' . DIRECTORY_SEPARATOR . 'Entity ' ,
638- ],
639- ! class_exists (AnnotationDriver::class),
640- ]);
641- }
642-
643613 $ ymlDef = $ container ->getDefinition ('doctrine.orm.em2_yml_metadata_driver ' );
644614 $ this ->assertDICConstructorArguments ($ ymlDef , [
645615 [__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures ' . DIRECTORY_SEPARATOR . 'Bundles ' . DIRECTORY_SEPARATOR . 'YamlBundle ' . DIRECTORY_SEPARATOR . 'Resources ' . DIRECTORY_SEPARATOR . 'config ' . DIRECTORY_SEPARATOR . 'doctrine ' => 'Fixtures\Bundles\YamlBundle\Entity ' ],
@@ -659,7 +629,7 @@ public function testSingleEntityManagerDefaultTableOptions(): void
659629 self ::markTestSkipped ('This test requires ORM ' );
660630 }
661631
662- $ container = $ this ->loadContainer ('orm_single_em_default_table_options ' , ['YamlBundle ' , 'AnnotationsBundle ' , ' XmlBundle ' , 'AttributesBundle ' ]);
632+ $ container = $ this ->loadContainer ('orm_single_em_default_table_options ' , ['YamlBundle ' , 'XmlBundle ' , 'AttributesBundle ' ]);
663633
664634 $ param = $ container ->getDefinition ('doctrine.dbal.default_connection ' )->getArgument (0 );
665635
0 commit comments