5 require_once(__DIR__ .
"/../../../Base.php");
28 $df =
new Data\Factory();
29 $language = $this->createMock(\ilLanguage::class);
40 $options = [
"one" =>
"Eins",
"two" =>
"Zwei",
"three" =>
"Drei"];
42 $this->createMock(
ILIAS\Data\Factory::class),
49 $this->assertTrue($select->_isClientSideValueOk(
"one"));
50 $this->assertTrue($select->_isClientSideValueOk(
"two"));
51 $this->assertTrue($select->_isClientSideValueOk(
"three"));
52 $this->assertFalse($select->_isClientSideValueOk(
"four"));
59 $this->createMock(
ILIAS\Data\Factory::class),
66 $this->assertTrue($select->_isClientSideValueOk(
""));
73 $this->createMock(
ILIAS\Data\Factory::class),
80 $this->assertTrue($select->_isClientSideValueOk(
""));
85 $f = $this->buildFactory();
88 $options = [
"one" =>
"One",
"two" =>
"Two",
"three" =>
"Three"];
89 $select =
$f->select($label, $options, $byline)->withNameFrom($this->name_source);
91 $r = $this->getDefaultRenderer();
92 $html = $this->brutallyTrimHTML($r->render($select));
94 $expected = $this->brutallyTrimHTML(
' 95 <div class="form-group row"> 96 <label for="id_1" class="control-label col-sm-3">label</label> 97 <div class="col-sm-9"> 98 <select id="id_1" name="name_0"> 99 <option selected="selected" value="">-</option> 100 <option value="one">One</option> 101 <option value="two">Two</option> 102 <option value="three">Three</option> 104 <div class="help-block">byline</div> 108 $this->assertEquals($expected, $html);
114 $f = $this->buildFactory();
117 $options = [
"one" =>
"One",
"two" =>
"Two",
"three" =>
"Three"];
118 $select =
$f->select($label, $options, $byline)->withNameFrom($this->name_source)->withValue(
"one");
120 $r = $this->getDefaultRenderer();
121 $html = $this->brutallyTrimHTML($r->render($select));
123 $expected = $this->brutallyTrimHTML(
' 124 <div class="form-group row"> 125 <label for="id_1" class="control-label col-sm-3">label</label> 126 <div class="col-sm-9"> 127 <select id="id_1" name="name_0"> 128 <option value="">-</option> 129 <option selected="selected" value="one">One</option> 130 <option value="two">Two</option> 131 <option value="three">Three</option> 133 <div class="help-block">byline</div> 137 $this->assertEquals($expected, $html);
142 $f = $this->buildFactory();
145 $options = [
"one" =>
"One",
"two" =>
"Two",
"three" =>
"Three"];
146 $select =
$f->select($label, $options, $byline)->withNameFrom($this->name_source)->withDisabled(
true);
148 $r = $this->getDefaultRenderer();
149 $html = $this->brutallyTrimHTML($r->render($select));
151 $expected = $this->brutallyTrimHTML(
' 152 <div class="form-group row"> 153 <label for="id_1" class="control-label col-sm-3">label</label> 154 <div class="col-sm-9"> 155 <select id="id_1" name="name_0" disabled="disabled"> 156 <option selected="selected" value="">-</option> 157 <option value="one">One</option> 158 <option value="two">Two</option> 159 <option value="three">Three</option> 161 <div class="help-block">byline</div> 165 $this->assertEquals($expected, $html);
Class ChatMainBarProvider .
Provides common functionality for UI tests.
_isClientSideValueOk($value)