mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
adding test case for #4043
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6499 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
0b4e8e63ac
commit
2918b68877
1 changed files with 19 additions and 1 deletions
|
@ -79,7 +79,7 @@ class NumberTreeCase extends CakeTestCase {
|
|||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
|
||||
function testInitialize() {
|
||||
$this->NumberTree = & new NumberTree();
|
||||
$this->NumberTree->__initialize(2, 2);
|
||||
|
@ -617,6 +617,24 @@ class NumberTreeCase extends CakeTestCase {
|
|||
$this->assertIdentical($result, $expected);
|
||||
}
|
||||
|
||||
function testMoveToRootAndMoveUp(){
|
||||
$this->NumberTree = & new NumberTree();
|
||||
$this->NumberTree->__initialize(1, 1);
|
||||
$data = $this->NumberTree->find(array('NumberTree.name' => '1.1'), array('id'));
|
||||
$this->NumberTree->id = $data['NumberTree']['id'];
|
||||
$this->NumberTree->save(array('parent_id' => null));
|
||||
|
||||
$result = $this->NumberTree->verify();
|
||||
$this->assertIdentical($result, true);
|
||||
|
||||
$this->NumberTree->moveup();
|
||||
|
||||
$result = $this->NumberTree->findAll(null, array('name'), 'NumberTree.lft ASC');
|
||||
$expected = array(array('NumberTree' => array('name' => '1.1')),
|
||||
array('NumberTree' => array('name' => '1. Root')));
|
||||
$this->assertIdentical($result, $expected);
|
||||
}
|
||||
|
||||
function testDelete() {
|
||||
$this->NumberTree = & new NumberTree();
|
||||
$this->NumberTree->__initialize(2, 2);
|
||||
|
|
Loading…
Add table
Reference in a new issue