Skip to content

Commit

Permalink
Fix broken test on phpunit 9
Browse files Browse the repository at this point in the history
Fix broken test on phpunit 9
  • Loading branch information
slt committed Apr 27, 2020
1 parent 2c9119e commit f38fa41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ vendor
composer.lock
/test/fixtures/generated-tests
.phpunit.result.cache
.php_cs.cache
.idea
5 changes: 3 additions & 2 deletions src/Runners/PHPUnit/ResultPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ protected function printFeedbackItem(string $item)
}
}

protected function printFeedbackItemColor(string $item) {
protected function printFeedbackItemColor(string $item)
{
if ($this->colors) {
switch ($item) {
case 'E':
Expand All @@ -410,7 +411,7 @@ protected function printFeedbackItemColor(string $item) {
// fg-cyan
echo "\x1b[36m" . $item . "\x1b[0m";
return;
}
}
}
echo $item;
}
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Runners/PHPUnit/ResultPrinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ public function testGetHeader()
$header = $this->printer->getHeader();

$this->assertRegExp(
"/\n\nTime: [0-9]+([.][0-9]{1,2})? " .
'(minute|minutes|second|seconds|ms)?,' .
"/\n\nTime: ([.:?][0-9]{1,3})+ ?" .
'(minute|minutes|second|seconds|ms|)?,' .
" Memory:[\s][0-9]+([.][0-9]{1,2})? ?M[Bb]\n\n/",
$header
);
Expand Down

0 comments on commit f38fa41

Please # to comment.