Skip to content
This repository
Browse code

Reformatting code to use tabs.

Fixing issue with float comparison.
Fixes #219
  • Loading branch information...
commit 4496a0a0bb82be02d27092cf1e429d3ab6d9a94b 1 parent b8f0dda
Mark Story authored October 24, 2010
60  cake/tests/cases/libs/controller/controller.test.php
@@ -701,36 +701,36 @@ function testPaginateExtraParams() {
701 701
  * @return void
702 702
  * @access public
703 703
  */
704  
-        function testPaginateFieldsDouble(){
705  
-                $Controller =& new Controller();
706  
-                $Controller->uses = array('ControllerPost');
707  
-                $Controller->params['url'] = array();
708  
-                $Controller->constructClasses();
709  
-
710  
-                $Controller->paginate = array(
711  
-                        'fields' => array(
712  
-                            'ControllerPost.id',
713  
-                            'radians(180.0) as floatvalue'
714  
-                            ),
715  
-                        'order' => array('ControllerPost.created'=>'DESC'),
716  
-                        'limit' => 1,
717  
-                        'page' => 1,
718  
-                        'recursive' => -1
719  
-                );
720  
-                $conditions = array();
721  
-                $result = $Controller->paginate('ControllerPost',$conditions);
722  
-                $expected = array(
723  
-                    0=>array(
724  
-                        'ControllerPost'=>array(
725  
-                            'id'=>3,
726  
-                            ),
727  
-                        0=>array(
728  
-                            'floatvalue'=>3.1415926545898,
729  
-                            ),
730  
-                        ),
731  
-                    );
732  
-                $this->assertEqual($result, $expected);
733  
-        }
  704
+	function testPaginateFieldsDouble(){
  705
+		$Controller =& new Controller();
  706
+		$Controller->uses = array('ControllerPost');
  707
+		$Controller->params['url'] = array();
  708
+		$Controller->constructClasses();
  709
+
  710
+		$Controller->paginate = array(
  711
+			'fields' => array(
  712
+				'ControllerPost.id',
  713
+				'radians(180.0) as floatvalue'
  714
+			),
  715
+			'order' => array('ControllerPost.created'=>'DESC'),
  716
+			'limit' => 1,
  717
+			'page' => 1,
  718
+			'recursive' => -1
  719
+		);
  720
+		$conditions = array();
  721
+		$result = $Controller->paginate('ControllerPost',$conditions);
  722
+		$expected = array(
  723
+			array(
  724
+				'ControllerPost' => array(
  725
+					'id' => 3,
  726
+				),
  727
+				0 => array(
  728
+					'floatvalue' => '3.14159265358979',
  729
+				),
  730
+			),
  731
+		);
  732
+		$this->assertEqual($result, $expected);
  733
+	}
734 734
 
735 735
 
736 736
 /**

0 notes on commit 4496a0a

Please sign in to comment.
Something went wrong with that request. Please try again.