File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 22
33namespace PHPStan \Testing \PHPUnit ;
44
5+ use PHPStan \DependencyInjection \InvalidIgnoredErrorExceptionTest ;
56use function array_key_exists ;
67
78final class ContainerInitializer
89{
9-
10- /** @var array<string, true> */
11- private static array $ initialized = [];
12-
1310 public static function initialize (string $ testClassName ): void
1411 {
15- if (array_key_exists ($ testClassName , self ::$ initialized )) {
12+ // This test expects an exception during container initialization
13+ if ($ testClassName === InvalidIgnoredErrorExceptionTest::class) {
1614 return ;
1715 }
1816
1917 $ testClassName ::getContainer ();
20-
21- self ::$ initialized [$ testClassName ] = true ;
2218 }
2319
2420}
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ public function bootstrap(
1818 ParameterCollection $ parameters ,
1919 ): void
2020 {
21- // use multiple subscribers which all initialize the test-container.
22- // we need to make sure we only initialize once per test-class.
2321 $ facade ->registerSubscriber (
2422 new InitContainerBeforeDataProviderSubscriber (),
2523 );
You can’t perform that action at this time.
0 commit comments