Definition at line 33 of file MultiSelectInputTest.php.
◆ setUp()
MultiSelectInputTest::setUp |
( |
| ) |
|
◆ testCommonRendering()
MultiSelectInputTest::testCommonRendering |
( |
| ) |
|
Definition at line 181 of file MultiSelectInputTest.php.
References Vendor\Package\$f, and null.
183 $f = $this->getFieldFactory();
185 $multi_select =
$f->multiSelect($label, [],
null)->withNameFrom($this->name_source);
187 $this->testWithError($multi_select);
188 $this->testWithNoByline($multi_select);
189 $this->testWithRequired($multi_select);
190 $this->testWithDisabled($multi_select);
191 $this->testWithAdditionalOnloadCodeRendersId($multi_select);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testImplementsFactoryInterface()
MultiSelectInputTest::testImplementsFactoryInterface |
( |
| ) |
|
Definition at line 44 of file MultiSelectInputTest.php.
References Vendor\Package\$f.
46 $f = $this->getFieldFactory();
51 $ms =
$f->multiSelect(
"label", $options,
"byline");
52 $this->assertInstanceOf(\
ILIAS\
UI\
Component\Input\Container\Form\FormInput::class, $ms);
53 $this->assertInstanceOf(Field\MultiSelect::class, $ms);
Interface Observer Contains several chained tasks and infos about them.
◆ testOnlyAcceptsActualOptionsFromClientSide()
MultiSelectInputTest::testOnlyAcceptsActualOptionsFromClientSide |
( |
| ) |
|
- Returns
- string[]
Definition at line 67 of file MultiSelectInputTest.php.
References Vendor\Package\$f, and ILIAS\GlobalScreen\has().
69 $this->expectException(InvalidArgumentException::class);
70 $f = $this->getFieldFactory();
75 $ms =
$f->multiSelect(
"label", $options,
"byline")
76 ->withNameFrom(
new class () implements
NameSource {
77 public function getNewName(): string
82 $ms = $ms->withInput(
new class () implements
InputData {
86 public function getOr($_, $__): array
90 public function get($_):
void 93 public function has($name): bool
◆ testOptions()
MultiSelectInputTest::testOptions |
( |
| ) |
|
◆ testRender()
MultiSelectInputTest::testRender |
( |
| ) |
|
Definition at line 100 of file MultiSelectInputTest.php.
References Vendor\Package\$f, $r, and null.
102 $r = $this->getDefaultRenderer();
103 $f = $this->getFieldFactory();
108 $ms =
$f->multiSelect(
"label", $options,
"byline")
109 ->withNameFrom($this->name_source);
111 $name = $ms->getName();
112 $label = $ms->getLabel();
113 $byline = $ms->getByline();
114 $expected_options =
"";
115 foreach ($options as $opt_value => $opt_label) {
116 $expected_options .=
"" 118 .
"<input type=\"checkbox\" name=\"$name" .
"[]\" value=\"$opt_value\" />" 119 .
' <span class="c-field-multiselect__label-text">' 121 .
"</span></label></li>";
123 $expected = $this->getFormWrappedHtml(
124 'multi-select-field-input',
126 '<ul class="c-field-multiselect">' 127 . $expected_options .
132 $this->assertEquals($expected, $this->render($ms));
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testRenderNoOptions()
MultiSelectInputTest::testRenderNoOptions |
( |
| ) |
|
Definition at line 194 of file MultiSelectInputTest.php.
References Vendor\Package\$f, and $r.
196 $r = $this->getDefaultRenderer();
197 $f = $this->getFieldFactory();
199 $ms =
$f->multiSelect(
"label", $options,
"byline")
200 ->withNameFrom($this->name_source)->withDisabled(
true);
202 $name = $ms->getName();
203 $label = $ms->getLabel();
204 $byline = $ms->getByline();
206 <fieldset class="c-input" data-il-ui-component="multi-select-field-input" data-il-ui-input-name="name_0" disabled="disabled" tabindex="0"> 208 <div class="c-input__field"> 209 <ul class="c-field-multiselect"> 213 <div class="c-input__help-byline">byline</div> 216 $this->assertHTMLEquals($expected,
$r->render($ms));
◆ testRenderValue()
MultiSelectInputTest::testRenderValue |
( |
| ) |
|
Definition at line 135 of file MultiSelectInputTest.php.
References Vendor\Package\$f, $r, and null.
137 $r = $this->getDefaultRenderer();
138 $f = $this->getFieldFactory();
143 $value = array_keys($options)[1];
144 $ms =
$f->multiSelect(
"label", $options,
"byline")
145 ->withNameFrom($this->name_source)
146 ->withValue([$value]);
148 $name = $ms->getName();
149 $label = $ms->getLabel();
150 $byline = $ms->getByline();
151 $expected_options =
"";
152 foreach ($options as $opt_value => $opt_label) {
153 if ($opt_value === $value) {
154 $expected_options .=
"" 156 .
"<input type=\"checkbox\" name=\"$name" .
"[]\" value=\"$opt_value\" checked=\"checked\" />" 157 .
'<span class="c-field-multiselect__label-text">' 159 .
"</span></label></li>";
161 $expected_options .=
"" 163 .
"<input type=\"checkbox\" name=\"$name" .
"[]\" value=\"$opt_value\" />" 164 .
'<span class="c-field-multiselect__label-text">' 166 .
"</span></label></li>";
169 $expected = $this->getFormWrappedHtml(
170 'multi-select-field-input',
172 '<ul class="c-field-multiselect">' 173 . $expected_options .
178 $this->assertEquals($expected, $this->render($ms));
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ $name_source
The documentation for this class was generated from the following file: