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; }