File tree Expand file tree Collapse file tree
tests/system/Validation/StrictRules Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616use CodeIgniter \Validation \Validation ;
1717use Config \Database ;
1818use Config \Services ;
19+ use InvalidArgumentException ;
1920use Tests \Support \Validation \TestRules ;
2021
2122/**
@@ -82,6 +83,16 @@ public function testIsUniqueTrue(): void
8283 $ this ->assertTrue ($ this ->validation ->run ($ data ));
8384 }
8485
86+ public function testIsUniqueWithInvalidDBGroup (): void
87+ {
88+ $ this ->expectException (InvalidArgumentException::class);
89+ $ this ->expectExceptionMessage ('invalidGroup is not a valid database connection group ' );
90+
91+ $ this ->validation ->setRules (['email ' => 'is_unique[user.email] ' ]);
92+ $ data = ['email ' => 'derek@world.co.uk ' ];
93+ $ this ->assertTrue ($ this ->validation ->run ($ data , null , 'invalidGroup ' ));
94+ }
95+
8596 public function testIsUniqueWithIgnoreValue (): void
8697 {
8798 $ db = Database::connect ();
You can’t perform that action at this time.
0 commit comments