diff --git a/Tests/DoctrineTestHelper.php b/Tests/DoctrineTestHelper.php index 84c3e305..2cbf416a 100644 --- a/Tests/DoctrineTestHelper.php +++ b/Tests/DoctrineTestHelper.php @@ -12,6 +12,7 @@ namespace Symfony\Bridge\Doctrine\Tests; use Doctrine\Common\Annotations\AnnotationReader; +use Doctrine\Common\EventManager; use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory; use Doctrine\ORM\Configuration; @@ -51,7 +52,9 @@ public static function createTestEntityManager(Configuration $config = null): En return EntityManager::create($params, $config); } - return new EntityManager(DriverManager::getConnection($params, $config), $config); + $eventManager = new EventManager(); + + return new EntityManager(DriverManager::getConnection($params, $config, $eventManager), $config, $eventManager); } public static function createTestConfiguration(): Configuration diff --git a/Tests/PropertyInfo/DoctrineExtractorTest.php b/Tests/PropertyInfo/DoctrineExtractorTest.php index 0f78692d..225b4217 100644 --- a/Tests/PropertyInfo/DoctrineExtractorTest.php +++ b/Tests/PropertyInfo/DoctrineExtractorTest.php @@ -13,6 +13,7 @@ use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Collections\Collection; +use Doctrine\Common\EventManager; use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory; use Doctrine\DBAL\Types\Type as DBALType; @@ -54,7 +55,8 @@ private function createExtractor() if (!(new \ReflectionMethod(EntityManager::class, '__construct'))->isPublic()) { $entityManager = EntityManager::create(['driver' => 'pdo_sqlite'], $config); } else { - $entityManager = new EntityManager(DriverManager::getConnection(['driver' => 'pdo_sqlite'], $config), $config); + $eventManager = new EventManager(); + $entityManager = new EntityManager(DriverManager::getConnection(['driver' => 'pdo_sqlite'], $config, $eventManager), $config, $eventManager); } if (!DBALType::hasType('foo')) {