<?php
/**
- * Tests for wfParseUrl()
- *
* Copyright © 2013 Alexandre Emsenhuber
*
* This program is free software; you can redistribute it and/or modify
* @file
*/
+/**
+ * @covers ::wfParseUrl
+ */
class WfParseUrlTest extends MediaWikiTestCase {
protected function setUp() {
parent::setUp();
$this->setMwGlobals( 'wgUrlProtocols', array(
- '//', 'http://', 'file://', 'mailto:',
+ '//',
+ 'http://',
+ 'https://',
+ 'file://',
+ 'mailto:',
) );
}
- /** @dataProvider provideURLs */
+ /**
+ * @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(