Example #1
0
 /**
  * Print a failure message and provide some explanatory output
  * about what went wrong if so configured.
  *
  * @param ParserTestResult $testResult
  * @return bool
  */
 private function showFailure(ParserTestResult $testResult)
 {
     if ($this->showFailure) {
         if (!$this->showProgress) {
             # In quiet mode we didn't show the 'Testing' message before the
             # test, in case it succeeded. Show it now:
             $this->showTesting($testResult->getDescription());
         }
         print $this->term->color('31') . 'FAILED!' . $this->term->reset() . "\n";
         if ($this->showOutput) {
             print "--- Expected ---\n{$testResult->expected}\n";
             print "--- Actual ---\n{$testResult->actual}\n";
         }
         if ($this->showDiffs) {
             print $this->quickDiff($testResult->expected, $testResult->actual);
             if (!$this->wellFormed($testResult->actual)) {
                 print "XML error: {$this->xmlError}\n";
             }
         }
     }
     return false;
 }