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
59
59
60
60
public static function createTestConfiguration (): Configuration
61
61
{
62
- $ config = class_exists ( ORMSetup::class) ? ORMSetup:: createConfiguration (true ) : new Configuration ( );
62
+ $ config = ORMSetup::createConfiguration (true );
63
63
$ config ->setEntityNamespaces (['SymfonyTestsDoctrine ' => 'Symfony\Bridge\Doctrine\Tests\Fixtures ' ]);
64
64
$ config ->setAutoGenerateProxyClasses (true );
65
65
$ config ->setProxyDir (sys_get_temp_dir ());
@@ -72,8 +72,7 @@ public static function createTestConfiguration(): Configuration
72
72
if (class_exists (DefaultSchemaManagerFactory::class)) {
73
73
$ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
74
74
}
75
-
76
- if (method_exists (Configuration::class, 'setLazyGhostObjectEnabled ' )) {
75
+ if (method_exists ($ config , 'setLazyGhostObjectEnabled ' )) {
77
76
$ config ->setLazyGhostObjectEnabled (true );
78
77
}
79
78
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Bridge \Doctrine \Tests \Middleware \Debug ;
13
13
14
- use Doctrine \DBAL \Configuration ;
15
14
use Doctrine \DBAL \Connection ;
16
15
use Doctrine \DBAL \Driver \Middleware as MiddlewareInterface ;
17
16
use Doctrine \DBAL \DriverManager ;
@@ -51,10 +50,13 @@ private function init(bool $withStopwatch = true): void
51
50
{
52
51
$ this ->stopwatch = $ withStopwatch ? new Stopwatch () : null ;
53
52
54
- $ config = class_exists ( ORMSetup::class) ? ORMSetup:: createConfiguration (true ) : new Configuration ( );
53
+ $ config = ORMSetup::createConfiguration (true );
55
54
if (class_exists (DefaultSchemaManagerFactory::class)) {
56
55
$ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
57
56
}
57
+ if (method_exists ($ config , 'setLazyGhostObjectEnabled ' )) {
58
+ $ config ->setLazyGhostObjectEnabled (true );
59
+ }
58
60
$ this ->debugDataHolder = new DebugDataHolder ();
59
61
$ config ->setMiddlewares ([new Middleware ($ this ->debugDataHolder , $ this ->stopwatch )]);
60
62
Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ private function createExtractor()
43
43
$ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
44
44
}
45
45
46
+ if (method_exists ($ config , 'setLazyGhostObjectEnabled ' )) {
47
+ $ config ->setLazyGhostObjectEnabled (true );
48
+ }
49
+
46
50
if (!(new \ReflectionMethod (EntityManager::class, '__construct ' ))->isPublic ()) {
47
51
$ entityManager = EntityManager::create (['driver ' => 'pdo_sqlite ' ], $ config );
48
52
} else {
Original file line number Diff line number Diff line change 11
11
12
12
namespace Security \RememberMe ;
13
13
14
- use Doctrine \DBAL \Configuration ;
15
14
use Doctrine \DBAL \DriverManager ;
16
15
use Doctrine \DBAL \Schema \DefaultSchemaManagerFactory ;
17
16
use Doctrine \ORM \ORMSetup ;
@@ -123,11 +122,15 @@ public function testVerifyOutdatedTokenAfterParallelRequestFailsAfter60Seconds()
123
122
*/
124
123
private function bootstrapProvider ()
125
124
{
126
- $ config = class_exists ( ORMSetup::class) ? ORMSetup:: createConfiguration (true ) : new Configuration ( );
125
+ $ config = ORMSetup::createConfiguration (true );
127
126
if (class_exists (DefaultSchemaManagerFactory::class)) {
128
127
$ config ->setSchemaManagerFactory (new DefaultSchemaManagerFactory ());
129
128
}
130
129
130
+ if (method_exists ($ config , 'setLazyGhostObjectEnabled ' )) {
131
+ $ config ->setLazyGhostObjectEnabled (true );
132
+ }
133
+
131
134
$ connection = DriverManager::getConnection ([
132
135
'driver ' => 'pdo_sqlite ' ,
133
136
'memory ' => true ,
You can’t perform that action at this time.
0 commit comments