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);
58<div class="form-group row">
59 <label for="id_1" class="control-label col-sm-3">label</label>
60 <div class="col-sm-9">
61 <input id="id_1" type="text" name="name_0" class="form-control form-control-sm" />
62 <div class="help-block">byline</div>
66 $this->assertEquals($expected, $html);
77 $text =
$f->text($label, $byline)->withNameFrom($this->name_source)->withError($error);
83<div class="form-group row">
84 <label for="id_1" class="control-label col-sm-3">label</label>
85 <div class="col-sm-9">
86 <div class="help-block alert alert-danger" role="alert">an_error</div>
87 <input id="id_1" type="text" name="name_0" class="form-control form-control-sm" />
88 <div class="help-block">byline</div>
92 $this->assertEquals($expected, $html);
101 $text =
$f->text($label)->withNameFrom($this->name_source);
107<div class="form-group row">
108 <label for="id_1" class="control-label col-sm-3">label</label>
109 <div class="col-sm-9"><input id="id_1" type="text" name="name_0" class="form-control form-control-sm" /></div>
112 $this->assertEquals($expected, $html);
122 $text =
$f->text($label)->withValue($value)->withNameFrom($this->name_source);
128<div class="form-group row">
129 <label for="id_1" class="control-label col-sm-3">label</label>
130 <div class="col-sm-9"><input id="id_1" type="text" value="value" name="name_0" class="form-control form-control-sm" /></div>
133 $this->assertEquals($expected, $html);
141 $text =
$f->text($label)->withValue($value)->withNameFrom($this->name_source);
147<div class="form-group row">
148 <label for="id_1" class="control-label col-sm-3">label</label>
149 <div class="col-sm-9"><input id="id_1" type="text" value="0" name="name_0" class="form-control form-control-sm" /></div>
152 $this->assertEquals($expected, $html);
160 $text =
$f->text($label)->withNameFrom($this->name_source)->withRequired(
true);
166<div class="form-group row">
167 <label for="id_1" class="control-label col-sm-3">label<span class="asterisk">*</span></label>
168 <div class="col-sm-9"><input id="id_1" type="text" name="name_0" class="form-control form-control-sm" /></div>
171 $this->assertEquals($expected, $html);
179 $text =
$f->text($label)->withNameFrom($this->name_source)->withDisabled(
true);
185<div class="form-group row">
186 <label for="id_1" class="control-label col-sm-3">label</label>
187 <div class="col-sm-9"><input id="id_1" type="text" name="name_0" disabled="disabled" class="form-control form-control-sm" /></div>
190 $this->assertEquals($expected, $html);
199 $text =
$f->text($label)->withNameFrom($this->name_source)->withRequired(
true);
202 $value1 = $text1->getContent();
203 $this->assertTrue($value1->isOk());
204 $this->assertEquals(
"0", $value1->value());
207 $value2 = $text2->getContent();
208 $this->assertTrue($value2->isError());
216 ->withNameFrom($this->name_source)
219 $content = $text->getContent();
220 $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, $with_stub_renderings=[])
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
test_implements_factory_interface()
Class ChatMainBarProvider \MainMenu\Provider.