Added test to disprove #4992. Closes #4992.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7265 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
joelmoss 2008-06-26 14:12:48 +00:00
parent a4c05ecba8
commit 65281500b3

View file

@ -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);