Skip to content

Commit 7be77a4

Browse files
authored
Merge pull request #8030 from cakephp/5.next-assert-redirect-back
5.next assertRedirectBack()
2 parents 65d3246 + 8e51670 commit 7be77a4

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

en/appendices/5-3-migration-guide.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ Validation
6161

6262
- ``ipOrRange()`` validation has has been added to check for an IP or a range (subnet).
6363

64+
TestSuite
65+
---------
66+
67+
- `assertRedirectBack()` added to assert a successful redirect has been made to the same previous URL.

en/development/testing.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,6 +1519,9 @@ make testing responses much simpler. Some examples are::
15191519
// Check the Location header
15201520
$this->assertRedirect(['controller' => 'Articles', 'action' => 'index']);
15211521

1522+
// Check the Location header matches the same previous URL
1523+
$this->assertRedirectBack();
1524+
15221525
// Check that no Location header has been set
15231526
$this->assertNoRedirect();
15241527

0 commit comments

Comments
 (0)