Class TagInputTest.
More...
◆ buildFactory()
TagInputTest::buildFactory |
( |
| ) |
|
|
protected |
Definition at line 30 of file TagInputTest.php.
Referenced by test_max_tags_not_ok(), testImplementsFactoryInterface(), testMaxTaglengthTagsNotOk(), testMaxTaglengthTagsOk(), testMaxTagsOk(), testNullValueLeadsToException(), testRender(), testRenderDisabled(), testRenderError(), testRenderNoByline(), testRenderRequired(), and testUserCreatedNotAllowed().
32 $df =
new Data\Factory();
33 $language = $this->createMock(\ilLanguage::class);
Class ChatMainBarProvider .
◆ setUp()
◆ test_max_tags_not_ok()
TagInputTest::test_max_tags_not_ok |
( |
| ) |
|
Definition at line 289 of file TagInputTest.php.
References Vendor\Package\$f, and buildFactory().
293 $this->expectException(\InvalidArgumentException::class);
294 $f->tag(
"label", [])->withMaxTags(2)->withNameFrom($this->name_source)->withInput(
296 [
"name_0" =>
"lorem,ipsum,dolor"]
◆ testImplementsFactoryInterface()
TagInputTest::testImplementsFactoryInterface |
( |
| ) |
|
◆ testMaxTaglengthTagsNotOk()
TagInputTest::testMaxTaglengthTagsNotOk |
( |
| ) |
|
Definition at line 314 of file TagInputTest.php.
References Vendor\Package\$f, and buildFactory().
318 $this->expectException(\InvalidArgumentException::class);
319 $f->tag(
"label", [])->withTagMaxLength(2)->withNameFrom($this->name_source)->withInput(
321 [
"name_0" =>
"lorem,ipsum,dolor"]
◆ testMaxTaglengthTagsOk()
TagInputTest::testMaxTaglengthTagsOk |
( |
| ) |
|
Definition at line 302 of file TagInputTest.php.
References Vendor\Package\$f, and buildFactory().
306 $tag =
$f->tag(
"label", [])->withTagMaxLength(10)->withNameFrom($this->name_source)->withInput(
309 $value = $tag->getContent();
310 $this->assertTrue($value->isOk());
◆ testMaxTagsOk()
TagInputTest::testMaxTagsOk |
( |
| ) |
|
Definition at line 277 of file TagInputTest.php.
References Vendor\Package\$f, and buildFactory().
281 $tag =
$f->tag(
"label", [])->withMaxTags(3)->withNameFrom($this->name_source)->withInput(
284 $value = $tag->getContent();
285 $this->assertTrue($value->isOk());
◆ testNullValueLeadsToException()
TagInputTest::testNullValueLeadsToException |
( |
| ) |
|
Definition at line 233 of file TagInputTest.php.
References Vendor\Package\$f, $name, and buildFactory().
238 $tags = [
"lorem",
"ipsum",
"dolor",];
240 $tag =
$f->tag($label, $tags)->withNameFrom($this->name_source)->withRequired(
true);
242 $value2 = $tag2->getContent();
243 $this->assertTrue($value2->isError());
◆ testRender()
TagInputTest::testRender |
( |
| ) |
|
Definition at line 56 of file TagInputTest.php.
References Vendor\Package\$f, $name, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
61 $tags = [
"lorem",
"ipsum",
"dolor",];
63 $text =
$f->tag($label, $tags, $byline)->withNameFrom($this->name_source);
68 <div class="form-group row"> 69 <label for="id_1" class="control-label col-sm-3">label</label> 70 <div class="col-sm-9"> 71 <div id="container-id_1" class="form-control form-control-sm il-input-tag-container"> 72 <input id="id_1" name="name_0" class="form-control form-control-sm il-input-tag" value=""/> 74 <div class="help-block">byline</div> 78 $this->assertEquals($expected, $html);
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
◆ testRenderDisabled()
TagInputTest::testRenderDisabled |
( |
| ) |
|
Definition at line 156 of file TagInputTest.php.
References Vendor\Package\$e, Vendor\Package\$f, $name, $result, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
160 $tags = [
"lorem",
"ipsum",
"dolor",];
161 $text =
$f->tag($label, $tags)->withNameFrom($this->name_source)->withDisabled(
true);
167 <div class="form-group row"> 168 <label for="id_1" class="control-label col-sm-3">label</label> 169 <div class="col-sm-9"> 170 <div id="container-id_1" class="form-control form-control-sm il-input-tag-container disabled"> 171 <input id="id_1" name="name_0" class="form-control form-control-sm il-input-tag" readonly value=""/> 177 $this->assertEquals($expected, $html);
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
◆ testRenderError()
TagInputTest::testRenderError |
( |
| ) |
|
Definition at line 81 of file TagInputTest.php.
References Vendor\Package\$f, $name, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
87 $tags = [
"lorem",
"ipsum",
"dolor",];
89 $text =
$f->tag($label, $tags, $byline)->withNameFrom($this->name_source)->withError($error);
94 <div class="form-group row"> 95 <label for="id_1" class="control-label col-sm-3">label</label> 96 <div class="col-sm-9"> 97 <div class="help-block alert alert-danger" role="alert">an_error</div> 98 <div id="container-id_1" class="form-control form-control-sm il-input-tag-container"> 99 <input id="id_1" name="name_0" class="form-control form-control-sm il-input-tag" value=""/> 101 <div class="help-block">byline</div> 105 $this->assertEquals($expected, $html);
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
◆ testRenderNoByline()
TagInputTest::testRenderNoByline |
( |
| ) |
|
Definition at line 108 of file TagInputTest.php.
References Vendor\Package\$f, $name, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
113 $tags = [
"lorem",
"ipsum",
"dolor",];
114 $text =
$f->tag($label, $tags)->withNameFrom($this->name_source);
119 <div class="form-group row"> 120 <label for="id_1" class="control-label col-sm-3">label</label> 121 <div class="col-sm-9"> 122 <div id="container-id_1" class="form-control form-control-sm il-input-tag-container"> 123 <input id="id_1" name="name_0" class="form-control form-control-sm il-input-tag" value=""/> 128 $this->assertEquals($expected, $html);
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
◆ testRenderRequired()
TagInputTest::testRenderRequired |
( |
| ) |
|
Definition at line 131 of file TagInputTest.php.
References Vendor\Package\$f, $name, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
136 $tags = [
"lorem",
"ipsum",
"dolor",];
137 $text =
$f->tag($label, $tags)->withNameFrom($this->name_source)->withRequired(
true);
143 <div class="form-group row"> 144 <label for="id_1" class="control-label col-sm-3">label<span class="asterisk">*</span></label> 145 <div class="col-sm-9"> 146 <div id="container-id_1" class="form-control form-control-sm il-input-tag-container"> 147 <input id="id_1" name="name_0" class="form-control form-control-sm il-input-tag" value=""/> 153 $this->assertEquals($expected, $html);
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
◆ testUserCreatedNotAllowed()
TagInputTest::testUserCreatedNotAllowed |
( |
| ) |
|
Definition at line 246 of file TagInputTest.php.
References Vendor\Package\$f, and buildFactory().
248 $this->markTestSkipped(
"This is supposed to work, but currently does not.");
251 $tags = [
"lorem",
"ipsum",
"dolor",];
252 $tag =
$f->tag(
"label", $tags)->withUserCreatedTagsAllowed(
false)->withNameFrom($this->name_source);
254 $tag1 = $tag->withInput(
256 [
"name_0" =>
"lorem,ipsum"]
259 $value1 = $tag1->getContent();
260 $this->assertTrue($value1->isOk());
261 $value = $value1->value();
267 $tag1 = $tag->withInput(
269 [
"name_0" =>
"conseptetuer,ipsum"]
272 $value1 = $tag1->getContent();
273 $this->assertTrue($value1->isError());
◆ $name_source
TagInputTest::$name_source |
|
private |
The documentation for this class was generated from the following file: