Merge "Make assertFileContains not create files by default"
[lhc/web/wiklou.git] / tests / phpunit / MediaWikiPHPUnitCommand.php
1 <?php
2
3 class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command {
4 private $cliArgs;
5
6 public function __construct( $ignorableOptions, $cliArgs ) {
7 $ignore = function ( $arg ) {
8 };
9 foreach ( $ignorableOptions as $option ) {
10 $this->longOptions[$option] = $ignore;
11 }
12 $this->cliArgs = $cliArgs;
13 }
14
15 protected function handleCustomTestSuite() {
16 // Use our suite.xml
17 if ( !isset( $this->arguments['configuration'] ) ) {
18 $this->arguments['configuration'] = __DIR__ . '/suite.xml';
19 }
20
21 // Add our own listener
22 $this->arguments['listeners'][] = new MediaWikiPHPUnitTestListener;
23 }
24
25 protected function createRunner() {
26 $runner = new MediaWikiTestRunner;
27 $runner->setMwCliArgs( $this->cliArgs );
28 return $runner;
29 }
30 }