Class TagInputTest.
More...
◆ buildFactory()
TagInputTest::buildFactory |
( |
| ) |
|
|
protected |
Definition at line 33 of file TagInputTest.php.
Referenced by test_implements_factory_interface(), test_max_taglength_tags_not_ok(), test_max_taglength_tags_ok(), test_max_tags_not_ok(), test_max_tags_ok(), test_null_value_leads_to_exception(), test_render(), test_render_disabled(), test_render_error(), test_render_no_byline(), test_render_required(), test_render_value(), and test_user_created_not_allowed().
35 $df =
new Data\Factory();
36 $language = $this->createMock(\ilLanguage::class);
Class ChatMainBarProvider .
◆ setUp()
◆ test_implements_factory_interface()
TagInputTest::test_implements_factory_interface |
( |
| ) |
|
◆ test_max_taglength_tags_not_ok()
TagInputTest::test_max_taglength_tags_not_ok |
( |
| ) |
|
Definition at line 277 of file TagInputTest.php.
References Vendor\Package\$f, and buildFactory().
281 $this->expectException(\InvalidArgumentException::class);
282 $f->tag(
"label", [])->withTagMaxLength(2)->withNameFrom($this->name_source)->withInput(
284 [
"name_0" => [
"lorem",
"ipsum",
"dolor",],]
◆ test_max_taglength_tags_ok()
TagInputTest::test_max_taglength_tags_ok |
( |
| ) |
|
Definition at line 265 of file TagInputTest.php.
References Vendor\Package\$f, and buildFactory().
269 $tag =
$f->tag(
"label", [])->withTagMaxLength(10)->withNameFrom($this->name_source)->withInput(
272 $value = $tag->getContent();
273 $this->assertTrue($value->isOk());
◆ test_max_tags_not_ok()
TagInputTest::test_max_tags_not_ok |
( |
| ) |
|
Definition at line 252 of file TagInputTest.php.
References Vendor\Package\$f, and buildFactory().
256 $this->expectException(\InvalidArgumentException::class);
257 $f->tag(
"label", [])->withMaxTags(2)->withNameFrom($this->name_source)->withInput(
259 [
"name_0" => [
"lorem",
"ipsum",
"dolor",],]
◆ test_max_tags_ok()
TagInputTest::test_max_tags_ok |
( |
| ) |
|
Definition at line 240 of file TagInputTest.php.
References Vendor\Package\$f, and buildFactory().
244 $tag =
$f->tag(
"label", [])->withMaxTags(3)->withNameFrom($this->name_source)->withInput(
247 $value = $tag->getContent();
248 $this->assertTrue($value->isOk());
◆ test_null_value_leads_to_exception()
TagInputTest::test_null_value_leads_to_exception |
( |
| ) |
|
Definition at line 197 of file TagInputTest.php.
References Vendor\Package\$f, $name, and buildFactory().
202 $tags = [
"lorem",
"ipsum",
"dolor",];
204 $tag =
$f->tag($label, $tags)->withNameFrom($this->name_source)->withRequired(
true);
206 $value2 = $tag2->getContent();
207 $this->assertTrue($value2->isError());
◆ test_render()
TagInputTest::test_render |
( |
| ) |
|
Definition at line 62 of file TagInputTest.php.
References Vendor\Package\$f, $name, buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
67 $tags = [
"lorem",
"ipsum",
"dolor",];
69 $text =
$f->tag($label, $tags, $byline)->withNameFrom($this->name_source);
74 $expected =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label</label> <div class=\"col-sm-9\"> <div id=\"container-id_1\" class=\"form-control form-control-sm il-input-tag\"> <input type=\"text\" id=\"id_1\" value=\"\" class=\"form-control form-control-sm\"/> <input type=\"hidden\" id=\"template-id_1\" value='name_0[]'> </div> <div class=\"help-block\">byline</div> </div></div>";
75 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null)
◆ test_render_disabled()
TagInputTest::test_render_disabled |
( |
| ) |
|
Definition at line 149 of file TagInputTest.php.
References Vendor\Package\$f, $name, $result, buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
153 $tags = [
"lorem",
"ipsum",
"dolor",];
154 $text =
$f->tag($label, $tags)->withNameFrom($this->name_source)->withDisabled(
true);
159 $expected =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label</label> <div class=\"col-sm-9\"> <div id=\"container-id_1\" class=\"form-control form-control-sm il-input-tag disabled\"> <input type=\"text\" id=\"id_1\" value=\"\" class=\"form-control form-control-sm\"/> <input type=\"hidden\" id=\"template-id_1\" value='name_0[]'> </div> </div></div>";
161 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null)
◆ test_render_error()
TagInputTest::test_render_error |
( |
| ) |
|
Definition at line 79 of file TagInputTest.php.
References Vendor\Package\$f, $name, buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
85 $tags = [
"lorem",
"ipsum",
"dolor",];
87 $text =
$f->tag($label, $tags, $byline)->withNameFrom($this->name_source)->withError($error);
93 =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label</label> <div class=\"col-sm-9\"> <div id=\"container-id_1\" class=\"form-control form-control-sm il-input-tag\"> <input type=\"text\" id=\"id_1\" value=\"\" class=\"form-control form-control-sm\"/> <input type=\"hidden\" id=\"template-id_1\" value='name_0[]'> </div> <div class=\"help-block\">byline</div> <div class=\"help-block alert alert-danger\" role=\"alert\"> <img border=\"0\" src=\"./templates/default/images/icon_alert.svg\" alt=\"alert\" /> an_error </div> </div></div>";
94 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null)
◆ test_render_no_byline()
TagInputTest::test_render_no_byline |
( |
| ) |
|
Definition at line 98 of file TagInputTest.php.
References Vendor\Package\$f, $name, buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
103 $tags = [
"lorem",
"ipsum",
"dolor",];
104 $text =
$f->tag($label, $tags)->withNameFrom($this->name_source);
109 $expected =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label</label> <div class=\"col-sm-9\"> <div id=\"container-id_1\" class=\"form-control form-control-sm il-input-tag\"> <input type=\"text\" id=\"id_1\" value=\"\" class=\"form-control form-control-sm\"/> <input type=\"hidden\" id=\"template-id_1\" value='name_0[]'> </div> </div></div>";
110 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null)
◆ test_render_required()
TagInputTest::test_render_required |
( |
| ) |
|
Definition at line 132 of file TagInputTest.php.
References Vendor\Package\$f, $name, buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
137 $tags = [
"lorem",
"ipsum",
"dolor",];
138 $text =
$f->tag($label, $tags)->withNameFrom($this->name_source)->withRequired(
true);
143 $expected =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label<span class=\"asterisk\">*</span></label> <div class=\"col-sm-9\"> <div id=\"container-id_1\" class=\"form-control form-control-sm il-input-tag\"> <input type=\"text\" id=\"id_1\" value=\"\" class=\"form-control form-control-sm\"/> <input type=\"hidden\" id=\"template-id_1\" value='name_0[]'> </div> </div></div>";
145 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null)
◆ test_render_value()
TagInputTest::test_render_value |
( |
| ) |
|
Definition at line 114 of file TagInputTest.php.
References Vendor\Package\$f, $name, buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
118 $value = [
"lorem",
"ipsum",];
120 $tags = [
"lorem",
"ipsum",
"dolor",];
121 $text =
$f->tag($label, $tags)->withValue($value)->withNameFrom($this->name_source);
127 =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label</label> <div class=\"col-sm-9\"> <div id=\"container-id_1\" class=\"form-control form-control-sm il-input-tag\"> <input type=\"text\" id=\"id_1\" value=\"lorem,ipsum\" class=\"form-control form-control-sm\"/> <input type=\"hidden\" id=\"template-id_1\" value='name_0[]'> <input type=\"hidden\" id=\"tag-id_1-lorem\" name=\"name_0[]\" value='lorem'> <input type=\"hidden\" id=\"tag-id_1-ipsum\" name=\"name_0[]\" value='ipsum'> </div> </div></div>";
128 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null)
◆ test_user_created_not_allowed()
TagInputTest::test_user_created_not_allowed |
( |
| ) |
|
Definition at line 211 of file TagInputTest.php.
References Vendor\Package\$f, and buildFactory().
214 $tags = [
"lorem",
"ipsum",
"dolor",];
215 $tag =
$f->tag(
"label", $tags)->withUserCreatedTagsAllowed(
false)->withNameFrom($this->name_source);
217 $tag1 = $tag->withInput(
219 [
"name_0" => [
"lorem",
"ipsum",],]
222 $value1 = $tag1->getContent();
223 $this->assertTrue($value1->isOk());
224 $value = $value1->value();
230 $tag1 = $tag->withInput(
232 [
"name_0" => [
"conseptetuer",
"ipsum",],]
235 $value1 = $tag1->getContent();
236 $this->assertTrue($value1->isError());
◆ $name_source
TagInputTest::$name_source |
|
private |
The documentation for this class was generated from the following file: