Tests for the SimpleNode.
More...
Tests for the SimpleNode.
Definition at line 18 of file BylineNodeTest.php.
◆ setUp()
BylineNodeTest::setUp |
( |
| ) |
|
Reimplemented from ILIAS_UI_TestBase.
Definition at line 30 of file BylineNodeTest.php.
30 : void
31 {
32 $this->node_factory = new I\Tree\Node\Factory();
33 $icon_factory = new I\Symbol\Icon\Factory();
34 $this->icon = $icon_factory->standard("", '');
35 }
◆ testCreateBylineNode()
BylineNodeTest::testCreateBylineNode |
( |
| ) |
|
Definition at line 37 of file BylineNodeTest.php.
38 {
39 $node = $this->node_factory->bylined('My Label', 'This is my byline', $this->icon);
40 $this->assertEquals('My Label', $node->getLabel());
41 $this->assertEquals('This is my byline', $node->getByline());
42 $this->assertEquals($this->icon, $node->getIcon());
43 }
◆ testRendering()
BylineNodeTest::testRendering |
( |
| ) |
|
Definition at line 45 of file BylineNodeTest.php.
46 {
47 $node = $this->node_factory->bylined('My Label', 'This is my byline');
48
50 $html = $r->render($node);
51
52 $expected = <<<EOT
53 <li id="" class="il-tree-node node-simple" role="treeitem">
54 <span class="node-line">
55 <span class="node-label">My Label</span>
56 <span class="node-byline">This is my byline</span>
57 </span>
58 </li>
59EOT;
60
61 $this->assertEquals(
64 );
65 }
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
References ILIAS_UI_TestBase\brutallyTrimHTML(), and ILIAS_UI_TestBase\getDefaultRenderer().
◆ testRenderingExpanded()
BylineNodeTest::testRenderingExpanded |
( |
| ) |
|
Definition at line 119 of file BylineNodeTest.php.
120 {
121 $node = $this->node_factory->bylined('My Label', 'This is my byline');
122 $node = $node->withAsyncURL('something.de')->withExpanded(true);
123
125 $html = $r->render($node);
126
127 $expected = <<<EOT
128 <li id=""
129 class="il-tree-node node-simple expandable"
130 role="treeitem" aria-expanded="true"
131 data-async_url="something.de" data-async_loaded="false">
132 <span class="node-line">
133 <span class="node-label">My Label</span>
134 <span class="node-byline">This is my byline</span>
135 </span>
136 <ul role="group"></ul>
137 </li>
138EOT;
139
140 $this->assertEquals(
143 );
144 }
References ILIAS_UI_TestBase\brutallyTrimHTML(), and ILIAS_UI_TestBase\getDefaultRenderer().
◆ testRenderingWithAsync()
BylineNodeTest::testRenderingWithAsync |
( |
| ) |
|
Definition at line 92 of file BylineNodeTest.php.
93 {
94 $node = $this->node_factory->bylined('My Label', 'This is my byline');
95 $node = $node->withAsyncURL('something.de');
96
98 $html = $r->render($node);
99
100 $expected = <<<EOT
101 <li id=""
102 class="il-tree-node node-simple expandable"
103 role="treeitem" aria-expanded="false"
104 data-async_url="something.de" data-async_loaded="false">
105 <span class="node-line">
106 <span class="node-label">My Label</span>
107 <span class="node-byline">This is my byline</span>
108 </span>
109 <ul role="group"></ul>
110 </li>
111EOT;
112
113 $this->assertEquals(
116 );
117 }
References ILIAS_UI_TestBase\brutallyTrimHTML(), and ILIAS_UI_TestBase\getDefaultRenderer().
◆ testRenderingWithIcon()
BylineNodeTest::testRenderingWithIcon |
( |
| ) |
|
Definition at line 67 of file BylineNodeTest.php.
68 {
69 $node = $this->node_factory->bylined('My Label', 'This is my byline', $this->icon);
70
72 $html = $r->render($node);
73
74 $expected = <<<EOT
75 <li id="" class="il-tree-node node-simple" role="treeitem">
76 <span class="node-line">
77 <span class="node-label">
78 <img class="icon small" src="./templates/default/images/icon_default.svg" alt=""/>
79 My Label
80 </span>
81 <span class="node-byline">This is my byline</span>
82 </span>
83 </li>
84EOT;
85
86 $this->assertEquals(
89 );
90 }
References ILIAS_UI_TestBase\brutallyTrimHTML(), and ILIAS_UI_TestBase\getDefaultRenderer().
◆ $icon
◆ $node_factory
BylineNodeTest::$node_factory |
|
private |
The documentation for this class was generated from the following file: