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 1919use Illuminate \Support \Arr ;
2020use Illuminate \Support \Carbon ;
2121use Illuminate \Support \Exceptions \MathException ;
22+ use Illuminate \Support \Stringable ;
2223use Illuminate \Translation \ArrayLoader ;
2324use Illuminate \Translation \Translator ;
2425use Illuminate \Validation \DatabasePresenceVerifierInterface ;
@@ -2817,6 +2818,14 @@ public function testValidateJson()
28172818 $ trans = $ this ->getIlluminateArrayTranslator ();
28182819 $ v = new Validator ($ trans , ['foo ' => ['array ' ]], ['foo ' => 'json ' ]);
28192820 $ 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 ());
28202829 }
28212830
28222831 public function testValidateBoolean ()
You can’t perform that action at this time.
0 commit comments