File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 55use DAMA \DoctrineTestBundle \Doctrine \DBAL \StaticDriver ;
66use Symfony \Bundle \FrameworkBundle \Console \Application ;
77use Symfony \Component \HttpKernel \KernelInterface ;
8+ use Zenstruck \Foundry \Factory ;
89
910/**
1011 * @internal
@@ -41,7 +42,7 @@ public static function resetDatabase(KernelInterface $kernel): void
4142
4243 $ databaseResetter ->resetDatabase ();
4344
44- self ::flushGlobalState ($ kernel );
45+ self ::bootFoundry ($ kernel );
4546
4647 self ::$ hasBeenReset = true ;
4748 }
@@ -56,7 +57,7 @@ public static function resetSchema(KernelInterface $kernel): void
5657 return ;
5758 }
5859
59- self ::flushGlobalState ($ kernel );
60+ self ::bootFoundry ($ kernel );
6061 }
6162
6263 /** @retrun array<SchemaResetterInterface> */
@@ -76,9 +77,11 @@ private static function schemaResetters(KernelInterface $kernel): array
7677 return $ databaseResetters ;
7778 }
7879
79- private static function flushGlobalState (KernelInterface $ kernel ): void
80+ private static function bootFoundry (KernelInterface $ kernel ): void
8081 {
81- TestState::bootFromContainer ($ kernel ->getContainer ());
82+ if (!Factory::isBooted ()) {
83+ TestState::bootFromContainer ($ kernel ->getContainer ());
84+ }
8285
8386 TestState::flushGlobalState ();
8487 }
You can’t perform that action at this time.
0 commit comments