File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
src/Symfony/Bridge/Doctrine/Tests 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
5858 {
5959 $ config = ORMSetup::createConfiguration (true );
6060 $ 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+ }
6466 $ config ->setMetadataDriverImpl (new AttributeDriver ([__DIR__ .'/../Tests/Fixtures ' => 'Symfony\Bridge\Doctrine\Tests\Fixtures ' ], true ));
6567 if (class_exists (DefaultSchemaManagerFactory::class)) {
6668 $ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
Original file line number Diff line number Diff line change @@ -45,7 +45,11 @@ private function createExtractor(): DoctrineExtractor
4545 $ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
4646 }
4747 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+ }
4953 }
5054
5155 $ eventManager = new EventManager ();
You can’t perform that action at this time.
0 commit comments