5require_once(__DIR__ .
"/../../../../../libs/composer/vendor/autoload.php");
6require_once(__DIR__ .
"/../../../Base.php");
11use \ILIAS\UI\Component\Input\Field;
25 $language = $this->createMock(\ilLanguage::class);
42 $ms =
$f->multiSelect(
"label", $options,
"byline");
43 $this->assertInstanceOf(Field\Input::class, $ms);
44 $this->assertInstanceOf(Field\MultiSelect::class, $ms);
55 $ms =
$f->multiSelect(
"label", $options,
"byline");
56 $this->assertEquals($options, $ms->getOptions());
62 $this->expectException(\InvalidArgumentException::class);
68 $ms =
$f->multiSelect(
"label", $options,
"byline")
69 ->withNameFrom(
new class() implements
NameSource {
70 public function getNewName()
75 $ms = $ms->withInput(
new class() implements
InputData {
76 public function getOr($_, $__)
80 public function get($_)
84 $content = $ms->getContent();
96 $ms =
$f->multiSelect(
"label", $options,
"byline")
97 ->withNameFrom($this->name_source);
99 $name = $ms->getName();
100 $label = $ms->getLabel();
101 $byline = $ms->getByline();
103 .
"<div class=\"form-group row\">"
104 .
"<label class=\"control-label col-sm-3\">$label</label>"
105 .
"<div class=\"col-sm-9\">"
106 .
"<ul class=\"il-input-multiselect\" id=\"id_1\">";
108 foreach ($options as $opt_value => $opt_label) {
111 .
"<input type=\"checkbox\" name=\"$name" .
"[]\" value=\"$opt_value\" />"
112 .
"<span>$opt_label</span>"
118 .
"<div class=\"help-block\">$byline</div>"
133 $value = array_keys($options)[1];
134 $ms =
$f->multiSelect(
"label", $options,
"byline")
135 ->withNameFrom($this->name_source)
136 ->withValue([$value]);
138 $name = $ms->getName();
139 $label = $ms->getLabel();
140 $byline = $ms->getByline();
142 .
"<div class=\"form-group row\">"
143 .
"<label class=\"control-label col-sm-3\">$label</label>"
144 .
"<div class=\"col-sm-9\">"
145 .
"<ul class=\"il-input-multiselect\" id=\"id_1\">";
147 foreach ($options as $opt_value => $opt_label) {
148 if ($opt_value === $value) {
151 .
"<input type=\"checkbox\" name=\"$name" .
"[]\" value=\"$opt_value\" checked=\"checked\" />"
152 .
"<span>$opt_label</span>"
157 .
"<input type=\"checkbox\" name=\"$name" .
"[]\" value=\"$opt_value\" />"
158 .
"<span>$opt_label</span>"
165 .
"<div class=\"help-block\">$byline</div>"
179 $ms =
$f->multiSelect(
"label", $options,
"byline")
180 ->withNameFrom($this->name_source)->withDisabled(
true);
182 $name = $ms->getName();
183 $label = $ms->getLabel();
184 $byline = $ms->getByline();
186 .
"<div class=\"form-group row\">"
187 .
"<label class=\"control-label col-sm-3\">$label</label>"
188 .
"<div class=\"col-sm-9\">"
189 .
"<ul class=\"il-input-multiselect\" id=\"id_1\">";
191 foreach ($options as $opt_value => $opt_label) {
194 .
"<input type=\"checkbox\" name=\"$name" .
"[]\" value=\"$opt_value\" disabled=\"disabled\" />"
195 .
"<span>$opt_label</span>"
201 .
"<div class=\"help-block\">$byline</div>"
An exception for terminatinating execution or to throw for unit testing.
Provides common functionality for UI tests.
assertHTMLEquals($expected_html_as_string, $html_as_string)
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
Class ChatMainBarProvider \MainMenu\Provider.