Selaa lähdekoodia

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

hiszpek 3 vuotta sitten
vanhempi
commit
ab6a9b1e9a
1 muutettua tiedostoa jossa 16 lisäystä ja 0 poistoa
  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>.",
+            ]
+        ];
     }
 }