diff --git a/src/Illuminate/Foundation/Testing/TestResponse.php b/src/Illuminate/Foundation/Testing/TestResponse.php index 97f6ea4d98a3..78ef234fa78f 100644 --- a/src/Illuminate/Foundation/Testing/TestResponse.php +++ b/src/Illuminate/Foundation/Testing/TestResponse.php @@ -125,14 +125,27 @@ public function assertRedirect($uri = null) ); if (! is_null($uri)) { - PHPUnit::assertEquals( - app('url')->to($uri), app('url')->to($this->headers->get('Location')) - ); + $this->assertUri($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. *