File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 19
19
use Illuminate \Support \Arr ;
20
20
use Illuminate \Support \Carbon ;
21
21
use Illuminate \Support \Exceptions \MathException ;
22
+ use Illuminate \Support \Stringable ;
22
23
use Illuminate \Translation \ArrayLoader ;
23
24
use Illuminate \Translation \Translator ;
24
25
use Illuminate \Validation \DatabasePresenceVerifierInterface ;
@@ -2817,6 +2818,14 @@ public function testValidateJson()
2817
2818
$ trans = $ this ->getIlluminateArrayTranslator ();
2818
2819
$ v = new Validator ($ trans , ['foo ' => ['array ' ]], ['foo ' => 'json ' ]);
2819
2820
$ this ->assertFalse ($ v ->passes ());
2821
+
2822
+ $ trans = $ this ->getIlluminateArrayTranslator ();
2823
+ $ v = new Validator ($ trans , ['foo ' => null ], ['foo ' => 'json ' ]);
2824
+ $ this ->assertFalse ($ v ->passes ());
2825
+
2826
+ $ trans = $ this ->getIlluminateArrayTranslator ();
2827
+ $ v = new Validator ($ trans , ['foo ' => new Stringable ('[] ' )], ['foo ' => 'json ' ]);
2828
+ $ this ->assertTrue ($ v ->passes ());
2820
2829
}
2821
2830
2822
2831
public function testValidateBoolean ()
You can’t perform that action at this time.
0 commit comments