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 164 of file ilTreeTest.php.
References $d.
166 $tree =
new ilTree(ROOT_FOLDER_ID);
167 $d = $tree->getDepth(24);
169 $this->assertEquals(
$d,4);
171 $node = $tree->getNodeData(24);
172 $this->assertEquals($node[
'title'],
'Public chat');
174 $bool = $tree->isInTree(24);
175 $this->assertEquals($bool,
true);
177 $bool = $tree->isInTree(24242424);
178 $this->assertEquals($bool,
false);
185 $bool = $tree->isGrandChild(9,24);
186 $this->assertEquals($bool,1);
193 $bool = $tree->isDeleted(24);
194 $this->assertEquals($bool,
false);
196 $id = $tree->getParentId(24);
197 $this->assertEquals($id,14);
199 $lft = $tree->getLeftValue(24);
200 $this->assertEquals($lft,14);
202 $seq = $tree->getChildSequenceNumber($tree->getNodeData(24));
203 $this->assertEquals($seq,1);
205 $tree->getNodePath(9,1);
207 $max_depth = $tree->getMaximumDepth();
210 $tree =
new ilTree(ROOT_FOLDER_ID);
211 $suc = $tree->fetchSuccessorNode(16);
212 $cals = $tree->fetchPredecessorNode($suc[
'child']);
213 $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 140 of file ilTreeTest.php.
References $res.
142 $tree =
new ilTree(ROOT_FOLDER_ID);
143 $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 122 of file ilTreeTest.php.
126 $this->assertTrue(
false,
"Testcase leads to fatal error.");
128 $tree =
new ilTree(ROOT_FOLDER_ID);
129 $ids_ns = $tree->getPathIdsUsingNestedSets(24);
130 $ids_al = $tree->getPathIdsUsingAdjacencyMap(24);
132 $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.
103 $this->assertTrue(
false,
"Testcase leads to fatal error.");
105 $tree =
new ilTree(ROOT_FOLDER_ID);
106 $ids = $tree->getPathIdsUsingNestedSets(24,9);
108 $this->assertEquals($ids,array(9,14,24));
110 $tree =
new ilTree(ROOT_FOLDER_ID);
111 $ids = $tree->getPathIdsUsingNestedSets(24);
113 $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 152 of file ilTreeTest.php.
154 $tree =
new ilTree(ROOT_FOLDER_ID);
155 $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: