Adding 1.2 regression test for escaping fields for Ticket #1372

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4638 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-03-21 05:24:03 +00:00
parent c2c17f9b90
commit 363ff0c9ab

View file

@ -700,6 +700,15 @@ class DboSourceTest extends UnitTestCase {
$expected = array("CONCAT(REPEAT(' ', COUNT(`Parent`.`name`) - 1), Node.name) AS name", "`Node`.`created`");
$this->assertEqual($result, $expected);
$result = $this->db->fields($this->model, null, 'round( (3.55441 * fooField), 3 ) AS test');
$this->assertEqual($result, array('round( (3.55441 * fooField), 3 ) AS test'));
$result = $this->db->fields($this->model, null, 'ROUND(`Rating`.`rate_total` / `Rating`.`rate_count`,2) AS rating');
$this->assertEqual($result, array('ROUND(`Rating`.`rate_total` / `Rating`.`rate_count`,2) AS rating'));
$result = $this->db->fields($this->model, null, 'ROUND(Rating.rate_total / Rating.rate_count,2) AS rating');
$this->assertEqual($result, array('ROUND(Rating.rate_total / Rating.rate_count,2) AS rating'));
$result = $this->db->fields($this->model, 'Post', "Node.created, CONCAT(REPEAT(' ', COUNT(Parent.name) - 1), Node.name) AS name");
$expected = array("`Node`.`created`", "CONCAT(REPEAT(' ', COUNT(`Parent`.`name`) - 1), Node.name) AS name");
$this->assertEqual($result, $expected);