From 6767397e99f1a64285851b1f737885e62c82dedb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Mon, 4 Dec 2023 00:49:38 +0100 Subject: [PATCH] fix: Fix Doctrine DBAL deprecation Closes #41. --- src/PhpUnit/RefreshDatabaseTrait.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/PhpUnit/RefreshDatabaseTrait.php b/src/PhpUnit/RefreshDatabaseTrait.php index 6d83006..1b64101 100644 --- a/src/PhpUnit/RefreshDatabaseTrait.php +++ b/src/PhpUnit/RefreshDatabaseTrait.php @@ -38,8 +38,13 @@ protected static function bootKernel(array $options = []): KernelInterface static::$fixtures = FixtureStore::getFixtures(); } - $container = static::$kernel->getContainer(); - $container->get('doctrine')->getConnection(FixtureStore::getConnectionName())->beginTransaction(); + $connection = static::$kernel + ->getContainer() + ->get('doctrine') + ->getConnection(FixtureStore::getConnectionName()); + + $connection->setNestTransactionsWithSavepoints(true); + $connection->beginTransaction(); return $kernel; }