X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FMediaWikiPHPUnitCommand.php;h=042956a915d5406270214adbd97a322c6e20d5f9;hb=8118a343fc58c31063a7f11dde6c856e87bd75ef;hp=b9117fd5a54ea999d98d12db0057e61b0125f31d;hpb=2525ceb3cdc1b1c50526ea128af3677fed2049b4;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/MediaWikiPHPUnitCommand.php b/tests/phpunit/MediaWikiPHPUnitCommand.php index b9117fd5a5..042956a915 100644 --- a/tests/phpunit/MediaWikiPHPUnitCommand.php +++ b/tests/phpunit/MediaWikiPHPUnitCommand.php @@ -12,6 +12,7 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command { 'use-normal-tables' => false, 'reuse-db' => false, 'wiki=' => false, + 'debug-tests' => false, ); public function __construct() { @@ -20,6 +21,22 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command { } } + protected function handleArguments( array $argv ) { + parent::handleArguments( $argv ); + + if ( !isset( $this->arguments['listeners'] ) ) { + $this->arguments['listeners'] = array(); + } + + foreach ( $this->options[0] as $option ) { + switch ( $option[0] ) { + case '--debug-tests': + $this->arguments['listeners'][] = new MediaWikiPHPUnitTestListener( 'PHPUnitCommand' ); + break; + } + } + } + public static function main( $exit = true ) { $command = new self; @@ -85,7 +102,7 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command { ParserTest-specific options: --regex="" Only run parser tests that match the given regex - --file="" Prints the version and exits. + --file="" File describing parser tests --keep-uploads Re-use the same upload directory for each test, don't delete it @@ -94,6 +111,9 @@ Database options: --reuse-db Init DB only if tables are missing and keep after finish. +Debugging options: + --debug-tests Log testing activity to the PHPUnitCommand log channel. + EOT; } }