Explorar o código

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

hiszpek %!s(int64=3) %!d(string=hai) anos
pai
achega
ab6a9b1e9a
Modificáronse 1 ficheiros con 16 adicións e 0 borrados
  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>.",
+            ]
+        ];
     }
 }