From: Antoine Musso Date: Tue, 29 Jul 2014 09:43:54 +0000 (+0200) Subject: test: coverage for wfWikiID() X-Git-Tag: 1.31.0-rc.0~14677^2~1 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=4f55b804f20960e039671a3dbf3f3eb4a5a4b81e;p=lhc%2Fweb%2Fwiklou.git test: coverage for wfWikiID() Basic coverage test, note that $wgDBprefix is used as a suffix! Bug: 68231 Change-Id: Ic454ce38672b1f18db2a7f2f46c50bcfc5ee83d0 --- diff --git a/tests/phpunit/includes/GlobalFunctions/wfWikiIDTest.php b/tests/phpunit/includes/GlobalFunctions/wfWikiIDTest.php new file mode 100644 index 0000000000..d3cba0d28c --- /dev/null +++ b/tests/phpunit/includes/GlobalFunctions/wfWikiIDTest.php @@ -0,0 +1,22 @@ +setMwGlobals( 'wgDBname', 'known_db_name' ); + $this->assertEquals('known_db_name', wfWikiID() ); + } + + public function testHonorsDatabasePrefix() { + $this->setMwGlobals( array( + 'wgDBname' => 'known_db_name', + 'wgDBprefix' => 'prefix', + )); + # Note: prefix is actually a suffix in wfWikiID() + $this->assertEquals('known_db_name-prefix', wfWikiID() ); + } + +}