Changeset 88 for trunk/tests
- Timestamp:
- Apr 8, 2006 5:41:22 AM (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/HierarchyTest.php
r86 r88 4 4 5 5 /** 6 * PHPUnit test case for NodeHeirarchy6 * PHPUnit test case for Hierarchy 7 7 * 8 8 * The method skeletons below need to be filled in with … … 13 13 */ 14 14 require_once 'PHPUnit.php'; 15 class NodeHeirarchyTest extends PHPUnit_TestCase {15 class HierarchyTest extends PHPUnit_TestCase { 16 16 17 var $ NodeHeirarchy;17 var $Hierarchy; 18 18 19 function NodeHeirarchyTest($name)19 function HierarchyTest($name) 20 20 { 21 21 $this->PHPUnit_TestCase($name); … … 25 25 { 26 26 require dirname(__FILE__) . '/_config.inc.php'; 27 require_once '../lib/ NodeHeirarchy.inc.php';28 $this-> NodeHeirarchy =& new NodeHeirarchy(PARAM);27 require_once '../lib/Hierarchy.inc.php'; 28 $this->Hierarchy =& new Hierarchy(PARAM); 29 29 } 30 30 31 31 function tearDown() 32 32 { 33 unset($this-> NodeHeirarchy);33 unset($this->Hierarchy); 34 34 } 35 35 36 36 function test_currentnode() 37 37 { 38 $result = $this-> NodeHeirarchy->currentnode(PARAM);38 $result = $this->Hierarchy->currentnode(PARAM); 39 39 $expected = EXPECTED_VAL; 40 40 $this->assertEquals($expected, $result); … … 43 43 function test_tostringid() 44 44 { 45 $result = $this-> NodeHeirarchy->tostringid(PARAM);45 $result = $this->Hierarchy->tostringid(PARAM); 46 46 $expected = EXPECTED_VAL; 47 47 $this->assertEquals($expected, $result); … … 50 50 function test_toarrayid() 51 51 { 52 $result = $this-> NodeHeirarchy->toarrayid(PARAM);52 $result = $this->Hierarchy->toarrayid(PARAM); 53 53 $expected = EXPECTED_VAL; 54 54 $this->assertEquals($expected, $result); … … 57 57 function test_insertnode() 58 58 { 59 $result = $this-> NodeHeirarchy->insertnode(PARAM);59 $result = $this->Hierarchy->insertnode(PARAM); 60 60 $expected = EXPECTED_VAL; 61 61 $this->assertEquals($expected, $result); … … 64 64 function test_deletenode() 65 65 { 66 $result = $this-> NodeHeirarchy->deletenode(PARAM);66 $result = $this->Hierarchy->deletenode(PARAM); 67 67 $expected = EXPECTED_VAL; 68 68 $this->assertEquals($expected, $result); … … 71 71 function test_movenode() 72 72 { 73 $result = $this-> NodeHeirarchy->movenode(PARAM);73 $result = $this->Hierarchy->movenode(PARAM); 74 74 $expected = EXPECTED_VAL; 75 75 $this->assertEquals($expected, $result); … … 78 78 function test_getparents() 79 79 { 80 $result = $this-> NodeHeirarchy->getparents(PARAM);80 $result = $this->Hierarchy->getparents(PARAM); 81 81 $expected = EXPECTED_VAL; 82 82 $this->assertEquals($expected, $result); … … 85 85 function test_getnode() 86 86 { 87 $result = $this-> NodeHeirarchy->getnode(PARAM);87 $result = $this->Hierarchy->getnode(PARAM); 88 88 $expected = EXPECTED_VAL; 89 89 $this->assertEquals($expected, $result); … … 92 92 function test_getchildren() 93 93 { 94 $result = $this-> NodeHeirarchy->getchildren(PARAM);94 $result = $this->Hierarchy->getchildren(PARAM); 95 95 $expected = EXPECTED_VAL; 96 96 $this->assertEquals($expected, $result); … … 99 99 function test_getnumberchildren() 100 100 { 101 $result = $this-> NodeHeirarchy->getnumberchildren(PARAM);101 $result = $this->Hierarchy->getnumberchildren(PARAM); 102 102 $expected = EXPECTED_VAL; 103 103 $this->assertEquals($expected, $result); … … 106 106 function test_isleaf() 107 107 { 108 $result = $this-> NodeHeirarchy->isleaf(PARAM);108 $result = $this->Hierarchy->isleaf(PARAM); 109 109 $expected = EXPECTED_VAL; 110 110 $this->assertEquals($expected, $result); … … 113 113 function test_isancestor() 114 114 { 115 $result = $this-> NodeHeirarchy->isancestor(PARAM);115 $result = $this->Hierarchy->isancestor(PARAM); 116 116 $expected = EXPECTED_VAL; 117 117 $this->assertEquals($expected, $result); … … 120 120 function test_getallancestors() 121 121 { 122 $result = $this-> NodeHeirarchy->getallancestors(PARAM);122 $result = $this->Hierarchy->getallancestors(PARAM); 123 123 $expected = EXPECTED_VAL; 124 124 $this->assertEquals($expected, $result); … … 127 127 function test_nodeexists() 128 128 { 129 $result = $this-> NodeHeirarchy->nodeexists(PARAM);129 $result = $this->Hierarchy->nodeexists(PARAM); 130 130 $expected = EXPECTED_VAL; 131 131 $this->assertEquals($expected, $result); … … 134 134 function test_getnodelist() 135 135 { 136 $result = $this-> NodeHeirarchy->getnodelist(PARAM);136 $result = $this->Hierarchy->getnodelist(PARAM); 137 137 $expected = EXPECTED_VAL; 138 138 $this->assertEquals($expected, $result); … … 141 141 function test_rebuildsubnodeqty() 142 142 { 143 $result = $this-> NodeHeirarchy->rebuildsubnodeqty(PARAM);143 $result = $this->Hierarchy->rebuildsubnodeqty(PARAM); 144 144 $expected = EXPECTED_VAL; 145 145 $this->assertEquals($expected, $result); … … 148 148 function test_setsubnodeqtytoparents() 149 149 { 150 $result = $this-> NodeHeirarchy->setsubnodeqtytoparents(PARAM);150 $result = $this->Hierarchy->setsubnodeqtytoparents(PARAM); 151 151 $expected = EXPECTED_VAL; 152 152 $this->assertEquals($expected, $result); … … 155 155 } 156 156 // Running the test. 157 $suite = new PHPUnit_TestSuite(' NodeHeirarchyTest');157 $suite = new PHPUnit_TestSuite('HierarchyTest'); 158 158 $result = PHPUnit::run($suite); 159 159 echo $result->toString();
Note: See TracChangeset
for help on using the changeset viewer.