Skip to content
Permalink
Browse files

Fixing incorrect optional parameters passed to TreeBehavior::children…

…() in TreeBehavior test case. Fixes errors & test failures when running under PHP 5.3.
  • Loading branch information...
jperras committed Sep 10, 2009
1 parent 115ae3f commit c48d9794f6dff2472bd7e9bad4011ece408620b4
Showing with 8 additions and 7 deletions.
  1. +8 −7 cake/tests/cases/libs/model/behaviors/tree.test.php
@@ -1128,12 +1128,12 @@ function testNoAmbiguousColumn() {
$data = $this->Tree->find(array($modelClass . '.name' => '1. Root'));
$this->Tree->id= $data[$modelClass]['id'];
$direct = $this->Tree->children(null, true, array('id', 'name', $parentField, $leftField, $rightField), null, null, null, 1);
$direct = $this->Tree->children(null, true, array('id', 'name', $parentField, $leftField, $rightField));
$expects = array(array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 7)),
array($modelClass => array('id' => 5, 'name' => '1.2', $parentField => 1, $leftField => 8, $rightField => 13)));
$this->assertEqual($direct, $expects);
$total = $this->Tree->children(null, null, array('id', 'name', $parentField, $leftField, $rightField), null, null, null, 1);
$total = $this->Tree->children(null, null, array('id', 'name', $parentField, $leftField, $rightField));
$expects = array(
array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 7)),
array($modelClass => array('id' => 3, 'name' => '1.1.1', $parentField => 2, $leftField => 3, $rightField => 4)),
@@ -1717,7 +1717,7 @@ function testChildren() {
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1. Root'));
$this->Tree->id= $data[$modelClass]['id'];
$this->Tree->id = $data[$modelClass]['id'];
$direct = $this->Tree->children(null, true, array('name', $leftField, $rightField));
$expects = array(array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 7)),
@@ -1742,19 +1742,20 @@ function testChildren() {
function testNoAmbiguousColumn() {
extract($this->settings);
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->bindModel(array('belongsTo' => array('Dummy' =>
array('className' => $modelClass, 'foreignKey' => $parentField, 'conditions' => array('Dummy.id' => null)))), false);
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1. Root'));
$this->Tree->id= $data[$modelClass]['id'];
$this->Tree->id = $data[$modelClass]['id'];
$direct = $this->Tree->children(null, true, array('name', $leftField, $rightField), null, null, null, 1);
$direct = $this->Tree->children(null, true, array('name', $leftField, $rightField));
$expects = array(array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 7)),
array($modelClass => array('name' => '1.2', $leftField => 8, $rightField => 13)));
$this->assertEqual($direct, $expects);
$total = $this->Tree->children(null, null, array('name', $leftField, $rightField), null, null, null, 1);
$total = $this->Tree->children(null, null, array('name', $leftField, $rightField));
$expects = array(
array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 7)),
array($modelClass => array('name' => '1.1.1', $leftField => 3, $rightField => 4)),

0 comments on commit c48d979

Please sign in to comment.
You can’t perform that action at this time.