Skip to content

Commit a018f1e

Browse files
authored
Make phpunit fail if a --filter does not execute any tests (#2924)
1 parent 2143b5e commit a018f1e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

phpunit.xml

+2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
bootstrap="tests/bootstrap.php"
55
cacheResult="false"
66
colors="true"
7+
executionOrder="random"
78
failOnRisky="true"
89
failOnWarning="true"
10+
failOnEmptyTestSuite="true"
911
beStrictAboutChangesToGlobalState="true"
1012
beStrictAboutCoversAnnotation="true"
1113
beStrictAboutOutputDuringTests="true"

tests/PHPStan/Command/ErrorFormatter/TableErrorFormatterTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ protected function setUp(): void
2424
protected function tearDown(): void
2525
{
2626
putenv('COLUMNS');
27+
putenv('TERM_PROGRAM');
2728
}
2829

2930
public function dataFormatterOutputProvider(): iterable
@@ -195,6 +196,7 @@ public function testFormatErrors(
195196
}
196197
$formatter = $this->createErrorFormatter(null);
197198

199+
// NOTE: extra env vars need to be cleared in tearDown()
198200
foreach ($extraEnvVars as $envVar) {
199201
putenv($envVar);
200202
}

0 commit comments

Comments
 (0)