3 class MediaWikiPHPUnitCommand
extends PHPUnit_TextUI_Command
{
6 public function __construct( $ignorableOptions, $cliArgs ) {
7 $ignore = function ( $arg ) {
9 foreach ( $ignorableOptions as $option ) {
10 $this->longOptions
[$option] = $ignore;
12 $this->cliArgs
= $cliArgs;
15 protected function handleCustomTestSuite() {
17 if ( !isset( $this->arguments
['configuration'] ) ) {
18 $this->arguments
['configuration'] = __DIR__
. '/suite.xml';
21 // Add our own listeners
22 $this->arguments
['listeners'][] = new MediaWikiPHPUnitTestListener
;
23 $this->arguments
['listeners'][] = new MediaWikiLoggerPHPUnitTestListener
;
25 // Output only to stderr to avoid "Headers already sent" problems
26 $this->arguments
['stderr'] = true;
28 // Use a custom result printer that includes per-test logging output
29 // when nothing is provided.
30 if ( !isset( $this->arguments
['printer'] ) ) {
31 $this->arguments
['printer'] = MediaWikiPHPUnitResultPrinter
::class;
35 protected function createRunner() {
36 $runner = new MediaWikiTestRunner
;
37 $runner->setMwCliArgs( $this->cliArgs
);