2019-01-18 23:28:26 +00:00
|
|
|
<?php
|
|
|
|
|
|
2019-10-06 04:54:59 +00:00
|
|
|
use PHPUnit\Framework\TestFailure;
|
|
|
|
|
use PHPUnit\TextUI\ResultPrinter;
|
|
|
|
|
|
|
|
|
|
class MediaWikiPHPUnitResultPrinter extends ResultPrinter {
|
2019-11-02 04:05:36 +00:00
|
|
|
protected function printDefectTrace( TestFailure $defect ) : void {
|
2019-03-04 21:44:39 +00:00
|
|
|
$test = $defect->failedTest();
|
|
|
|
|
if ( $test !== null && isset( $test->_formattedMediaWikiLogs ) ) {
|
|
|
|
|
$log = $test->_formattedMediaWikiLogs;
|
|
|
|
|
if ( $log ) {
|
|
|
|
|
$this->write( "=== Logs generated by test case\n{$log}\n===\n" );
|
|
|
|
|
}
|
2019-01-18 23:28:26 +00:00
|
|
|
}
|
|
|
|
|
parent::printDefectTrace( $defect );
|
|
|
|
|
}
|
|
|
|
|
}
|