Skip to content

Commit ac18293

Browse files
committed
fix
1 parent 1925638 commit ac18293

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/Testing/PHPUnit/ContainerInitializer.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,19 @@
22

33
namespace PHPStan\Testing\PHPUnit;
44

5+
use PHPStan\DependencyInjection\InvalidIgnoredErrorExceptionTest;
56
use function array_key_exists;
67

78
final 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
}

src/Testing/PHPUnit/PHPStanPHPUnitExtension.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff 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
);

0 commit comments

Comments
 (0)