File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,26 @@ public function testUnique(): void
41
41
['name ' => 'required|unique:users ' ]
42
42
);
43
43
$ this ->assertFalse ($ validator ->fails ());
44
+
45
+ User::create (['name ' => 'Johnny Cash ' , 'email ' => 'johnny.cash+200@gmail.com ' ]);
46
+
47
+ $ validator = Validator::make (
48
+ ['email ' => 'johnny.cash+200@gmail.com ' ],
49
+ ['email ' => 'required|unique:users ' ]
50
+ );
51
+ $ this ->assertTrue ($ validator ->fails ());
52
+
53
+ $ validator = Validator::make (
54
+ ['email ' => 'johnny.cash+20@gmail.com ' ],
55
+ ['email ' => 'required|unique:users ' ]
56
+ );
57
+ $ this ->assertFalse ($ validator ->fails ());
58
+
59
+ $ validator = Validator::make (
60
+ ['email ' => 'johnny.cash+1@gmail.com ' ],
61
+ ['email ' => 'required|unique:users ' ]
62
+ );
63
+ $ this ->assertFalse ($ validator ->fails ());
44
64
}
45
65
46
66
public function testExists (): void
You can’t perform that action at this time.
0 commit comments