yield [[null, null, 'bar', '?a[b][c]=dd', null
], 'bar?a[b][c]=d&e[f]=g',
['a' =>
['b' =>
['c' => 'dd'
]], 'e[f]' => null
]];
yield [[null, null, 'bar', '?a=b&a[b%20c]=d&e%3Df=%E2%9C%93', null
], 'bar?a=b',
['a' =>
['b c' => 'd'
], 'e=f' => '✓'
]];
// IDNA 2008 compliance
yield [['https:', '//xn--fuball-cta.test', null, null, null
], 'https://fußball.test'
];
} /**
* @dataProvider provideRemoveDotSegments
*/
public function testRemoveDotSegments($expected,
$url) { $this->
assertSame($expected, self::
removeDotSegments($url));
} public static function provideRemoveDotSegments() { yield ['', ''
];
yield ['', '.'
];
yield ['', '..'
];
yield ['a', './a'
];
yield ['a', '../a'
];
yield ['/a/b', '/a/./b'
];
yield ['/b/', '/a/../b/.'
];