X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FWikiMapTest.php;h=2092e0cf5d137c46e1ccdc42958f8f1f7eb54a62;hb=725a203bc1f35a5cd7624d4f1a116fb46667ca2d;hp=9233416c74dce846afbac4cfcdaef51f5fde5c6b;hpb=4f21e6be661f7305abc223bb31600970a3fb5326;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/WikiMapTest.php b/tests/phpunit/includes/WikiMapTest.php index 9233416c74..2092e0cf5d 100644 --- a/tests/phpunit/includes/WikiMapTest.php +++ b/tests/phpunit/includes/WikiMapTest.php @@ -27,8 +27,8 @@ class WikiMapTest extends MediaWikiLangTestCase { } public function provideGetWiki() { - $enwiki = new WikiReference( 'wiki', 'en', 'http://en.example.org', '/w/$1' ); - $ruwiki = new WikiReference( 'wiki', 'ru', '//ru.example.org', '/wiki/$1' ); + $enwiki = new WikiReference( 'http://en.example.org', '/w/$1' ); + $ruwiki = new WikiReference( '//ru.example.org', '/wiki/$1' ); return array( 'unknown' => array( false, 'xyzzy' ), @@ -62,8 +62,19 @@ class WikiMapTest extends MediaWikiLangTestCase { public function provideMakeForeignLink() { return array( 'unknown' => array( false, 'xyzzy', 'Foo' ), - 'enwiki' => array( 'Foo', 'enwiki', 'Foo', ), - 'ruwiki' => array( 'вар', 'ruwiki', 'Фу', 'вар' ), + 'enwiki' => array( + 'Foo', + 'enwiki', + 'Foo' + ), + 'ruwiki' => array( + 'вар', + 'ruwiki', + 'Фу', + 'вар' + ), ); } @@ -71,14 +82,28 @@ class WikiMapTest extends MediaWikiLangTestCase { * @dataProvider provideMakeForeignLink */ public function testMakeForeignLink( $expected, $wikiId, $page, $text = null ) { - $this->assertEquals( $expected, WikiMap::makeForeignLink( $wikiId, $page, $text ) ); + $this->assertEquals( + $expected, + WikiMap::makeForeignLink( $wikiId, $page, $text ) + ); } public function provideForeignUserLink() { return array( 'unknown' => array( false, 'xyzzy', 'Foo' ), - 'enwiki' => array( 'User:Foo', 'enwiki', 'Foo', ), - 'ruwiki' => array( 'вар', 'ruwiki', 'Фу', 'вар' ), + 'enwiki' => array( + 'User:Foo', + 'enwiki', + 'Foo' + ), + 'ruwiki' => array( + 'вар', + 'ruwiki', + 'Фу', + 'вар' + ), ); } @@ -92,8 +117,13 @@ class WikiMapTest extends MediaWikiLangTestCase { public function provideGetForeignURL() { return array( 'unknown' => array( false, 'xyzzy', 'Foo' ), - 'enwiki' => array( 'http://en.example.org/w/Foo', 'enwiki', 'Foo', ), - 'ruwiki with fragement' => array( '//ru.example.org/wiki/%D0%A4%D1%83#%D0%B2%D0%B0%D1%80', 'ruwiki', 'Фу', 'вар' ), + 'enwiki' => array( 'http://en.example.org/w/Foo', 'enwiki', 'Foo' ), + 'ruwiki with fragement' => array( + '//ru.example.org/wiki/%D0%A4%D1%83#%D0%B2%D0%B0%D1%80', + 'ruwiki', + 'Фу', + 'вар' + ), ); } @@ -105,4 +135,3 @@ class WikiMapTest extends MediaWikiLangTestCase { } } -