5require_once(__DIR__ .
"/../../../../../libs/composer/vendor/autoload.php");
6require_once(__DIR__ .
"/../../../Base.php");
7require_once(__DIR__ .
"/InputTest.php");
10use \ILIAS\UI\Component\Input\Field;
25 $language = $this->createMock(\ilLanguage::class);
39 $text =
$f->text(
"label",
"byline");
41 $this->assertInstanceOf(Field\Input::class, $text);
42 $this->assertInstanceOf(Field\Text::class, $text);
52 $text =
$f->text($label, $byline)->withNameFrom($this->name_source);
57 $expected =
"<div class=\"form-group row\">" .
" <label for=\"$name\" class=\"control-label col-sm-3\">$label</label>"
58 .
" <div class=\"col-sm-9\">" .
" <input type=\"text\" name=\"$name\" class=\"form-control form-control-sm\" />"
59 .
" <div class=\"help-block\">$byline</div>" .
" " .
" </div>" .
"</div>";
60 $this->assertEquals($expected, $html);
71 $text =
$f->text($label, $byline)->withNameFrom($this->name_source)->withError($error);
76 $expected =
"<div class=\"form-group row\">" .
" <label for=\"$name\" class=\"control-label col-sm-3\">$label</label>"
77 .
" <div class=\"col-sm-9\">" .
" <input type=\"text\" name=\"$name\" class=\"form-control form-control-sm\" />"
78 .
" <div class=\"help-block\">$byline</div>" .
" <div class=\"help-block alert alert-danger\" role=\"alert\">"
79 .
" <img border=\"0\" src=\"./templates/default/images/icon_alert.svg\" alt=\"alert\" />" .
" $error"
80 .
" </div>" .
" </div>" .
"</div>";
81 $this->assertEquals($expected, $html);
90 $text =
$f->text($label)->withNameFrom($this->name_source);
95 $expected =
"<div class=\"form-group row\">" .
" <label for=\"$name\" class=\"control-label col-sm-3\">$label</label>"
96 .
" <div class=\"col-sm-9\">" .
" <input type=\"text\" name=\"$name\" class=\"form-control form-control-sm\" />" .
" "
97 .
" " .
" </div>" .
"</div>";
98 $this->assertEquals($expected, $html);
108 $text =
$f->text($label)->withValue($value)->withNameFrom($this->name_source);
113 $expected =
"<div class=\"form-group row\">" .
" <label for=\"$name\" class=\"control-label col-sm-3\">$label</label>"
114 .
" <div class=\"col-sm-9\">"
115 .
" <input type=\"text\" value=\"$value\" name=\"$name\" class=\"form-control form-control-sm\" />" .
" " .
" "
116 .
" </div>" .
"</div>";
117 $this->assertEquals($expected, $html);
126 $text =
$f->text($label)->withNameFrom($this->name_source)->withRequired(
true);
131 $expected =
"<div class=\"form-group row\">" .
" <label for=\"$name\" class=\"control-label col-sm-3\">" .
"$label"
132 .
"<span class=\"asterisk\">*</span>" .
"</label>" .
" <div class=\"col-sm-9\">"
133 .
" <input type=\"text\" name=\"$name\" class=\"form-control form-control-sm\" />" .
" " .
" " .
" </div>"
135 $this->assertEquals($expected, $html);
143 $text =
$f->text($label)->withNameFrom($this->name_source)->withDisabled(
true);
148 $expected =
"<div class=\"form-group row\">" .
" <label for=\"$name\" class=\"control-label col-sm-3\">$label</label>"
149 .
" <div class=\"col-sm-9\">" .
" <input type=\"text\" name=\"$name\" disabled=\"disabled\" class=\"form-control form-control-sm\" />" .
" "
150 .
" " .
" </div>" .
"</div>";
152 $this->assertEquals($expected, $html);
161 $text =
$f->text($label)->withNameFrom($this->name_source)->withRequired(
true);
164 $value1 = $text1->getContent();
165 $this->assertTrue($value1->isOk());
166 $this->assertEquals(
"0", $value1->value());
169 $value2 = $text2->getContent();
170 $this->assertTrue($value2->isError());
178 ->withNameFrom($this->name_source)
181 $content = $text->getContent();
182 $this->assertEquals(
"alert()", $content->value());
An exception for terminatinating execution or to throw for unit testing.
Provides common functionality for UI tests.
getDefaultRenderer(JavaScriptBinding $js_binding=null)
test_implements_factory_interface()
Class ChatMainBarProvider \MainMenu\Provider.