This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning
Definition at line 34 of file LSControlBuilderTest.php.
◆ setUp()
| LSControlBuilderTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 40 of file LSControlBuilderTest.php.
40 : void
41 {
42 $ui_factory = $this->mockUIFactory();
43 $lang = $this->mockIlLanguage();
44
45 $data_factory = new DataFactory();
46 $uri = $data_factory->uri('https://ilias.de/somepath');
49 $uri = $data_factory->uri('http://ilias.de/some/other/path');
51
53 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
References $lang, and ILIAS\LTI\ToolProvider\$settings.
◆ testConstruction()
| LSControlBuilderTest::testConstruction |
( |
| ) |
|
Definition at line 55 of file LSControlBuilderTest.php.
55 : void
56 {
57 $this->assertInstanceOf(ControlBuilder::class, $this->control_builder);
58 }
◆ testDone()
| LSControlBuilderTest::testDone |
( |
| ) |
|
Definition at line 159 of file LSControlBuilderTest.php.
159 : void
160 {
161 $cb = $this->control_builder->done('cmd', 1);
162 $this->assertInstanceOf(ControlBuilder::class, $cb);
163 $this->assertInstanceOf(
Button\Primary::class, $cb->getDoneControl());
164 }
◆ testExit()
| LSControlBuilderTest::testExit |
( |
| ) |
|
Definition at line 70 of file LSControlBuilderTest.php.
70 : void
71 {
72 $cb = $this->control_builder->exit('cmd');
73 $this->assertInstanceOf(ControlBuilder::class, $cb);
74 $this->assertInstanceOf(
Button\Bulky::class, $cb->getExitControl());
75 }
◆ testGeneric()
| LSControlBuilderTest::testGeneric |
( |
| ) |
|
Definition at line 143 of file LSControlBuilderTest.php.
143 : void
144 {
145 $cb = $this->control_builder->generic('label', 'cmd', 1);
146 $this->assertInstanceOf(ControlBuilder::class, $cb);
147 $this->assertInstanceOf(
Button\Standard::class, $cb->getControls()[0]);
148 }
◆ testInitialValues()
| LSControlBuilderTest::testInitialValues |
( |
| ) |
|
Definition at line 60 of file LSControlBuilderTest.php.
60 : void
61 {
62 $this->assertNull($this->control_builder->getExitControl());
63 $this->assertNull($this->control_builder->getNextControl());
64 $this->assertNull($this->control_builder->getPreviousControl());
65 $this->assertNull($this->control_builder->getDoneControl());
66 $this->assertEquals([], $this->control_builder->getControls());
67 $this->assertNull($this->control_builder->getToc());
68 }
◆ testLocator()
| LSControlBuilderTest::testLocator |
( |
| ) |
|
Definition at line 185 of file LSControlBuilderTest.php.
185 : void
186 {
187 $cb = $this->control_builder->locator('cmd');
188 $this->assertInstanceOf(LocatorBuilder::class, $cb);
189 }
◆ testMode()
| LSControlBuilderTest::testMode |
( |
| ) |
|
Definition at line 178 of file LSControlBuilderTest.php.
178 : void
179 {
180 $cb = $this->control_builder->mode('cmd', ['m1', 'm2']);
181 $this->assertInstanceOf(ControlBuilder::class, $cb);
182 $this->assertInstanceOf(ViewControl\Mode::class, $cb->getModeControls()[0]);
183 }
◆ testMultipleGeneric()
| LSControlBuilderTest::testMultipleGeneric |
( |
| ) |
|
Definition at line 150 of file LSControlBuilderTest.php.
150 : void
151 {
152 $cb = $this->control_builder
153 ->generic('label', 'cmd', 1)
154 ->generic('label', 'cmd', 2)
155 ->generic('label', 'cmd', 3);
156 $this->assertCount(3, $cb->getControls());
157 }
◆ testNavigationControls()
| LSControlBuilderTest::testNavigationControls |
( |
| ) |
|
Definition at line 90 of file LSControlBuilderTest.php.
90 : void
91 {
92 $cb = $this->control_builder
93 ->previous('cmd', -1)
94 ->next('cmd', 1);
95 $this->assertInstanceOf(ControlBuilder::class, $cb);
96 $this->assertInstanceOf(
Button\Standard::class, $cb->getPreviousControl());
97 $this->assertInstanceOf(
Button\Standard::class, $cb->getNextControl());
98 }
◆ testToC()
| LSControlBuilderTest::testToC |
( |
| ) |
|
Definition at line 124 of file LSControlBuilderTest.php.
124 : void
125 {
126 $toc = $this->control_builder->tableOfContent('cmd', 'rootnode');
127 $this->assertInstanceOf(TOCBuilder::class, $toc);
128 $this->assertEquals($toc, $this->control_builder->getToc());
129 }
◆ testUniqueDone()
| LSControlBuilderTest::testUniqueDone |
( |
| ) |
|
Definition at line 166 of file LSControlBuilderTest.php.
166 : void
167 {
168 try {
169 $this->control_builder
170 ->done('cmd', 1)
171 ->done('cmd', 1);
172 $this->assertFalse("This should not happen");
173 }
catch (LogicException
$e) {
174 $this->assertTrue(true);
175 }
176 }
References Vendor\Package\$e.
◆ testUniqueExit()
| LSControlBuilderTest::testUniqueExit |
( |
| ) |
|
Definition at line 77 of file LSControlBuilderTest.php.
77 : void
78 {
79 try {
80
81 $this->control_builder
82 ->exit('cmd')
83 ->exit('cmd');
84 $this->assertFalse("This should not happen");
85 }
catch (LogicException
$e) {
86 $this->assertTrue(true);
87 }
88 }
References Vendor\Package\$e.
◆ testUniqueLocator()
| LSControlBuilderTest::testUniqueLocator |
( |
| ) |
|
Definition at line 191 of file LSControlBuilderTest.php.
191 : void
192 {
193 try {
194 $this->control_builder->locator('cmd')
195 ->end();
196 $this->control_builder->locator('cmd');
197 $this->assertFalse("This should not happen");
198 }
catch (LogicException
$e) {
199 $this->assertTrue(true);
200 }
201 }
References Vendor\Package\$e.
◆ testUniqueNext()
| LSControlBuilderTest::testUniqueNext |
( |
| ) |
|
Definition at line 112 of file LSControlBuilderTest.php.
112 : void
113 {
114 try {
115 $this->control_builder
116 ->next('cmd', 1)
117 ->next('cmd', 1);
118 $this->assertFalse("This should not happen");
119 }
catch (LogicException
$e) {
120 $this->assertTrue(true);
121 }
122 }
References Vendor\Package\$e.
◆ testUniquePrevious()
| LSControlBuilderTest::testUniquePrevious |
( |
| ) |
|
Definition at line 100 of file LSControlBuilderTest.php.
100 : void
101 {
102 try {
103 $this->control_builder
104 ->previous('cmd', 1)
105 ->previous('cmd', 1);
106 $this->assertFalse("This should not happen");
107 }
catch (LogicException
$e) {
108 $this->assertTrue(true);
109 }
110 }
References Vendor\Package\$e.
◆ testUniqueToC()
| LSControlBuilderTest::testUniqueToC |
( |
| ) |
|
Definition at line 131 of file LSControlBuilderTest.php.
131 : void
132 {
133 try {
134 $this->control_builder->tableOfContent('cmd', 'rootnode')
135 ->end();
136 $this->control_builder->tableOfContent('cmd', 'rootnode');
137 $this->assertFalse("This should not happen");
138 }
catch (LogicException
$e) {
139 $this->assertTrue(true);
140 }
141 }
References Vendor\Package\$e.
◆ $control_builder
The documentation for this class was generated from the following file: