MediaWiki REL1_33
MediaWikiPHPUnitCommand.php
Go to the documentation of this file.
1<?php
2
3class 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}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Replaces the logging SPI on each test run.
__construct( $ignorableOptions, $cliArgs)
setMwCliArgs(array $cliArgs)