From 8ee4a309d0b99a54aca9572bfadfc478a907b50b Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 3 Aug 2026 20:42:22 -0400 Subject: [PATCH] debug tests --- phpunit.xml | 5 +- tests/Extensions/RealTimeOutputExtension.php | 60 ++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 tests/Extensions/RealTimeOutputExtension.php diff --git a/phpunit.xml b/phpunit.xml index 8c16d0ae0e..7cc898e9d0 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,7 +7,10 @@ extensionsDirectory="tests/Extensions" displayDetailsOnAllIssues="true" > - + + + + tests/Feature tests/Managers diff --git a/tests/Extensions/RealTimeOutputExtension.php b/tests/Extensions/RealTimeOutputExtension.php new file mode 100644 index 0000000000..2816f91988 --- /dev/null +++ b/tests/Extensions/RealTimeOutputExtension.php @@ -0,0 +1,60 @@ +registerSubscriber(new class implements PreparationStartedSubscriber { + public function notify(PreparationStarted $event): void + { + fwrite(STDERR, "\n\033[1;33m[START]\033[0m " . $event->test()->id() . "\n"); + } + }); + + $facade->registerSubscriber(new class implements PassedSubscriber { + public function notify(Passed $event): void + { + fwrite(STDERR, "\033[1;32m[PASS]\033[0m " . $event->test()->id() . "\n"); + } + }); + + $facade->registerSubscriber(new class implements FailedSubscriber { + public function notify(Failed $event): void + { + fwrite(STDERR, "\033[1;31m[FAIL]\033[0m " . $event->test()->id() . "\n"); + // TESTING_VERBOSE will handle the trace, but we can add a small marker here if needed. + } + }); + + $facade->registerSubscriber(new class implements ErroredSubscriber { + public function notify(Errored $event): void + { + fwrite(STDERR, "\033[1;31m[ERROR]\033[0m " . $event->test()->id() . "\n"); + } + }); + + $facade->registerSubscriber(new class implements SkippedSubscriber { + public function notify(Skipped $event): void + { + fwrite(STDERR, "\033[1;34m[SKIP]\033[0m " . $event->test()->id() . "\n"); + } + }); + } +}