From e2d9935a267b60055a48cb8b900865e132116084 Mon Sep 17 00:00:00 2001 From: "mariano.iglesias" Date: Mon, 30 Apr 2007 13:27:41 +0000 Subject: [PATCH] Added variation for a field parsing test git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4952 3807eeeb-6ff5-0310-8944-8be069107fe0 --- .../cases/libs/model/datasources/dbo_source.test.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 6ee8b869d..6e4ad6fdb 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -1475,8 +1475,12 @@ 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`'); + $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, '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");