diff --git a/src/Illuminate/Foundation/Testing/TestResponse.php b/src/Illuminate/Foundation/Testing/TestResponse.php index 78ef234fa78f..849671cbb9a3 100644 --- a/src/Illuminate/Foundation/Testing/TestResponse.php +++ b/src/Illuminate/Foundation/Testing/TestResponse.php @@ -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. * @@ -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. *