Definition at line 32 of file NumericInputTest.php.
◆ setUp()
| NumericInputTest::setUp |
( |
| ) |
|
◆ testCommonRendering()
| NumericInputTest::testCommonRendering |
( |
| ) |
|
Definition at line 71 of file NumericInputTest.php.
References Vendor\Package\$f.
73 $f = $this->getFieldFactory();
75 $numeric =
$f->numeric($label)->withNameFrom($this->name_source);
77 $this->testWithError($numeric);
78 $this->testWithNoByline($numeric);
79 $this->testWithRequired($numeric);
80 $this->testWithDisabled($numeric);
81 $this->testWithAdditionalOnloadCodeRendersId($numeric);
◆ testConstraintForRequirementForFloat()
testNullValue
Definition at line 154 of file NumericInputTest.php.
157 $field_required = $field->withRequired(
true);
159 $value = $field->withInput($post_data)->getContent();
160 $this->assertTrue($value->isOk());
162 $this->assertEquals(1, $value->value());
164 $value = $field_required->withInput($post_data)->getContent();
165 $this->assertTrue($value->isOK());
166 $this->assertEquals(1, $value->value());
◆ testEmptyValue()
testNullValue
Definition at line 120 of file NumericInputTest.php.
123 $field_required = $field->withRequired(
true);
125 $value = $field->withInput($post_data)->getContent();
126 $this->assertTrue($value->isOk());
127 $this->assertNull($value->value());
129 $field_required = $field_required->withInput($post_data);
130 $value = $field_required->getContent();
131 $this->assertTrue($value->isError());
◆ testImplementsFactoryInterface()
| NumericInputTest::testImplementsFactoryInterface |
( |
| ) |
|
Definition at line 43 of file NumericInputTest.php.
References Vendor\Package\$f.
45 $f = $this->getFieldFactory();
47 $numeric =
$f->numeric(
"label",
"byline");
49 $this->assertInstanceOf(\
ILIAS\
UI\
Component\Input\Container\Form\FormInput::class, $numeric);
50 $this->assertInstanceOf(Field\Numeric::class, $numeric);
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testNullValue()
| NumericInputTest::testNullValue |
( |
| ) |
|
Definition at line 101 of file NumericInputTest.php.
References Vendor\Package\$f.
101 : \ILIAS\UI\Component\Input\Container\Form\FormInput
103 $f = $this->getFieldFactory();
105 $field =
$f->numeric(
'')->withNameFrom($this->name_source);
106 $field_required = $field->withRequired(
true);
108 $value = $field->withInput($post_data)->getContent();
109 $this->assertTrue($value->isOk());
110 $this->assertNull($value->value());
112 $value = $field_required->withInput($post_data)->getContent();
113 $this->assertTrue($value->isError());
◆ testRender()
| NumericInputTest::testRender |
( |
| ) |
|
Definition at line 54 of file NumericInputTest.php.
References Vendor\Package\$f.
56 $f = $this->getFieldFactory();
59 $numeric =
$f->numeric($label, $byline)->withNameFrom($this->name_source);
61 $expected = $this->getFormWrappedHtml(
62 'numeric-field-input',
64 '<input id="id_1" type="number" name="name_0" class="c-field-number" />',
68 $this->assertEquals($expected, $this->render($numeric));
◆ testRenderValue()
| NumericInputTest::testRenderValue |
( |
| ) |
|
Definition at line 84 of file NumericInputTest.php.
References Vendor\Package\$f.
86 $f = $this->getFieldFactory();
89 $numeric =
$f->numeric($label)->withValue($value)->withNameFrom($this->name_source);
91 $expected = $this->getFormWrappedHtml(
92 'numeric-field-input',
94 '<input id="id_1" type="number" value="10" name="name_0" class="c-field-number" />',
98 $this->assertEquals($expected, $this->render($numeric));
◆ testZeroIsValidValue()
testNullValue
Definition at line 137 of file NumericInputTest.php.
140 $field_required = $field->withRequired(
true);
142 $value = $field->withInput($post_data)->getContent();
143 $this->assertTrue($value->isOk());
144 $this->assertEquals(0, $value->value());
146 $value = $field_required->withInput($post_data)->getContent();
147 $this->assertTrue($value->isOK());
148 $this->assertEquals(0, $value->value());
◆ $name_source
The documentation for this class was generated from the following file: