@@ -31,13 +31,19 @@ public function test()
31
31
$ dir = __DIR__ .'/../Tests/Fixtures/coverage ' ;
32
32
$ phpunit = $ _SERVER ['argv ' ][0 ];
33
33
34
- exec ("$ php $ phpunit -c $ dir/phpunit-without-listener.xml.dist $ dir/tests/ --coverage-text 2> /dev/null " , $ output );
34
+ exec ("$ php $ phpunit -c $ dir/phpunit-without-listener.xml.dist $ dir/tests/ --coverage-text --colors=never 2> /dev/null " , $ output );
35
35
$ output = implode ("\n" , $ output );
36
- $ this ->assertStringContainsString ( ' FooCov ' , $ output );
36
+ $ this ->assertMatchesRegularExpression ( ' / FooCov\n\s*Methods:\s+100.00%[^\n]+Lines:\s+100.00%/ ' , $ output );
37
37
38
- exec ("$ php $ phpunit -c $ dir/phpunit-with-listener.xml.dist $ dir/tests/ --coverage-text 2> /dev/null " , $ output );
38
+ exec ("$ php $ phpunit -c $ dir/phpunit-with-listener.xml.dist $ dir/tests/ --coverage-text --colors=never 2> /dev/null " , $ output );
39
39
$ output = implode ("\n" , $ output );
40
- $ this ->assertStringNotContainsString ('FooCov ' , $ output );
40
+
41
+ if (false === strpos ($ output , 'FooCov ' )) {
42
+ $ this ->addToAssertionCount (1 );
43
+ } else {
44
+ $ this ->assertMatchesRegularExpression ('/FooCov\n\s*Methods:\s+0.00%[^\n]+Lines:\s+0.00%/ ' , $ output );
45
+ }
46
+
41
47
$ this ->assertStringContainsString ("SutNotFoundTest::test \nCould not find the tested class. " , $ output );
42
48
$ this ->assertStringNotContainsString ("CoversTest::test \nCould not find the tested class. " , $ output );
43
49
$ this ->assertStringNotContainsString ("CoversDefaultClassTest::test \nCould not find the tested class. " , $ output );
0 commit comments