ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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.

57  : TestingNode
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:33

◆ testDefaults()

NodeTest::testDefaults ( TestingNode  $node)

Definition at line 66 of file NodeTest.php.

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().

66  : void
67  {
68  $this->assertFalse($node->isExpanded());
69  $this->assertFalse($node->isHighlighted());
70  $this->assertEquals([], $node->getSubnodes());
71  }
+ Here is the call graph for this function:

◆ testWithAppendOnClick()

NodeTest::testWithAppendOnClick ( Clickable  $node)

Definition at line 102 of file NodeTest.php.

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

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  }
getTriggeredSignals()
Get all triggered signals of this component.
$check
Definition: buildRTE.php:81
appendOnClick(Signal $signal)
Get a component like this, triggering a signal of another component on click.
+ Here is the call graph for this function:

◆ testWithExpanded()

NodeTest::testWithExpanded ( TestingNode  $node)

Definition at line 74 of file NodeTest.php.

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

74  : void
75  {
76  $this->assertTrue(
77  $node->withExpanded(true)->isExpanded()
78  );
79  }
+ Here is the call graph for this function:

◆ testWithHighlighted()

NodeTest::testWithHighlighted ( TestingNode  $node)

Definition at line 82 of file NodeTest.php.

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

82  : void
83  {
84  $this->assertTrue(
85  $node->withHighlighted(true)->isHighlighted()
86  );
87  }
+ Here is the call graph for this function:

◆ testWithOnClick()

NodeTest::testWithOnClick ( TestingNode  $node)

Definition at line 90 of file NodeTest.php.

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

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  }
$check
Definition: buildRTE.php:81
+ 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 documentation for this class was generated from the following file: