diff --git a/src/Illuminate/Foundation/Testing/TestResponse.php b/src/Illuminate/Foundation/Testing/TestResponse.php index 6c1f9fd67fab..ca5eacd20cb3 100644 --- a/src/Illuminate/Foundation/Testing/TestResponse.php +++ b/src/Illuminate/Foundation/Testing/TestResponse.php @@ -94,7 +94,9 @@ public function assertRedirect($uri = null) ); if (! is_null($uri)) { - PHPUnit::assertEquals(app('url')->to($uri), $this->headers->get('Location')); + PHPUnit::assertEquals( + app('url')->to($uri), app('url')->to($this->headers->get('Location')) + ); } return $this; diff --git a/tests/Integration/Routing/RouteRedirectTest.php b/tests/Integration/Routing/RouteRedirectTest.php index d5316de717f8..8ae56e0e2536 100644 --- a/tests/Integration/Routing/RouteRedirectTest.php +++ b/tests/Integration/Routing/RouteRedirectTest.php @@ -24,10 +24,14 @@ public function test_route_redirect_with_params() Route::redirect('from/{param}/{param2?}', 'to', 301); $response = $this->get('/from/value1/value2'); + $response->assertRedirect('to'); + $this->assertEquals(301, $response->getStatusCode()); $this->assertEquals('to', $response->headers->get('Location')); $response = $this->get('/from/value1'); + $response->assertRedirect('to'); + $this->assertEquals(301, $response->getStatusCode()); $this->assertEquals('to', $response->headers->get('Location')); }