From: umherirrender Date: Mon, 31 Dec 2012 12:23:20 +0000 (+0100) Subject: Wrong namespace in BackupDumperPageTest::testFullTextPlain X-Git-Tag: 1.31.0-rc.0~21187 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=commitdiff_plain;h=b8b9c6d6cd239a7bd0edcda96675a2b1e7ea1145;p=lhc%2Fweb%2Fwiklou.git 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 --- 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