ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
KSDocumentationTreeRecursionTest Class Reference
+ Inheritance diagram for KSDocumentationTreeRecursionTest:
+ Collaboration diagram for KSDocumentationTreeRecursionTest:

Public Member Functions

 testConstruct ()
 
 testGetChildren ()
 
 testBuild ()
 
 testIsNodeExpandedByDefault ()
 
 testIsNodeHighlightedByDefault ()
 
 testIsNodeExpandedAfterActivatingEntry2 ()
 
 testIsNodeHighlightedAfterActivatingEntry ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

UITestHelper $ui_helper
 
 $entries_data
 
Entries $entries
 
Entry $entry
 
array $entry_data
 
URI $test_uri
 
KSDocumentationTreeRecursion $tree_recursion
 

Detailed Description

Definition at line 30 of file KSDocumentationTreeRecursionTest.php.

Member Function Documentation

◆ setUp()

KSDocumentationTreeRecursionTest::setUp ( )
protected

Definition at line 40 of file KSDocumentationTreeRecursionTest.php.

40 : void
41 {
42 $this->ui_helper = new UITestHelper();
43
44 $this->entries_data = include './components/ILIAS/UI/tests/Crawler/Fixture/EntriesFixture.php';
45 $this->entries = new Entries();
46 $this->entries->addEntriesFromArray($this->entries_data);
47 $this->test_uri = new URI('http://ilias.de');
48 $this->tree_recursion = new KSDocumentationTreeRecursion($this->entries, $this->test_uri, '');
49 }
trait UITestHelper
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
Tree Recursion, putting Entries into a Tree.

References UITestHelper.

◆ testBuild()

KSDocumentationTreeRecursionTest::testBuild ( )

Definition at line 65 of file KSDocumentationTreeRecursionTest.php.

65 : void
66 {
67 $tree_factory = $this->ui_helper->factory()->tree()->node();
68 $built_node = $this->tree_recursion->build($tree_factory, $this->entries->getEntryById('Entry1'));
69 $this->assertInstanceOf('ILIAS\UI\Implementation\Component\Tree\Node\Simple', $built_node);
70 }

◆ testConstruct()

KSDocumentationTreeRecursionTest::testConstruct ( )

Definition at line 51 of file KSDocumentationTreeRecursionTest.php.

51 : void
52 {
53 $this->assertInstanceOf('KSDocumentationTreeRecursion', $this->tree_recursion);
54 }

◆ testGetChildren()

KSDocumentationTreeRecursionTest::testGetChildren ( )

Definition at line 56 of file KSDocumentationTreeRecursionTest.php.

56 : void
57 {
58 $this->assertEquals(
59 [$this->entries->getEntryById('Entry2')],
60 $this->tree_recursion->getChildren($this->entries->getEntryById('Entry1'))
61 );
62 $this->assertEquals([], $this->tree_recursion->getChildren($this->entries->getEntryById('Entry2')));
63 }

◆ testIsNodeExpandedAfterActivatingEntry2()

KSDocumentationTreeRecursionTest::testIsNodeExpandedAfterActivatingEntry2 ( )

Definition at line 94 of file KSDocumentationTreeRecursionTest.php.

94 : void
95 {
96 $this->tree_recursion = new KSDocumentationTreeRecursion($this->entries, $this->test_uri, 'Entry2');
97
98 $tree_factory = $this->ui_helper->factory()->tree()->node();
99 $built_root_node = $this->tree_recursion->build($tree_factory, $this->entries->getEntryById('Entry1'));
100 $built_child_node = $this->tree_recursion->build($tree_factory, $this->entries->getEntryById('Entry2'));
101
102 $this->assertEquals(true, $built_root_node->isExpanded());
103 $this->assertEquals(false, $built_child_node->isExpanded());
104 }

◆ testIsNodeExpandedByDefault()

KSDocumentationTreeRecursionTest::testIsNodeExpandedByDefault ( )

Definition at line 72 of file KSDocumentationTreeRecursionTest.php.

72 : void
73 {
74 $tree_factory = $this->ui_helper->factory()->tree()->node();
75 $built_root_node = $this->tree_recursion->build($tree_factory, $this->entries->getEntryById('Entry1'));
76 $built_child_node = $this->tree_recursion->build($tree_factory, $this->entries->getEntryById('Entry2'));
77
78 $this->assertEquals(true, $built_root_node->isExpanded());
79 $this->assertEquals(false, $built_child_node->isExpanded());
80 }

◆ testIsNodeHighlightedAfterActivatingEntry()

KSDocumentationTreeRecursionTest::testIsNodeHighlightedAfterActivatingEntry ( )

Definition at line 106 of file KSDocumentationTreeRecursionTest.php.

106 : void
107 {
108 $this->tree_recursion = new KSDocumentationTreeRecursion($this->entries, $this->test_uri, 'Entry2');
109
110 $tree_factory = $this->ui_helper->factory()->tree()->node();
111 $built_root_node = $this->tree_recursion->build($tree_factory, $this->entries->getEntryById('Entry1'));
112 $built_child_node = $this->tree_recursion->build($tree_factory, $this->entries->getEntryById('Entry2'));
113
114 $this->assertEquals(false, $built_root_node->isHighlighted());
115 $this->assertEquals(true, $built_child_node->isHighlighted());
116 }

◆ testIsNodeHighlightedByDefault()

KSDocumentationTreeRecursionTest::testIsNodeHighlightedByDefault ( )

Definition at line 82 of file KSDocumentationTreeRecursionTest.php.

82 : void
83 {
84 $this->tree_recursion = new KSDocumentationTreeRecursion($this->entries, $this->test_uri, 'Entry2');
85
86 $tree_factory = $this->ui_helper->factory()->tree()->node();
87 $built_root_node = $this->tree_recursion->build($tree_factory, $this->entries->getEntryById('Entry1'));
88 $built_child_node = $this->tree_recursion->build($tree_factory, $this->entries->getEntryById('Entry2'));
89
90 $this->assertEquals(false, $built_root_node->isHighlighted());
91 $this->assertEquals(true, $built_child_node->isHighlighted());
92 }

Field Documentation

◆ $entries

Entries KSDocumentationTreeRecursionTest::$entries
protected

Definition at line 34 of file KSDocumentationTreeRecursionTest.php.

◆ $entries_data

KSDocumentationTreeRecursionTest::$entries_data
protected

Definition at line 33 of file KSDocumentationTreeRecursionTest.php.

◆ $entry

Entry KSDocumentationTreeRecursionTest::$entry
protected

Definition at line 35 of file KSDocumentationTreeRecursionTest.php.

◆ $entry_data

array KSDocumentationTreeRecursionTest::$entry_data
protected

Definition at line 36 of file KSDocumentationTreeRecursionTest.php.

◆ $test_uri

URI KSDocumentationTreeRecursionTest::$test_uri
protected

Definition at line 37 of file KSDocumentationTreeRecursionTest.php.

◆ $tree_recursion

KSDocumentationTreeRecursion KSDocumentationTreeRecursionTest::$tree_recursion
protected

Definition at line 38 of file KSDocumentationTreeRecursionTest.php.

◆ $ui_helper

UITestHelper KSDocumentationTreeRecursionTest::$ui_helper
protected

Definition at line 32 of file KSDocumentationTreeRecursionTest.php.


The documentation for this class was generated from the following file: