File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public static function createTestEntityManager(Configuration $config = null): En
5959
6060 public static function createTestConfiguration (): Configuration
6161 {
62- $ config = class_exists ( ORMSetup::class) ? ORMSetup:: createConfiguration (true ) : new Configuration ( );
62+ $ config = ORMSetup::createConfiguration (true );
6363 $ config ->setEntityNamespaces (['SymfonyTestsDoctrine ' => 'Symfony\Bridge\Doctrine\Tests\Fixtures ' ]);
6464 $ config ->setAutoGenerateProxyClasses (true );
6565 $ config ->setProxyDir (sys_get_temp_dir ());
@@ -72,8 +72,7 @@ public static function createTestConfiguration(): Configuration
7272 if (class_exists (DefaultSchemaManagerFactory::class)) {
7373 $ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
7474 }
75-
76- if (method_exists (Configuration::class, 'setLazyGhostObjectEnabled ' )) {
75+ if (method_exists ($ config , 'setLazyGhostObjectEnabled ' )) {
7776 $ config ->setLazyGhostObjectEnabled (true );
7877 }
7978
Original file line number Diff line number Diff line change 1111
1212namespace Symfony \Bridge \Doctrine \Tests \Middleware \Debug ;
1313
14- use Doctrine \DBAL \Configuration ;
1514use Doctrine \DBAL \Connection ;
1615use Doctrine \DBAL \Driver \Middleware as MiddlewareInterface ;
1716use Doctrine \DBAL \DriverManager ;
@@ -51,10 +50,13 @@ private function init(bool $withStopwatch = true): void
5150 {
5251 $ this ->stopwatch = $ withStopwatch ? new Stopwatch () : null ;
5352
54- $ config = class_exists ( ORMSetup::class) ? ORMSetup:: createConfiguration (true ) : new Configuration ( );
53+ $ config = ORMSetup::createConfiguration (true );
5554 if (class_exists (DefaultSchemaManagerFactory::class)) {
5655 $ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
5756 }
57+ if (method_exists ($ config , 'setLazyGhostObjectEnabled ' )) {
58+ $ config ->setLazyGhostObjectEnabled (true );
59+ }
5860 $ this ->debugDataHolder = new DebugDataHolder ();
5961 $ config ->setMiddlewares ([new Middleware ($ this ->debugDataHolder , $ this ->stopwatch )]);
6062
Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ private function createExtractor()
4343 $ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
4444 }
4545
46+ if (method_exists ($ config , 'setLazyGhostObjectEnabled ' )) {
47+ $ config ->setLazyGhostObjectEnabled (true );
48+ }
49+
4650 if (!(new \ReflectionMethod (EntityManager::class, '__construct ' ))->isPublic ()) {
4751 $ entityManager = EntityManager::create (['driver ' => 'pdo_sqlite ' ], $ config );
4852 } else {
Original file line number Diff line number Diff line change 1111
1212namespace Security \RememberMe ;
1313
14- use Doctrine \DBAL \Configuration ;
1514use Doctrine \DBAL \DriverManager ;
1615use Doctrine \DBAL \Schema \DefaultSchemaManagerFactory ;
1716use Doctrine \ORM \ORMSetup ;
@@ -123,11 +122,15 @@ public function testVerifyOutdatedTokenAfterParallelRequestFailsAfter60Seconds()
123122 */
124123 private function bootstrapProvider ()
125124 {
126- $ config = class_exists ( ORMSetup::class) ? ORMSetup:: createConfiguration (true ) : new Configuration ( );
125+ $ config = ORMSetup::createConfiguration (true );
127126 if (class_exists (DefaultSchemaManagerFactory::class)) {
128127 $ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
129128 }
130129
130+ if (method_exists ($ config , 'setLazyGhostObjectEnabled ' )) {
131+ $ config ->setLazyGhostObjectEnabled (true );
132+ }
133+
131134 $ connection = DriverManager::getConnection ([
132135 'driver ' => 'pdo_sqlite ' ,
133136 'memory ' => true ,
You can’t perform that action at this time.
0 commit comments