Permalink
Browse files

Environment::$debugMode moved to CliTester::$debugMode

  • Loading branch information...
dg committed Feb 7, 2019
1 parent b9b9159 commit 911c0e60a520850c039758a6b0b10e186c7c12ba
Showing with 6 additions and 6 deletions.
  1. +1 βˆ’4 src/Framework/Environment.php
  2. +5 βˆ’2 src/Runner/CliTester.php
@@ -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;
@@ -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);
}
@@ -25,6 +25,9 @@ class CliTester
/** @var PhpInterpreter */
private $interpreter;
/** @var bool */
private $debugMode = true;
public function run(): ?int
{
@@ -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)) {
@@ -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";

0 comments on commit 911c0e6

Please sign in to comment.