#How should I test validation rules?

3 messages · Page 1 of 1 (latest)

inland vapor
#

Hello, I am new to the Laravel world, and I am confused about how to write tests for my validation rules.

What is the correct way to test them?

1 - in a unitary manner and mock rules that use the database? If so, is there documentation that provides examples for these cases?

2 - should I use an integration test with a database and make a request? This option seems simpler, as we would be testing what we want, but we wouldn't have coverage in a unitary way.

coarse adder
coarse adder
#

Also, sure is quiet in here