mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding test to disprove Ticket #3506 (DboSource::order())
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6010 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a83cfa8489
commit
3c7d0e90ee
1 changed files with 16 additions and 0 deletions
|
@ -2051,6 +2051,22 @@ class DboSourceTest extends CakeTestCase {
|
|||
|
||||
$result = $this->db->order("Page.name = 'view' DESC");
|
||||
$this->assertPattern("/^\s*ORDER BY\s+`Page`\.`name`\s*=\s*'view'\s+DESC\s*$/", $result);
|
||||
|
||||
$result = $this->db->order("(Post.views)");
|
||||
$this->assertPattern("/^\s*ORDER BY\s+\(`Post`\.`views`\)\s+ASC\s*$/", $result);
|
||||
|
||||
$result = $this->db->order("(Post.views)*Post.views");
|
||||
$this->assertPattern("/^\s*ORDER BY\s+\(`Post`\.`views`\)\*`Post`\.`views`\s+ASC\s*$/", $result);
|
||||
|
||||
$result = $this->db->order("(Post.views) * Post.views");
|
||||
$this->assertPattern("/^\s*ORDER BY\s+\(`Post`\.`views`\) \* `Post`\.`views`\s+ASC\s*$/", $result);
|
||||
|
||||
$result = $this->db->order("(Model.field1 + Model.field2) * Model.field3");
|
||||
$this->assertPattern("/^\s*ORDER BY\s+\(`Model`\.`field1` \+ `Model`\.`field2`\) \* `Model`\.`field3`\s+ASC\s*$/", $result);
|
||||
|
||||
$result = $this->db->order("Model.name+0 ASC");
|
||||
$this->assertPattern("/^\s*ORDER BY\s+`Model`\.`name`\+0\s+ASC\s*$/", $result);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Reference in a new issue