3 class MediaWikiPHPUnitCommand
extends PHPUnit_TextUI_Command
{
5 public static $additionalOptions = array(
8 'use-filebackend=' => false,
9 'use-bagostuff=' => false,
10 'use-jobqueue=' => false,
11 'keep-uploads' => false,
12 'use-normal-tables' => false,
15 'debug-tests' => false,
18 public function __construct() {
19 foreach ( self
::$additionalOptions as $option => $default ) {
20 $this->longOptions
[$option] = $option . 'Handler';
24 protected function handleArguments( array $argv ) {
25 parent
::handleArguments( $argv );
27 if ( !isset( $this->arguments
['listeners'] ) ) {
28 $this->arguments
['listeners'] = array();
31 foreach ( $this->options
[0] as $option ) {
32 switch ( $option[0] ) {
34 $this->arguments
['listeners'][] = new MediaWikiPHPUnitTestListener( 'PHPUnitCommand' );
40 public static function main( $exit = true ) {
42 $command->run( $_SERVER['argv'], $exit );
45 public function __call( $func, $args ) {
47 if ( substr( $func, -7 ) == 'Handler' ) {
48 if ( is_null( $args[0] ) ) {
51 self
::$additionalOptions[substr( $func, 0, -7 )] = $args[0];
55 public function showHelp() {
60 ParserTest-specific options:
61 --regex="<regex>" Only run parser tests that match the given regex
62 --file="<filename>" File describing parser tests
63 --keep-uploads Re-use the same upload directory for each test, don't delete it
66 --use-normal-tables Use normal DB tables.
67 --reuse-db Init DB only if tables are missing and keep after finish.
70 --debug-tests Log testing activity to the PHPUnitCommand log channel.