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 () {