Skip to content

Commit

Permalink
Make phpunit fail if a --filter does not execute any tests (#2924)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Feb 18, 2024
1 parent 2143b5e commit a018f1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
bootstrap="tests/bootstrap.php"
cacheResult="false"
colors="true"
executionOrder="random"
failOnRisky="true"
failOnWarning="true"
failOnEmptyTestSuite="true"
beStrictAboutChangesToGlobalState="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ protected function setUp(): void
protected function tearDown(): void
{
putenv('COLUMNS');
putenv('TERM_PROGRAM');
}

public function dataFormatterOutputProvider(): iterable
Expand Down Expand Up @@ -195,6 +196,7 @@ public function testFormatErrors(
}
$formatter = $this->createErrorFormatter(null);

// NOTE: extra env vars need to be cleared in tearDown()
foreach ($extraEnvVars as $envVar) {
putenv($envVar);
}
Expand Down

0 comments on commit a018f1e

Please sign in to comment.