We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cc03d34 commit d7bc121Copy full SHA for d7bc121
1 file changed
tests/system/EntityTest.php
@@ -490,6 +490,20 @@ public function testCastAsJSONAnotherErrorDepth()
490
491
$method($string, true);
492
}
493
+
494
+ public function testCastAsJSONControlCharCheck()
495
+ {
496
+ $entity = new Entity();
497
498
+ $method = $this->getPrivateMethodInvoker($entity,'castAsJson');
499
500
+ $this->expectException(CastException::class);
501
+ $this->expectExceptionMessage('Unexpected control character found');
502
503
+ $string = "{\n\t\"property1\": \"The quick brown fox\njumps over the lazy dog\",\n\t\"property2\":\"value2\"\n}";
504
505
+ $method($string, true);
506
+ }
507
//--------------------------------------------------------------------
508
509
public function testAsArray()
0 commit comments