3 declare(strict_types=1);
21 require_once(__DIR__ .
"/../../../Base.php");
48 $df =
new Data\Factory();
49 $language = $this->createMock(ilLanguage::class);
50 return new I\Input\Field\Factory(
61 $options = [
"one" =>
"Eins",
"two" =>
"Zwei",
"three" =>
"Drei"];
63 $this->createMock(
ILIAS\Data\Factory::class),
70 $this->assertTrue($select->_isClientSideValueOk(
"one"));
71 $this->assertTrue($select->_isClientSideValueOk(
"two"));
72 $this->assertTrue($select->_isClientSideValueOk(
"three"));
73 $this->assertFalse($select->_isClientSideValueOk(
"four"));
80 $this->createMock(
ILIAS\Data\Factory::class),
87 $this->assertTrue($select->_isClientSideValueOk(
""));
93 $select = $this->buildFactory()->select(
99 ->withNameFrom($this->name_source);
101 $data = $this->createMock(InputData::class);
102 $data->expects($this->once())
105 $select = $select->withInput(
109 $this->assertNotEquals(null, $select->getError());
116 $this->createMock(
ILIAS\Data\Factory::class),
123 $this->assertTrue($select->_isClientSideValueOk(
""));
128 $f = $this->buildFactory();
131 $options = [
"one" =>
"One",
"two" =>
"Two",
"three" =>
"Three"];
132 $select =
$f->select(
$label,
$options, $byline)->withNameFrom($this->name_source);
134 $r = $this->getDefaultRenderer();
135 $html = $this->brutallyTrimHTML($r->render($select));
137 $expected = $this->brutallyTrimHTML(
' 138 <div class="form-group row"> 139 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 140 <div class="col-sm-8 col-md-9 col-lg-10"> 141 <select id="id_1" name="name_0"> 142 <option selected="selected" value="">-</option> 143 <option value="one">One</option> 144 <option value="two">Two</option> 145 <option value="three">Three</option> 147 <div class="help-block">byline</div> 151 $this->assertEquals($expected, $html);
157 $f = $this->buildFactory();
160 $options = [
"one" =>
"One",
"two" =>
"Two",
"three" =>
"Three"];
161 $select =
$f->select(
$label,
$options, $byline)->withNameFrom($this->name_source)->withValue(
"one");
163 $r = $this->getDefaultRenderer();
164 $html = $this->brutallyTrimHTML($r->render($select));
166 $expected = $this->brutallyTrimHTML(
' 167 <div class="form-group row"> 168 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 169 <div class="col-sm-8 col-md-9 col-lg-10"> 170 <select id="id_1" name="name_0"> 171 <option value="">-</option> 172 <option selected="selected" value="one">One</option> 173 <option value="two">Two</option> 174 <option value="three">Three</option> 176 <div class="help-block">byline</div> 180 $this->assertEquals($expected, $html);
185 $f = $this->buildFactory();
188 $options = [
"one" =>
"One",
"two" =>
"Two",
"three" =>
"Three"];
189 $select =
$f->select(
$label,
$options, $byline)->withNameFrom($this->name_source)->withDisabled(
true);
191 $r = $this->getDefaultRenderer();
192 $html = $this->brutallyTrimHTML($r->render($select));
194 $expected = $this->brutallyTrimHTML(
' 195 <div class="form-group row"> 196 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 197 <div class="col-sm-8 col-md-9 col-lg-10"> 198 <select id="id_1" name="name_0" disabled="disabled"> 199 <option selected="selected" value="">-</option> 200 <option value="one">One</option> 201 <option value="two">Two</option> 202 <option value="three">Three</option> 204 <div class="help-block">byline</div> 208 $this->assertEquals($expected, $html);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Provides common functionality for UI tests.
_isClientSideValueOk($value)