Skip to content

Commit d7d0be8

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Prevent parsing invalid octal digits as octal numbers [DI] fix ContainerBuilder on PHP8 [Console] Make sure $maxAttempts is an int or null. [VarDumper] Fix caster for invalid SplFileInfo objects on php 8. [Intl] Skip test cases that produce a TypeError on php 8. [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3. [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x add bosnian (bs) translation [Debug] Parse "x not found" errors correctly on php 8.
2 parents 86f4900 + e6e6da2 commit d7d0be8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Tests/CoverageListenerTest.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,19 @@ public function test()
2727
$dir = __DIR__.'/../Tests/Fixtures/coverage';
2828
$phpunit = $_SERVER['argv'][0];
2929

30-
exec("$php $phpunit -c $dir/phpunit-without-listener.xml.dist $dir/tests/ --coverage-text 2> /dev/null", $output);
30+
exec("$php $phpunit -c $dir/phpunit-without-listener.xml.dist $dir/tests/ --coverage-text --colors=never 2> /dev/null", $output);
3131
$output = implode("\n", $output);
32-
$this->assertStringContainsString('FooCov', $output);
32+
$this->assertMatchesRegularExpression('/FooCov\n\s*Methods:\s+100.00%[^\n]+Lines:\s+100.00%/', $output);
3333

34-
exec("$php $phpunit -c $dir/phpunit-with-listener.xml.dist $dir/tests/ --coverage-text 2> /dev/null", $output);
34+
exec("$php $phpunit -c $dir/phpunit-with-listener.xml.dist $dir/tests/ --coverage-text --colors=never 2> /dev/null", $output);
3535
$output = implode("\n", $output);
36-
$this->assertStringNotContainsString('FooCov', $output);
36+
37+
if (false === strpos($output, 'FooCov')) {
38+
$this->addToAssertionCount(1);
39+
} else {
40+
$this->assertMatchesRegularExpression('/FooCov\n\s*Methods:\s+0.00%[^\n]+Lines:\s+0.00%/', $output);
41+
}
42+
3743
$this->assertStringContainsString("SutNotFoundTest::test\nCould not find the tested class.", $output);
3844
$this->assertStringNotContainsString("CoversTest::test\nCould not find the tested class.", $output);
3945
$this->assertStringNotContainsString("CoversDefaultClassTest::test\nCould not find the tested class.", $output);

0 commit comments

Comments
 (0)