diff --git a/src/Event/Value/Test/TestDox.php b/src/Event/Value/Test/TestDox.php index e6175f22203..2703a368500 100644 --- a/src/Event/Value/Test/TestDox.php +++ b/src/Event/Value/Test/TestDox.php @@ -9,8 +9,6 @@ */ namespace PHPUnit\Event\Code; -use RuntimeException; - /** * @psalm-immutable * @@ -20,11 +18,13 @@ { private string $prettifiedClassName; private string $prettifiedMethodName; + private string $prettifiedAndColorizedMethodName; - public function __construct(string $prettifiedClassName, string $prettifiedMethodName) + public function __construct(string $prettifiedClassName, string $prettifiedMethodName, string $prettifiedAndColorizedMethodName) { - $this->prettifiedClassName = $prettifiedClassName; - $this->prettifiedMethodName = $prettifiedMethodName; + $this->prettifiedClassName = $prettifiedClassName; + $this->prettifiedMethodName = $prettifiedMethodName; + $this->prettifiedAndColorizedMethodName = $prettifiedAndColorizedMethodName; } public function prettifiedClassName(): string @@ -32,13 +32,10 @@ public function prettifiedClassName(): string return $this->prettifiedClassName; } - /** - * @throws RuntimeException - */ public function prettifiedMethodName(bool $colorize = false): string { if ($colorize) { - throw new RuntimeException('Colorized pretty printing of method names is no longer supported for performance reasons.'); + return $this->prettifiedAndColorizedMethodName; } return $this->prettifiedMethodName;