From 4f55b804f20960e039671a3dbf3f3eb4a5a4b81e Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 29 Jul 2014 11:43:54 +0200 Subject: [PATCH] test: coverage for wfWikiID() Basic coverage test, note that $wgDBprefix is used as a suffix! Bug: 68231 Change-Id: Ic454ce38672b1f18db2a7f2f46c50bcfc5ee83d0 --- .../includes/GlobalFunctions/wfWikiIDTest.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/phpunit/includes/GlobalFunctions/wfWikiIDTest.php 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() ); + } + +} -- 2.20.1