19 declare(strict_types=1);
21 require_once(__DIR__ .
"/../../../../../../../../vendor/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"/../../../../Base.php");
23 require_once(__DIR__ .
"/FilterTest.php");
68 return new I\Input\Container\Filter\Factory(
69 new I\SignalGenerator(),
70 $this->buildInputFactory()
76 $df =
new Data\Factory();
77 $language = $this->createMock(
ILIAS\Language\Language::class);
78 return new I\Input\Field\Factory(
81 new I\SignalGenerator(),
90 return new I\Symbol\Factory(
99 return new I\Popover\Factory(
new I\SignalGenerator());
104 $mock = $this->createMock(
I\Legacy\Factory::class);
105 $mock->method(
'content')->willReturn(
106 new I\Legacy\Content(
'',
new I\SignalGenerator())
114 $this->buildSymbolFactory(),
115 $this->buildPopoverFactory(),
116 $this->buildLegacyFactory(),
122 $f = $this->buildFactory();
123 $if = $this->buildInputFactory();
124 $text = $if->text(
'label',
'byline');
125 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
126 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
127 $html = $this->brutallyTrimHTML($fr->render($text));
129 $expected = $this->brutallyTrimHTML(
' 130 <div class="col-md-6 col-lg-4 il-popover-container"> 131 <div class="input-group"> 132 <label for="id_1" class="input-group-addon leftaddon">label</label> 133 <input id="id_1" type="text" class="c-field-text" /> 134 <span class="input-group-addon rightaddon"> 135 <a class="glyph" href="" aria-label="remove" id="id_2"> 136 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> 142 $this->assertHTMLEquals($expected, $html);
147 $f = $this->buildFactory();
148 $if = $this->buildInputFactory();
149 $numeric = $if->numeric(
'label',
'byline');
150 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
151 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
152 $html = $this->brutallyTrimHTML($fr->render($numeric));
154 $expected = $this->brutallyTrimHTML(
' 155 <div class="col-md-6 col-lg-4 il-popover-container"> 156 <div class="input-group"> 157 <label for="id_1" class="input-group-addon leftaddon">label</label> 158 <input id="id_1" type="number" step="1" class="c-field-number" /> 159 <span class="input-group-addon rightaddon"> 160 <a class="glyph" href="" aria-label="remove" id="id_2"> 161 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> 167 $this->assertHTMLEquals($expected, $html);
172 $f = $this->buildFactory();
173 $if = $this->buildInputFactory();
174 $options = [
"one" =>
"One",
"two" =>
"Two",
"three" =>
"Three"];
175 $select = $if->select(
'label', $options,
'byline');
176 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
177 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
178 $html = $this->brutallyTrimHTML($fr->render($select));
180 $expected = $this->brutallyTrimHTML(
' 181 <div class="col-md-6 col-lg-4 il-popover-container"> 182 <div class="input-group"> 183 <label for="id_1" class="input-group-addon leftaddon">label</label> 185 <option selected="selected" value="">-</option> 186 <option value="one">One</option> 187 <option value="two">Two</option> 188 <option value="three">Three</option> 190 <span class="input-group-addon rightaddon"> 191 <a class="glyph" href="" aria-label="remove" id="id_2"><span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span></a> 196 $this->assertHTMLEquals($expected, $html);
201 $f = $this->buildFactory();
202 $if = $this->buildInputFactory();
203 $options = [
"one" =>
"One",
"two" =>
"Two",
"three" =>
"Three"];
204 $multi = $if->multiSelect(
'label', $options,
'byline');
205 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
206 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
207 $html = $this->brutallyTrimHTML($fr->render($multi));
209 $expected = $this->brutallyTrimHTML(
' 210 <div class="col-md-6 col-lg-4 il-popover-container"> 211 <div class="input-group"> 212 <label class="input-group-addon leftaddon">label</label> 213 <span role="button" tabindex="0" class="form-control il-filter-field" id="id_3" data-placement="bottom"></span> 214 <div class="il-standard-popover-content" style="display:none;" id="id_1"></div> 215 <span class="input-group-addon rightaddon"> 216 <a class="glyph" href="" aria-label="remove" id="id_4"> 217 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> 224 $this->assertHTMLEquals($expected, $html);
229 $f = $this->buildFactory();
230 $if = $this->buildInputFactory();
231 $datetime = $if->dateTime(
'label',
'byline');
232 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
233 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
234 $html = $this->brutallyTrimHTML($fr->render(
$datetime));
236 $expected = $this->brutallyTrimHTML(
' 237 <div class="col-md-6 col-lg-4 il-popover-container"> 238 <div class="input-group"> 239 <label for="id_1" class="input-group-addon leftaddon">label</label> 240 <div class="c-input-group"> 241 <input id="id_1" type="date" class="c-field-datetime" /> 243 <span class="input-group-addon rightaddon"> 244 <a class="glyph" href="" aria-label="remove" id="id_2"> 245 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> 251 $this->assertHTMLEquals($expected, $html);
256 $f = $this->buildFactory();
257 $if = $this->buildInputFactory();
258 $duration = $if->duration(
'label',
'byline');
259 $datetime = $if->dateTime(
'label',
'byline');
260 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
262 $html = $this->brutallyTrimHTML($dr->render(
$datetime));
264 $expected = $this->brutallyTrimHTML(
' 265 <fieldset class="c-input" data-il-ui-component="" data-il-ui-input-name=""> 266 <label for="id_1">label</label> 267 <div class="c-input__field"> 268 <div class="c-input-group"> 269 <input id="id_1" type="date" class="c-field-datetime" /> 274 $this->assertEquals($expected, $html);
275 $this->assertHTMLEquals($expected, $html);
280 $f = $this->buildFactory();
281 $if = $this->buildInputFactory();
282 $datetime = $if->duration(
'label',
'byline');
283 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
284 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
285 $html = $this->brutallyTrimHTML($fr->render(
$datetime));
286 $label_start =
'duration_default_label_start';
287 $label_end =
'duration_default_label_end';
290 $expected = $this->brutallyTrimHTML(
' 291 <div class="col-md-6 col-lg-4 il-popover-container"> 292 <div class="input-group"> 293 <label class="input-group-addon leftaddon">label</label> 294 <span role="button" tabindex="0" class="form-control il-filter-field" id="id_7" data-placement="bottom"></span> 295 <div class="il-standard-popover-content" style="display:none;" id="id_5"></div> 296 <span class="input-group-addon rightaddon"> 297 <a class="glyph" href="" aria-label="remove" id="id_8"> 298 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> 305 $this->assertHTMLEquals($expected, $html);
Interface Observer Contains several chained tasks and infos about them.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null