Make --wiki work with phpunit.php.
authordaniel <daniel.kinzler@wikimedia.de>
Mon, 10 Dec 2012 11:03:13 +0000 (12:03 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 13 Dec 2012 13:11:36 +0000 (13:11 +0000)
This introduces --wiki as a dummy paramter to the PHPUnit job, so it no
longer complains and errors our. The parameter is already picked up
correctly be Maintenance.php.

I have a wiki family setup with a Wikibase repo and client using the
same install base, and the same LanguageSettings.php. Different
databases etc are triggered based on the request URI or, for maintenance
scripts, by the --wiki paramters.

I can run maintenance scripts etc against the client setup using --wiki
client. But how do I run unit tests against the client setup? If I try:

  $ phpunit.php --wiki client
  unrecognized option --wiki
  $

That's because after Maintenances.inc (correctly) processes the command
line parameters, phpunit also tries to process them - and complains,
because it doesn't know --wiki.

This change introduces --wiki as a dummy parameter to phpunit to work
around this. With this patch applied, I can run unit tests against my
client setup using phpunit.php --wiki client as expected.

Change-Id: I6cf319cdbdf55a541c986838d370aa324994ae78

tests/phpunit/MediaWikiPHPUnitCommand.php

index 2745c6a..b675000 100644 (file)
@@ -9,6 +9,7 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command {
                'keep-uploads' => false,
                'use-normal-tables' => false,
                'reuse-db' => false,
+               'wiki=' => false,
        );
 
        public function __construct() {