Remove unused minor and major in WikiReference
[lhc/web/wiklou.git] / tests / phpunit / includes / WikiMapTest.php
index f7ae08e..2092e0c 100644 (file)
@@ -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( '<a class="external" rel="nofollow" href="http://en.example.org/w/Foo">Foo</a>', 'enwiki', 'Foo' ),
-                       'ruwiki' => array( '<a class="external" rel="nofollow" href="//ru.example.org/wiki/%D0%A4%D1%83">вар</a>', 'ruwiki', 'Фу', 'вар' ),
+                       'enwiki' => array(
+                               '<a class="external" rel="nofollow" ' .
+                                       'href="http://en.example.org/w/Foo">Foo</a>',
+                               'enwiki',
+                               'Foo'
+                       ),
+                       'ruwiki' => array(
+                               '<a class="external" rel="nofollow" ' .
+                                       'href="//ru.example.org/wiki/%D0%A4%D1%83">вар</a>',
+                               '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( '<a class="external" rel="nofollow" href="http://en.example.org/w/User:Foo">User:Foo</a>', 'enwiki', 'Foo' ),
-                       'ruwiki' => array( '<a class="external" rel="nofollow" href="//ru.example.org/wiki/User:%D0%A4%D1%83">вар</a>', 'ruwiki', 'Фу', 'вар' ),
+                       'enwiki' => array(
+                               '<a class="external" rel="nofollow" ' .
+                                       'href="http://en.example.org/w/User:Foo">User:Foo</a>',
+                               'enwiki',
+                               'Foo'
+                       ),
+                       'ruwiki' => array(
+                               '<a class="external" rel="nofollow" ' .
+                                       'href="//ru.example.org/wiki/User:%D0%A4%D1%83">вар</a>',
+                               'ruwiki',
+                               'Фу',
+                               'вар'
+                       ),
                );
        }
 
@@ -93,7 +118,12 @@ class WikiMapTest extends MediaWikiLangTestCase {
                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', 'Фу', 'вар' ),
+                       '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 {
        }
 
 }
-