X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FWikiMapTest.php;h=53e0b10b880419a084aa7c904a2cf6dd28447fbe;hb=dd2e27c4b1c83403d510fbf7eb240a3b62aa9563;hp=186ffdbcc32ffed732fbb131f9e2bc93597de05b;hpb=e5ffb82fabc3411ac3f23f5ac7ebd49c923dc1cf;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/WikiMapTest.php b/tests/phpunit/includes/WikiMapTest.php index 186ffdbcc3..53e0b10b88 100644 --- a/tests/phpunit/includes/WikiMapTest.php +++ b/tests/phpunit/includes/WikiMapTest.php @@ -1,4 +1,5 @@ assertEquals( $wiki, WikiMap::getWikiFromUrl( $url ) ); } + + /** + * @dataProvider provideGetWikiIdFromDomain + * @covers WikiMap::getWikiIdFromDomain() + */ + public function testGetWikiIdFromDomain( $domain, $wikiId ) { + $this->assertEquals( $wikiId, WikiMap::getWikiIdFromDomain( $domain ) ); + } + + public function provideGetWikiIdFromDomain() { + return [ + [ 'db-prefix', 'db-prefix' ], + [ wfWikiID(), wfWikiID() ], + [ new DatabaseDomain( 'db-dash', null, 'prefix' ), 'db-dash-prefix' ] + ]; + } }