X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fphpunit.php;h=587d6d0c2c843c4b37d1d08cec2d996d3fb19386;hb=4f21e6be661f7305abc223bb31600970a3fb5326;hp=d18ab73917d181f8b8757e9ffd7795b22351157f;hpb=786a37c5778e2fc69b48010236199621449ebba0;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index d18ab73917..587d6d0c2c 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -55,7 +55,7 @@ class PHPUnitMaintClass extends Maintenance { public function finalSetup() { parent::finalSetup(); - global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType; + global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgMainWANCache; global $wgLanguageConverterCacheType, $wgUseDatabaseMessages; global $wgLocaltimezone, $wgLocalisationCacheConf; global $wgDevelopmentWarnings; @@ -67,6 +67,7 @@ class PHPUnitMaintClass extends Maintenance { $wgDevelopmentWarnings = true; $wgMainCacheType = CACHE_NONE; + $wgMainWANCache = CACHE_NONE; $wgMessageCacheType = CACHE_NONE; $wgParserCacheType = CACHE_NONE; $wgLanguageConverterCacheType = CACHE_NONE; @@ -215,15 +216,23 @@ if ( version_compare( PHP_VERSION, '5.4.0', '<' ) ) { $ok = false; -foreach ( array( - stream_resolve_include_path( 'phpunit.phar' ), - 'PHPUnit/Runner/Version.php', - 'PHPUnit/Autoload.php' -) as $includePath ) { - @include_once $includePath; - if ( class_exists( 'PHPUnit_TextUI_Command' ) ) { - $ok = true; - break; +if ( class_exists( 'PHPUnit_TextUI_Command' ) ) { + echo "PHPUnit already present\n"; + $ok = true; +} else { + foreach ( array( + stream_resolve_include_path( 'phpunit.phar' ), + 'PHPUnit/Runner/Version.php', + 'PHPUnit/Autoload.php' + ) as $includePath ) { + // @codingStandardsIgnoreStart + @include_once $includePath; + // @codingStandardsIgnoreEnd + if ( class_exists( 'PHPUnit_TextUI_Command' ) ) { + $ok = true; + echo "Using PHPUnit from $includePath\n"; + break; + } } }