Closed gofish543 closed 4 years ago
Sure. This package already has a createFormRequest
method. But maybe you can improve it with the additional parameters for the route and request type.
I only ask that you may as much as possible optional to optimize for the simple use case. Or better yet, use the pending object pattern similar to factory
or sending requests in Laravel.
I also like the form request assertions. I have a few, but not any validated ones.
My suggestion would be to make "atomic" PRs for each of these. That way we can tweak and review individually, instead of a one big PR with a massive amount of changes.
I have not forgotten about this. I've gotten swamped with school work, but plan on coming back to this in about a week!
If I get more available time, I'll come back to this.
Problem: Testing form requests in Laravel is difficult and annoying.
Solution: I have a little Trait FormRequestAssertions that results in the following test structure...
This solution allows for form requests tests that target specific validation rule(s) along with the authorization function.
I want to ask if you would like this functionality within this package as this seems like the best place for it; a nice collection of PHPUnit assertions for Laravel. If so, I'd be happy to submit the trait within a PR for your review.
(Maybe bundle in the https://laracasts.com/series/phpunit-testing-in-laravel/episodes/12) as well for mail assertions? I've got a trait build that can be submitted as well