The two hooks were moved to a PHPUnit extensions which uses hooks. The rest was simply deleted. The reason for this change is that TestListener was removed in PHPUnit 9, with PHPUnit hooks as replacement. No hooks exist for startSuite/endSuite, plus we should avoid adding too much functionality: if the output of PHPUnit isn't clear, that should be reported upstream. Additionally, PHPUnit hooks were also deprecated in PHPUnit 10, which means that extending PHPUnit becomes more and more difficult. As such, the two hooks will be hard-deprecated & removed soon. Removing all these wfDebugLog and other function calls should also hopefully speed up the suite. Bug: T243600 Bug: T225730 Change-Id: I2b67cd0074aca4b0ea76696ce9f24be68f5f88f8
25 lines
682 B
PHP
25 lines
682 B
PHP
<?php
|
|
|
|
use PHPUnit\TextUI\Command;
|
|
|
|
class MediaWikiPHPUnitCommand extends Command {
|
|
protected function handleCustomTestSuite() : void {
|
|
// Use our suite.xml
|
|
if ( !isset( $this->arguments['configuration'] ) ) {
|
|
$this->arguments['configuration'] = __DIR__ . '/suite.xml';
|
|
}
|
|
|
|
// Output only to stderr to avoid "Headers already sent" problems
|
|
$this->arguments['stderr'] = true;
|
|
|
|
// Use a custom result printer that includes per-test logging output
|
|
// when nothing is provided.
|
|
if ( !isset( $this->arguments['printer'] ) ) {
|
|
$this->arguments['printer'] = MediaWikiPHPUnitResultPrinter::class;
|
|
}
|
|
}
|
|
|
|
public function publicShowHelp() {
|
|
parent::showHelp();
|
|
}
|
|
}
|