ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
NodeTest Class Reference

Tests for the (Base-)Node. More...

+ Inheritance diagram for NodeTest:
+ Collaboration diagram for NodeTest:

Public Member Functions

 testConstruction ()
 
 testDefaults (TestingNode $node)
 
 testWithExpanded (TestingNode $node)
 
 testWithHighlighted (TestingNode $node)
 
 testWithOnClick (TestingNode $node)
 
 testWithAppendOnClick (Clickable $node)
 
 testWithURI (Clickable $node)
 

Detailed Description

Tests for the (Base-)Node.

Definition at line 55 of file NodeTest.php.

Member Function Documentation

◆ testConstruction()

NodeTest::testConstruction ( )

Definition at line 57 of file NodeTest.php.

58 {
59 $node = new TestingNode("");
60 $this->assertInstanceOf("ILIAS\\UI\\Component\\Tree\\Node\\Node", $node);
61
62 return $node;
63 }
Dummy-implementation for testing.
Definition: NodeTest.php:34

◆ testDefaults()

NodeTest::testDefaults ( TestingNode  $node)

Definition at line 66 of file NodeTest.php.

66 : void
67 {
68 $this->assertFalse($node->isExpanded());
69 $this->assertFalse($node->isHighlighted());
70 $this->assertEquals([], $node->getSubnodes());
71 }

References ILIAS\UI\Implementation\Component\Tree\Node\Node\getSubnodes(), ILIAS\UI\Implementation\Component\Tree\Node\Node\isExpanded(), and ILIAS\UI\Implementation\Component\Tree\Node\Node\isHighlighted().

+ Here is the call graph for this function:

◆ testWithAppendOnClick()

NodeTest::testWithAppendOnClick ( Clickable  $node)

Definition at line 102 of file NodeTest.php.

102 : void
103 {
104 $sig_gen = new I\SignalGenerator();
105 $sig = $sig_gen->create();
106
107 $node = $node->appendOnClick($sig);
108 $check = $node->getTriggeredSignals()[1]->getSignal();
109 $this->assertEquals($sig, $check);
110 }
$check
Definition: buildRTE.php:81
appendOnClick(Signal $signal)
Get a component like this, triggering a signal of another component on click.
getTriggeredSignals()
Get all triggered signals of this component.

References $check, ILIAS\UI\Component\Clickable\appendOnClick(), and ILIAS\UI\Component\Triggerer\getTriggeredSignals().

+ Here is the call graph for this function:

◆ testWithExpanded()

NodeTest::testWithExpanded ( TestingNode  $node)

Definition at line 74 of file NodeTest.php.

74 : void
75 {
76 $this->assertTrue(
77 $node->withExpanded(true)->isExpanded()
78 );
79 }

References ILIAS\UI\Implementation\Component\Tree\Node\Node\withExpanded().

+ Here is the call graph for this function:

◆ testWithHighlighted()

NodeTest::testWithHighlighted ( TestingNode  $node)

Definition at line 82 of file NodeTest.php.

82 : void
83 {
84 $this->assertTrue(
85 $node->withHighlighted(true)->isHighlighted()
86 );
87 }
withHighlighted(bool $highlighted)
@inhertidoc
Definition: Node.php:101

References ILIAS\UI\Implementation\Component\Tree\Node\Node\withHighlighted().

+ Here is the call graph for this function:

◆ testWithOnClick()

NodeTest::testWithOnClick ( TestingNode  $node)

Definition at line 90 of file NodeTest.php.

90 : Clickable
91 {
92 $sig_gen = new I\SignalGenerator();
93 $sig = $sig_gen->create();
94
95 $node = $node->withOnClick($sig);
96 $check = $node->getTriggeredSignals()[0]->getSignal();
97 $this->assertEquals($sig, $check);
98 return $node;
99 }
withOnClick(Signal $signal)
@inhertidoc
Definition: Node.php:119

References $check, and ILIAS\UI\Implementation\Component\Tree\Node\Node\withOnClick().

+ Here is the call graph for this function:

◆ testWithURI()

NodeTest::testWithURI ( Clickable  $node)

Definition at line 113 of file NodeTest.php.

113 : void
114 {
115 $uri = new URI('http://google.de:8080');
116
117 $node = $node->withLink($uri);
118
119 $stringTransformation = new StringTransformation();
120
121 $this->assertEquals('http://google.de:8080', $stringTransformation->transform($node->getLink()));
122 }
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35

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