Follow-up r74553, r74554 and r74555: don't guess, just include stuff properly
authorMax Semenik <maxsem@users.mediawiki.org>
Sat, 9 Oct 2010 19:00:44 +0000 (19:00 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Sat, 9 Oct 2010 19:00:44 +0000 (19:00 +0000)
maintenance/tests/phpunit/phpunit.php

index 139d54e..fda2f73 100755 (executable)
@@ -28,21 +28,7 @@ $pathSeparator = wfIsWindows() ? ';' : ':';
 
 $folders = explode( $pathSeparator, getenv('PATH') );
 
-# We may not have PHPUnit folder in the path, but have 
-# PEAR folder in the include path.
-$includeFolders = explode( $pathSeparator, get_include_path() );
-foreach ( $includeFolders as $includeFolder ) {
-       $folders[] =  "$includeFolder/PHPUnit";
-}
-
-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 );
+require 'PHPUnit/TextUI/Command.php';
+define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main');
+PHPUnit_TextUI_Command::main();