private const RFC3986_BASE = 'http://a/b/c/d;p?q';
/**
* @dataProvider providePrepareRequestUrl
*/
public function testPrepareRequestUrl(string
$expected, string
$url, array
$query =
[]) { $defaults =
[ 'base_uri' => 'http://example.com?c=c',
'query' =>
['a' => 1, 'b' => 'b'
],
];
[,
$defaults] = self::
prepareRequest(null, null,
$defaults);
[$url] = self::
prepareRequest(null,
$url,
['query' =>
$query],
$defaults);
$this->
assertSame($expected,
implode('',
$url));
} public static function providePrepareRequestUrl(): iterable
{ yield ['http://example.com/', 'http://example.com/'
];
yield ['http://example.com/?a=1&b=b', '.'
];
yield ['http://example.com/?a=2&b=b', '.?a=2'
];
yield ['http://example.com/?a=3&b=b', '.',
['a' => 3
]];