Definition at line 31 of file TextInputTest.php.
◆ buildFactory()
TextInputTest::buildFactory |
( |
| ) |
|
|
protected |
Definition at line 40 of file TextInputTest.php.
Referenced by test_implements_factory_interface(), test_max_length(), test_render(), test_render_disabled(), test_render_error(), test_render_max_value(), test_render_no_byline(), test_render_required(), test_render_value(), test_render_value_0(), test_stripsTags(), and test_value_required().
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_implements_factory_interface()
TextInputTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 53 of file TextInputTest.php.
References Vendor\Package\$f, and buildFactory().
57 $text =
$f->text(
"label",
"byline");
60 $this->assertInstanceOf(Field\Text::class, $text);
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ test_max_length()
TextInputTest::test_max_length |
( |
| ) |
|
Definition at line 201 of file TextInputTest.php.
References Vendor\Package\$f, and buildFactory().
208 $this->assertEquals(4, $text->getMaxLength());
210 $text1 = $text->withValue(
"1234");
211 $this->assertEquals(
"1234", $text1->getValue());
213 $this->expectException(InvalidArgumentException::class);
214 $this->expectExceptionMessage(
"Argument 'value': Display value does not match input type.");
215 $text->withValue(
"12345");
◆ test_render()
TextInputTest::test_render |
( |
| ) |
|
Definition at line 63 of file TextInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
68 $text =
$f->text($label, $byline)->withNameFrom($this->name_source);
74 <div class="form-group row"> 75 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 76 <div class="col-sm-8 col-md-9 col-lg-10"> 77 <input id="id_1" type="text" name="name_0" class="form-control form-control-sm" /> 78 <div class="help-block">byline</div> 82 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ test_render_disabled()
TextInputTest::test_render_disabled |
( |
| ) |
|
Definition at line 183 of file TextInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
187 $text =
$f->text($label)->withNameFrom($this->name_source)->withDisabled(
true);
193 <div class="form-group row"> 194 <label for="id_1" 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"><input id="id_1" type="text" name="name_0" disabled="disabled" class="form-control form-control-sm" /></div> 198 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ test_render_error()
TextInputTest::test_render_error |
( |
| ) |
|
Definition at line 85 of file TextInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
91 $text =
$f->text($label, $byline)->withNameFrom($this->name_source)->withError($error);
97 <div class="form-group row"> 98 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 99 <div class="col-sm-8 col-md-9 col-lg-10"> 100 <div class="help-block alert alert-danger" aria-describedby="id_1" role="alert">an_error</div> 101 <input id="id_1" type="text" name="name_0" class="form-control form-control-sm" /> 102 <div class="help-block">byline</div> 106 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ test_render_max_value()
TextInputTest::test_render_max_value |
( |
| ) |
|
Definition at line 218 of file TextInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
222 $text =
$f->text($label)->withNameFrom($this->name_source)->withMaxLength(8);
228 <div class="form-group row"> 229 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 230 <div class="col-sm-8 col-md-9 col-lg-10"> <input id="id_1" type="text" name="name_0" maxlength="8" class="form-control form-control-sm" /> </div> 233 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ test_render_no_byline()
TextInputTest::test_render_no_byline |
( |
| ) |
|
Definition at line 109 of file TextInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
113 $text =
$f->text($label)->withNameFrom($this->name_source);
119 <div class="form-group row"> 120 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 121 <div class="col-sm-8 col-md-9 col-lg-10"><input id="id_1" type="text" name="name_0" class="form-control form-control-sm" /></div> 124 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ test_render_required()
TextInputTest::test_render_required |
( |
| ) |
|
Definition at line 165 of file TextInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
169 $text =
$f->text($label)->withNameFrom($this->name_source)->withRequired(
true);
175 <div class="form-group row"> 176 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label<span class="asterisk">*</span></label> 177 <div class="col-sm-8 col-md-9 col-lg-10"><input id="id_1" type="text" name="name_0" class="form-control form-control-sm" /></div> 180 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ test_render_value()
TextInputTest::test_render_value |
( |
| ) |
|
Definition at line 127 of file TextInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
132 $text =
$f->text($label)->withValue($value)->withNameFrom($this->name_source);
138 <div class="form-group row"> 139 <label for="id_1" 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"><input id="id_1" type="text" value="value" name="name_0" class="form-control form-control-sm" /></div> 143 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ test_render_value_0()
TextInputTest::test_render_value_0 |
( |
| ) |
|
Definition at line 146 of file TextInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
151 $text =
$f->text($label)->withValue($value)->withNameFrom($this->name_source);
157 <div class="form-group row"> 158 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 159 <div class="col-sm-8 col-md-9 col-lg-10"><input id="id_1" type="text" value="0" name="name_0" class="form-control form-control-sm" /></div> 162 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ test_stripsTags()
TextInputTest::test_stripsTags |
( |
| ) |
|
◆ test_value_required()
TextInputTest::test_value_required |
( |
| ) |
|
Definition at line 236 of file TextInputTest.php.
References Vendor\Package\$f, $name, and buildFactory().
241 $text =
$f->text($label)->withNameFrom($this->name_source)->withRequired(
true);
244 $value1 = $text1->getContent();
245 $this->assertTrue($value1->isOk());
246 $this->assertEquals(
"0", $value1->value());
249 $value2 = $text2->getContent();
250 $this->assertTrue($value2->isError());
◆ $name_source
The documentation for this class was generated from the following file: