Clear json_last_error
This commit is contained in:
parent
ef91f710e3
commit
6d6a3af4ff
@ -107,6 +107,9 @@ class JsonResponse extends Response
|
||||
});
|
||||
|
||||
try {
|
||||
// Clear json_last_error()
|
||||
json_encode(null);
|
||||
|
||||
$this->data = json_encode($data, $this->encodingOptions);
|
||||
|
||||
restore_error_handler();
|
||||
|
@ -203,8 +203,9 @@ class JsonResponseTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_Error_Warning
|
||||
* @expectedExceptionMessage This error is expected
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Failed calling Symfony\Component\HttpFoundation\Tests\JsonSerializableObject::jsonSerialize()
|
||||
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php#114688
|
||||
*/
|
||||
public function testSetContentJsonSerializeError()
|
||||
{
|
||||
|
Reference in New Issue
Block a user