Skip to content

Commit 8c213be

Browse files
authored
[9.x] Add test for assertRedirect (#41828)
1 parent 2b5d80b commit 8c213be

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/Testing/TestResponseTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,6 +1656,15 @@ public function testAssertRedirectContains()
16561656
$response->assertRedirectContains('url.net');
16571657
}
16581658

1659+
public function testAssertRedirect()
1660+
{
1661+
$response = TestResponse::fromBaseResponse(
1662+
(new Response('', 302))->withHeaders(['Location' => 'https://url.com'])
1663+
);
1664+
1665+
$response->assertRedirect();
1666+
}
1667+
16591668
public function testGetDecryptedCookie()
16601669
{
16611670
$response = TestResponse::fromBaseResponse(

0 commit comments

Comments
 (0)