Skip to content

Commit

Permalink
Allow testing of relative signed routes (#52726)
Browse files Browse the repository at this point in the history
* Allow testing of relative signed routes

* Fix styling
  • Loading branch information
shealavington authored Sep 10, 2024
1 parent 32ecbcd commit 89a2a21
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Illuminate/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ public function assertRedirectToRoute($name, $parameters = [])
*
* @param string|null $name
* @param mixed $parameters
* @param bool $absolute
* @return $this
*/
public function assertRedirectToSignedRoute($name = null, $parameters = [])
public function assertRedirectToSignedRoute($name = null, $parameters = [], $absolute = true)
{
if (! is_null($name)) {
$uri = route($name, $parameters);
Expand All @@ -252,7 +253,7 @@ public function assertRedirectToSignedRoute($name = null, $parameters = [])
$request = Request::create($this->headers->get('Location'));

PHPUnit::withResponse($this)->assertTrue(
$request->hasValidSignature(), 'The response is not a redirect to a signed route.'
$request->hasValidSignature($absolute), 'The response is not a redirect to a signed route.'
);

if (! is_null($name)) {
Expand Down

0 comments on commit 89a2a21

Please sign in to comment.