Skip to content

Commit

Permalink
Added tests to disprove TreeBehavior can generate warning. Closes #5975.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8007 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
renan committed Jan 21, 2009
1 parent b5d7f18 commit dcf1c1e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cake/tests/cases/libs/model/behaviors/tree.test.php
Expand Up @@ -338,6 +338,25 @@ function testAddInvalid() {
$validTree = $this->Tree->verify();
$this->assertIdentical($validTree, true);
}
/**
* testAddNotIndexedByModel method
*
* @access public
* @return void
*/
function testAddNotIndexedByModel() {
extract($this->settings);
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);

$this->Tree->save(array('name' => 'testAddNotIndexed', $parentField => null));
$result = $this->Tree->find(null, array('name', $parentField), $modelClass . '.' . $leftField . ' desc');
$expected = array($modelClass => array('name' => 'testAddNotIndexed', $parentField => null));
$this->assertEqual($result, $expected);

$validTree = $this->Tree->verify();
$this->assertIdentical($validTree, true);
}
/**
* testMovePromote method
*
Expand Down

0 comments on commit dcf1c1e

Please sign in to comment.