Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

New method: assertRedirectToRoute for more robust redirect checks in tests #68

Open
2 tasks done
koseduhemak opened this issue Jul 6, 2018 · 1 comment
Open
2 tasks done

Comments

@koseduhemak
Copy link

koseduhemak commented Jul 6, 2018

Would it be nice to have a new assertRedirectToRoute method for easier checking of redirects? In opposite to assertRedirectTo, the new method would be more robust due to changes in the routes of the application to test.

F.e. if I change the URI in one of the routes (my-route) of my application from /foo/bar/baz to /foo-foo/bar-bar/baz-baz, I would have to modify my test case too:

...
$this->assertRedirectTo('/foo/bar/baz');
...

to

...
$this->assertRedirectTo('/foo-foo/bar-bar/baz-baz');
...

With the new method:

...
$this->assertRedirectToRoute('my-route');
...

What do you think? I could make a pull-request for that if you would accept my proposal.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-test; a new issue has been opened at laminas/laminas-test#2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants