toBeInstanceOf(SafeEmailValidator::class); }); test('addresses with line breaks are rejected', function (string $email, string $rule) { expect(Validator::make(['email' => $email], ['email' => $rule])->fails())->toBeTrue(); })->with([ 'quoted local part' => "\"a\r\n b\"@example.com", 'folded local part' => "a\r\n @example.com", 'comment' => "(c\r\n )a@example.com", 'bare line feed' => "\"a\n b\"@example.com", ])->with(['email', 'email:rfc', 'required|email|max:191']); test('ordinary addresses stay valid', function (string $email) { expect(Validator::make(['email' => $email], ['email' => 'email'])->passes())->toBeTrue(); })->with([ 'kunde@example.com', 'vor.name+shop@sub.example.de', 'müller@example.de', ]);