From 8e51670adea8d7621c8ae9955ce5a3028ed26be5 Mon Sep 17 00:00:00 2001 From: mscherer Date: Mon, 5 May 2025 16:44:43 +0200 Subject: [PATCH] assertRedirectBack() docs --- en/appendices/5-3-migration-guide.rst | 4 ++++ en/development/testing.rst | 3 +++ 2 files changed, 7 insertions(+) diff --git a/en/appendices/5-3-migration-guide.rst b/en/appendices/5-3-migration-guide.rst index 08e1cd21f7..50aa4e17de 100644 --- a/en/appendices/5-3-migration-guide.rst +++ b/en/appendices/5-3-migration-guide.rst @@ -54,3 +54,7 @@ Validation - ``ipOrRange()`` validation has has been added to check for an IP or a range (subnet). +TestSuite +--------- + +- `assertRedirectBack()` added to assert a successful redirect has been made to the same previous URL. diff --git a/en/development/testing.rst b/en/development/testing.rst index 288df98e94..e9b50c6615 100644 --- a/en/development/testing.rst +++ b/en/development/testing.rst @@ -1509,6 +1509,9 @@ make testing responses much simpler. Some examples are:: // Check the Location header $this->assertRedirect(['controller' => 'Articles', 'action' => 'index']); + // Check the Location header matches the same previous URL + $this->assertRedirectBack(); + // Check that no Location header has been set $this->assertNoRedirect();