mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Updating test in JavascriptTest so float precision is taken into account
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6808 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
98cf0f47f5
commit
94c129cf9e
1 changed files with 2 additions and 2 deletions
|
@ -237,11 +237,11 @@ class JavascriptTest extends UnitTestCase {
|
|||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->Javascript->object(array('Object' => array(true, false, 1, '02101', 0, -1, 3.141592653589, "1")));
|
||||
$expected = '{"Object":[true,false,1,"02101",0,-1,3.14159265359,"1"]}';
|
||||
$expected = '{"Object":[true,false,1,"02101",0,-1,' . sprintf("%.11f", 3.141592653589) . ',"1"]}';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->Javascript->object(array('Object' => array(true => true, false, -3.141592653589, -10)));
|
||||
$expected = '{"Object":{"1":true,"2":false,"3":-3.14159265359,"4":-10}}';
|
||||
$expected = '{"Object":{"1":true,"2":false,"3":' . sprintf("%.11f", -3.141592653589) . ',"4":-10}}';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
if (function_exists('json_encode')) {
|
||||
|
|
Loading…
Add table
Reference in a new issue