Page MenuHomeWickedGov Phorge

MWTestDox.php
No OneTemporary

Size
1013 B
Referenced Files
None
Subscribers
None

MWTestDox.php

<?php
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestFailure;
use PHPUnit\Util\TestDox\CliTestDoxPrinter;
/**
* Custom version of PHPUnit TestDox.
*/
class MWTestDox extends CliTestDoxPrinter {
/**
* @param TestFailure $defect
* @return void
*/
protected function printDefectTrace( TestFailure $defect ): void {
parent::printDefectTrace( $defect );
$test = $defect->getTestName();
$log = MediaWikiLoggerPHPUnitExtension::$testsCollection[$test] ?? null;
if ( $log ) {
$this->write( "=== Logs generated by test case\n{$log}\n===\n" );
}
}
/**
* Print the plain test name, not the prettified version from TestDox.
*
* @param Test $test
* @return string
*/
protected function formatTestName( Test $test ): string {
return $test->getName();
}
/**
* Print the plain class name, not the prettified version from TestDox.
*
* @param Test $test
* @return string
*/
protected function formatClassName( Test $test ): string {
return get_class( $test );
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Dec 8, 02:57 (1 d, 18 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fa/71/323d7634a8aa5b5d7497d271f210
Default Alt Text
MWTestDox.php (1013 B)

Event Timeline