0

If i have a Validator like below

[
        'id' => ['string', 'required', 'regex:/^[A-Za-z]{1}([A-Za-z]|[0-9]){5,7}$/im', 'unique:users'],
        'user_name' => ['string', 'required', 'unique:users'],
        'email' => ['string', 'required', 'email', 'unique:users'],
        'password' => [\Illuminate\Validation\Rules\Password::min(8)->letters()->mixedCase()->numbers()->symbols(), 'max:32', 'sometimes'],
        'role_id' => ['integer', 'required'],
        'status' => ['integer', 'required', 'in:1,2']
]

That would requires 4 * 3 * 4 * 3 * 2 * 3 = 846 methods to test all the validation cases, which sounds stupid itself.

How would validation feature testing (and other kinds of testing) actually be implemented?

La Hai
  • 113
  • 2
  • 12

0 Answers0