3declare(strict_types=1);
21require_once(__DIR__ .
"/../../../../../libs/composer/vendor/autoload.php");
22require_once(__DIR__ .
"/../../../Base.php");
23require_once(__DIR__ .
"/InputTest.php");
44 return new I\Input\Field\Factory(
48 new Refinery($df, $language),
57 $numeric =
$f->numeric(
"label",
"byline");
60 $this->assertInstanceOf(Field\Numeric::class, $numeric);
69 $numeric =
$f->numeric($label, $byline)->withNameFrom($this->name_source);
75<div class="form-group row">
76 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label>
77 <div class="col-sm-8 col-md-9 col-lg-10">
78 <input id="id_1" type="number" name="name_0" class="form-control form-control-sm" />
79 <div class="help-block">byline</div>
83 $this->assertEquals($expected, $html);
92 $numeric =
$f->numeric($label, $byline)->withNameFrom($this->name_source)->withError($error);
98<div class="form-group row">
99 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label>
100 <div class="col-sm-8 col-md-9 col-lg-10">
101 <div class="help-block alert alert-danger" aria-describedby="id_1" role="alert">an_error</div>
102 <input id="id_1" type="number" name="name_0" class="form-control form-control-sm" />
103 <div class="help-block">byline</div>
106 $this->assertEquals($expected, $html);
113 $numeric =
$f->numeric($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="number" name="name_0" class="form-control form-control-sm" /> </div>
124 $this->assertEquals($expected, $html);
132 $numeric =
$f->numeric($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="number" value="10" name="name_0" class="form-control form-control-sm" /> </div>
143 $this->assertEquals($expected, $html);
150 $numeric =
$f->numeric($label)->withNameFrom($this->name_source)->withDisabled(
true);
156<div class="form-group row">
157 <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">label</label>
158 <div class="col-sm-8 col-md-9 col-lg-10"> <input id="id_1" type="number" name="name_0" disabled="disabled" class="form-control form-control-sm" /> </div>
160 $this->assertEquals($expected, $html);
167 $field =
$f->numeric(
'')->withNameFrom($this->name_source);
168 $field_required = $field->withRequired(
true);
170 $value = $field->withInput($post_data)->getContent();
171 $this->assertTrue($value->isOk());
172 $this->assertNull($value->value());
174 $value = $field_required->withInput($post_data)->getContent();
175 $this->assertTrue($value->isError());
185 $field_required = $field->withRequired(
true);
187 $value = $field->withInput($post_data)->getContent();
188 $this->assertTrue($value->isOk());
189 $this->assertNull($value->value());
191 $field_required = $field_required->withInput($post_data);
192 $value = $field_required->getContent();
193 $this->assertTrue($value->isError());
202 $field_required = $field->withRequired(
true);
204 $value = $field->withInput($post_data)->getContent();
205 $this->assertTrue($value->isOk());
206 $this->assertEquals(0, $value->value());
208 $value = $field_required->withInput($post_data)->getContent();
209 $this->assertTrue($value->isOK());
210 $this->assertEquals(0, $value->value());
219 $field_required = $field->withRequired(
true);
221 $value = $field->withInput($post_data)->getContent();
222 $this->assertTrue($value->isOk());
224 $this->assertEquals(1, $value->value());
226 $value = $field_required->withInput($post_data)->getContent();
227 $this->assertTrue($value->isOK());
228 $this->assertEquals(1, $value->value());
Provides common functionality for UI tests.
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.