From b29515a082a0d91832caf643d15c2ffa34dc906f Mon Sep 17 00:00:00 2001 From: Platonides Date: Sat, 9 Oct 2010 18:40:05 +0000 Subject: [PATCH] Follow r74554. Also take include path into account. --- maintenance/tests/phpunit/phpunit.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/maintenance/tests/phpunit/phpunit.php b/maintenance/tests/phpunit/phpunit.php index 16d0c83eb7..139d54eefb 100755 --- a/maintenance/tests/phpunit/phpunit.php +++ b/maintenance/tests/phpunit/phpunit.php @@ -27,6 +27,14 @@ $targetFile = wfIsWindows() ? 'phpunit.php' : 'phpunit'; $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"; -- 2.20.1