Fix mediawiki-core-regression-master
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 23 Dec 2013 18:48:21 +0000 (13:48 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 23 Dec 2013 18:48:21 +0000 (13:48 -0500)
The Interwiki class caches lookups, so ApiQueryTest.php's use of "en:"
was failing for mediawiki-core-regression-master because something else
had already made a call for that prefix. The easy fix is to use a
different prefix that is very unlikely to ever be used in a different
test.

Change-Id: I43ca554d5b5465d760eae03d1f76b8c3bf589210

tests/phpunit/includes/api/query/ApiQueryTest.php

index 17da9a1..ea0b323 100644 (file)
@@ -21,7 +21,7 @@ class ApiQueryTest extends ApiTestCase {
                // Setup en: as interwiki prefix
                $this->hooks = $wgHooks;
                $wgHooks['InterwikiLoadPrefix'][] = function ( $prefix, &$data ) {
-                       if ( $prefix == 'en' ) {
+                       if ( $prefix == 'apiquerytestiw' ) {
                                $data = array( 'iw_url' => 'wikipedia' );
                        }
                        return false;
@@ -114,10 +114,10 @@ class ApiQueryTest extends ApiTestCase {
                        array( 'x', NS_MAIN, 'X', false ),
                        array( 'y ', NS_MAIN, 'Y_', false ),
                        array( 'template:foo', NS_CATEGORY, 'Template:foo', false ),
-                       array( 'en:foo', NS_CATEGORY, 'En:foo', false ),
+                       array( 'apiquerytestiw:foo', NS_CATEGORY, 'Apiquerytestiw:foo', false ),
                        array( "\xF7", NS_MAIN, null, true ),
                        array( 'template:foo', NS_MAIN, null, true ),
-                       array( 'en:foo', NS_MAIN, null, true ),
+                       array( 'apiquerytestiw:foo', NS_MAIN, null, true ),
                );
        }
 }