mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Adding testcase for ticket #219
This commit is contained in:
parent
d3e0ddbb0e
commit
a429287c19
1 changed files with 39 additions and 1 deletions
|
@ -695,6 +695,44 @@ class ControllerTest extends CakeTestCase {
|
||||||
$this->assertEqual($Controller->ControllerPaginateModel->extraCount, $expected);
|
$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
|
* testPaginatePassedArgs method
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue