parent::setUp();
$this->setMwGlobals( 'wgUrlProtocols', array(
- '//', 'http://', 'file://', 'mailto:',
+ '//',
+ 'http://',
+ 'https://',
+ 'file://',
+ 'mailto:',
) );
}
* @dataProvider provideURLs
*/
public function testWfParseUrl( $url, $parts ) {
- $partsDump = var_export( $parts, true );
$this->assertEquals(
$parts,
- wfParseUrl( $url ),
- "Testing $url parses to $partsDump"
+ wfParseUrl( $url )
);
}
'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(
$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 */