"Adding test cases from #3810"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6343 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2008-01-09 01:04:14 +00:00
parent c8172ed96a
commit 3b2e24d6ef

View file

@ -2665,6 +2665,37 @@ class ModelTest extends CakeTestCase {
)
);
$this->assertEqual($result, $expected);
$result = $this->model->findAllThreaded(null, null, 'id DESC');
$expected = array(
array(
'Category' => array('id' => 5, 'parent_id' => 0, 'name' => 'Category 3', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'),
'children' => array(
array(
'Category' => array('id' => 6, 'parent_id' => 5, 'name' => 'Category 3.1', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'),
'children' => array()
)
)
),
array(
'Category' => array('id' => 4, 'parent_id' => 0, 'name' => 'Category 2', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'),
'children' => array()
),
array(
'Category' => array('id' => 1, 'parent_id' => 0, 'name' => 'Category 1', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'),
'children' => array(
array(
'Category' => array('id' => 3, 'parent_id' => 1, 'name' => 'Category 1.2', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'),
'children' => array()
),
array(
'Category' => array('id' => 2, 'parent_id' => 1, 'name' => 'Category 1.1', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'),
'children' => array()
)
)
)
);
$this->assertEqual($result, $expected);
}
function testFindNeighbours() {