Browse Source

Add tests for fixing body parameters with accepted and accepted_if validation rules

hiszpek 3 năm trước cách đây
mục cha
commit
ab6a9b1e9a
1 tập tin đã thay đổi với 16 bổ sung0 xóa
  1. 16 0
      tests/Unit/ValidationRuleParsingTest.php

+ 16 - 0
tests/Unit/ValidationRuleParsingTest.php

@@ -367,5 +367,21 @@ class ValidationRuleParsingTest extends BaseLaravelTest
             [],
             ['description' => "Must be a file. Must not be greater than 6 kilobytes."],
         ];
+        yield 'accepted' => [
+            ['accepted_param' => 'accepted'],
+            [],
+            [
+                'type' => 'boolean',
+                '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>.",
+            ]
+        ];
     }
 }