From 5ec352cb79c8059c7cd6a47e658189527552f169 Mon Sep 17 00:00:00 2001 From: Kabirou ALASSANE Date: Sat, 18 May 2024 17:40:57 +0100 Subject: [PATCH] add NotRequiredWithRule for conditional validation --- tests/Feature/RuleTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Feature/RuleTest.php b/tests/Feature/RuleTest.php index 5f93948..05a4a20 100644 --- a/tests/Feature/RuleTest.php +++ b/tests/Feature/RuleTest.php @@ -367,12 +367,12 @@ it('validates not_required_with rule successfully', function () { - $validator = new Validator(['field' => 'value', 'other_field' => 'value2'], ['field' => 'not_required_with:other_field']); - expect($validator->isValid())->toBeFalse(); - $validator = new Validator(['field' => 'value'], ['field' => 'not_required_with:other_field']); expect($validator->isValid())->toBeTrue(); + $validator = new Validator(['field' => 'value', 'other_field' => 'value2'], ['field' => 'not_required_with:other_field']); + expect($validator->isValid())->toBeFalse(); + expect($validator->getErrors()['field'][0])->toBe( LangManager::getTranslation('validation.not_required_with', [ 'attribute' => 'field',