mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Adding test for field parsing
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4951 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
01ce8392a4
commit
9451c58377
1 changed files with 4 additions and 0 deletions
|
@ -1475,6 +1475,10 @@ class DboSourceTest extends UnitTestCase {
|
|||
}
|
||||
|
||||
function testFieldParsing() {
|
||||
$result = $this->db->fields($this->model, 'Vendor', "`Vendor`.`id`, COUNT(`Model`.`vendor_id`) as `Vendor`.`count`");
|
||||
$expected = array('`Vendor`.`id`', 'COUNT(`Model`.`vendor_id`) as `Vendor`.`count`');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $this->db->fields($this->model, 'Post', "CONCAT(REPEAT(' ', COUNT(Parent.name) - 1), Node.name) AS name, Node.created");
|
||||
$expected = array("CONCAT(REPEAT(' ', COUNT(`Parent`.`name`) - 1), Node.name) AS name", "`Node`.`created`");
|
||||
$this->assertEqual($result, $expected);
|
||||
|
|
Loading…
Add table
Reference in a new issue