Merge "test: Remove MagicVariableTest#testServernameFromDifferentProtocols"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 26 Jun 2014 15:49:35 +0000 (15:49 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 26 Jun 2014 15:49:35 +0000 (15:49 +0000)
tests/phpunit/includes/GlobalFunctions/wfParseUrlTest.php
tests/phpunit/includes/parser/MagicVariableTest.php

index 5032dc1..af834f8 100644 (file)
@@ -28,7 +28,11 @@ class WfParseUrlTest extends MediaWikiTestCase {
                parent::setUp();
 
                $this->setMwGlobals( 'wgUrlProtocols', array(
-                       '//', 'http://', 'file://', 'mailto:',
+                       '//',
+                       'http://',
+                       'https://',
+                       'file://',
+                       'mailto:',
                ) );
        }
 
@@ -36,11 +40,9 @@ class WfParseUrlTest extends MediaWikiTestCase {
         * @dataProvider provideURLs
         */
        public function testWfParseUrl( $url, $parts ) {
-               $partsDump = var_export( $parts, true );
                $this->assertEquals(
                        $parts,
-                       wfParseUrl( $url ),
-                       "Testing $url parses to $partsDump"
+                       wfParseUrl( $url )
                );
        }
 
@@ -67,6 +69,14 @@ class WfParseUrlTest extends MediaWikiTestCase {
                                        'host' => 'example.org',
                                )
                        ),
+                       array(
+                               'https://example.org',
+                               array(
+                                       'scheme' => 'https',
+                                       'delimiter' => '://',
+                                       'host' => 'example.org',
+                               )
+                       ),
                        array(
                                'http://id:key@example.org:123/path?foo=bar#baz',
                                array(
index b81c973..d36697e 100644 (file)
@@ -155,26 +155,6 @@ class MagicVariableTest extends MediaWikiTestCase {
                $this->assertUnPadded( 'revisionmonth1', $month );
        }
 
-       /**
-        * Rough tests for {{SERVERNAME}} magic word
-        * Bug 31176
-        * @group Database
-        * @dataProvider provideDataServernameFromDifferentProtocols
-        */
-       public function testServernameFromDifferentProtocols( $server ) {
-               $this->setMwGlobals( 'wgServer', $server );
-
-               $this->assertMagic( 'localhost', 'servername' );
-       }
-
-       public static function provideDataServernameFromDifferentProtocols() {
-               return array(
-                       array( 'http://localhost/' ),
-                       array( 'https://localhost/' ),
-                       array( '//localhost/' ), # bug 31176
-               );
-       }
-
        ############### HELPERS ############################################
 
        /** assertion helper expecting a magic output which is zero padded */