Unit tests for tree table.
More...
Unit tests for tree table.
- Author
- Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
- Version
- $Id$
Definition at line 33 of file ilTreeTest.php.
◆ setUp()
Definition at line 37 of file ilTreeTest.php.
39 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
40 ilUnitUtil::performInitialisation();
◆ testAllOthers()
ilTreeTest::testAllOthers |
( |
| ) |
|
get path ids (adjacenca and nested set) IL_Init
- Parameters
-
Definition at line 157 of file ilTreeTest.php.
References $d.
159 $tree =
new ilTree(ROOT_FOLDER_ID);
160 $d = $tree->getDepth(24);
162 $this->assertEquals(
$d,4);
164 $node = $tree->getNodeData(24);
165 $this->assertEquals($node[
'title'],
'Public chat');
167 $bool = $tree->isInTree(24);
168 $this->assertEquals($bool,
true);
170 $bool = $tree->isInTree(24242424);
171 $this->assertEquals($bool,
false);
178 $bool = $tree->isGrandChild(9,24);
179 $this->assertEquals($bool,1);
186 $bool = $tree->isDeleted(24);
187 $this->assertEquals($bool,
false);
189 $id = $tree->getParentId(24);
190 $this->assertEquals($id,14);
192 $lft = $tree->getLeftValue(24);
193 $this->assertEquals($lft,14);
195 $seq = $tree->getChildSequenceNumber($tree->getNodeData(24));
196 $this->assertEquals($seq,1);
198 $tree->getNodePath(9,1);
200 $max_depth = $tree->getMaximumDepth();
203 $tree =
new ilTree(ROOT_FOLDER_ID);
204 $suc = $tree->fetchSuccessorNode(16);
205 $cals = $tree->fetchPredecessorNode($suc[
'child']);
206 $this->assertEquals($cals[
'child'],16);
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
◆ testGetChild()
ilTreeTest::testGetChild |
( |
| ) |
|
Definition at line 43 of file ilTreeTest.php.
45 $tree =
new ilTree(ROOT_FOLDER_ID);
46 $childs = $tree->getChilds(14);
48 $this->assertEquals(count($childs),1);
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
◆ testGetChildsByType()
ilTreeTest::testGetChildsByType |
( |
| ) |
|
|
static |
get childs by type IL_Init
Definition at line 56 of file ilTreeTest.php.
58 $tree =
new ilTree(ROOT_FOLDER_ID);
59 $childs = $tree->getChildsByType(9,
'cals');
61 $this->assertEquals(count($childs),1);
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
◆ testGetChildsByTypeFilter()
ilTreeTest::testGetChildsByTypeFilter |
( |
| ) |
|
|
static |
get childs by type filter IL_Init
Definition at line 69 of file ilTreeTest.php.
71 $tree =
new ilTree(ROOT_FOLDER_ID);
72 $childs = $tree->getChildsByTypeFilter(9,array(
'cals',
'rolf'));
74 $this->assertEquals(count($childs),2);
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
◆ testGetNodePath()
ilTreeTest::testGetNodePath |
( |
| ) |
|
IL_Init
- Parameters
-
Definition at line 133 of file ilTreeTest.php.
References $res.
135 $tree =
new ilTree(ROOT_FOLDER_ID);
136 $res = $tree->getNodePath(1,29);
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
◆ testGetPathIds()
ilTreeTest::testGetPathIds |
( |
| ) |
|
get path ids (adjacenca and nested set) IL_Init
- Parameters
-
Definition at line 119 of file ilTreeTest.php.
121 $tree =
new ilTree(ROOT_FOLDER_ID);
122 $ids_ns = $tree->getPathIdsUsingNestedSets(24);
123 $ids_al = $tree->getPathIdsUsingAdjacencyMap(24);
125 $this->assertEquals($ids_ns,$ids_al);
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
◆ testGetPathIdsUsingNestedSet()
ilTreeTest::testGetPathIdsUsingNestedSet |
( |
| ) |
|
get path ids using nested set IL_Init
- Parameters
-
Definition at line 99 of file ilTreeTest.php.
101 $tree =
new ilTree(ROOT_FOLDER_ID);
102 $ids = $tree->getPathIdsUsingNestedSets(24,9);
104 $this->assertEquals($ids,array(9,14,24));
106 $tree =
new ilTree(ROOT_FOLDER_ID);
107 $ids = $tree->getPathIdsUsingNestedSets(24);
109 $this->assertEquals($ids,array(1,9,14,24));
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
◆ testGetSubTree()
ilTreeTest::testGetSubTree |
( |
| ) |
|
|
static |
get childs by type filter IL_Init
Definition at line 82 of file ilTreeTest.php.
84 $tree =
new ilTree(ROOT_FOLDER_ID);
86 $root = $tree->getNodeData(1);
87 $childs = $tree->getSubTree($root,
false,
'cals');
89 $this->assertEquals(count($childs),1);
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
◆ testMaxDepth()
ilTreeTest::testMaxDepth |
( |
| ) |
|
get path ids (adjacenca and nested set) IL_Init
- Parameters
-
Definition at line 145 of file ilTreeTest.php.
147 $tree =
new ilTree(ROOT_FOLDER_ID);
148 $tree->getMaximumDepth();
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
◆ $backupGlobals
ilTreeTest::$backupGlobals = FALSE |
|
protected |
The documentation for this class was generated from the following file: