Remove unwanted query parameters from normalized URLs
This commit is contained in:
parent
12a6b8f6b3
commit
6ccd564d56
2 changed files with 34 additions and 16 deletions
|
@ -12,14 +12,6 @@ class HelpersTest extends TestCase
|
|||
$this->assertEquals(normalize_url(normalize_url($input)), normalize_url($input));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider urlProvider
|
||||
*/
|
||||
public function test_normalize_url($input, $output)
|
||||
{
|
||||
$this->assertEquals($output, normalize_url($input));
|
||||
}
|
||||
|
||||
public function urlProvider()
|
||||
{
|
||||
return [
|
||||
|
@ -27,9 +19,22 @@ class HelpersTest extends TestCase
|
|||
['https://example.org:443/', 'https://example.org'],
|
||||
['http://www.foo.bar/index.php/', 'http://www.foo.bar'],
|
||||
['https://example.org/?foo=bar&baz=true', 'https://example.org?baz=true&foo=bar'],
|
||||
[
|
||||
'http://example.org/?ref_src=twcamp^share|twsrc^ios|twgr^software.studioh.Indigenous.share-micropub',
|
||||
'http://example.org',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider urlProvider
|
||||
* @group temp
|
||||
*/
|
||||
public function test_normalize_url($input, $output)
|
||||
{
|
||||
$this->assertEquals($output, normalize_url($input));
|
||||
}
|
||||
|
||||
public function test_pretty_print_json()
|
||||
{
|
||||
$json = <<<JSON
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue