TextReporter::paintException PHP Method

paintException() public method

Paints a PHP error or exception.
public paintException ( Exception $exception )
$exception Exception Exception to describe.
    public function paintException($exception)
    {
        parent::paintException($exception);
        $message = 'Unexpected exception of type [' . get_class($exception) . '] with message [' . $exception->getMessage() . '] in [' . $exception->getFile() . ' line ' . $exception->getLine() . ']';
        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
 /**
  * Paint exception faildetail to STDERR.
  */
 function paintException($message)
 {
     parent::paintException($message);
     fwrite(STDERR, 'EXCEPTION' . $this->faildetail_separator . $this->_paintTestFailDetail($message));
 }
All Usage Examples Of TextReporter::paintException