* Copyright 2001-2012 Strangecode, LLC * * This file is part of The Strangecode Codebase. * * The Strangecode Codebase is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your option) * any later version. * * The Strangecode Codebase is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * The Strangecode Codebase. If not, see . */ /** * PHPUnit test case for codebase/lib/Hierarchy.inc.php * * The method skeletons below need to be filled in with * real data so that the tests will run correctly. Replace * all EXPECTED_VAL and PARAM strings with real data. * * Created with PHPUnit_Skeleton on 2005-08-09 */ class HierarchyTest extends PHPUnit_Framework_TestCase { var $Hierarchy; function HierarchyTest($name) { $this->PHPUnit_Framework_TestCase($name); } function setUp() { require dirname(__FILE__) . '/_config.inc.php'; require_once '../lib/Hierarchy.inc.php'; $this->Hierarchy =& new Hierarchy(PARAM); } function tearDown() { unset($this->Hierarchy); } function test_currentnode() { $result = $this->Hierarchy->currentnode(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_tostringid() { $result = $this->Hierarchy->tostringid(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_toarrayid() { $result = $this->Hierarchy->toarrayid(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_insertnode() { $result = $this->Hierarchy->insertnode(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_deletenode() { $result = $this->Hierarchy->deletenode(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_movenode() { $result = $this->Hierarchy->movenode(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_getparents() { $result = $this->Hierarchy->getparents(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_getnode() { $result = $this->Hierarchy->getnode(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_getchildren() { $result = $this->Hierarchy->getchildren(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_getnumberchildren() { $result = $this->Hierarchy->getnumberchildren(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_isleaf() { $result = $this->Hierarchy->isleaf(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_isancestor() { $result = $this->Hierarchy->isancestor(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_getallancestors() { $result = $this->Hierarchy->getallancestors(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_nodeexists() { $result = $this->Hierarchy->nodeexists(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_getnodelist() { $result = $this->Hierarchy->getnodelist(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_rebuildsubnodeqty() { $result = $this->Hierarchy->rebuildsubnodeqty(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } function test_setsubnodeqtytoparents() { $result = $this->Hierarchy->setsubnodeqtytoparents(PARAM); $expected = EXPECTED_VAL; $this->assertEquals($expected, $result); } }