Skip to content

Commit 6c5af17

Browse files
[10.x] Add method to create request (#49446)
* add method to create request * formatting --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent c41b5b5 commit 6c5af17

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ public function call($method, $uri, $parameters = [], $cookies = [], $files = []
583583
);
584584

585585
$response = $kernel->handle(
586-
$request = Request::createFromBase($symfonyRequest)
586+
$request = $this->createTestRequest($symfonyRequest)
587587
);
588588

589589
$kernel->terminate($request, $response);
@@ -710,6 +710,17 @@ protected function followRedirects($response)
710710
return $response;
711711
}
712712

713+
/**
714+
* Create the request instance used for testing from the given Symfony request.
715+
*
716+
* @param \Symfony\Component\HttpFoundation\Request $symfonyRequest
717+
* @return \Illuminate\Http\Request
718+
*/
719+
protected function createTestRequest($symfonyRequest)
720+
{
721+
return Request::createFromBase($symfonyRequest);
722+
}
723+
713724
/**
714725
* Create the test response instance from the given response.
715726
*

0 commit comments

Comments
 (0)