Skip to content

Commit d929ac4

Browse files
committed
invoke from within the test
1 parent 9f20e61 commit d929ac4

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/Testing/PHPStanTestCase.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace PHPStan\Testing;
44

5-
use Override;
65
use PHPStan\Analyser\ConstantResolver;
76
use PHPStan\Analyser\DirectInternalScopeFactory;
87
use PHPStan\Analyser\Error;
@@ -97,12 +96,6 @@ public static function getContainer(): Container
9796
return self::$containers[$cacheKey];
9897
}
9998

100-
#[Override]
101-
public static function setUpBeforeClass(): void
102-
{
103-
self::getContainer();
104-
}
105-
10699
/**
107100
* @return string[]
108101
*/

tests/bootstrap.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ class InitContainerBeforeDataProvider implements DataProviderMethodCalledSubscri
3030

3131
public function notify(DataProviderMethodCalled $event): void
3232
{
33-
PHPStanTestCase::getContainer();
33+
$testClassName = $event->testMethod()->className();
34+
35+
if (!is_a($testClassName, PhpStanTestCase::class, true)) {
36+
return;
37+
}
38+
39+
$testClassName::getContainer();
3440
}
3541

3642
}

0 commit comments

Comments
 (0)