File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
tests/system/Validation/StrictRules Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,28 @@ public function testRunGroupWithCustomErrorMessage(): void
359
359
], $ this ->validation ->getErrors ());
360
360
}
361
361
362
+ /**
363
+ * @see https://github.com/codeigniter4/CodeIgniter4/issues/6245
364
+ */
365
+ public function testRunWithCustomErrorsAndAsteriskField (): void
366
+ {
367
+ $ data = [
368
+ 'foo ' => [
369
+ ['bar ' => null ],
370
+ ['bar ' => null ],
371
+ ],
372
+ ];
373
+ $ this ->validation ->setRules (
374
+ ['foo.*.bar ' => ['label ' => 'foo bar ' , 'rules ' => 'required ' ]],
375
+ ['foo.*.bar ' => ['required ' => 'Required ' ]]
376
+ );
377
+ $ this ->validation ->run ($ data );
378
+ $ this ->assertSame ([
379
+ 'foo.0.bar ' => 'Required ' ,
380
+ 'foo.1.bar ' => 'Required ' ,
381
+ ], $ this ->validation ->getErrors ());
382
+ }
383
+
362
384
/**
363
385
* @dataProvider rulesSetupProvider
364
386
*
You can’t perform that action at this time.
0 commit comments