Ejemplo n.º 1
0
 /**
  * Write information about the error to the screen
  */
 public function writeError($httpRequest, $errno, $errstr, $errfile, $errline, $errcontext)
 {
     $errorType = self::$error_types[$errno];
     echo SSCli::text("ERROR [" . $errorType['title'] . "]: {$errstr}\nIN {$httpRequest}\n", "red", null, true);
     echo SSCli::text("Line {$errline} in {$errfile}\n\n", "red");
 }
Ejemplo n.º 2
0
 protected function writeTest($test)
 {
     if ($test['status'] != 1) {
         $filteredTrace = array();
         $ignoredClasses = array('TestRunner');
         foreach ($test['trace'] as $item) {
             if (isset($item['file']) && strpos($item['file'], 'PHPUnit/Framework') === false && (!isset($item['class']) || !in_array($item['class'], $ignoredClasses))) {
                 $filteredTrace[] = $item;
             }
             if (isset($item['class']) && isset($item['function']) && $item['class'] == 'PHPUnit_Framework_TestSuite' && $item['function'] == 'run') {
                 break;
             }
         }
         echo "\n\n" . SSCli::text($this->testNameToPhrase($test['name']) . "\n" . $test['message'] . "\n", 'red', null, true);
         echo SSCli::text("In line {$test['exception']['line']} of {$test['exception']['file']}" . "\n\n", 'red');
         echo Debug::get_rendered_backtrace($filteredTrace, true);
         echo "\n--------------------\n";
     }
 }