From 9451c58377908d833696e87dc2783856d5135a68 Mon Sep 17 00:00:00 2001 From: "mariano.iglesias" Date: Mon, 30 Apr 2007 13:24:13 +0000 Subject: [PATCH] Adding test for field parsing git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4951 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/libs/model/datasources/dbo_source.test.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index a506ebe08..6ee8b869d 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -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);