Skip to content

[12.x] Add assertRedirectBack assertion method#55635

Merged
taylorotwell merged 1 commit into
laravel:12.xfrom
ryangjchandler:assert-redirect-back
May 5, 2025
Merged

[12.x] Add assertRedirectBack assertion method#55635
taylorotwell merged 1 commit into
laravel:12.xfrom
ryangjchandler:assert-redirect-back

Conversation

@ryangjchandler

Copy link
Copy Markdown
Contributor

This pull request implements a new assertRedirectBack() method that ensures the response's Location header is the same as the previous URL produced by UrlGenerator.

I believe this is a nice convenience helper method compared to the alternative ->assertRedirect("enter-expected-previous-url-here").

@taylorotwell taylorotwell merged commit 6d825ed into laravel:12.x May 5, 2025
@AhmedAlaa4611

Copy link
Copy Markdown
Contributor

Is this documented yet?

@AndrewMast

Copy link
Copy Markdown
Contributor

Is this documented yet?

@AhmedAlaa4611 I've seen you post this on quite a few PRs (and some really old PRs). Considering this was merged 4 hours before you asked, no, it probably hasn't been documented yet. Instead of asking this, please check the documentation on the Laravel website or the laravel/docs repo. I know you are active in opening PRs on that repo, so you should already know this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants