TextReporter::paintError PHP Method

paintError() public method

Paints a PHP error or exception.
public paintError ( string $message )
$message string Message to be shown.
    public function paintError($message)
    {
        parent::paintError($message);
        print 'Exception ' . $this->getExceptionCount() . "!\n{$message}\n";
        $breadcrumb = $this->getTestList();
        array_shift($breadcrumb);
        print "\tin " . implode("\n\tin ", array_reverse($breadcrumb));
        print "\n";
    }

Usage Example

Example #1
0
 function paintError($message) {
     parent::paintError($message);
     if (!isset($this->_exceptionCounts[$this->suiteName])) {
         $this->_exceptionCounts[$this->suiteName] = 0;
     }
     if (!isset($this->_exceptionCounts[$this->testFileName])) {
         $this->_exceptionCounts[$this->testFileName] = 0;
     }
     if (!isset($this->_exceptionCounts[$this->testMethodName])) {
         $this->_exceptionCounts[$this->testMethodName] = 0;
     }
     $this->_exceptionCounts[$this->testMethodName]++;
     $message = 'Exception:'."\n".$message;
     $this->_exceptionCounts[$this->testFileName]++;
     $this->_exceptionCounts[$this->suiteName]++;
     $this->fail_messages[] = $message;
 }
All Usage Examples Of TextReporter::paintError