Adding testcase for ticket #219

This commit is contained in:
C. James Callaway 2010-07-15 09:31:20 -05:00 committed by mark_story
parent d3e0ddbb0e
commit a429287c19

View file

@ -695,6 +695,44 @@ class ControllerTest extends CakeTestCase {
$this->assertEqual($Controller->ControllerPaginateModel->extraCount, $expected);
}
/**
* 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
*
@ -1453,4 +1491,4 @@ class ControllerTest extends CakeTestCase {
$MockedController->MockTest->expectCallCount('shutdown', 1);
$MockedController->shutdownProcess();
}
}
}