5 require_once(
"libs/composer/vendor/autoload.php");
6 require_once(__DIR__ .
"../../../Base.php");
8 use \ILIAS\UI\Component as
C;
9 use \ILIAS\UI\Implementation\Component as
I;
30 public function getChildren($record, $environment = null) : array
32 return $record->getChildren();
39 ) :
C\Tree\Node\Node {
40 return $factory->simple($record->getLabel());
51 $factory =
new class extends NoUIFactory {
52 public function tree()
54 return new I\Tree\Factory();
64 $n1 =
new DataNode(
'1', [$n11, $n12]);
70 $f = $this->getUIFactory();
71 $this->tree =
$f->tree()->expandable(
$label, $recursion)
77 $html = str_replace([
"\n",
"\r",
"\t"],
"", $html);
78 $html = preg_replace(
'# {2,}#',
" ", $html);
84 $r = $this->getDefaultRenderer();
85 $html = $r->render($this->tree);
87 $expected =
'<ul id="id_1" class="il-tree" role="tree" aria-label="label">' . $this->getInnerTreePart() .
'</ul>';
90 $this->brutallyTrimHTML($expected),
91 $this->brutallyTrimHTML($html)
97 $r = $this->getDefaultRenderer();
98 $html = $r->render($this->tree->withIsSubTree(
true));
100 $expected = $this->getInnerTreePart();
103 $this->brutallyTrimHTML($expected),
104 $this->brutallyTrimHTML($html)
110 return '<li id="" class="il-tree-node node-simple expandable" role="treeitem" aria-expanded="false"> 111 <span class="node-line"><span class="node-label">1</span></span> 114 <li id="" class="il-tree-node node-simple" role="treeitem"> 115 <span class="node-line"><span class="node-label">1.1</span></span> 117 <li id="" class="il-tree-node node-simple expandable" role="treeitem" aria-expanded="false"> 118 <span class="node-line"><span class="node-label">1.2</span></span> 121 <li id="" class="il-tree-node node-simple" role="treeitem"> 122 <span class="node-line"><span class="node-label">1.2.1</span></span> 128 <li id="" class="il-tree-node node-simple" role="treeitem"> 129 <span class="node-line"><span class="node-label">2</span></span>
Provides common functionality for UI tests.
getChildren($record, $environment=null)
__construct(string $label, array $children=[])
Tests for the Expandable Tree.
build(C\Tree\Node\Factory $factory, $record, $environment=null)