Skip to content

Commit 56fa534

Browse files
authored
State mismatch Json test case
1 parent d7bc121 commit 56fa534

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/system/EntityTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,20 @@ public function testCastAsJSONControlCharCheck()
504504

505505
$method($string, true);
506506
}
507+
508+
public function testCastAsJSONStateMismatch()
509+
{
510+
$entity = new Entity();
511+
512+
$method = $this->getPrivateMethodInvoker($entity,'castAsJson');
513+
514+
$this->expectException(CastException::class);
515+
$this->expectExceptionMessage('Underflow or the modes mismatch');
516+
517+
$string = '[{"name":"jack","product_id":"1234"]';
518+
519+
$method($string, true);
520+
}
507521
//--------------------------------------------------------------------
508522

509523
public function testAsArray()

0 commit comments

Comments
 (0)