Skip to content

Commit 589eeeb

Browse files
Fix merge
1 parent 09c9655 commit 589eeeb

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

Tests/DoctrineTestHelper.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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

Tests/Middleware/Debug/MiddlewareTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Tests\Middleware\Debug;
1313

14-
use Doctrine\DBAL\Configuration;
1514
use Doctrine\DBAL\Connection;
1615
use Doctrine\DBAL\Driver\Middleware as MiddlewareInterface;
1716
use 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

Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

Tests/Security/RememberMe/DoctrineTokenProviderTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Security\RememberMe;
1313

14-
use Doctrine\DBAL\Configuration;
1514
use Doctrine\DBAL\DriverManager;
1615
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
1716
use 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,

0 commit comments

Comments
 (0)