From: addshore Date: Mon, 5 May 2014 12:17:22 +0000 (+0100) Subject: Remove includepath stuff from MediaWikiPHPUnitCommand X-Git-Tag: 1.31.0-rc.0~15868^2~2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=e7867c803fc3896c7af6f65f800deaa2370a9283;p=lhc%2Fweb%2Fwiklou.git Remove includepath stuff from MediaWikiPHPUnitCommand Change-Id: I949c1ca350a28c606fba7406e9904e836e596b49 --- diff --git a/tests/phpunit/MediaWikiPHPUnitCommand.php b/tests/phpunit/MediaWikiPHPUnitCommand.php index 7241f0a401..bac9f4dadd 100644 --- a/tests/phpunit/MediaWikiPHPUnitCommand.php +++ b/tests/phpunit/MediaWikiPHPUnitCommand.php @@ -39,17 +39,6 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command { public static function main( $exit = true ) { $command = new self; - - # Makes MediaWiki PHPUnit directory includable so the PHPUnit will - # be able to resolve relative files inclusion such as suites/* - # PHPUnit uses stream_resolve_include_path() internally - # See bug 32022 - set_include_path( - __DIR__ - . PATH_SEPARATOR - . get_include_path() - ); - $command->run( $_SERVER['argv'], $exit ); } diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index a0d23f51a0..c67bf38ac9 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -107,6 +107,20 @@ class PHPUnitMaintClass extends Maintenance { array_splice( $_SERVER['argv'], 1, 0, '--colors' ); } } + + # Makes MediaWiki PHPUnit directory includable so the PHPUnit will + # be able to resolve relative files inclusion such as suites/* + # PHPUnit uses stream_resolve_include_path() internally + # See bug 32022 + $key = array_search( '--include-path', $_SERVER['argv'] ); + if( $key === false ) { + array_splice( $_SERVER['argv'], 1, 0, + __DIR__ + . PATH_SEPARATOR + . get_include_path() + ); + array_splice( $_SERVER['argv'], 1, 0, '--include-path' ); + } } public function getDbType() {