Skip to content

Commit

Permalink
Do not echo stuff, these are unit tests.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/DB_NestedSet/trunk@321982 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Daniel Convissor committed Jan 10, 2012
1 parent a98854c commit 1e099a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
10 changes: 6 additions & 4 deletions tests/DB/NestedSet/TestCase.php
Expand Up @@ -108,14 +108,14 @@ function _moveTree__Across($branches, $mvt, $nodecount) {
if ($p['id'] != $mnode['parent']) {
// <DEBUG>
// <DEBUG>
echo "\n<pre>\n";
// echo "\n<pre>\n";
print_r($p);
echo "\n</pre>\n";
// echo "\n</pre>\n";
// </DEBUG>
// <DEBUG>
echo "\n<pre>\n";
// echo "\n<pre>\n";
print_r($mnode);
echo "\n</pre>\n";
// echo "\n</pre>\n";
// </DEBUG>
// </DEBUG>
}
Expand Down Expand Up @@ -518,6 +518,8 @@ function _traverseChildRelations($relationTree, $nid, $deep = false, $init = fal
}

function _indentTree($tree) {
return;

echo "\n";
foreach($tree AS $nid => $node) {
printf('%s %02d-%02d [%02d|%02d|%02d] | %s (%s)',
Expand Down
22 changes: 11 additions & 11 deletions tests/DB_NestedSet_APITest.php
Expand Up @@ -7,7 +7,7 @@ function test_sortMethods() {

// Rootnodes

echo "<code>";
// echo "<code>";
$values['STRNA'] = 'Skireisen';
$skireisen = $this->_NeSe->createRootNode($values, false, true);

Expand All @@ -34,55 +34,55 @@ function test_sortMethods() {
$meransen = $this->_NeSe->createSubNode($italien, $values);


echo "DEFAULT\n";
// echo "DEFAULT\n";
$this->_NeSe->setSortMode(NESE_SORT_LEVEL);
$allnodes_default = $this->_NeSe->getAllNodes(true);
$this->_indentTree($allnodes_default);

echo "BY NAME\n";
// echo "BY NAME\n";
$this->_NeSe->setSortMode(NESE_SORT_LEVEL);
$this->_NeSe->secondarySort = 'STRNA';
$allnodes_byname = $this->_NeSe->getAllNodes(true);
$this->_indentTree($allnodes_byname);

echo "PREORDER\n";
// echo "PREORDER\n";
$this->_NeSe->setSortMode(NESE_SORT_PREORDER);
$this->_NeSe->secondarySort = 'STREH';
$allnodes_preorder = $this->_NeSe->getAllNodes(true);
$this->_indentTree($allnodes_preorder);

echo "BY NAME PREORDER\n";
// echo "BY NAME PREORDER\n";
$this->_NeSe->setSortMode(NESE_SORT_PREORDER);
$this->_NeSe->secondarySort = 'STRNA';
$allnodes_byname_pre = $this->_NeSe->getAllNodes(true);
$this->_indentTree($allnodes_byname_pre);

echo "BY NAME PREORDER getSubBranch\n";
// echo "BY NAME PREORDER getSubBranch\n";
$this->_NeSe->setSortMode(NESE_SORT_PREORDER);
$this->_NeSe->secondarySort = 'STRNA';
$allnodes_preorder = $this->_NeSe->getSubBranch($oesterreich, true);
$this->_indentTree($allnodes_preorder);

echo "BY NAME PREORDER getSubBranch empty subbranch\n";
// echo "BY NAME PREORDER getSubBranch empty subbranch\n";
$this->_NeSe->setSortMode(NESE_SORT_PREORDER);
$this->_NeSe->secondarySort = 'STRNA';
$allnodes_preorder = $this->_NeSe->getSubBranch($grindelwald, true);
$this->_indentTree($allnodes_preorder);



echo "TRYING getBranch()\n";
// echo "TRYING getBranch()\n";
$atbranch = $this->_NeSe->getBranch($oesterreich, true);
$this->_indentTree($atbranch);

echo "TRYING getChildren()\n";
// echo "TRYING getChildren()\n";
$atbranch = $this->_NeSe->getChildren($oesterreich, true);
$this->_indentTree($atbranch);

echo "TRYING getSubBranch()\n";
// echo "TRYING getSubBranch()\n";
$atbranch = $this->_NeSe->getSubBranch($skireisen, true);
$this->_indentTree($atbranch);
echo "</code>";
// echo "</code>";
}

function test_convertModel() {
Expand Down

0 comments on commit 1e099a9

Please sign in to comment.