X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FWikiMapTest.php;h=53e0b10b880419a084aa7c904a2cf6dd28447fbe;hb=2b2f9e229d2772d680393c1e7d7e4a41dae5b114;hp=186ffdbcc32ffed732fbb131f9e2bc93597de05b;hpb=3b104ebdbe8e31ecf5d554ea1b69ae6b1339c17e;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' ] + ]; + } }