ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
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 29 of file KSDocumentationTreeRecursionTest.php.

Member Function Documentation

◆ setUp()

KSDocumentationTreeRecursionTest::setUp ( )
protected

Definition at line 39 of file KSDocumentationTreeRecursionTest.php.

39 : void
40 {
41 $this->ui_helper = new UITestHelper();
42
43 $this->entries_data = include './components/ILIAS/UI/tests/Crawler/Fixture/EntriesFixture.php';
44 $this->entries = new Entries();
45 $this->entries->addEntriesFromArray($this->entries_data);
46 $this->test_uri = new URI('http://ilias.de');
47 $this->tree_recursion = new KSDocumentationTreeRecursion($this->entries, $this->test_uri, '');
48 }
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 64 of file KSDocumentationTreeRecursionTest.php.

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

◆ testConstruct()

KSDocumentationTreeRecursionTest::testConstruct ( )

Definition at line 50 of file KSDocumentationTreeRecursionTest.php.

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

◆ testGetChildren()

KSDocumentationTreeRecursionTest::testGetChildren ( )

Definition at line 55 of file KSDocumentationTreeRecursionTest.php.

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

◆ testIsNodeExpandedAfterActivatingEntry2()

KSDocumentationTreeRecursionTest::testIsNodeExpandedAfterActivatingEntry2 ( )

Definition at line 93 of file KSDocumentationTreeRecursionTest.php.

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

◆ testIsNodeExpandedByDefault()

KSDocumentationTreeRecursionTest::testIsNodeExpandedByDefault ( )

Definition at line 71 of file KSDocumentationTreeRecursionTest.php.

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

◆ testIsNodeHighlightedAfterActivatingEntry()

KSDocumentationTreeRecursionTest::testIsNodeHighlightedAfterActivatingEntry ( )

Definition at line 105 of file KSDocumentationTreeRecursionTest.php.

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

◆ testIsNodeHighlightedByDefault()

KSDocumentationTreeRecursionTest::testIsNodeHighlightedByDefault ( )

Definition at line 81 of file KSDocumentationTreeRecursionTest.php.

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

Field Documentation

◆ $entries

Entries KSDocumentationTreeRecursionTest::$entries
protected

Definition at line 33 of file KSDocumentationTreeRecursionTest.php.

◆ $entries_data

KSDocumentationTreeRecursionTest::$entries_data
protected

Definition at line 32 of file KSDocumentationTreeRecursionTest.php.

◆ $entry

Entry KSDocumentationTreeRecursionTest::$entry
protected

Definition at line 34 of file KSDocumentationTreeRecursionTest.php.

◆ $entry_data

array KSDocumentationTreeRecursionTest::$entry_data
protected

Definition at line 35 of file KSDocumentationTreeRecursionTest.php.

◆ $test_uri

URI KSDocumentationTreeRecursionTest::$test_uri
protected

Definition at line 36 of file KSDocumentationTreeRecursionTest.php.

◆ $tree_recursion

KSDocumentationTreeRecursion KSDocumentationTreeRecursionTest::$tree_recursion
protected

Definition at line 37 of file KSDocumentationTreeRecursionTest.php.

◆ $ui_helper

UITestHelper KSDocumentationTreeRecursionTest::$ui_helper
protected

Definition at line 31 of file KSDocumentationTreeRecursionTest.php.


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