Test on standard form implementation.
More...
Test on standard form implementation.
Definition at line 72 of file StandardFormTest.php.
◆ buildButtonFactory()
| StandardFormTest::buildButtonFactory |
( |
| ) |
|
|
protected |
◆ buildFactory()
| StandardFormTest::buildFactory |
( |
| ) |
|
|
protected |
◆ buildInputFactory()
| StandardFormTest::buildInputFactory |
( |
| ) |
|
|
protected |
Definition at line 79 of file StandardFormTest.php.
79 : I\Input\Field\Factory
81 $df =
new Data\Factory();
82 $language = $this->createMock(ilLanguage::class);
83 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...
◆ getUIFactory()
| StandardFormTest::getUIFactory |
( |
| ) |
|
◆ testGetPostURL()
| StandardFormTest::testGetPostURL |
( |
| ) |
|
◆ testRender()
| StandardFormTest::testRender |
( |
| ) |
|
Definition at line 111 of file StandardFormTest.php.
References Vendor\Package\$f, $r, and $url.
117 $form =
$f->standard(
$url, [
118 $if->text(
"label",
"byline"),
125 <form role="form" class="il-standard-form form-horizontal" enctype="multipart/form-data" action="MY_URL" method="post" > 126 <div class="il-standard-form-header clearfix"> 127 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">save</button></div> 129 <div class="form-group row"> 130 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 131 <div class="col-sm-8 col-md-9 col-lg-10"> 132 <input id="id_1" type="text" name="form/input_0" class="form-control form-control-sm"/> 133 <div class="help-block">byline</div> 136 <div class="il-standard-form-footer clearfix"> 137 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">save</button></div> getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ testRenderNoUrl()
| StandardFormTest::testRenderNoUrl |
( |
| ) |
|
Definition at line 195 of file StandardFormTest.php.
References Vendor\Package\$f, $r, and $url.
201 $form =
$f->standard(
$url, [
202 $if->text(
"label",
"byline"),
209 <form role="form" class="il-standard-form form-horizontal" enctype="multipart/form-data" method="post" > 210 <div class="il-standard-form-header clearfix"> 211 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">save</button></div> 213 <div class="form-group row"> 214 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 215 <div class="col-sm-8 col-md-9 col-lg-10"> 216 <input id="id_1" type="text" name="form/input_0" class="form-control form-control-sm"/> 217 <div class="help-block">byline</div> 220 <div class="il-standard-form-footer clearfix"> 221 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">save</button></div> getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ testRenderWithErrorOnField()
| StandardFormTest::testRenderWithErrorOnField |
( |
| ) |
|
Definition at line 229 of file StandardFormTest.php.
References $r, and ILIAS\Repository\$refinery.
232 $df =
new Data\Factory();
233 $language = $this->createMock(\ilLanguage::class);
235 ->expects($this->once())
237 ->willReturn(
'testing error message');
239 $refinery = new \ILIAS\Refinery\Factory($df, $language);
249 $fail =
$refinery->custom()->constraint(
function ($v) {
251 },
"This is invalid...");
252 $input = $if->text(
"label",
"byline");
254 $input = $input->withAdditionalTransformation($fail);
258 $request = $this->createMock(ServerRequestInterface::class);
260 ->expects($this->once())
261 ->method(
"getParsedBody")
263 'form_0/input_1' =>
'' 266 $form = $form->withRequest($request);
267 $this->assertNull($form->getData());
271 <form role="form" class="il-standard-form form-horizontal" enctype="multipart/form-data" method="post" > 272 <div class="il-standard-form-header clearfix"> 273 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">save</button></div> 276 <div class="help-block alert alert-danger" role="alert">testing error message</div> 278 <div class="form-group row"> 279 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 280 <div class="col-sm-8 col-md-9 col-lg-10"> 281 <div class="help-block alert alert-danger" aria-describedby="id_1" role="alert">This is invalid...</div> 282 <input id="id_1" type="text" name="form_0/input_1" class="form-control form-control-sm" /> 283 <div class="help-block">byline</div> 286 <div class="il-standard-form-footer clearfix"> 287 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">save</button></div> getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
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)
Refinery Factory $refinery
◆ testRenderWithErrorOnForm()
| StandardFormTest::testRenderWithErrorOnForm |
( |
| ) |
|
Definition at line 295 of file StandardFormTest.php.
References $r, and ILIAS\Repository\$refinery.
298 $df =
new Data\Factory();
299 $language = $this->createMock(\ilLanguage::class);
300 $refinery = new \ILIAS\Refinery\Factory($df, $language);
310 $fail =
$refinery->custom()->constraint(
function ($v) {
312 },
"This is a fail on form.");
313 $input = $if->text(
"label",
"byline");
316 $form = $form->withAdditionalTransformation($fail);
318 $request = $this->createMock(ServerRequestInterface::class);
320 ->expects($this->once())
321 ->method(
"getParsedBody")
323 'form_0/input_1' =>
'' 326 $form = $form->withRequest($request);
327 $this->assertNull($form->getData());
331 <form role="form" class="il-standard-form form-horizontal" enctype="multipart/form-data" method="post" > 332 <div class="il-standard-form-header clearfix"> 333 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">save</button></div> 336 <div class="help-block alert alert-danger" role="alert">This is a fail on form.</div> 338 <div class="form-group row"> 339 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 340 <div class="col-sm-8 col-md-9 col-lg-10"> 341 <input id="id_1" type="text" name="form_0/input_1" class="form-control form-control-sm" /> 342 <div class="help-block">byline</div> 345 <div class="il-standard-form-footer clearfix"> 346 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">save</button></div> getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
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)
Refinery Factory $refinery
◆ testStandardFormRenderWithRequired()
| StandardFormTest::testStandardFormRenderWithRequired |
( |
| ) |
|
Definition at line 353 of file StandardFormTest.php.
References Vendor\Package\$f, $r, and $url.
359 $form =
$f->standard(
$url, [$if->text(
"label",
"byline")->withRequired(
true)]);
365 <form role="form" class="il-standard-form form-horizontal" enctype="multipart/form-data" action="MY_URL" method="post" > 366 <div class="il-standard-form-header clearfix"> 367 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">save</button></div> 368 <div class="il-standard-form-required"> 369 <span class="asterisk">*</span><span class="small"> required_field</span> 372 <div class="form-group row"> 373 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label<span class="asterisk">*</span></label> 374 <div class="col-sm-8 col-md-9 col-lg-10"> 375 <input id="id_1" type="text" name="form/input_0" class="form-control form-control-sm"/> 376 <div class="help-block">byline</div> 379 <div class="il-standard-form-footer clearfix"> 380 <span class="asterisk">*</span><span class="small"> required_field</span> 382 <div class="il-standard-form-footer clearfix"> 383 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">save</button></div> getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ testSubmitCaption()
| StandardFormTest::testSubmitCaption |
( |
| ) |
|
Definition at line 144 of file StandardFormTest.php.
References Vendor\Package\$f, and $url.
150 $form =
$f->standard(
$url, [
151 $if->text(
"label",
"byline"),
154 $this->assertNull($form->getSubmitLabel());
156 $caption =
'Caption';
157 $form = $form->withSubmitLabel($caption);
159 $this->assertEquals($caption, $form->getSubmitLabel());
◆ testSubmitCaptionRender()
| StandardFormTest::testSubmitCaptionRender |
( |
| ) |
|
Definition at line 162 of file StandardFormTest.php.
References Vendor\Package\$f, $r, and $url.
168 $form =
$f->standard(
$url, [
169 $if->text(
"label",
"byline"),
170 ])->withSubmitLabel(
'create');
176 <form role="form" class="il-standard-form form-horizontal" enctype="multipart/form-data" action="MY_URL" method="post" > 177 <div class="il-standard-form-header clearfix"> 178 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">create</button></div> 180 <div class="form-group row"> 181 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label> 182 <div class="col-sm-8 col-md-9 col-lg-10"> 183 <input id="id_1" type="text" name="form/input_0" class="form-control form-control-sm"/> 184 <div class="help-block">byline</div> 187 <div class="il-standard-form-footer clearfix"> 188 <div class="il-standard-form-cmd"><button class="btn btn-default" data-action="">create</button></div> getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
The documentation for this class was generated from the following file: