From 2d64dcd9f95b25ab4be50d291c4d7e03054fd7f4 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 1 Nov 2011 15:09:52 +0000 Subject: [PATCH] (bug 32022) phpunit.php can not execute from another directory Adds tests/phpunit to the include_path to let PHPUnit find out our files. Also add to change the suite.xml paths from './path' to 'path' so stream_resolve_path() correctly find out the suite by using include_path --- RELEASE-NOTES-1.19 | 1 + tests/phpunit/MediaWikiPHPUnitCommand.php | 11 +++++++++++ tests/phpunit/suite.xml | 10 +++++----- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 867285c443..18be8797ed 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -123,6 +123,7 @@ production. * (bug 19186) Special:UserLogin's title on Special:SpecialPages now says "create account" when the user cannot create an account * (bug 31818) 'usercreated' message now supports GENDER +* (bug 32022) Our phpunit.php script can now be executed from another directory === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/tests/phpunit/MediaWikiPHPUnitCommand.php b/tests/phpunit/MediaWikiPHPUnitCommand.php index 16f73ef738..6af7b54c05 100644 --- a/tests/phpunit/MediaWikiPHPUnitCommand.php +++ b/tests/phpunit/MediaWikiPHPUnitCommand.php @@ -28,6 +28,17 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command { # Probably fix bug 29226 $command->arguments['colors'] = false; } + + # 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( + dirname( __FILE__ ) + .PATH_SEPARATOR + . get_include_path() + ); + $command->run($_SERVER['argv'], $exit); } diff --git a/tests/phpunit/suite.xml b/tests/phpunit/suite.xml index c132f5e1ed..eb52aa6e6b 100644 --- a/tests/phpunit/suite.xml +++ b/tests/phpunit/suite.xml @@ -12,19 +12,19 @@ verbose="true"> - ./includes + includes - ./languages + languages - ./skins + skins - ./suites/UploadFromUrlTestSuite.php + suites/UploadFromUrlTestSuite.php - ./suites/ExtensionsTestSuite.php + suites/ExtensionsTestSuite.php -- 2.20.1