Limit test leakage, $wgCapitalLinks expected to be true
authorChad Horohoe <chadh@wikimedia.org>
Mon, 7 Jul 2014 23:21:09 +0000 (16:21 -0700)
committerChad Horohoe <chadh@wikimedia.org>
Mon, 7 Jul 2014 23:54:35 +0000 (16:54 -0700)
Change-Id: I0f837d29595abefaebeb67d6cc62ea48838d626a

tests/phpunit/includes/LinkerTest.php
tests/phpunit/includes/LinksUpdateTest.php
tests/phpunit/includes/SampleTest.php
tests/phpunit/includes/WikiPageTest.php
tests/phpunit/includes/api/query/ApiQueryTest.php
tests/phpunit/includes/content/TextContentTest.php
tests/phpunit/includes/site/MediaWikiSiteTest.php
tests/phpunit/includes/title/MediaWikiTitleCodecTest.php

index 4d62cc7..72114e9 100644 (file)
@@ -94,6 +94,7 @@ class LinkerTest extends MediaWikiLangTestCase {
                        'wgScript' => '/wiki/index.php',
                        'wgArticlePath' => '/wiki/$1',
                        'wgWellFormedXml' => true,
+                       'wgCapitalLinks' => true,
                ) );
 
                if ( $title === false ) {
index 9ff547c..a5dac8d 100644 (file)
@@ -186,6 +186,10 @@ class LinksUpdateTest extends MediaWikiTestCase {
         * @covers ParserOutput::addLanguageLink
         */
        public function testUpdate_langlinks() {
+               $this->setMwGlobals( array(
+                       'wgCapitalLinks' => true,
+               ) );
+
                /** @var ParserOutput $po */
                list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 );
 
index 758c2e2..6fdc239 100644 (file)
@@ -16,6 +16,7 @@ class TestSample extends MediaWikiLangTestCase {
                $this->setMwGlobals( array(
                        'wgContLang' => Language::factory( 'en' ),
                        'wgLanguageCode' => 'en',
+                       'wgCapitalLinks' => true,
                ) );
        }
 
index 78457d2..7f7945b 100644 (file)
@@ -499,6 +499,10 @@ class WikiPageTest extends MediaWikiLangTestCase {
         * @covers WikiPage::getRedirectTarget
         */
        public function testGetRedirectTarget( $title, $model, $text, $target ) {
+               $this->setMwGlobals( array(
+                       'wgCapitalLinks' => true,
+               ) );
+
                $page = $this->createPage( $title, $text, $model );
 
                # sanity check, because this test seems to fail for no reason for some people.
index ea0b323..7b686a3 100644 (file)
@@ -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 {
index 03cbbc0..2f81109 100644 (file)
@@ -31,6 +31,7 @@ class TextContentTest extends MediaWikiLangTestCase {
                        ),
                        'wgUseTidy' => false,
                        'wgAlwaysUseTidy' => false,
+                       'wgCapitalLinks' => true,
                ) );
 
                // bypass hooks that force custom rendering
index 15b8865..c3fd155 100644 (file)
 class MediaWikiSiteTest extends SiteTest {
 
        public function testNormalizePageTitle() {
+               $this->setMwGlobals( array(
+                       'wgCapitalLinks' => true,
+               ) );
+
                $site = new MediaWikiSite();
                $site->setGlobalId( 'enwiki' );
 
index 1e5aca9..2cf8663 100644 (file)
@@ -40,6 +40,7 @@ class MediaWikiTitleCodecTest extends MediaWikiTestCase {
                        'wgAllowUserJs' => false,
                        'wgDefaultLanguageVariant' => false,
                        'wgLocalInterwikis' => array( 'localtestiw' ),
+                       'wgCapitalLinks' => true,
 
                        // NOTE: this is why global state is evil.
                        // TODO: refactor access to the interwiki codes so it can be injected.