Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding testcase for ticket #219

  • Loading branch information...
commit a429287c1956788cf95759654d2b96a0febc0712 1 parent d3e0ddb
@TehTreag TehTreag authored markstory committed
Showing with 39 additions and 1 deletion.
  1. +39 −1 cake/tests/cases/libs/controller/controller.test.php
View
40 cake/tests/cases/libs/controller/controller.test.php
@@ -696,6 +696,44 @@ function testPaginateExtraParams() {
}
/**
+ * testPaginateFieldsDouble method
+ *
+ * @return void
+ * @access public
+ */
+ function testPaginateFieldsDouble(){
+ $Controller =& new Controller();
+ $Controller->uses = array('ControllerPost');
+ $Controller->params['url'] = array();
+ $Controller->constructClasses();
+
+ $Controller->paginate = array(
+ 'fields' => array(
+ 'ControllerPost.id',
+ '1.2 as floatvalue'
+ ),
+ 'order' => array('ControllerPost.created'=>'DESC'),
+ 'limit' => 1,
+ 'page' => 1,
+ 'recursive' => -1
+ );
+ $conditions = array();
+ $result = $Controller->paginate('ControllerPost',$conditions);
+ $expected = array(
+ 0=>array(
+ 'ControllerPost'=>array(
+ 'id'=>3,
+ ),
+ 0=>array(
+ 'floatvalue'=>1.2,
+ ),
+ ),
+ );
+ $this->assertEqual($result, $expected);
+ }
+
+
+/**
* testPaginatePassedArgs method
*
* @return void
@@ -1453,4 +1491,4 @@ function testShutdownProcess() {
$MockedController->MockTest->expectCallCount('shutdown', 1);
$MockedController->shutdownProcess();
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.