From 94c129cf9e56b99edf9814d438dc5e59c3e2e273 Mon Sep 17 00:00:00 2001 From: "mariano.iglesias" Date: Sun, 11 May 2008 19:42:56 +0000 Subject: [PATCH] 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 --- cake/tests/cases/libs/view/helpers/javascript.test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/javascript.test.php b/cake/tests/cases/libs/view/helpers/javascript.test.php index b071d8faf..c9e5d0177 100644 --- a/cake/tests/cases/libs/view/helpers/javascript.test.php +++ b/cake/tests/cases/libs/view/helpers/javascript.test.php @@ -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')) {