Skip to content

Commit 64924aa

Browse files
committed
test: add condition to follow required_without[] rule.
1 parent 2bdb36c commit 64924aa

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tests/system/Validation/ValidationTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,13 +1414,20 @@ public function testNestedArrayThrowsException(): void
14141414
'credit_amount' => null,
14151415
'purpose' => 'A',
14161416
],
1417+
'account_3' => [
1418+
'account_number' => '',
1419+
'credit_amount' => 2000,
1420+
'purpose' => '',
1421+
],
14171422
],
14181423
];
14191424
$this->validation->run($data);
14201425

14211426
$this->assertSame([
1422-
'beneficiaries_accounts.account_2.credit_amount' => 'The CREDIT AMOUNT field is required.',
1423-
'beneficiaries_accounts.account_2.purpose' => 'The PURPOSE field must be at least 3 characters in length.',
1427+
'beneficiaries_accounts.account_3.account_number' => 'The BENEFICIARY ACCOUNT NUMBER field must be exactly 5 characters in length.',
1428+
'beneficiaries_accounts.account_2.credit_amount' => 'The CREDIT AMOUNT field is required.',
1429+
'beneficiaries_accounts.account_2.purpose' => 'The PURPOSE field must be at least 3 characters in length.',
1430+
'beneficiaries_accounts.account_3.purpose' => 'The PURPOSE field is required when BENEFICIARY ACCOUNT NUMBER is not present.',
14241431
], $this->validation->getErrors());
14251432
}
14261433

0 commit comments

Comments
 (0)