Definition at line 15 of file TextareaTest.php.
◆ buildFactory()
TextareaTest::buildFactory |
( |
| ) |
|
|
protected |
Definition at line 29 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_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().
31 $df =
new Data\Factory();
35 new Validation\
Factory($df, $this->createMock(\ilLanguage::class)),
◆ setUp()
◆ test_get_max_limit()
TextareaTest::test_get_max_limit |
( |
| ) |
|
Definition at line 112 of file TextareaTest.php.
References $f, and buildFactory().
116 $textarea =
$f->textarea(
'label')->withMaxLimit($limit);
117 $this->assertEquals($textarea->getMaxLimit(), $limit);
◆ test_get_min_limit()
TextareaTest::test_get_min_limit |
( |
| ) |
|
Definition at line 103 of file TextareaTest.php.
References $f, and buildFactory().
107 $textarea =
$f->textarea(
'label')->withMinLimit($limit);
108 $this->assertEquals($textarea->getMinLimit(), $limit);
◆ test_implements_factory_interface()
TextareaTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 41 of file TextareaTest.php.
References $f, and buildFactory().
44 $textarea =
$f->textarea(
"label",
"byline");
45 $this->assertInstanceOf(Field\Input::class, $textarea);
46 $this->assertInstanceOf(Field\Textarea::class, $textarea);
◆ test_implements_factory_interface_without_byline()
TextareaTest::test_implements_factory_interface_without_byline |
( |
| ) |
|
Definition at line 50 of file TextareaTest.php.
References $f, and buildFactory().
53 $textarea =
$f->textarea(
"label");
54 $this->assertInstanceOf(Field\Input::class, $textarea);
55 $this->assertInstanceOf(Field\Textarea::class, $textarea);
◆ test_is_limited()
TextareaTest::test_is_limited |
( |
| ) |
|
Definition at line 81 of file TextareaTest.php.
References $f, and buildFactory().
86 $textarea =
$f->textarea(
'label')->withMinLimit(5);
87 $this->assertTrue($textarea->isLimited());
90 $textarea =
$f->textarea(
'label')->withMaxLimit(5);
91 $this->assertTrue($textarea->isLimited());
94 $textarea =
$f->textarea(
'label')->withMinLimit(5)->withMaxLimit(20);
95 $this->assertTrue($textarea->isLimited());
98 $textarea =
$f->textarea(
'label');
99 $this->assertFalse($textarea->isLimited());
◆ test_renderer()
TextareaTest::test_renderer |
( |
| ) |
|
◆ test_renderer_counter_with_value()
TextareaTest::test_renderer_counter_with_value |
( |
| ) |
|
Definition at line 218 of file TextareaTest.php.
References $f, $html, $name, $r, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
225 $value =
"Lorem ipsum dolor sit";
226 $textarea =
$f->textarea($label, $byline)->withValue($value)->withNameFrom($this->name_source);
228 $expected =
"<div class=\"form-group row\">" 229 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>" 230 .
"<div class=\"col-sm-9\">" 231 .
"<textarea name=\"$name\" class=\"form-control form-control-sm\" id=\"\">$value</textarea>" 232 .
"<div id=\"textarea_feedback_\" data-maxchars=\"\"></div>" 233 .
"<div class=\"help-block\">byline</div>"
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_renderer_with_error()
TextareaTest::test_renderer_with_error |
( |
| ) |
|
Definition at line 241 of file TextareaTest.php.
References $f, $html, $name, $r, buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
248 $byline =
"This is just a byline Min: " . $min;
250 $textarea =
$f->textarea($label, $byline)->withNameFrom($this->name_source)->withError($error);
252 $expected =
"<div class=\"form-group row\">" 253 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>" 254 .
"<div class=\"col-sm-9\">" 255 .
"<textarea name=\"$name\" class=\"form-control form-control-sm\" id=\"\"></textarea>" 256 .
"<div id=\"textarea_feedback_\" data-maxchars=\"\"></div>" 257 .
"<div class=\"help-block\">$byline</div>" 258 .
"<div class=\"help-block alert alert-danger\" role=\"alert\">" 259 .
"<img border=\"0\" src=\"./templates/default/images/icon_alert.svg\" alt=\"alert\" />" 260 .
"$error</div></div></div>";
263 $html = trim(preg_replace(
'/\t+/',
'', $html));
264 $expected = trim(preg_replace(
'/\t+/',
'', $expected));
265 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null)
◆ test_renderer_with_max_limit()
TextareaTest::test_renderer_with_max_limit |
( |
| ) |
|
Definition at line 169 of file TextareaTest.php.
References $f, $html, $id, $name, $r, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
177 $byline =
"This is just a byline Max: " . $max;
178 $textarea =
$f->textarea($label, $byline)->withMaxLimit($max)->withNameFrom($this->name_source);
180 $expected =
"<div class=\"form-group row\">" 181 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>" 182 .
"<div class=\"col-sm-9\">" 183 .
"<textarea name=\"$name\" class=\"form-control form-control-sm\" id=\"$id\"></textarea>" 184 .
"<div id=\"textarea_feedback_$id\" data-maxchars=\"$max\"></div>" 185 .
"<div class=\"help-block\">$byline</div>"
if(!array_key_exists('StateId', $_REQUEST)) $id
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_renderer_with_min_and_max_limit()
TextareaTest::test_renderer_with_min_and_max_limit |
( |
| ) |
|
Definition at line 193 of file TextareaTest.php.
References $f, $html, $id, $name, $r, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
202 $byline =
"This is just a byline Min: " . $min .
" Max: " . $max;
203 $textarea =
$f->textarea($label, $byline)->withMinLimit($min)->withMaxLimit($max)->withNameFrom($this->name_source);
205 $expected =
"<div class=\"form-group row\">" 206 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>" 207 .
"<div class=\"col-sm-9\">" 208 .
"<textarea name=\"$name\" class=\"form-control form-control-sm\" id=\"$id\"></textarea>" 209 .
"<div id=\"textarea_feedback_$id\" data-maxchars=\"$max\"></div>" 210 .
"<div class=\"help-block\">$byline</div>"
if(!array_key_exists('StateId', $_REQUEST)) $id
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_renderer_with_min_limit()
TextareaTest::test_renderer_with_min_limit |
( |
| ) |
|
Definition at line 144 of file TextareaTest.php.
References $f, $html, $id, $name, $r, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), ILIAS_UI_TestBase\getDefaultRenderer(), and ILIAS_UI_TestBase\normalizeHTML().
153 $byline =
"This is just a byline Min: " . $min;
154 $textarea =
$f->textarea($label, $byline)->withMinLimit($min)->withNameFrom($this->name_source);
156 $expected =
"<div class=\"form-group row\">" 157 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>" 158 .
"<div class=\"col-sm-9\">" 159 .
"<textarea name=\"$name\" class=\"form-control form-control-sm\" id=\"$id\"></textarea>" 160 .
"<div id=\"textarea_feedback_$id\" data-maxchars=\"\"></div>" 161 .
"<div class=\"help-block\">$byline</div>"
if(!array_key_exists('StateId', $_REQUEST)) $id
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_stripsTags()
TextareaTest::test_stripsTags |
( |
| ) |
|
◆ test_with_max_limit()
TextareaTest::test_with_max_limit |
( |
| ) |
|
Definition at line 70 of file TextareaTest.php.
References $f, and buildFactory().
74 $textarea =
$f->textarea(
'label')->withMaxLimit($limit);
75 $this->assertInstanceOf(Field\Input::class, $textarea);
76 $this->assertInstanceOf(Field\Textarea::class, $textarea);
77 $this->assertEquals($textarea->getMaxLimit(), $limit);
◆ test_with_min_limit()
TextareaTest::test_with_min_limit |
( |
| ) |
|
Definition at line 59 of file TextareaTest.php.
References $f, and buildFactory().
63 $textarea =
$f->textarea(
'label')->withMinLimit($limit);
64 $this->assertInstanceOf(Field\Input::class, $textarea);
65 $this->assertInstanceOf(Field\Textarea::class, $textarea);
66 $this->assertEquals($textarea->getMinLimit(), $limit);
◆ $name_source
TextareaTest::$name_source |
|
private |
The documentation for this class was generated from the following file: