File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -463,6 +463,28 @@ public function testRunGroupWithCustomErrorMessage(): void
463
463
], $ this ->validation ->getErrors ());
464
464
}
465
465
466
+ /**
467
+ * @see https://github.com/codeigniter4/CodeIgniter4/issues/6245
468
+ */
469
+ public function testRunWithCustomErrorsAndAsteriskField (): void
470
+ {
471
+ $ data = [
472
+ 'foo ' => [
473
+ ['bar ' => null ],
474
+ ['bar ' => null ],
475
+ ]
476
+ ];
477
+ $ this ->validation ->setRules (
478
+ ['foo.*.bar ' => ['label ' => 'foo bar ' , 'rules ' => 'required ' ]],
479
+ ['foo.*.bar ' => ['required ' => 'Required ' ]]
480
+ );
481
+ $ this ->validation ->run ($ data );
482
+ $ this ->assertSame ([
483
+ 'foo.0.bar ' => 'Required ' ,
484
+ 'foo.1.bar ' => 'Required '
485
+ ], $ this ->validation ->getErrors ());
486
+ }
487
+
466
488
/**
467
489
* @dataProvider rulesSetupProvider
468
490
*
You can’t perform that action at this time.
0 commit comments