Skip to content

Commit

Permalink
Environment::$debugMode moved to CliTester::$debugMode
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 7, 2019
1 parent b9b9159 commit 911c0e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/Framework/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class Environment
/** Thread number when run tests in multi threads */
public const THREAD = 'NETTE_TESTER_THREAD';

/** @var bool used for debugging Tester itself */
public static $debugMode = true;

/** @var bool */
public static $checkAssertions = false;

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

Expand Down
7 changes: 5 additions & 2 deletions src/Runner/CliTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class CliTester
/** @var PhpInterpreter */
private $interpreter;

/** @var bool */
private $debugMode = true;


public function run(): ?int
{
Expand All @@ -34,7 +37,7 @@ public function run(): ?int
ob_start();
$cmd = $this->loadOptions();

Environment::$debugMode = (bool) $this->options['--debug'];
$this->debugMode = (bool) $this->options['--debug'];
if (isset($this->options['--colors'])) {
Environment::$useColors = (bool) $this->options['--colors'];
} elseif (in_array($this->options['-o'], ['tap', 'junit'], true)) {
Expand Down Expand Up @@ -300,7 +303,7 @@ private function setupErrors(): void
private function displayException(\Throwable $e): void
{
echo "\n";
echo Environment::$debugMode
echo $this->debugMode
? Dumper::dumpException($e)
: Dumper::color('white/red', 'Error: ' . $e->getMessage());
echo "\n";
Expand Down

0 comments on commit 911c0e6

Please sign in to comment.