Limit test leakage, $wgCapitalLinks expected to be true
[lhc/web/wiklou.git] / tests / phpunit / includes / api / query / ApiQueryTest.php
index 17da9a1..7b686a3 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;
@@ -36,9 +36,12 @@ class ApiQueryTest extends ApiTestCase {
        }
 
        public function testTitlesGetNormalized() {
-
                global $wgMetaNamespace;
 
+               $this->setMwGlobals( array(
+                       'wgCapitalLinks' => true,
+               ) );
+
                $data = $this->doApiRequest( array(
                        'action' => 'query',
                        'titles' => 'Project:articleA|article_B' ) );
@@ -97,6 +100,10 @@ class ApiQueryTest extends ApiTestCase {
         * @dataProvider provideTestTitlePartToKey
         */
        function testTitlePartToKey( $titlePart, $namespace, $expected, $expectException ) {
+               $this->setMwGlobals( array(
+                       'wgCapitalLinks' => true,
+               ) );
+
                $api = new MockApiQueryBase();
                $exceptionCaught = false;
                try {
@@ -114,10 +121,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 ),
                );
        }
 }