diff --git a/tests/Feature/OctaneHandlerTest.php b/tests/Feature/OctaneHandlerTest.php index c5791b4..757d184 100644 --- a/tests/Feature/OctaneHandlerTest.php +++ b/tests/Feature/OctaneHandlerTest.php @@ -315,7 +315,10 @@ public function test_request_query_string() $response = $handler->handle([ 'httpMethod' => 'GET', - 'path' => '/?foo=bar', + 'path' => '/', + 'multiValueQueryStringParameters' => [ + 'foo' => ['bar'], + ], 'headers' => [ 'cookie' => 'XSRF-TOKEN=token_value', ], @@ -324,6 +327,28 @@ public function test_request_query_string() static::assertEquals('foo=bar', $response->toApiGatewayFormat()['body']); } + public function test_request_query_params() + { + $handler = new OctaneHandler(); + + Route::get('/', function (Request $request) { + return $request->query(); + }); + + $response = $handler->handle([ + 'httpMethod' => 'GET', + 'path' => '/', + 'multiValueQueryStringParameters' => [ + 'foo' => ['bar'], + ], + 'headers' => [ + 'cookie' => 'XSRF-TOKEN=token_value', + ], + ]); + + static::assertEquals(['foo' => 'bar'], json_decode($response->toApiGatewayFormat()['body'], true)); + } + public function test_request_headers() { $handler = new OctaneHandler();