Skip to content

Commit

Permalink
formatting and method rename
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed May 21, 2018
1 parent 6911659 commit 6ceca14
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/Illuminate/Foundation/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,27 +125,12 @@ public function assertRedirect($uri = null)
);

if (! is_null($uri)) {
$this->assertUri($uri);
$this->assertLocation($uri);
}

return $this;
}

/**
* Assert whether the response location is to a given URI.
*
* @param string $uri
* @return $this
*/
public function assertUri($uri)
{
PHPUnit::assertEquals(
app('url')->to($uri), app('url')->to($this->headers->get('Location'))
);

return $this;
}

/**
* Asserts that the response contains the given header and equals the optional value.
*
Expand Down Expand Up @@ -186,6 +171,21 @@ public function assertHeaderMissing($headerName)
return $this;
}

/**
* Assert that the current location header matches the given URI.
*
* @param string $uri
* @return $this
*/
public function assertLocation($uri)
{
PHPUnit::assertEquals(
app('url')->to($uri), app('url')->to($this->headers->get('Location'))
);

return $this;
}

/**
* Asserts that the response contains the given cookie and equals the optional value.
*
Expand Down

0 comments on commit 6ceca14

Please sign in to comment.