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$
needsInstalledILIAS
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 163 of file ilTreeTest.php.
References $d, $id, and $tree.
168 $this->assertEquals(
$d, 4);
170 $node =
$tree->getNodeData(24);
171 $this->assertEquals($node[
'title'],
'Public chat');
173 $bool =
$tree->isInTree(24);
174 $this->assertEquals($bool,
true);
176 $bool =
$tree->isInTree(24242424);
177 $this->assertEquals($bool,
false);
184 $bool =
$tree->isGrandChild(9, 24);
185 $this->assertEquals($bool, 1);
192 $bool =
$tree->isDeleted(24);
193 $this->assertEquals($bool,
false);
196 $this->assertEquals(
$id, 14);
198 $lft =
$tree->getLeftValue(24);
199 $this->assertEquals($lft, 14);
201 $seq =
$tree->getChildSequenceNumber(
$tree->getNodeData(24));
202 $this->assertEquals($seq, 1);
204 $tree->getNodePath(9, 1);
206 $max_depth =
$tree->getMaximumDepth();
210 $suc =
$tree->fetchSuccessorNode(16);
211 $cals =
$tree->fetchPredecessorNode($suc[
'child']);
212 $this->assertEquals($cals[
'child'], 16);
if(!array_key_exists('StateId', $_REQUEST)) $id
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
◆ testGetChild()
ilTreeTest::testGetChild |
( |
| ) |
|
Definition at line 43 of file ilTreeTest.php.
References $tree.
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.
References $tree.
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.
References $tree.
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 139 of file ilTreeTest.php.
References $res, and $tree.
foreach($_POST as $key=> $value) $res
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 121 of file ilTreeTest.php.
References $tree.
125 $this->assertTrue(
false,
"Testcase leads to fatal error.");
128 $ids_ns =
$tree->getPathIdsUsingNestedSets(24);
129 $ids_al =
$tree->getPathIdsUsingAdjacencyMap(24);
131 $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 98 of file ilTreeTest.php.
References $tree.
102 $this->assertTrue(
false,
"Testcase leads to fatal error.");
105 $ids =
$tree->getPathIdsUsingNestedSets(24, 9);
107 $this->assertEquals($ids, array(9,14,24));
110 $ids =
$tree->getPathIdsUsingNestedSets(24);
112 $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.
References $root, and $tree.
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 151 of file ilTreeTest.php.
References $tree.
154 $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: