Skip to content

Commit b03808f

Browse files
committed
test: add test cases
1 parent 6a24550 commit b03808f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/system/Validation/ValidationTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ public function testRulesSetup($rules, $expected, array $errors = [])
440440
$data = ['foo' => ''];
441441
$this->validation->setRules(['foo' => $rules], $errors);
442442
$this->validation->run($data);
443+
443444
$this->assertSame($expected, $this->validation->getError('foo'));
444445
}
445446

@@ -468,13 +469,24 @@ public function rulesSetupProvider(): Generator
468469
['rules' => 'min_length[10]'],
469470
'The foo field must be at least 10 characters in length.',
470471
],
472+
[
473+
['rules' => ['min_length[10]']],
474+
'The foo field must be at least 10 characters in length.',
475+
],
471476
[
472477
[
473478
'label' => 'Foo Bar',
474479
'rules' => 'min_length[10]',
475480
],
476481
'The Foo Bar field must be at least 10 characters in length.',
477482
],
483+
[
484+
[
485+
'label' => 'Foo Bar',
486+
'rules' => ['min_length[10]'],
487+
],
488+
'The Foo Bar field must be at least 10 characters in length.',
489+
],
478490
[
479491
[
480492
'label' => 'Foo Bar',

0 commit comments

Comments
 (0)