mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing whitespacing.
This commit is contained in:
parent
959befb6e1
commit
ab21855efd
1 changed files with 17 additions and 17 deletions
|
@ -4095,7 +4095,7 @@ class DboSourceTest extends CakeTestCase {
|
||||||
'this_moment' => 'NOW()',
|
'this_moment' => 'NOW()',
|
||||||
'two' => '1 + 1',
|
'two' => '1 + 1',
|
||||||
'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'
|
||||||
);
|
);
|
||||||
$result = $this->db->fields($Article);
|
$result = $this->db->fields($Article);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
@ -4112,7 +4112,7 @@ class DboSourceTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$this->assertEqual($expected,$result);
|
$this->assertEqual($expected,$result);
|
||||||
|
|
||||||
$result = $this->db->fields($Article,null,array('this_moment','title'));
|
$result = $this->db->fields($Article, null, array('this_moment','title'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'`Article`.`title`',
|
'`Article`.`title`',
|
||||||
'(NOW()) AS `Article__this_moment`',
|
'(NOW()) AS `Article__this_moment`',
|
||||||
|
@ -4133,27 +4133,27 @@ class DboSourceTest extends CakeTestCase {
|
||||||
'this_moment' => 'NOW()',
|
'this_moment' => 'NOW()',
|
||||||
'two' => '1 + 1',
|
'two' => '1 + 1',
|
||||||
'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('two' => 2);
|
$conditions = array('two' => 2);
|
||||||
$result = $this->db->conditions($conditions,true,false,$Article);
|
$result = $this->db->conditions($conditions,true,false,$Article);
|
||||||
$expected = '(1 + 1) = 2';
|
$expected = '(1 + 1) = 2';
|
||||||
$this->assertEqual($expected,$result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$conditions = array('this_moment BETWEEN ? AND ?' => array(1,2));
|
$conditions = array('this_moment BETWEEN ? AND ?' => array(1,2));
|
||||||
$expected = 'NOW() BETWEEN 1 AND 2';
|
$expected = 'NOW() BETWEEN 1 AND 2';
|
||||||
$result = $this->db->conditions($conditions,true,false,$Article);
|
$result = $this->db->conditions($conditions, true, false, $Article);
|
||||||
$this->assertEqual($expected,$result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$conditions = array('comment_count >' => 5);
|
$conditions = array('comment_count >' => 5);
|
||||||
$expected = '(SELECT COUNT(*) FROM comments WHERE `Article`.`id` = `comments`.`article_id`) > 5';
|
$expected = '(SELECT COUNT(*) FROM comments WHERE `Article`.`id` = `comments`.`article_id`) > 5';
|
||||||
$result = $this->db->conditions($conditions,true,false,$Article);
|
$result = $this->db->conditions($conditions, true, false, $Article);
|
||||||
$this->assertEqual($expected,$result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$conditions = array('NOT' => array('two' => 2));
|
$conditions = array('NOT' => array('two' => 2));
|
||||||
$result = $this->db->conditions($conditions,true,false,$Article);
|
$result = $this->db->conditions($conditions, true, false, $Article);
|
||||||
$expected = 'NOT ((1 + 1) = 2)';
|
$expected = 'NOT ((1 + 1) = 2)';
|
||||||
$this->assertEqual($expected,$result);
|
$this->assertEqual($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4169,10 +4169,10 @@ class DboSourceTest extends CakeTestCase {
|
||||||
'this_moment' => 'NOW()',
|
'this_moment' => 'NOW()',
|
||||||
'two' => '1 + 1',
|
'two' => '1 + 1',
|
||||||
);
|
);
|
||||||
$order = array('two','this_moment');
|
$order = array('two', 'this_moment');
|
||||||
$result = $this->db->order($order,'ASC',$Article);
|
$result = $this->db->order($order, 'ASC', $Article);
|
||||||
$expected = ' ORDER BY (1 + 1) ASC, (NOW()) ASC';
|
$expected = ' ORDER BY (1 + 1) ASC, (NOW()) ASC';
|
||||||
$this->assertEqual($expected,$result);
|
$this->assertEqual($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4191,13 +4191,13 @@ class DboSourceTest extends CakeTestCase {
|
||||||
' WHERE Article.id = ' . $this->db->fullTableName('comments'). '.article_id'
|
' WHERE Article.id = ' . $this->db->fullTableName('comments'). '.article_id'
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $this->db->calculate($Article,'count',array('this_moment'));
|
$result = $this->db->calculate($Article, 'count', array('this_moment'));
|
||||||
$expected = 'COUNT(NOW()) AS `count`';
|
$expected = 'COUNT(NOW()) AS `count`';
|
||||||
$this->assertEqual($expected,$result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $this->db->calculate($Article,'max',array('comment_count'));
|
$result = $this->db->calculate($Article, 'max', array('comment_count'));
|
||||||
$expected = 'MAX(SELECT COUNT(*) FROM comments WHERE `Article`.`id` = `comments`.`article_id`) AS `comment_count`';
|
$expected = 'MAX(SELECT COUNT(*) FROM comments WHERE `Article`.`id` = `comments`.`article_id`) AS `comment_count`';
|
||||||
$this->assertEqual($expected,$result);
|
$this->assertEqual($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue