wiki.techinc.nl/tests/phpunit/MediaWikiPHPUnitCommand.php
Daimona Eaytoy 1c20e1e032 phpunit: Add typehints for PHPUnit 8
Split from Ic14f5debc53e55d67146dc96279d26dfd52b4000.

Bug: T192167
Change-Id: Iec3b9f6f3702578ac76806e73ff0263aa15ac458
2019-11-17 15:15:24 +01:00

25 lines
794 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';
}
// Add our own listeners
$this->arguments['listeners'][] = new MediaWikiPHPUnitTestListener;
$this->arguments['listeners'][] = new MediaWikiLoggerPHPUnitTestListener;
// 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;
}
}
}