More work on new parser tests:
[lhc/web/wiklou.git] / tests / phpunit / MediaWikiPHPUnitCommand.php
1 <?php
2
3 class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command {
4
5 static $additionalOptions = array(
6 'regex=' => false,
7 'record' => false,
8 'file=' => false,
9 'keep-uploads' => false,
10 );
11
12 //Fixme: These aren't shown on the --help menu
13
14 public function __construct() {
15 foreach( self::$additionalOptions as $option => $default ) {
16 $this->longOptions[$option] = $option . 'Handler';
17 }
18
19 }
20
21 public static function main( $exit = true ) {
22 $command = new self;
23 $command->run($_SERVER['argv'], $exit);
24 }
25
26 public function __call( $func, $args ) {
27
28 if( substr( $func, -7 ) == 'Handler' ) {
29 if( is_null( $args[0] ) ) $args[0] = true; //Booleans
30 self::$additionalOptions[substr( $func, 0, -7 ) ] = $args[0];
31 }
32 }
33
34 }