Look for PHPUnit folder in the PATH and add support for Windows.
authorPlatonides <platonides@users.mediawiki.org>
Sat, 9 Oct 2010 18:32:13 +0000 (18:32 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sat, 9 Oct 2010 18:32:13 +0000 (18:32 +0000)
Follow r74553

maintenance/tests/phpunit/phpunit.php

index 6fde611..16d0c83 100755 (executable)
@@ -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 );