Adding additional tests for object() encoding.

This commit is contained in:
mark_story 2009-07-11 17:36:48 -04:00
parent 69de1291e1
commit 4d4bc9040e

View file

@ -416,6 +416,14 @@ class JsBaseEngineTestCase extends CakeTestCase {
$data['mystring'] = 'a \\"double-quoted\\" string';
$this->assertEqual(json_encode($data), $this->JsEngine->object($data));
unset($data['mystring']);
$data[3] = array(1, 2, 3);
$this->assertEqual(json_encode($data), $this->JsEngine->object($data));
unset($data[3]);
$data = array('mystring' => null, 'bool' => false, 'array' => array(1, 44, 66));
$this->assertEqual(json_encode($data), $this->JsEngine->object($data));
}
/**
* test that JSON made with JsBaseEngineHelper::object() against json_decode()