2018-09-03 07:02:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
2019-10-06 04:54:59 +00:00
|
|
|
use PHPUnit\TextUI\Command;
|
|
|
|
|
|
|
|
|
|
class MediaWikiPHPUnitCommand extends Command {
|
2019-11-17 14:15:24 +00:00
|
|
|
protected function handleCustomTestSuite() : void {
|
2018-09-03 07:02:44 +00:00
|
|
|
// Use our suite.xml
|
|
|
|
|
if ( !isset( $this->arguments['configuration'] ) ) {
|
|
|
|
|
$this->arguments['configuration'] = __DIR__ . '/suite.xml';
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-18 23:28:26 +00:00
|
|
|
// Add our own listeners
|
2018-09-03 07:02:44 +00:00
|
|
|
$this->arguments['listeners'][] = new MediaWikiPHPUnitTestListener;
|
2019-03-04 21:44:39 +00:00
|
|
|
$this->arguments['listeners'][] = new MediaWikiLoggerPHPUnitTestListener;
|
2018-10-08 18:04:12 +00:00
|
|
|
|
|
|
|
|
// Output only to stderr to avoid "Headers already sent" problems
|
|
|
|
|
$this->arguments['stderr'] = true;
|
2019-01-18 23:28:26 +00:00
|
|
|
|
2019-03-04 21:44:39 +00:00
|
|
|
// Use a custom result printer that includes per-test logging output
|
|
|
|
|
// when nothing is provided.
|
2019-01-18 23:28:26 +00:00
|
|
|
if ( !isset( $this->arguments['printer'] ) ) {
|
|
|
|
|
$this->arguments['printer'] = MediaWikiPHPUnitResultPrinter::class;
|
|
|
|
|
}
|
2018-09-03 07:02:44 +00:00
|
|
|
}
|
|
|
|
|
}
|