diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
commit | 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch) | |
tree | af68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /tests/phpunit/phpunit.php | |
parent | af4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff) |
Update to MediaWiki 1.22.0
Diffstat (limited to 'tests/phpunit/phpunit.php')
-rw-r--r-- | tests/phpunit/phpunit.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 2ec07440..1d65e521 100644 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -12,7 +12,7 @@ define( 'MW_PHPUNIT_TEST', true ); // Start up MediaWiki in command-line mode -require_once( dirname( dirname( __DIR__ ) ) . "/maintenance/Maintenance.php" ); +require_once dirname( dirname( __DIR__ ) ) . "/maintenance/Maintenance.php"; class PHPUnitMaintClass extends Maintenance { @@ -33,6 +33,9 @@ class PHPUnitMaintClass extends Maintenance { global $wgLocaltimezone, $wgLocalisationCacheConf; global $wgDevelopmentWarnings; + // Inject test autoloader + require_once __DIR__ . '/../TestsAutoLoader.php'; + // wfWarn should cause tests to fail $wgDevelopmentWarnings = true; @@ -50,8 +53,11 @@ class PHPUnitMaintClass extends Maintenance { // Bug 44192 Do not attempt to send a real e-mail Hooks::clear( 'AlternateUserMailer' ); - Hooks::register( 'AlternateUserMailer', - function() { return false; } + Hooks::register( + 'AlternateUserMailer', + function () { + return false; + } ); } @@ -86,7 +92,6 @@ class PHPUnitMaintClass extends Maintenance { unset( $_SERVER['argv'][$key] ); // the option unset( $_SERVER['argv'][$key + 1] ); // its value $_SERVER['argv'] = array_values( $_SERVER['argv'] ); - } } @@ -96,16 +101,19 @@ class PHPUnitMaintClass extends Maintenance { } $maintClass = 'PHPUnitMaintClass'; -require( RUN_MAINTENANCE_IF_MAIN ); +require RUN_MAINTENANCE_IF_MAIN; -require_once( 'PHPUnit/Runner/Version.php' ); +if ( !class_exists( 'PHPUnit_Runner_Version' ) ) { + require_once 'PHPUnit/Runner/Version.php'; +} if ( PHPUnit_Runner_Version::id() !== '@package_version@' && version_compare( PHPUnit_Runner_Version::id(), '3.6.7', '<' ) ) { die( 'PHPUnit 3.6.7 or later required, you have ' . PHPUnit_Runner_Version::id() . ".\n" ); } -require_once( 'PHPUnit/Autoload.php' ); -require_once( "$IP/tests/TestsAutoLoader.php" ); +if ( !class_exists( 'PHPUnit_TextUI_Command' ) ) { + require_once 'PHPUnit/Autoload.php'; +} MediaWikiPHPUnitCommand::main(); |