From 6d72c3ebf3f4047a796b6ea06f96fe324e22c26d Mon Sep 17 00:00:00 2001 From: mychidarko Date: Mon, 4 Nov 2024 19:43:35 +0000 Subject: [PATCH] test: update failing test --- tests/rules.test.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/rules.test.php b/tests/rules.test.php index 63bb4f1..46a75c4 100644 --- a/tests/rules.test.php +++ b/tests/rules.test.php @@ -31,8 +31,14 @@ return $value === 'custom'; }); - expect(validator()->validateRule('anotherCustomRule', 'custom'))->toBe(true); - expect(validator()->validateRule('anotherCustomRule', 'not custom'))->toBe(false); + $data = [ + 'item1' => 'custom', + 'item2' => 'not custom', + ]; + + expect(validator()->validate($data, ['item1' => 'anotherCustomRule']))->toBe($data); + expect(validator()->validate($data, ['item2' => 'anotherCustomRule']))->toBe(false); + expect(validator()->errors())->toHaveKey('item2'); }); test('can add custom validation rules with closure and custom message', function () {