@@ -223,4 +223,70 @@ public function testWithCookies()
223223 $ this ->assertSame ('bar ' , $ responseCookie ['Value ' ]);
224224 $ this ->assertSame ('https://laravel.com ' , $ responseCookie ['Domain ' ]);
225225 }
226+
227+ public function testGetWithArrayQueryParam ()
228+ {
229+ $ this ->factory ->fake ();
230+
231+ $ this ->factory ->get ('http://foo.com/get ' , ['foo ' => 'bar ' ]);
232+
233+ $ this ->factory ->assertSent (function (Request $ request ) {
234+ return $ request ->url () === 'http://foo.com/get?foo=bar ' ;
235+ });
236+ }
237+
238+ public function testGetWithStringQueryParam ()
239+ {
240+ $ this ->factory ->fake ();
241+
242+ $ this ->factory ->get ('http://foo.com/get ' , 'foo=bar ' );
243+
244+ $ this ->factory ->assertSent (function (Request $ request ) {
245+ return $ request ->url () === 'http://foo.com/get?foo=bar ' ;
246+ });
247+ }
248+
249+ public function testGetWithQuery ()
250+ {
251+ $ this ->factory ->fake ();
252+
253+ $ this ->factory ->get ('http://foo.com/get?foo=bar&page=1 ' );
254+
255+ $ this ->factory ->assertSent (function (Request $ request ) {
256+ return $ request ->url () === 'http://foo.com/get?foo=bar&page=1 ' ;
257+ });
258+ }
259+
260+ public function testGetWithQueryWontEncode ()
261+ {
262+ $ this ->factory ->fake ();
263+
264+ $ this ->factory ->get ('http://foo.com/get?foo;bar;1;5;10&page=1 ' );
265+
266+ $ this ->factory ->assertSent (function (Request $ request ) {
267+ return $ request ->url () === 'http://foo.com/get?foo;bar;1;5;10&page=1 ' ;
268+ });
269+ }
270+
271+ public function testGetWithArrayQueryParamOverwrites ()
272+ {
273+ $ this ->factory ->fake ();
274+
275+ $ this ->factory ->get ('http://foo.com/get?foo=bar&page=1 ' , ['hello ' => 'world ' ]);
276+
277+ $ this ->factory ->assertSent (function (Request $ request ) {
278+ return $ request ->url () === 'http://foo.com/get?hello=world ' ;
279+ });
280+ }
281+
282+ public function testGetWithArrayQueryParamEncodes ()
283+ {
284+ $ this ->factory ->fake ();
285+
286+ $ this ->factory ->get ('http://foo.com/get ' , ['foo;bar; space test ' => 'laravel ' ]);
287+
288+ $ this ->factory ->assertSent (function (Request $ request ) {
289+ return $ request ->url () === 'http://foo.com/get?foo%3Bbar%3B%20space%20test=laravel ' ;
290+ });
291+ }
226292}
0 commit comments