Closed
Description
Q | A |
---|---|
PHPUnit version | 9.5.2 |
PHP version | 8.0 |
Installation Method | Composer / PHAR |
Summary
When calling self::markTestSkipped
in a setUpBeforeClass
method, all tests inside the file are flagged Skipped
without the error "Test skipped because of an error in hook method"
When looking at https://github.com/sebastianbergmann/phpunit/blob/master/src/Framework/TestSuite.php#L438-L448
It looks like we can fix this by throwing a SkippedTestSuiteError
instead. But this class is @internal
.
Current behavior
1) FooTest::testMethod
Test skipped because of an error in hook method
How to reproduce
class FooTest extends TestCase {
public static function setUpBeforeClass(): void
{
self::markTestSkipped('My Custom message');
}
}
Expected behavior
1) FooTest::testMethod
My Custom message
Suggestion
Add a public static markTestSuiteSkipped
method to the API