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:
AD7six 2008-08-18 18:34:01 +00:00
parent 582d8277fd
commit 01eec6b12e

View file

@ -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
*
@ -3316,7 +3326,7 @@ class DboSourceTest extends CakeTestCase {
$result = $this->testDb->buildColumn($data);
$expected = '`testName` DEFAULT NULL';
$this->assertEqual($result, $expected);
$data = array(
'name' => 'int_field',
'type' => 'integer',