Skip to content
Permalink
Browse files

Fixing failing tests caused by merge with 1.3

  • Loading branch information...
markstory committed Oct 7, 2011
1 parent 055224e commit d9e51acf0a77469fa9c9d9be48f7f805675cb01d
@@ -715,7 +715,6 @@ public function testPaginateMaxLimit() {
$Controller->uses = array('PaginatorControllerPost', 'ControllerComment');
$Controller->passedArgs[] = '1';
$Controller->params['url'] = array();
$Controller->constructClasses();
$Controller->request->params['named'] = array(
@@ -750,28 +749,27 @@ public function testPaginateMaxLimit() {
* @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 @@ public function testLocalizedFloats() {
$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 @@ public function testLocalizedFloats() {
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);
}

0 comments on commit d9e51ac

Please sign in to comment.
You can’t perform that action at this time.