mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
adding test case for complex, calculated, sort expression
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7474 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
582d8277fd
commit
01eec6b12e
1 changed files with 11 additions and 1 deletions
|
@ -3183,6 +3183,16 @@ class DboSourceTest extends CakeTestCase {
|
|||
$expected = ' ORDER BY `Anuncio`.`destaque` & 2 DESC';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
/**
|
||||
* testComplexSortExpression method
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testComplexSortExpression() {
|
||||
$result = $this->testDb->order(array('(Model.field > 100) DESC', 'Model.field ASC'));
|
||||
$this->assertPattern("/^\s*ORDER BY\s+\(`Model`\.`field`\s+>\s+100\)\s+DESC,\s+`Model`\.`field`\s+ASC\s*$/", $result);
|
||||
}
|
||||
/**
|
||||
* testCalculations method
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue