Definition at line 31 of file TextareaTest.php.
◆ buildFactory()
TextareaTest::buildFactory |
( |
| ) |
|
|
protected |
Definition at line 40 of file TextareaTest.php.
Referenced by test_get_max_limit(), test_get_min_limit(), test_implements_factory_interface(), test_implements_factory_interface_without_byline(), test_is_limited(), test_renderer(), test_renderer_counter_with_value(), test_renderer_with_disabled(), test_renderer_with_error(), test_renderer_with_max_limit(), test_renderer_with_min_and_max_limit(), test_renderer_with_min_limit(), test_stripsTags(), test_with_max_limit(), and test_with_min_limit().
40 : I\Input\Field\Factory
42 $df =
new Data\Factory();
43 $language = $this->createMock(ilLanguage::class);
44 return new I\Input\Field\Factory(
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ setUp()
◆ test_get_max_limit()
TextareaTest::test_get_max_limit |
( |
| ) |
|
◆ test_get_min_limit()
TextareaTest::test_get_min_limit |
( |
| ) |
|
◆ test_implements_factory_interface()
TextareaTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 53 of file TextareaTest.php.
References Vendor\Package\$f, and buildFactory().
56 $textarea =
$f->textarea(
"label",
"byline");
58 $this->assertInstanceOf(Field\Textarea::class, $textarea);
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ test_implements_factory_interface_without_byline()
TextareaTest::test_implements_factory_interface_without_byline |
( |
| ) |
|
Definition at line 61 of file TextareaTest.php.
References Vendor\Package\$f, and buildFactory().
64 $textarea =
$f->textarea(
"label");
66 $this->assertInstanceOf(Field\Textarea::class, $textarea);
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ test_is_limited()
TextareaTest::test_is_limited |
( |
| ) |
|
Definition at line 89 of file TextareaTest.php.
References Vendor\Package\$f, and buildFactory().
94 $textarea =
$f->textarea(
'label')->withMinLimit(5);
95 $this->assertTrue($textarea->isLimited());
98 $textarea =
$f->textarea(
'label')->withMaxLimit(5);
99 $this->assertTrue($textarea->isLimited());
102 $textarea =
$f->textarea(
'label')->withMinLimit(5)->withMaxLimit(20);
103 $this->assertTrue($textarea->isLimited());
106 $textarea =
$f->textarea(
'label');
107 $this->assertFalse($textarea->isLimited());
◆ test_renderer()
TextareaTest::test_renderer |
( |
| ) |
|
Definition at line 127 of file TextareaTest.php.
References Vendor\Package\$f, $name, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
134 $textarea =
$f->textarea($label, $byline)->withNameFrom($this->name_source);
136 $expected =
"<div class=\"form-group row\">" 137 .
"<label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label>" 138 .
"<div class=\"col-sm-8 col-md-9 col-lg-10\">" 139 .
"<textarea id=\"id_1\" name=\"$name\" class=\"form-control form-control-sm\"></textarea>" 140 .
"<div class=\"help-block\">byline</div>" getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
normalizeHTML(string $html)
◆ test_renderer_counter_with_value()
TextareaTest::test_renderer_counter_with_value |
( |
| ) |
|
Definition at line 222 of file TextareaTest.php.
References Vendor\Package\$f, $name, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
229 $value =
"Lorem ipsum dolor sit";
230 $textarea =
$f->textarea($label, $byline)->withValue($value)->withNameFrom($this->name_source);
232 $expected =
"<div class=\"form-group row\">" 233 .
"<label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label>" 234 .
"<div class=\"col-sm-8 col-md-9 col-lg-10\">" 235 .
"<textarea id=\"id_1\" name=\"$name\" class=\"form-control form-control-sm\">$value</textarea>" 236 .
"<div class=\"help-block\">byline</div>" getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
normalizeHTML(string $html)
◆ test_renderer_with_disabled()
TextareaTest::test_renderer_with_disabled |
( |
| ) |
|
Definition at line 269 of file TextareaTest.php.
References Vendor\Package\$f, $name, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
276 $textarea =
$f->textarea($label, $byline)->withNameFrom($this->name_source)->withDisabled(
true);
278 $expected =
"<div class=\"form-group row\">" 279 .
"<label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label>" 280 .
"<div class=\"col-sm-8 col-md-9 col-lg-10\">" 281 .
"<textarea id=\"id_1\" name=\"$name\" disabled=\"disabled\" class=\"form-control form-control-sm\"></textarea>" 282 .
"<div class=\"help-block\">byline</div>" getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
normalizeHTML(string $html)
◆ test_renderer_with_error()
TextareaTest::test_renderer_with_error |
( |
| ) |
|
Definition at line 244 of file TextareaTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
250 $byline =
"This is just a byline Min: " . $min;
252 $textarea =
$f->textarea($label, $byline)->withNameFrom($this->name_source)->withError($error);
255 <div class="form-group row"> 256 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 257 <div class="col-sm-8 col-md-9 col-lg-10"> 258 <div class="help-block alert alert-danger" aria-describedby="id_1" role="alert">an_error</div> 259 <textarea id="id_1" name="name_0" class="form-control form-control-sm"></textarea> 260 <div class="help-block">This is just a byline Min: 5</div> 266 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ test_renderer_with_max_limit()
TextareaTest::test_renderer_with_max_limit |
( |
| ) |
|
Definition at line 173 of file TextareaTest.php.
References Vendor\Package\$f, $id, $name, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
181 $byline =
"This is just a byline Max: " . $max;
182 $textarea =
$f->textarea($label, $byline)->withMaxLimit($max)->withNameFrom($this->name_source);
184 $expected =
"<div class=\"form-group row\">" 185 .
"<label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label>" 186 .
"<div class=\"col-sm-8 col-md-9 col-lg-10\">" 187 .
"<textarea id=\"$id\" name=\"$name\" class=\"form-control form-control-sm\"></textarea>" 188 .
"<div id=\"textarea_feedback_$id\" data-maxchars=\"$max\"></div>" 189 .
"<div class=\"help-block\">$byline</div>" getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
normalizeHTML(string $html)
◆ test_renderer_with_min_and_max_limit()
TextareaTest::test_renderer_with_min_and_max_limit |
( |
| ) |
|
Definition at line 197 of file TextareaTest.php.
References Vendor\Package\$f, $id, $name, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
206 $byline =
"This is just a byline Min: " . $min .
" Max: " . $max;
207 $textarea =
$f->textarea($label, $byline)->withMinLimit($min)->withMaxLimit($max)->withNameFrom($this->name_source);
209 $expected =
"<div class=\"form-group row\">" 210 .
"<label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label>" 211 .
"<div class=\"col-sm-8 col-md-9 col-lg-10\">" 212 .
"<textarea id=\"$id\" name=\"$name\" class=\"form-control form-control-sm\"></textarea>" 213 .
"<div id=\"textarea_feedback_$id\" data-maxchars=\"$max\"></div>" 214 .
"<div class=\"help-block\">$byline</div>" getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
normalizeHTML(string $html)
◆ test_renderer_with_min_limit()
TextareaTest::test_renderer_with_min_limit |
( |
| ) |
|
Definition at line 148 of file TextareaTest.php.
References Vendor\Package\$f, $id, $name, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
157 $byline =
"This is just a byline Min: " . $min;
158 $textarea =
$f->textarea($label, $byline)->withMinLimit($min)->withNameFrom($this->name_source);
160 $expected =
"<div class=\"form-group row\">" 161 .
"<label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label>" 162 .
"<div class=\"col-sm-8 col-md-9 col-lg-10\">" 163 .
"<textarea id=\"$id\" name=\"$name\" class=\"form-control form-control-sm\"></textarea>" 164 .
"<div id=\"textarea_feedback_$id\" data-maxchars=\"\"></div>" 165 .
"<div class=\"help-block\">$byline</div>" getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
normalizeHTML(string $html)
◆ test_stripsTags()
TextareaTest::test_stripsTags |
( |
| ) |
|
◆ test_with_max_limit()
TextareaTest::test_with_max_limit |
( |
| ) |
|
Definition at line 79 of file TextareaTest.php.
References Vendor\Package\$f, and buildFactory().
83 $textarea =
$f->textarea(
'label')->withMaxLimit($limit);
85 $this->assertInstanceOf(Field\Textarea::class, $textarea);
86 $this->assertEquals($textarea->getMaxLimit(), $limit);
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ test_with_min_limit()
TextareaTest::test_with_min_limit |
( |
| ) |
|
Definition at line 69 of file TextareaTest.php.
References Vendor\Package\$f, and buildFactory().
73 $textarea =
$f->textarea(
'label')->withMinLimit($limit);
75 $this->assertInstanceOf(Field\Textarea::class, $textarea);
76 $this->assertEquals($textarea->getMinLimit(), $limit);
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ $name_source
The documentation for this class was generated from the following file: