From b8b9c6d6cd239a7bd0edcda96675a2b1e7ea1145 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Mon, 31 Dec 2012 13:23:20 +0100 Subject: [PATCH] Wrong namespace in BackupDumperPageTest::testFullTextPlain The problem here is, that title objects are created before wgContLang is changed, so the title can contains wrong namespace names. 1) BackupDumperPageTest::testFullTextPlain Text of node title Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'Diskussion:BackupDumperTestP1' +'Talk:BackupDumperTestP1' Change-Id: I975c0f6ae7e6f51b038fe41edda2f54cd8c97eb6 --- tests/phpunit/maintenance/backup_PageTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/maintenance/backup_PageTest.php b/tests/phpunit/maintenance/backup_PageTest.php index 227e04a787..6cdc4ec218 100644 --- a/tests/phpunit/maintenance/backup_PageTest.php +++ b/tests/phpunit/maintenance/backup_PageTest.php @@ -19,6 +19,12 @@ class BackupDumperPageTest extends DumpTestCase { private $namespace, $talk_namespace; function addDBData() { + // be sure, titles created here using english namespace names + $this->setMwGlobals( array( + 'wgLanguageCode' => 'en', + 'wgContLang' => Language::factory( 'en' ), + )); + $this->tablesUsed[] = 'page'; $this->tablesUsed[] = 'revision'; $this->tablesUsed[] = 'text'; @@ -79,11 +85,6 @@ class BackupDumperPageTest extends DumpTestCase { protected function setUp() { parent::setUp(); - $this->setMwGlobals( array( - 'wgLanguageCode' => 'en', - 'wgContLang' => Language::factory( 'en' ), - )); - // Since we will restrict dumping by page ranges (to allow // working tests, even if the db gets prepopulated by a base // class), we have to assert, that the page id are consecutively -- 2.20.1