longOptions[$option] = $ignore; } $this->cliArgs = $cliArgs; } protected function handleCustomTestSuite() { // 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->logListener = new MediaWikiLoggerPHPUnitTestListener; $this->arguments['listeners'][] = $this->logListener; // Output only to stderr to avoid "Headers already sent" problems $this->arguments['stderr'] = true; // We could create a printer instance and avoid passing the // listener statically, but then we have to recreate the // appropriate arguments handling + defaults. if ( !isset( $this->arguments['printer'] ) ) { $this->arguments['printer'] = MediaWikiPHPUnitResultPrinter::class; } } protected function createRunner() { MediaWikiPHPUnitResultPrinter::setLogListener( $this->logListener ); $runner = new MediaWikiTestRunner; $runner->setMwCliArgs( $this->cliArgs ); return $runner; } }