We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bc65ee commit 86ecc5cCopy full SHA for 86ecc5c
tests/validation.test.php
@@ -60,3 +60,12 @@
60
expect($validatedData)->toBe(false);
61
expect(Form::errors())->toHaveKey('test5');
62
});
63
+
64
+test('optional rule works correctly no matter it\'s position', function () {
65
+ $itemsToValidate = [];
66
67
+ $validatedData = Form::validate($itemsToValidate, ['test6' => 'text|email|optional']);
68
69
+ expect($validatedData)->toBe($itemsToValidate);
70
+ expect(Form::errors())->not()->toHaveKey('test6');
71
+});
0 commit comments