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(
80 new I\SignalGenerator(),
89 return new I\Symbol\Factory(
98 return new I\Popover\Factory(
new I\SignalGenerator());
103 $mock = $this->createMock(
I\Legacy\Factory::class);
104 $mock->method(
'content')->willReturn(
105 new I\Legacy\Content(
'',
new I\SignalGenerator())
113 $this->buildSymbolFactory(),
114 $this->buildPopoverFactory(),
115 $this->buildLegacyFactory(),
121 $f = $this->buildFactory();
122 $if = $this->buildInputFactory();
123 $text = $if->text(
'label',
'byline');
124 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
125 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
126 $html = $this->brutallyTrimHTML($fr->render($text));
128 $expected = $this->brutallyTrimHTML(
' 129 <div class="col-md-6 col-lg-4 il-popover-container"> 130 <div class="input-group"> 131 <label for="id_1" class="input-group-addon leftaddon">label</label> 132 <input id="id_1" type="text" class="c-field-text" /> 133 <span class="input-group-addon rightaddon"> 134 <a class="glyph" href="" aria-label="remove" id="id_2"> 135 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> 141 $this->assertHTMLEquals($expected, $html);
146 $f = $this->buildFactory();
147 $if = $this->buildInputFactory();
148 $numeric = $if->numeric(
'label',
'byline');
149 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
150 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
151 $html = $this->brutallyTrimHTML($fr->render($numeric));
153 $expected = $this->brutallyTrimHTML(
' 154 <div class="col-md-6 col-lg-4 il-popover-container"> 155 <div class="input-group"> 156 <label for="id_1" class="input-group-addon leftaddon">label</label> 157 <input id="id_1" type="number" class="c-field-number" /> 158 <span class="input-group-addon rightaddon"> 159 <a class="glyph" href="" aria-label="remove" id="id_2"> 160 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> 166 $this->assertHTMLEquals($expected, $html);
171 $f = $this->buildFactory();
172 $if = $this->buildInputFactory();
173 $options = [
"one" =>
"One",
"two" =>
"Two",
"three" =>
"Three"];
174 $select = $if->select(
'label', $options,
'byline');
175 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
176 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
177 $html = $this->brutallyTrimHTML($fr->render($select));
179 $expected = $this->brutallyTrimHTML(
' 180 <div class="col-md-6 col-lg-4 il-popover-container"> 181 <div class="input-group"> 182 <label for="id_1" class="input-group-addon leftaddon">label</label> 184 <option selected="selected" value="">-</option> 185 <option value="one">One</option> 186 <option value="two">Two</option> 187 <option value="three">Three</option> 189 <span class="input-group-addon rightaddon"> 190 <a class="glyph" href="" aria-label="remove" id="id_2"><span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span></a> 195 $this->assertHTMLEquals($expected, $html);
200 $f = $this->buildFactory();
201 $if = $this->buildInputFactory();
202 $options = [
"one" =>
"One",
"two" =>
"Two",
"three" =>
"Three"];
203 $multi = $if->multiSelect(
'label', $options,
'byline');
204 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
205 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
206 $html = $this->brutallyTrimHTML($fr->render($multi));
208 $expected = $this->brutallyTrimHTML(
' 209 <div class="col-md-6 col-lg-4 il-popover-container"> 210 <div class="input-group"> 211 <label class="input-group-addon leftaddon">label</label> 212 <span role="button" tabindex="0" class="form-control il-filter-field" id="id_3" data-placement="bottom"></span> 213 <div class="il-standard-popover-content" style="display:none;" id="id_1"></div> 214 <span class="input-group-addon rightaddon"> 215 <a class="glyph" href="" aria-label="remove" id="id_4"> 216 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> 223 $this->assertHTMLEquals($expected, $html);
228 $f = $this->buildFactory();
229 $if = $this->buildInputFactory();
230 $datetime = $if->dateTime(
'label',
'byline');
231 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
232 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
233 $html = $this->brutallyTrimHTML($fr->render(
$datetime));
235 $expected = $this->brutallyTrimHTML(
' 236 <div class="col-md-6 col-lg-4 il-popover-container"> 237 <div class="input-group"> 238 <label for="id_1" class="input-group-addon leftaddon">label</label> 239 <div class="c-input-group"> 240 <input id="id_1" type="date" class="c-field-datetime" /> 242 <span class="input-group-addon rightaddon"> 243 <a class="glyph" href="" aria-label="remove" id="id_2"> 244 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> 250 $this->assertHTMLEquals($expected, $html);
255 $f = $this->buildFactory();
256 $if = $this->buildInputFactory();
257 $duration = $if->duration(
'label',
'byline');
258 $datetime = $if->dateTime(
'label',
'byline');
259 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
261 $html = $this->brutallyTrimHTML($dr->render(
$datetime));
263 $expected = $this->brutallyTrimHTML(
' 264 <fieldset class="c-input" data-il-ui-component="" data-il-ui-input-name=""> 265 <label for="id_1">label</label> 266 <div class="c-input__field"> 267 <div class="c-input-group"> 268 <input id="id_1" type="date" class="c-field-datetime" /> 273 $this->assertEquals($expected, $html);
274 $this->assertHTMLEquals($expected, $html);
279 $f = $this->buildFactory();
280 $if = $this->buildInputFactory();
281 $datetime = $if->duration(
'label',
'byline');
282 $filter =
$f->standard(
"#",
"#",
"#",
"#",
"#",
"#", [], [],
false,
false);
283 $fr = $this->getDefaultRenderer(
null, [], [$filter]);
284 $html = $this->brutallyTrimHTML($fr->render(
$datetime));
285 $label_start =
'duration_default_label_start';
286 $label_end =
'duration_default_label_end';
289 $expected = $this->brutallyTrimHTML(
' 290 <div class="col-md-6 col-lg-4 il-popover-container"> 291 <div class="input-group"> 292 <label class="input-group-addon leftaddon">label</label> 293 <span role="button" tabindex="0" class="form-control il-filter-field" id="id_7" data-placement="bottom"></span> 294 <div class="il-standard-popover-content" style="display:none;" id="id_5"></div> 295 <span class="input-group-addon rightaddon"> 296 <a class="glyph" href="" aria-label="remove" id="id_8"> 297 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> 304 $this->assertHTMLEquals($expected, $html);
Interface Observer Contains several chained tasks and infos about them.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null