File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,11 @@ public static function createTestConfiguration(): Configuration
58
58
{
59
59
$ config = ORMSetup::createConfiguration (true );
60
60
$ config ->setEntityNamespaces (['SymfonyTestsDoctrine ' => 'Symfony\Bridge\Doctrine\Tests\Fixtures ' ]);
61
- $ config ->setAutoGenerateProxyClasses (true );
62
- $ config ->setProxyDir (sys_get_temp_dir ());
63
- $ config ->setProxyNamespace ('SymfonyTests\Doctrine ' );
61
+ if (\PHP_VERSION_ID < 80400 || !method_exists ($ config , 'enableNativeLazyObjects ' )) {
62
+ $ config ->setAutoGenerateProxyClasses (true );
63
+ $ config ->setProxyDir (sys_get_temp_dir ());
64
+ $ config ->setProxyNamespace ('SymfonyTests\Doctrine ' );
65
+ }
64
66
$ config ->setMetadataDriverImpl (new AttributeDriver ([__DIR__ .'/../Tests/Fixtures ' => 'Symfony\Bridge\Doctrine\Tests\Fixtures ' ], true ));
65
67
if (class_exists (DefaultSchemaManagerFactory::class)) {
66
68
$ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
Original file line number Diff line number Diff line change @@ -45,7 +45,11 @@ private function createExtractor(): DoctrineExtractor
45
45
$ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
46
46
}
47
47
if (!class_exists (\Doctrine \Persistence \Mapping \Driver \AnnotationDriver::class)) { // doctrine/persistence >= 3.0
48
- $ config ->setLazyGhostObjectEnabled (true );
48
+ if (\PHP_VERSION_ID >= 80400 && method_exists ($ config , 'enableNativeLazyObjects ' )) {
49
+ $ config ->enableNativeLazyObjects (true );
50
+ } else {
51
+ $ config ->setLazyGhostObjectEnabled (true );
52
+ }
49
53
}
50
54
51
55
$ eventManager = new EventManager ();
You can’t perform that action at this time.
0 commit comments