mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
More whitespace fixes.
This commit is contained in:
parent
ab21855efd
commit
18c878b3f5
1 changed files with 5 additions and 5 deletions
|
@ -4206,22 +4206,22 @@ class DboSourceTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testVirtualFieldsFetch() {
|
function testVirtualFieldsFetch() {
|
||||||
$this->loadFixtures('Article','Comment');
|
$this->loadFixtures('Article', 'Comment');
|
||||||
|
|
||||||
$Article =& ClassRegistry::init('Article');
|
$Article =& ClassRegistry::init('Article');
|
||||||
$Article->virtualFields = array(
|
$Article->virtualFields = array(
|
||||||
'comment_count' => 'SELECT COUNT(*) FROM ' . $this->db->fullTableName('comments') .
|
'comment_count' => 'SELECT COUNT(*) FROM ' . $this->db->fullTableName('comments') .
|
||||||
' WHERE Article.id = ' . $this->db->fullTableName('comments'). '.article_id'
|
' WHERE Article.id = ' . $this->db->fullTableName('comments') . '.article_id'
|
||||||
);
|
);
|
||||||
|
|
||||||
$conditions = array('comment_count >' => 2);
|
$conditions = array('comment_count >' => 2);
|
||||||
$query = 'SELECT ' . join(',',$this->db->fields($Article,null,array('id','comment_count'))) .
|
$query = 'SELECT ' . join(',',$this->db->fields($Article, null, array('id', 'comment_count'))) .
|
||||||
' FROM ' . $this->db->fullTableName($Article) . ' Article ' . $this->db->conditions($conditions,true,true,$Article);
|
' FROM ' . $this->db->fullTableName($Article) . ' Article ' . $this->db->conditions($conditions, true, true, $Article);
|
||||||
$result = $this->db->fetchAll($query);
|
$result = $this->db->fetchAll($query);
|
||||||
$expected = array(array(
|
$expected = array(array(
|
||||||
'Article' => array('id' => 1, 'comment_count' => 4)
|
'Article' => array('id' => 1, 'comment_count' => 4)
|
||||||
));
|
));
|
||||||
$this->assertEqual($expected,$result);
|
$this->assertEqual($expected, $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Loading…
Reference in a new issue