Skip to content

Commit 71f08af

Browse files
authored
Merge pull request #259 from kbond/global-state-fix
Fix global state issue
2 parents 4a56be7 + c131715 commit 71f08af

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
strategy:
3434
matrix:
3535
php: [7.4, 8.0, 8.1]
36-
symfony: [4.4.*, 5.3.*, 5.4.*]
36+
symfony: [4.4.*, 5.4.*]
3737
deps: [highest]
3838
include:
3939
- php: 7.2

src/Test/DatabaseResetter.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticDriver;
66
use Symfony\Bundle\FrameworkBundle\Console\Application;
77
use Symfony\Component\HttpKernel\KernelInterface;
8-
use Zenstruck\Foundry\Factory;
98

109
/**
1110
* @internal
@@ -42,7 +41,7 @@ public static function resetDatabase(KernelInterface $kernel): void
4241

4342
$databaseResetter->resetDatabase();
4443

45-
self::bootFoundry($kernel);
44+
self::flushGlobalState($kernel);
4645

4746
self::$hasBeenReset = true;
4847
}
@@ -57,7 +56,7 @@ public static function resetSchema(KernelInterface $kernel): void
5756
return;
5857
}
5958

60-
self::bootFoundry($kernel);
59+
self::flushGlobalState($kernel);
6160
}
6261

6362
/** @retrun array<SchemaResetterInterface> */
@@ -77,11 +76,9 @@ private static function schemaResetters(KernelInterface $kernel): array
7776
return $databaseResetters;
7877
}
7978

80-
private static function bootFoundry(KernelInterface $kernel): void
79+
private static function flushGlobalState(KernelInterface $kernel): void
8180
{
82-
if (!Factory::isBooted()) {
83-
TestState::bootFromContainer($kernel->getContainer());
84-
}
81+
TestState::bootFromContainer($kernel->getContainer());
8582

8683
TestState::flushGlobalState();
8784
}

0 commit comments

Comments
 (0)