From 3ec6c660d3b885b5bb1f7efe0abfb6926d3f3033 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 5 Feb 2023 04:16:50 +0100 Subject: [PATCH] TestCase: lists the running methods --- src/Framework/TestCase.php | 6 +++++- tests/Framework/TestCase.errors.4.phpt | 2 +- tests/Framework/TestCase.errors.5.phpt | 2 +- tests/Framework/TestCase.errors.6.phpt | 2 +- tests/Framework/TestCase.order.errorMuted.phpt | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php index 6be91d52..b7889424 100644 --- a/src/Framework/TestCase.php +++ b/src/Framework/TestCase.php @@ -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; } } } diff --git a/tests/Framework/TestCase.errors.4.phpt b/tests/Framework/TestCase.errors.4.phpt index f665d9e9..334b56b8 100644 --- a/tests/Framework/TestCase.errors.4.phpt +++ b/tests/Framework/TestCase.errors.4.phpt @@ -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); diff --git a/tests/Framework/TestCase.errors.5.phpt b/tests/Framework/TestCase.errors.5.phpt index 118d31b8..bb05dd16 100644 --- a/tests/Framework/TestCase.errors.5.phpt +++ b/tests/Framework/TestCase.errors.5.phpt @@ -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); diff --git a/tests/Framework/TestCase.errors.6.phpt b/tests/Framework/TestCase.errors.6.phpt index 6d35513f..28815e6a 100644 --- a/tests/Framework/TestCase.errors.6.phpt +++ b/tests/Framework/TestCase.errors.6.phpt @@ -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); diff --git a/tests/Framework/TestCase.order.errorMuted.phpt b/tests/Framework/TestCase.order.errorMuted.phpt index a7b0c276..af564e7c 100644 --- a/tests/Framework/TestCase.order.errorMuted.phpt +++ b/tests/Framework/TestCase.order.errorMuted.phpt @@ -1,7 +1,7 @@