protected function printDefectTrace(\PHPUnit_Framework_TestFailure $defect)
{
$this->write($this->formatExceptionMsg($defect->getExceptionAsString()));
$trace = \PHPUnit_Util_Filter::getFilteredStacktrace($defect->thrownException());
if (!empty($trace)) {
$this->write("\n" . $trace);
}
$exception = $defect->thrownException()->getPrevious();
while ($exception) {
$this->write("\nCaused by\n" . \PHPUnit_Framework_TestFailure::exceptionToString($e) . "\n" . \PHPUnit_Util_Filter::getFilteredStacktrace($e));
$exception = $exception->getPrevious();
}
}