Index: trunk/phase3/maintenance/tests/phpunit/phpunit.php |
— | — | @@ -23,5 +23,18 @@ |
24 | 24 | // To prevent tests from failing with SQLite, we need to turn database caching off |
25 | 25 | $wgCaches[CACHE_DB] = false; |
26 | 26 | |
27 | | -require_once "/usr/bin/phpunit"; |
| 27 | +$targetFile = wfIsWindows() ? 'phpunit.php' : 'phpunit'; |
| 28 | +$pathSeparator = wfIsWindows() ? ';' : ':'; |
28 | 29 | |
| 30 | +$folders = explode( $pathSeparator, getenv('PATH') ); |
| 31 | +foreach ( $folders as $folder ) { |
| 32 | + if ( file_exists( "$folder/$targetFile" ) ) { |
| 33 | + require_once "$folder/$targetFile"; |
| 34 | + exit(0); |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | +echo "I couldn't find PHPUnit\nTry adding its folder to your PATH\n"; |
| 39 | + |
| 40 | +die( 1 ); |
| 41 | + |