Skip to content

Commit

Permalink
Fix accepted_if test by checking installed Laravel version
Browse files Browse the repository at this point in the history
  • Loading branch information
ac committed Mar 13, 2022
1 parent fdb0523 commit 5e751b0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/Unit/ValidationRuleParsingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,15 @@ public function supportedRules()
'description' => 'Must be accepted.',
]
];
yield 'accepted_if' => [
['accepted_if_param' => 'accepted_if:another_field,a_value'],
[],
[
'type' => 'boolean',
'description' => "Must be accepted when <code>another_field</code> is <code>a_value</code>.",
]
];
if (version_compare(Application::VERSION, '8.53', '>=')) {
yield 'accepted_if' => [
['accepted_if_param' => 'accepted_if:another_field,a_value'],
[],
[
'type' => 'boolean',
'description' => "Must be accepted when <code>another_field</code> is <code>a_value</code>.",
]
];
}
}
}

0 comments on commit 5e751b0

Please sign in to comment.