19 declare(strict_types=1);
    21 require_once(
"libs/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         $html = str_replace([
"\n", 
"\r", 
"\t"], 
"", $html);
    45         $html = preg_replace(
'# {2,}#', 
" ", $html);
    51         $node = $this->node_factory->simple(
'simple');
    52         $this->assertInstanceOf(
    53             "ILIAS\\UI\\Component\\Tree\\Node\\Simple",
    61         $this->expectException(ArgumentCountError::class);
    62         $this->node_factory->simple();
    67         $node = $this->node_factory->simple(
'label', $this->icon);
    68         $this->assertInstanceOf(
    69             "ILIAS\\UI\\Component\\Tree\\Node\\Simple",
    76         $this->icon->setLabel(
'Different Icon Label');
    77         $node = $this->node_factory->simple(
'label', $this->icon);
    78         $this->assertInstanceOf(
    79             "ILIAS\\UI\\Component\\Tree\\Node\\Simple",
    90         $this->assertNotEquals($this->icon->getLabel(), $node->getLabel());
    98         $this->assertEquals(
"label", $node->getLabel());
   106         $this->assertEquals($this->icon, $node->getIcon());
   115         $this->assertFalse($node->getAsyncLoading());
   123         $url = 
'something.de';
   124         $node = $node->withAsyncURL(
$url);
   125         $this->assertTrue($node->getAsyncLoading());
   126         $this->assertEquals(
$url, $node->getAsyncURL());
   136         $html = 
$r->render($node);
   139                         <li 
class=
"c-tree__node c-tree__node--simple" role=
"treeitem">
   140                                 <span 
class=
"c-tree__node__line">
   141                                         <span 
class=
"c-tree__node__label">
simple</span>
   158         $html = 
$r->render($node);
   162                                  class=
"c-tree__node c-tree__node--simple expandable"   163                                  role=
"treeitem" aria-expanded=
"false"   164                                  data-async_url=
"something.de" data-async_loaded=
"false">
   165                                 <span 
class=
"c-tree__node__line">
   166                                         <span 
class=
"c-tree__node__label">
simple</span>
   168                                 <ul role=
"group"></ul>
   184         $html = 
$r->render($node);
   187                         <li 
class=
"c-tree__node c-tree__node--simple" role=
"treeitem">
   188                                 <span 
class=
"c-tree__node__line">
   189                                         <span 
class=
"c-tree__node__label">
   190                                                 <img 
class=
"icon small" src=
"./templates/default/images/standard/icon_default.svg" alt=
""/>
   212         $html = 
$r->render($node);
   215                         <li 
class=
"c-tree__node c-tree__node--simple" role=
"treeitem">
   216                                 <span 
class=
"c-tree__node__line">
   217                                         <span 
class=
"c-tree__node__label">
   218                                                 <img 
class=
"icon small" src=
"./templates/default/images/standard/icon_default.svg" alt=
"Different Icon Label"/>
 testRendering(C\Tree\Node\Simple $node)
testConstruction 
 
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
testGetLabel(C\Tree\Node\Simple $node)
testConstructionWithIcon 
 
testConstructionWithIcon()
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
testConstructionWithIconAndDifferentLabels()
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
Tests for the SimpleNode. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
I Tree Node Factory $node_factory
 
testGetDifferentLabels(C\Tree\Node\Simple $node)
testConstructionWithIconAndDifferentLabels 
 
C Symbol Icon Standard $icon
 
testRenderingWithAsync(C\Tree\Node\Simple $node)
testWithAsyncURL 
 
Provides common functionality for UI tests. 
 
testWithAsyncURL(C\Tree\Node\Simple $node)
testConstruction 
 
testGetIcon(C\Tree\Node\Simple $node)
testConstructionWithIcon 
 
testDefaultAsyncLoading(C\Tree\Node\Simple $node)
testConstruction 
 
brutallyTrimHTML(string $html)
 
testRenderingWithIcon(C\Tree\Node\Simple $node)
testConstructionWithIcon 
 
testRenderingWithIconAndAltAttribute(C\Tree\Node\Simple $node)
This test is successfull if the icon label differs from the node label.