19 declare(strict_types=1);
21 require_once(
"vendor/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"../../../../Base.php");
33 private C\Symbol\Icon\Standard
$icon;
37 $this->node_factory =
new I\Tree\Node\Factory();
38 $icon_factory =
new I\Symbol\Icon\Factory();
39 $this->icon = $icon_factory->standard(
"",
'');
44 $node = $this->node_factory->bylined(
'My Label',
'This is my byline', $this->icon);
45 $this->assertEquals(
'My Label', $node->getLabel());
46 $this->assertEquals(
'This is my byline', $node->getByline());
47 $this->assertEquals($this->icon, $node->getIcon());
52 $node = $this->node_factory->bylined(
'My Label',
'This is my byline');
54 $r = $this->getDefaultRenderer();
55 $html =
$r->render($node);
58 <li
class=
"c-tree__node c-tree__node--simple" role=
"treeitem">
59 <span
class=
"c-tree__node__line">
60 <span
class=
"c-tree__node__label">My Label</span>
61 <span
class=
"c-tree__node__byline">This is my byline</span>
67 $this->brutallyTrimHTML($expected),
68 $this->brutallyTrimHTML($html)
74 $node = $this->node_factory->bylined(
'My Label',
'This is my byline', $this->icon);
76 $r = $this->getDefaultRenderer();
77 $html =
$r->render($node);
80 <li
class=
"c-tree__node c-tree__node--simple" role=
"treeitem">
81 <span
class=
"c-tree__node__line">
82 <span
class=
"c-tree__node__label">
83 <img
class=
"icon small" src=
"./assets/images/standard/icon_default.svg" alt=
""/>
86 <span
class=
"c-tree__node__byline">This is my byline</span>
92 $this->brutallyTrimHTML($expected),
93 $this->brutallyTrimHTML($html)
99 $node = $this->node_factory->bylined(
'My Label',
'This is my byline');
100 $node = $node->withAsyncURL(
'something.de');
102 $r = $this->getDefaultRenderer();
103 $html =
$r->render($node);
106 <li
class=
"c-tree__node c-tree__node--simple expandable" 107 role=
"treeitem" aria-expanded=
"false" 108 data-async_url=
"something.de" data-async_loaded=
"false">
109 <span
class=
"c-tree__node__line">
110 <span
class=
"c-tree__node__label">My Label</span>
111 <span
class=
"c-tree__node__byline">This is my byline</span>
113 <ul role=
"group"></ul>
118 $this->brutallyTrimHTML($expected),
119 $this->brutallyTrimHTML($html)
125 $node = $this->node_factory->bylined(
'My Label',
'This is my byline');
126 $node = $node->withAsyncURL(
'something.de')->withExpanded(
true);
128 $r = $this->getDefaultRenderer();
129 $html =
$r->render($node);
132 <li
class=
"c-tree__node c-tree__node--simple expandable" 133 role=
"treeitem" aria-expanded=
"true" 134 data-async_url=
"something.de" data-async_loaded=
"false">
135 <span
class=
"c-tree__node__line">
136 <span
class=
"c-tree__node__label">My Label</span>
137 <span
class=
"c-tree__node__byline">This is my byline</span>
139 <ul role=
"group"></ul>
144 $this->brutallyTrimHTML($expected),
145 $this->brutallyTrimHTML($html)
I Tree Node Factory $node_factory
C Symbol Icon Standard $icon
Tests for the SimpleNode.