mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7265 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a4c05ecba8
commit
65281500b3
1 changed files with 12 additions and 0 deletions
|
@ -1079,6 +1079,14 @@ class ModelTest extends CakeTestCase {
|
|||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
}
|
||||
|
||||
function getTests()
|
||||
{
|
||||
$methods = array('testGenerateList');
|
||||
$methods = array_merge(array_merge(array('start', 'startCase'), $methods), array('endCase', 'end'));
|
||||
return $methods;
|
||||
}
|
||||
|
||||
/**
|
||||
* testGenerateList method
|
||||
*
|
||||
|
@ -1095,6 +1103,10 @@ class ModelTest extends CakeTestCase {
|
|||
$expected = array(1 => 'First Article', 2 => 'Second Article', 3 => 'Third Article');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $TestModel->find('list', array('order' => array('FIELD(Article.id, 3, 2) ASC', 'Article.title ASC')));
|
||||
$expected = array(1 => 'First Article', 3 => 'Third Article', 2 => 'Second Article');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = Set::combine($TestModel->find('all', array('order' => 'Article.title ASC', 'fields' => array('id', 'title'))), '{n}.Article.id', '{n}.Article.title');
|
||||
$expected = array(1 => 'First Article', 2 => 'Second Article', 3 => 'Third Article');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
|
Loading…
Add table
Reference in a new issue