mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-10 05:22:41 +00:00
Reformatting code to use tabs.
Fixing issue with float comparison. Fixes #219
This commit is contained in:
parent
b8f0dda964
commit
4496a0a0bb
1 changed files with 29 additions and 29 deletions
|
@ -701,36 +701,36 @@ class ControllerTest extends CakeTestCase {
|
|||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testPaginateFieldsDouble(){
|
||||
$Controller =& new Controller();
|
||||
$Controller->uses = array('ControllerPost');
|
||||
$Controller->params['url'] = array();
|
||||
$Controller->constructClasses();
|
||||
function testPaginateFieldsDouble(){
|
||||
$Controller =& new Controller();
|
||||
$Controller->uses = array('ControllerPost');
|
||||
$Controller->params['url'] = array();
|
||||
$Controller->constructClasses();
|
||||
|
||||
$Controller->paginate = array(
|
||||
'fields' => array(
|
||||
'ControllerPost.id',
|
||||
'radians(180.0) 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'=>3.1415926545898,
|
||||
),
|
||||
),
|
||||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
$Controller->paginate = array(
|
||||
'fields' => array(
|
||||
'ControllerPost.id',
|
||||
'radians(180.0) as floatvalue'
|
||||
),
|
||||
'order' => array('ControllerPost.created'=>'DESC'),
|
||||
'limit' => 1,
|
||||
'page' => 1,
|
||||
'recursive' => -1
|
||||
);
|
||||
$conditions = array();
|
||||
$result = $Controller->paginate('ControllerPost',$conditions);
|
||||
$expected = array(
|
||||
array(
|
||||
'ControllerPost' => array(
|
||||
'id' => 3,
|
||||
),
|
||||
0 => array(
|
||||
'floatvalue' => '3.14159265358979',
|
||||
),
|
||||
),
|
||||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue