mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixes #957: Json::encode() doesn't handle empty object correctly.
This commit is contained in:
@ -45,6 +45,10 @@ class JsonTest extends TestCase
|
||||
'b' => new JsExpression($expression2),
|
||||
);
|
||||
$this->assertSame("{\"a\":[1,$expression1],\"b\":$expression2}", Json::encode($data));
|
||||
|
||||
// https://github.com/yiisoft/yii2/issues/957
|
||||
$data = (object)null;
|
||||
$this->assertSame('{}', Json::encode($data));
|
||||
}
|
||||
|
||||
public function testDecode()
|
||||
|
Reference in New Issue
Block a user