2018-09-03 07:02:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command {
|
|
|
|
|
private $cliArgs;
|
|
|
|
|
|
|
|
|
|
public function __construct( $ignorableOptions, $cliArgs ) {
|
|
|
|
|
$ignore = function ( $arg ) {
|
|
|
|
|
};
|
|
|
|
|
foreach ( $ignorableOptions as $option ) {
|
|
|
|
|
$this->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 listener
|
|
|
|
|
$this->arguments['listeners'][] = new MediaWikiPHPUnitTestListener;
|
2018-10-08 18:04:12 +00:00
|
|
|
|
|
|
|
|
// Output only to stderr to avoid "Headers already sent" problems
|
|
|
|
|
$this->arguments['stderr'] = true;
|
2018-09-03 07:02:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function createRunner() {
|
|
|
|
|
$runner = new MediaWikiTestRunner;
|
|
|
|
|
$runner->setMwCliArgs( $this->cliArgs );
|
|
|
|
|
return $runner;
|
|
|
|
|
}
|
|
|
|
|
}
|