Register the macro in a service provider or use the MacroServiceProvider
to keep things tidy. Be sure to register it in the array in the /bootstrap/providers.php
file.
You can then use the test example to “use” a dataset to run through your validation rules.
It will execute each item in the dataset, building the request for the provided parameter and the (incorrect) value, and then assert that the error is as expected.
If the validation fails to run, the error will not be found, and the test will fail. Similarily, if the error message changes, the test will fail.