From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- tests/phpunit/phpunit.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'tests/phpunit/phpunit.php') 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(); -- cgit v1.2.3-54-g00ecf