38
38
use Symfony \Component \DependencyInjection \Reference ;
39
39
use Symfony \Component \DependencyInjection \ServiceLocator ;
40
40
use Symfony \Component \HttpFoundation \Session \Storage \Handler \PdoSessionHandler ;
41
+ use Symfony \Component \HttpKernel \Kernel ;
41
42
use Symfony \Component \Security \Core \User \UserInterface ;
42
- use Symfony \Component \Validator \Mapping \Loader \AnnotationLoader ;
43
43
44
44
use function array_filter ;
45
45
use function array_intersect_key ;
55
55
use function sprintf ;
56
56
use function sys_get_temp_dir ;
57
57
use function uniqid ;
58
+ use function version_compare ;
58
59
59
60
use const DIRECTORY_SEPARATOR ;
60
61
@@ -537,7 +538,7 @@ public function testSingleEntityManagerMultipleMappingBundleDefinitions(): void
537
538
$ definition = $ container ->getDefinition ('doctrine.orm.default_metadata_driver ' );
538
539
539
540
$ this ->assertDICDefinitionMethodCallAt (0 , $ definition , 'addDriver ' , [
540
- new Reference (class_exists (AnnotationLoader::class ) ? 'doctrine.orm.default_annotation_metadata_driver ' : 'doctrine.orm.default_attribute_metadata_driver ' ),
541
+ new Reference (version_compare (Kernel:: VERSION , ' 7.0.0 ' , ' < ' ) ? 'doctrine.orm.default_annotation_metadata_driver ' : 'doctrine.orm.default_attribute_metadata_driver ' ),
541
542
'Fixtures\Bundles\AnnotationsBundle\Entity ' ,
542
543
]);
543
544
@@ -559,7 +560,7 @@ public function testSingleEntityManagerMultipleMappingBundleDefinitions(): void
559
560
$ attrDef = $ container ->getDefinition ('doctrine.orm.default_attribute_metadata_driver ' );
560
561
$ this ->assertDICConstructorArguments ($ attrDef , [
561
562
array_merge (
562
- ! class_exists (AnnotationLoader::class ) ? [
563
+ ! version_compare (Kernel:: VERSION , ' 7.0.0 ' , ' < ' ) ? [
563
564
__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures ' . DIRECTORY_SEPARATOR . 'Bundles ' . DIRECTORY_SEPARATOR . 'AnnotationsBundle ' . DIRECTORY_SEPARATOR . 'Entity ' ,
564
565
] : [],
565
566
[
@@ -596,7 +597,7 @@ public function testMultipleEntityManagersMappingBundleDefinitions(): void
596
597
597
598
$ def1 = $ container ->getDefinition ('doctrine.orm.em1_metadata_driver ' );
598
599
$ def2 = $ container ->getDefinition ('doctrine.orm.em2_metadata_driver ' );
599
- $ def1Id = class_exists (AnnotationLoader::class ) ? 'doctrine.orm.em1_annotation_metadata_driver ' : 'doctrine.orm.em1_attribute_metadata_driver ' ;
600
+ $ def1Id = version_compare (Kernel:: VERSION , ' 7.0.0 ' , ' < ' ) ? 'doctrine.orm.em1_annotation_metadata_driver ' : 'doctrine.orm.em1_attribute_metadata_driver ' ;
600
601
601
602
$ this ->assertDICDefinitionMethodCallAt (0 , $ def1 , 'addDriver ' , [
602
603
new Reference ($ def1Id ),
@@ -618,7 +619,7 @@ public function testMultipleEntityManagersMappingBundleDefinitions(): void
618
619
'Fixtures\Bundles\XmlBundle ' ,
619
620
]);
620
621
621
- if (class_exists (AnnotationLoader::class )) {
622
+ if (version_compare (Kernel:: VERSION , ' 7.0.0 ' , ' < ' )) {
622
623
$ annDef = $ container ->getDefinition ($ def1Id );
623
624
$ this ->assertDICConstructorArguments ($ annDef , [
624
625
new Reference ('doctrine.orm.metadata.annotation_reader ' ),
0 commit comments