@benou101 It should be fine either way. If you see value in using the named route helper, then just use that. Just make sure your tests fail if you change the route and you should be covered.
Feb 10, 2020
2
Level 1
Integration Test: use URL::route or hardcode the route
When testing a controller, all the example I've seen so far hardcode the route. For example, to test if you can delete something, I see: $this->delete(''something/'.$something->id).
But if the path to "something" becomes "somethingElse", you have to change all your tests. Would it be better to do: $this->delete(URL::route('something.destroy', $something->id)) This way, the only thing you have to change is web.php if the path changes.
What are the pros and cons ?
Please or to participate in this conversation.