From e7867c803fc3896c7af6f65f800deaa2370a9283 Mon Sep 17 00:00:00 2001 From: addshore Date: Mon, 5 May 2014 13:17:22 +0100 Subject: [PATCH] Remove includepath stuff from MediaWikiPHPUnitCommand Change-Id: I949c1ca350a28c606fba7406e9904e836e596b49 --- tests/phpunit/MediaWikiPHPUnitCommand.php | 11 ----------- tests/phpunit/phpunit.php | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) 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() { -- 2.20.1