浏览代码

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

hiszpek 3 年之前
父节点
当前提交
ab6a9b1e9a
共有 1 个文件被更改,包括 16 次插入0 次删除
  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>.",
+            ]
+        ];
     }
 }