mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
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:
parent
c2c17f9b90
commit
363ff0c9ab
1 changed files with 9 additions and 0 deletions
|
@ -700,6 +700,15 @@ class DboSourceTest extends UnitTestCase {
|
||||||
$expected = array("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);
|
$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");
|
$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");
|
$expected = array("`Node`.`created`", "CONCAT(REPEAT(' ', COUNT(`Parent`.`name`) - 1), Node.name) AS name");
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
Loading…
Add table
Reference in a new issue