From: Platonides Date: Sat, 9 Oct 2010 18:32:13 +0000 (+0000) Subject: Look for PHPUnit folder in the PATH and add support for Windows. X-Git-Tag: 1.31.0-rc.0~34566 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22statistiques_visites%22%2C%22%22%29%20.%20%22?a=commitdiff_plain;h=295456e2af13c3ca9a2196b8791ff69b4e61cb04;p=lhc%2Fweb%2Fwiklou.git Look for PHPUnit folder in the PATH and add support for Windows. Follow r74553 --- diff --git a/maintenance/tests/phpunit/phpunit.php b/maintenance/tests/phpunit/phpunit.php index 6fde6112ea..16d0c83eb7 100755 --- a/maintenance/tests/phpunit/phpunit.php +++ b/maintenance/tests/phpunit/phpunit.php @@ -23,5 +23,18 @@ $wgLocaltimezone = 'UTC'; // To prevent tests from failing with SQLite, we need to turn database caching off $wgCaches[CACHE_DB] = false; -require_once "/usr/bin/phpunit"; +$targetFile = wfIsWindows() ? 'phpunit.php' : 'phpunit'; +$pathSeparator = wfIsWindows() ? ';' : ':'; + +$folders = explode( $pathSeparator, getenv('PATH') ); +foreach ( $folders as $folder ) { + if ( file_exists( "$folder/$targetFile" ) ) { + require_once "$folder/$targetFile"; + exit(0); + } +} + +echo "I couldn't find PHPUnit\nTry adding its folder to your PATH\n"; + +die( 1 );