diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidationValidatorTest.php index f86123de3a70..aee3f9842100 100755 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidationValidatorTest.php @@ -19,6 +19,7 @@ use Illuminate\Support\Arr; use Illuminate\Support\Carbon; use Illuminate\Support\Exceptions\MathException; +use Illuminate\Support\Stringable; use Illuminate\Translation\ArrayLoader; use Illuminate\Translation\Translator; use Illuminate\Validation\DatabasePresenceVerifierInterface; @@ -2817,6 +2818,14 @@ public function testValidateJson() $trans = $this->getIlluminateArrayTranslator(); $v = new Validator($trans, ['foo' => ['array']], ['foo' => 'json']); $this->assertFalse($v->passes()); + + $trans = $this->getIlluminateArrayTranslator(); + $v = new Validator($trans, ['foo' => null], ['foo' => 'json']); + $this->assertFalse($v->passes()); + + $trans = $this->getIlluminateArrayTranslator(); + $v = new Validator($trans, ['foo' => new Stringable('[]')], ['foo' => 'json']); + $this->assertTrue($v->passes()); } public function testValidateBoolean()