Merge "objectcache: add metrics for WAN cache deletes and check key touches/resets"
[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 listeners
22 $this->arguments['listeners'][] = new MediaWikiPHPUnitTestListener;
23 $this->arguments['listeners'][] = new MediaWikiLoggerPHPUnitTestListener;
24
25 // Output only to stderr to avoid "Headers already sent" problems
26 $this->arguments['stderr'] = true;
27
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;
32 }
33 }
34
35 protected function createRunner() {
36 $runner = new MediaWikiTestRunner;
37 $runner->setMwCliArgs( $this->cliArgs );
38 return $runner;
39 }
40 }