File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -474,9 +474,21 @@ public function testCastAsJSONSyntaxError()
474474 $ this ->expectException (CastException::class);
475475 $ this ->expectExceptionMessage ('Syntax error, malformed JSON ' );
476476
477+ $ method ("{ this is bad string " , true );
478+ }
479+
480+ public function testCastAsJSONAnotherErrorDepth ()
481+ {
482+ $ entity = new Entity ();
483+
484+ $ method = $ this ->getPrivateMethodInvoker ($ entity ,'castAsJson ' );
477485
486+ $ this ->expectException (CastException::class);
487+ $ this ->expectExceptionMessage ('Maximum stack depth exceeded ' );
478488
479- $ method ("{ this is bad string " , true );
489+ $ string = '{ ' .str_repeat ('"test":{ ' , 513 ).'"test":"value" ' .str_repeat ('} ' , 513 ).'} ' ;
490+
491+ $ method ($ string , true );
480492 }
481493 //--------------------------------------------------------------------
482494
You can’t perform that action at this time.
0 commit comments