Legoktm has uploaded a new change for review.

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

Change subject: Make AutoLoaderTest handle namespaces
......................................................................

Make AutoLoaderTest handle namespaces

Bug: 67644
Change-Id: Ibeb0833742c574afac13bfebd278f9d2b8410de6
---
M RELEASE-NOTES-1.23
M tests/phpunit/structure/AutoLoaderTest.php
2 files changed, 21 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/18/204218/1

diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23
index 2eaa0a5..e870bd8 100644
--- a/RELEASE-NOTES-1.23
+++ b/RELEASE-NOTES-1.23
@@ -1,6 +1,15 @@
 Security reminder: MediaWiki does not require PHP's register_globals. If you
 have it on, turn it '''off''' if you can.
 
+== MediaWiki 1.23.10 ==
+
+This is a security and maintenance release of the MediaWiki 1.23 branch.
+
+== Changes since 1.23.9 ==
+
+* (bug 67644) Make AutoLoaderTest handle namespaces
+
+
 == MediaWiki 1.23.9 ==
 
 This is a security and maintenance release of the MediaWiki 1.23 branch.
diff --git a/tests/phpunit/structure/AutoLoaderTest.php 
b/tests/phpunit/structure/AutoLoaderTest.php
index be18a49..0fae361 100644
--- a/tests/phpunit/structure/AutoLoaderTest.php
+++ b/tests/phpunit/structure/AutoLoaderTest.php
@@ -70,13 +70,23 @@
                                )
                        /imx', $contents, $matches, PREG_SET_ORDER );
 
+                       $namespaceMatch = array();
+                       preg_match( '/
+                               ^ [\t ]*
+                                       namespace \s+
+                                               
([a-zA-Z0-9_]+(\\\\[a-zA-Z0-9_]+)*)
+                                       \s* ;
+                       /imx', $contents, $namespaceMatch );
+                       $fileNamespace = $namespaceMatch ? $namespaceMatch[1] . 
'\\' : '';
+
                        $classesInFile = array();
                        $aliasesInFile = array();
 
                        foreach ( $matches as $match ) {
                                if ( !empty( $match['class'] ) ) {
-                                       $actual[$match['class']] = $file;
-                                       $classesInFile[$match['class']] = true;
+                                       $class = $fileNamespace . 
$match['class'];
+                                       $actual[$class] = $file;
+                                       $classesInFile[$class] = true;
                                } else {
                                        $aliasesInFile[$match['alias']] = 
$match['original'];
                                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibeb0833742c574afac13bfebd278f9d2b8410de6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_23
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to