Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/181086

Change subject: Use also $wgAutoloadClasses in tests for module names
......................................................................

Use also $wgAutoloadClasses in tests for module names

Extensions using $wgAutoloadClasses where this test will fail

Follow-Up: If1125cd5fa4ed836fe15fc79480d78ebd899be4e
Change-Id: Ic2024605d7d59890c527cc0580a49da73f8516c8
---
M tests/phpunit/includes/api/ApiMainTest.php
M tests/phpunit/includes/api/query/ApiQueryTest.php
2 files changed, 10 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/86/181086/1

diff --git a/tests/phpunit/includes/api/ApiMainTest.php 
b/tests/phpunit/includes/api/ApiMainTest.php
index 51d03ed..e91edcb 100644
--- a/tests/phpunit/includes/api/ApiMainTest.php
+++ b/tests/phpunit/includes/api/ApiMainTest.php
@@ -65,7 +65,10 @@
         * Test if all classes in the main module manager exists
         */
        public function testClassNamesInModuleManager() {
-               global $wgAutoloadLocalClasses;
+               global $wgAutoloadLocalClasses, $wgAutoloadClasses;
+
+               // wgAutoloadLocalClasses has precedence, just like in 
includes/AutoLoader.php
+               $classes = $wgAutoloadLocalClasses + $wgAutoloadClasses;
 
                $api = new ApiMain(
                        new FauxRequest( array( 'action' => 'query', 'meta' => 
'siteinfo' ) )
@@ -74,7 +77,7 @@
                foreach( $modules as $name => $class ) {
                        $this->assertArrayHasKey(
                                $class,
-                               $wgAutoloadLocalClasses,
+                               $classes,
                                'Class ' . $class . ' for api module ' . $name 
. ' not in autoloader (with exact case)'
                        );
                }
diff --git a/tests/phpunit/includes/api/query/ApiQueryTest.php 
b/tests/phpunit/includes/api/query/ApiQueryTest.php
index 3ab1334..5f061b5 100644
--- a/tests/phpunit/includes/api/query/ApiQueryTest.php
+++ b/tests/phpunit/includes/api/query/ApiQueryTest.php
@@ -121,7 +121,10 @@
         * Test if all classes in the query module manager exists
         */
        public function testClassNamesInModuleManager() {
-               global $wgAutoloadLocalClasses;
+               global $wgAutoloadLocalClasses, $wgAutoloadClasses;
+
+               // wgAutoloadLocalClasses has precedence, just like in 
includes/AutoLoader.php
+               $classes = $wgAutoloadLocalClasses + $wgAutoloadClasses;
 
                $api = new ApiMain(
                        new FauxRequest( array( 'action' => 'query', 'meta' => 
'siteinfo' ) )
@@ -131,7 +134,7 @@
                foreach( $modules as $name => $class ) {
                        $this->assertArrayHasKey(
                                $class,
-                               $wgAutoloadLocalClasses,
+                               $classes,
                                'Class ' . $class . ' for api module ' . $name 
. ' not in autoloader (with exact case)'
                        );
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/181086
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2024605d7d59890c527cc0580a49da73f8516c8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to