(bug 32022) phpunit.php can not execute from another directory
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 1 Nov 2011 15:09:52 +0000 (15:09 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 1 Nov 2011 15:09:52 +0000 (15:09 +0000)
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
tests/phpunit/MediaWikiPHPUnitCommand.php
tests/phpunit/suite.xml

index 867285c..18be879 100644 (file)
@@ -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.
index 16f73ef..6af7b54 100644 (file)
@@ -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);
        }
 
index c132f5e..eb52aa6 100644 (file)
                 verbose="true">
        <testsuites>
                <testsuite name="includes">
-                       <directory>./includes</directory>
+                       <directory>includes</directory>
                </testsuite>
                <testsuite name="languages">
-                       <directory>./languages</directory>
+                       <directory>languages</directory>
                </testsuite>
                <testsuite name="skins">
-                       <directory>./skins</directory>
+                       <directory>skins</directory>
                </testsuite>
                <testsuite name="uploadfromurl">
-                       <file>./suites/UploadFromUrlTestSuite.php</file>
+                       <file>suites/UploadFromUrlTestSuite.php</file>
                </testsuite>
                <testsuite name="extensions">
-                       <file>./suites/ExtensionsTestSuite.php</file>
+                       <file>suites/ExtensionsTestSuite.php</file>
                </testsuite>
        </testsuites>
        <groups>