Skip to content

Commit

Permalink
TestCase: lists the running methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 6, 2023
1 parent e2506ac commit 3ec6c66
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ public function run(): void
foreach ($methods as $method) {
try {
$this->runTest($method);
Environment::print(Dumper::color('lime', '') . " $method");
} catch (TestCaseSkippedException $e) {
echo "\nSkipped:\n{$e->getMessage()}\n";
Environment::print("s $method {$e->getMessage()}");
} catch (\Throwable $e) {
Environment::print(Dumper::color('red', '×') . " $method\n\n");
throw $e;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Framework/TestCase.errors.4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* @exitCode 255
* @outputMatch #^Test::setUp,Exception: setUp\s+in#
* @outputMatch #^Test::setUp,× testMe\s+Exception: setUp\s+in#
*/

declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion tests/Framework/TestCase.errors.5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* @exitCode 255
* @outputMatch #^Test::setUp,Test::testMe,Test::tearDown,Exception: testMe\s+in#
* @outputMatch #^Test::setUp,Test::testMe,Test::tearDown,× testMe\s+Exception: testMe\s+in#
*/

declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion tests/Framework/TestCase.errors.6.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* @exitCode 255
* @outputMatch #^Test::setUp,Test::testMe,Test::tearDown,Exception: tearDown\s+in#
* @outputMatch #^Test::setUp,Test::testMe,Test::tearDown,× testMe\s+Exception: tearDown\s+in#
*/

declare(strict_types=1);
Expand Down
2 changes: 1 addition & 1 deletion tests/Framework/TestCase.order.errorMuted.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @outputMatch Test::setUp,Test::testMe,Test::tearDown
* @outputMatch Test::setUp,Test::testMe,Test::tearDown√ testMe
*/

declare(strict_types=1);
Expand Down

0 comments on commit 3ec6c66

Please sign in to comment.