X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fphpunit.php;h=7cf042d0b803dd9b41ea93c9a5d8f25f9629db01;hb=da63e1c56b9b42891aeeb5d6094fb8fd29f643a6;hp=d8171044f3b813c6deda6731b7f66d49d176cb51;hpb=c5adb2f42aeee78678967847d9e3792aed138a76;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index d8171044f3..7cf042d0b8 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -21,6 +21,7 @@ class PHPUnitMaintClass extends Maintenance { 'use-bagostuff' => false, 'use-jobqueue' => false, 'use-normal-tables' => false, + 'mwdebug' => false, 'reuse-db' => false, 'wiki' => false, 'profiler' => false, @@ -79,7 +80,7 @@ class PHPUnitMaintClass extends Maintenance { [ '--configuration', $IP . '/tests/phpunit/suite.xml' ] ); } - $phpUnitClass = 'PHPUnit_TextUI_Command'; + $phpUnitClass = PHPUnit_TextUI_Command::class; if ( $this->hasOption( 'with-phpunitclass' ) ) { $phpUnitClass = $this->getOption( 'with-phpunitclass' ); @@ -112,7 +113,7 @@ class PHPUnitMaintClass extends Maintenance { } } - if ( !class_exists( 'PHPUnit_Framework_TestCase' ) ) { + if ( !class_exists( 'PHPUnit\\Framework\\TestCase' ) ) { echo "PHPUnit not found. Please install it and other dev dependencies by running `composer install` in MediaWiki root directory.\n"; exit( 1 ); @@ -137,6 +138,15 @@ class PHPUnitMaintClass extends Maintenance { return Maintenance::DB_ADMIN; } + protected function addOption( $name, $description, $required = false, + $withArg = false, $shortName = false, $multiOccurrence = false + ) { + // ignore --quiet which does not really make sense for unit tests + if ( $name !== 'quiet' ) { + parent::addOption( $name, $description, $required, $withArg, $shortName, $multiOccurrence ); + } + } + /** * Force the format of elements in $_SERVER['argv'] * - Split args such as "wiki=enwiki" into two separate arg elements "wiki" and "enwiki"