mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
"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:
parent
c8172ed96a
commit
3b2e24d6ef
1 changed files with 31 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue