19 declare(strict_types=1);
21 require_once(__DIR__ .
"/../../../../../libs/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"/../../../Base.php");
23 require_once(__DIR__ .
"/InputTest.php");
42 $df =
new Data\Factory();
43 $language = $this->createMock(ilLanguage::class);
44 return new I\Input\Field\Factory(
56 $textarea =
$f->textarea(
"label",
"byline");
57 $this->assertInstanceOf(\
ILIAS\
UI\
Component\Input\Container\Form\FormInput::class, $textarea);
58 $this->assertInstanceOf(Field\Textarea::class, $textarea);
64 $textarea =
$f->textarea(
"label");
65 $this->assertInstanceOf(\
ILIAS\
UI\
Component\Input\Container\Form\FormInput::class, $textarea);
66 $this->assertInstanceOf(Field\Textarea::class, $textarea);
73 $textarea =
$f->textarea(
'label')->withMinLimit($limit);
74 $this->assertInstanceOf(\
ILIAS\
UI\
Component\Input\Container\Form\FormInput::class, $textarea);
75 $this->assertInstanceOf(Field\Textarea::class, $textarea);
76 $this->assertEquals($textarea->getMinLimit(), $limit);
83 $textarea =
$f->textarea(
'label')->withMaxLimit($limit);
84 $this->assertInstanceOf(\
ILIAS\
UI\
Component\Input\Container\Form\FormInput::class, $textarea);
85 $this->assertInstanceOf(Field\Textarea::class, $textarea);
86 $this->assertEquals($textarea->getMaxLimit(), $limit);
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());
114 $textarea =
$f->textarea(
'label')->withMinLimit($limit);
115 $this->assertEquals($textarea->getMinLimit(), $limit);
122 $textarea =
$f->textarea(
'label')->withMaxLimit($limit);
123 $this->assertEquals($textarea->getMaxLimit(), $limit);
135 $textarea =
$f->textarea($label, $byline)->withNameFrom($this->name_source);
138 <div class=\"form-group row\"> 139 <label for=\"$id\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 140 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 141 <div class=\"ui-input-textarea\"> 142 <textarea id=\"$id\" class=\"form-control form-control-sm\" name=\"$name\"></textarea> 144 <div class=\"help-block\">$byline</div> 162 $byline =
"This is just a byline Min: " . $min;
163 $textarea =
$f->textarea($label, $byline)->withMinLimit($min)->withNameFrom($this->name_source);
166 <div class=\"form-group row\"> 167 <label for=\"$id\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 168 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 169 <div class=\"ui-input-textarea\"> 170 <textarea id=\"$id\" class=\"form-control form-control-sm\" name=\"$name\" minlength=\"$min\"></textarea> 172 <div class=\"help-block\">$byline</div> 189 $byline =
"This is just a byline Max: " . $max;
190 $textarea =
$f->textarea($label, $byline)->withMaxLimit($max)->withNameFrom($this->name_source);
193 <div class=\"form-group row\"> 194 <label for=\"$id\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 195 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 196 <div class=\"ui-input-textarea\"> 197 <textarea id=\"$id\" class=\"form-control form-control-sm\" name=\"$name\" maxlength=\"$max\"></textarea> 198 <div class=\"ui-input-textarea-remainder\"> ui_chars_remaining <span data-action=\"remainder\">$max</span> </div> 200 <div class=\"help-block\">$byline</div> 218 $byline =
"This is just a byline Min: " . $min .
" Max: " . $max;
219 $textarea =
$f->textarea($label, $byline)->withMinLimit($min)->withMaxLimit($max)->withNameFrom(
224 <div class=\"form-group row\"> 225 <label for=\"$id\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 226 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 227 <div class=\"ui-input-textarea\"> 228 <textarea id=\"$id\" class=\"form-control form-control-sm\" name=\"$name\" minlength=\"5\" maxlength=\"20\"></textarea> 229 <div class=\"ui-input-textarea-remainder\"> ui_chars_remaining <span data-action=\"remainder\">$max</span> </div> 231 <div class=\"help-block\">$byline</div> 248 $value =
"Lorem ipsum dolor sit";
249 $textarea =
$f->textarea($label, $byline)->withValue($value)->withNameFrom($this->name_source);
252 <div class=\"form-group row\"> 253 <label for=\"$id\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 254 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 255 <div class=\"ui-input-textarea\"> 256 <textarea id=\"$id\" class=\"form-control form-control-sm\" name=\"$name\">$value</textarea> 258 <div class=\"help-block\">$byline</div> 275 $byline =
"This is just a byline Min: " . $min;
277 $textarea =
$f->textarea($label, $byline)->withNameFrom($this->name_source)->withError($error);
280 <div class=\"form-group row\"> 281 <label for=\"$id\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 282 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 283 <div class=\"help-block alert alert-danger\" aria-describedby=\"$id\" role=\"alert\">an_error</div> 284 <div class=\"ui-input-textarea\"> 285 <textarea id=\"$id\" class=\"form-control form-control-sm\" name=\"$name\"></textarea> 287 <div class=\"help-block\">$byline</div> 304 $textarea =
$f->textarea($label, $byline)->withNameFrom($this->name_source)->withDisabled(
true);
307 <div class=\"form-group row\"> 308 <label for=\"$id\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 309 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 310 <div class=\"ui-input-textarea\"> 311 <textarea id=\"$id\" class=\"form-control form-control-sm\" name=\"$name\" disabled=\"disabled\"></textarea> 313 <div class=\"help-block\">$byline</div> 326 $text =
$f->textarea(
"")
327 ->withNameFrom($this->name_source)
328 ->withInput(
new DefInputData([$name =>
"<script>alert()</script>"]));
330 $content = $text->getContent();
331 $this->assertEquals(
"alert()", $content->value());
testRendererCounterWithValue()
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testImplementsFactoryInterface_without_byline()
testRendererWithDisabled()
testRendererWithMaxLimit()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
DefNamesource $name_source
Provides common functionality for UI tests.
testRendererWithMinAndMaxLimit()
testRendererWithMinLimit()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
normalizeHTML(string $html)
testImplementsFactoryInterface()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...