Skip to content

Commit 911c0e6

Browse files
committed
Environment::$debugMode moved to CliTester::$debugMode
1 parent b9b9159 commit 911c0e6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Framework/Environment.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ class Environment
2727
/** Thread number when run tests in multi threads */
2828
public const THREAD = 'NETTE_TESTER_THREAD';
2929

30-
/** @var bool used for debugging Tester itself */
31-
public static $debugMode = true;
32-
3330
/** @var bool */
3431
public static $checkAssertions = false;
3532

@@ -125,7 +122,7 @@ public static function handleException(\Throwable $e): void
125122
{
126123
self::removeOutputBuffers();
127124
self::$checkAssertions = false;
128-
echo self::$debugMode ? Dumper::dumpException($e) : "\nError: {$e->getMessage()}\n";
125+
echo Dumper::dumpException($e);
129126
exit($e instanceof AssertException ? Runner\Job::CODE_FAIL : Runner\Job::CODE_ERROR);
130127
}
131128

src/Runner/CliTester.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class CliTester
2525
/** @var PhpInterpreter */
2626
private $interpreter;
2727

28+
/** @var bool */
29+
private $debugMode = true;
30+
2831

2932
public function run(): ?int
3033
{
@@ -34,7 +37,7 @@ public function run(): ?int
3437
ob_start();
3538
$cmd = $this->loadOptions();
3639

37-
Environment::$debugMode = (bool) $this->options['--debug'];
40+
$this->debugMode = (bool) $this->options['--debug'];
3841
if (isset($this->options['--colors'])) {
3942
Environment::$useColors = (bool) $this->options['--colors'];
4043
} elseif (in_array($this->options['-o'], ['tap', 'junit'], true)) {
@@ -300,7 +303,7 @@ private function setupErrors(): void
300303
private function displayException(\Throwable $e): void
301304
{
302305
echo "\n";
303-
echo Environment::$debugMode
306+
echo $this->debugMode
304307
? Dumper::dumpException($e)
305308
: Dumper::color('white/red', 'Error: ' . $e->getMessage());
306309
echo "\n";

0 commit comments

Comments
 (0)