aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/structure/AutoLoaderStructureTest.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2020-02-21 11:01:43 +1100
committerTim Starling <tstarling@wikimedia.org>2020-02-21 13:46:19 +1100
commit44d51cb04e5ebfe5ebef908aa336f4ad01f9781b (patch)
tree711f42bfcfd4c32336df89d553d5d5657bd9e2fa /tests/phpunit/structure/AutoLoaderStructureTest.php
parentd10928107908b6e98e78069378288e55b402cc4c (diff)
downloadmediawikicore-44d51cb04e5ebfe5ebef908aa336f4ad01f9781b.tar.gz
mediawikicore-44d51cb04e5ebfe5ebef908aa336f4ad01f9781b.zip
Fix the namespace of SpecialPageFactory
Follows-up d4045035b07. This class was added to the MediaWiki\Special namespace, contrary to the plan in T166010 which reserves that namespace for core special pages. Instead, use MediaWiki\SpecialPage, following the directory in which it is located. Also, fix two bugs which prevented the introduction of a namespaced class alias. Bug: T166010 Change-Id: I6e31340aaae32a89beb7e45b79d76a7fea9808d2
Diffstat (limited to 'tests/phpunit/structure/AutoLoaderStructureTest.php')
-rw-r--r--tests/phpunit/structure/AutoLoaderStructureTest.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/phpunit/structure/AutoLoaderStructureTest.php b/tests/phpunit/structure/AutoLoaderStructureTest.php
index f9b3158a9bcf..a389a73cf77a 100644
--- a/tests/phpunit/structure/AutoLoaderStructureTest.php
+++ b/tests/phpunit/structure/AutoLoaderStructureTest.php
@@ -115,16 +115,21 @@ class AutoLoaderStructureTest extends MediaWikiTestCase {
$classesInFile[$class] = true;
} elseif ( !empty( $match['original'] ) ) {
// 'class_alias( "Foo", "Bar" );'
- $aliasesInFile[$match['alias']] = $match['original'];
+ $aliasesInFile[self::removeSlashes( $match['alias'] )] = $match['original'];
} else {
// 'class_alias( Foo::class, "Bar" );'
- $aliasesInFile[$match['aliasString']] = $fileNamespace . $match['originalStatic'];
+ $aliasesInFile[self::removeSlashes( $match['aliasString'] )] =
+ $fileNamespace . $match['originalStatic'];
}
}
return [ $classesInFile, $aliasesInFile ];
}
+ private static function removeSlashes( $str ) {
+ return str_replace( '\\\\', '\\', $str );
+ }
+
protected static function checkAutoLoadConf() {
global $wgAutoloadLocalClasses, $wgAutoloadClasses, $IP;