Skip to content

Commit

Permalink
[10.x] Add method to create request (#49446)
Browse files Browse the repository at this point in the history
* add method to create request

* formatting

---------

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
dododedodonl and taylorotwell committed Dec 20, 2023
1 parent c41b5b5 commit 6c5af17
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php
Expand Up @@ -583,7 +583,7 @@ public function call($method, $uri, $parameters = [], $cookies = [], $files = []
);

$response = $kernel->handle(
$request = Request::createFromBase($symfonyRequest)
$request = $this->createTestRequest($symfonyRequest)
);

$kernel->terminate($request, $response);
Expand Down Expand Up @@ -710,6 +710,17 @@ protected function followRedirects($response)
return $response;
}

/**
* Create the request instance used for testing from the given Symfony request.
*
* @param \Symfony\Component\HttpFoundation\Request $symfonyRequest
* @return \Illuminate\Http\Request
*/
protected function createTestRequest($symfonyRequest)
{
return Request::createFromBase($symfonyRequest);
}

/**
* Create the test response instance from the given response.
*
Expand Down

0 comments on commit 6c5af17

Please sign in to comment.