From: Antoine Musso Date: Mon, 20 May 2013 11:19:13 +0000 (+0200) Subject: test: inject autoloader in Maintenance class X-Git-Tag: 1.31.0-rc.0~19521 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=7a82d5b779112c8a6c9cd0fcb940b6381639823a;p=lhc%2Fweb%2Fwiklou.git test: inject autoloader in Maintenance class We used to inject the test autoloader from the global space after the Maintenance class has been initialized. That prevents us from using tests classes (such as Mock) during the Maintenance setup. This patch move the TestsAutoLoader.php require() at the beginning of finalSetup() which would let use Mock classes. Change-Id: Ia402eafae8407d1516e3d200ac97539e3681fdc6 --- diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 7a22bd482d..deef7455fd 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -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; @@ -108,6 +111,4 @@ if ( PHPUnit_Runner_Version::id() !== '@package_version@' 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"; MediaWikiPHPUnitCommand::main();