Skip to content

Commit

Permalink
Adding additional tests for object() encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jul 11, 2009
1 parent 69de129 commit 4d4bc90
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cake/tests/cases/libs/view/helpers/js.test.php
Expand Up @@ -413,9 +413,17 @@ function testObjectAgainstJsonEncode() {

$data['mystring'] = "a \"double-quoted\" string";
$this->assertEqual(json_encode($data), $this->JsEngine->object($data));

$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()
Expand Down

0 comments on commit 4d4bc90

Please sign in to comment.