mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing failing tests caused by merge with 1.3
This commit is contained in:
parent
055224ef68
commit
d9e51acf0a
3 changed files with 21 additions and 26 deletions
|
@ -715,7 +715,6 @@ class PaginatorComponentTest extends CakeTestCase {
|
|||
|
||||
$Controller->uses = array('PaginatorControllerPost', 'ControllerComment');
|
||||
$Controller->passedArgs[] = '1';
|
||||
$Controller->params['url'] = array();
|
||||
$Controller->constructClasses();
|
||||
|
||||
$Controller->request->params['named'] = array(
|
||||
|
@ -750,28 +749,27 @@ class PaginatorComponentTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testPaginateOrderVirtualFieldSharedWithRealField() {
|
||||
$Controller =& new Controller();
|
||||
$Controller->uses = array('ControllerPost', 'ControllerComment');
|
||||
$Controller->request->params['url'] = array();
|
||||
$Controller =& new Controller($this->request);
|
||||
$Controller->uses = array('PaginatorControllerPost', 'PaginatorControllerComment');
|
||||
$Controller->constructClasses();
|
||||
$Controller->ControllerComment->virtualFields = array(
|
||||
'title' => 'ControllerComment.comment'
|
||||
$Controller->PaginatorControllerComment->virtualFields = array(
|
||||
'title' => 'PaginatorControllerComment.comment'
|
||||
);
|
||||
$Controller->ControllerComment->bindModel(array(
|
||||
$Controller->PaginatorControllerComment->bindModel(array(
|
||||
'belongsTo' => array(
|
||||
'ControllerPost' => array(
|
||||
'className' => 'ControllerPost',
|
||||
'PaginatorControllerPost' => array(
|
||||
'className' => 'PaginatorControllerPost',
|
||||
'foreignKey' => 'article_id'
|
||||
)
|
||||
)
|
||||
), false);
|
||||
|
||||
$Controller->paginate = array(
|
||||
'fields' => array('ControllerComment.id', 'title', 'ControllerPost.title'),
|
||||
'fields' => array('PaginatorControllerComment.id', 'title', 'PaginatorControllerPost.title'),
|
||||
);
|
||||
$Controller->passedArgs = array('sort' => 'ControllerPost.title', 'dir' => 'asc');
|
||||
$result = $Controller->paginate('ControllerComment');
|
||||
$this->assertEqual(Set::extract($result, '{n}.ControllerComment.id'), array(1, 2, 3, 4, 5, 6));
|
||||
$Controller->passedArgs = array('sort' => 'PaginatorControllerPost.title', 'dir' => 'asc');
|
||||
$result = $Controller->paginate('PaginatorControllerComment');
|
||||
$this->assertEqual(Set::extract($result, '{n}.PaginatorControllerComment.id'), array(1, 2, 3, 4, 5, 6));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -149,29 +149,26 @@ class MysqlTest extends CakeTestCase {
|
|||
$restore = setlocale(LC_ALL, null);
|
||||
setlocale(LC_ALL, 'de_DE');
|
||||
|
||||
$result = $this->Dbo->value(3.141593, 'float');
|
||||
$this->assertTrue(strpos((string)$result, ',') === false);
|
||||
|
||||
$result = $this->Dbo->value(3.141593);
|
||||
$this->assertTrue(strpos((string)$result, ',') === false);
|
||||
$this->assertEquals('3.141593', $result);
|
||||
|
||||
$result = $this->db->value(3.141593);
|
||||
$this->assertEqual('3.141593', $result);
|
||||
$result = $this->db->value(3.141593, 'float');
|
||||
$this->assertEquals('3.141593', $result);
|
||||
|
||||
$result = $this->db->value(1234567.11, 'float');
|
||||
$this->assertEqual('1234567.11', $result);
|
||||
$this->assertEquals('1234567.11', $result);
|
||||
|
||||
$result = $this->db->value(123456.45464748, 'float');
|
||||
$this->assertEqual('123456.454647', $result);
|
||||
$this->assertEquals('123456.454647', $result);
|
||||
|
||||
$result = $this->db->value(0.987654321, 'float');
|
||||
$this->assertEqual('0.987654321', (string)$result);
|
||||
$this->assertEquals('0.987654321', (string)$result);
|
||||
|
||||
$result = $this->db->value(2.2E-54, 'float');
|
||||
$this->assertEqual('2.2E-54', (string)$result);
|
||||
$this->assertEquals('2.2E-54', (string)$result);
|
||||
|
||||
$result = $this->db->value(2.2E-54);
|
||||
$this->assertEqual('2.2E-54', (string)$result);
|
||||
$this->assertEquals('2.2E-54', (string)$result);
|
||||
|
||||
setlocale(LC_ALL, $restore);
|
||||
}
|
||||
|
|
|
@ -347,10 +347,10 @@ class PostgresTest extends CakeTestCase {
|
|||
setlocale(LC_ALL, 'de_DE');
|
||||
|
||||
$result = $this->db->value(3.141593, 'float');
|
||||
$this->assertEqual((string)$result, "3.14159");
|
||||
$this->assertEquals($result, "3.141593");
|
||||
|
||||
$result = $this->db->value(3.14);
|
||||
$this->assertEqual((string)$result, "3.140000");
|
||||
$this->assertEquals($result, "3.140000");
|
||||
|
||||
setlocale(LC_ALL, $restore);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue