diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 46f30bdb7..f9bd4fb72 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -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',