Definition at line 15 of file CheckboxInputTest.php.
◆ buildFactory()
CheckboxInputTest::buildFactory |
( |
| ) |
|
|
protected |
Definition at line 24 of file CheckboxInputTest.php.
Referenced by testDisabledContent(), testFalseContent(), testHandleInvalidValue(), testImplementsFactoryInterface(), testRender(), testRenderDisabled(), testRenderError(), testRenderNoByline(), testRenderRequired(), testRenderValue(), testTransformation(), and testTrueContent().
26 $df =
new Data\Factory();
27 $language = $this->createMock(\ilLanguage::class);
Class ChatMainBarProvider .
◆ setUp()
CheckboxInputTest::setUp |
( |
| ) |
|
Definition at line 17 of file CheckboxInputTest.php.
20 $this->refinery =
new Refinery($this->createMock(Data\Factory::class), $this->createMock(\ilLanguage::class));
◆ testDisabledContent()
CheckboxInputTest::testDisabledContent |
( |
| ) |
|
Definition at line 186 of file CheckboxInputTest.php.
References Vendor\Package\$f, and buildFactory().
190 $checkbox =
$f->checkbox($label)
191 ->withNameFrom($this->name_source)
194 ->withInput($this->createMock(InputData::class))
197 $this->assertIsBool($checkbox->getContent()->value());
198 $this->assertTrue($checkbox->getContent()->value());
◆ testFalseContent()
CheckboxInputTest::testFalseContent |
( |
| ) |
|
Definition at line 167 of file CheckboxInputTest.php.
References Vendor\Package\$f, and buildFactory().
171 $checkbox =
$f->checkbox($label)->withNameFrom($this->name_source);
173 $input_data = $this->createMock(InputData::class);
175 ->expects($this->atLeastOnce())
180 $checkbox_false = $checkbox->withInput($input_data);
182 $this->assertIsBool($checkbox_false->getContent()->value());
183 $this->assertFalse($checkbox_false->getContent()->value());
◆ testHandleInvalidValue()
CheckboxInputTest::testHandleInvalidValue |
( |
| ) |
|
◆ testImplementsFactoryInterface()
CheckboxInputTest::testImplementsFactoryInterface |
( |
| ) |
|
◆ testRender()
CheckboxInputTest::testRender |
( |
| ) |
|
Definition at line 48 of file CheckboxInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
53 $checkbox =
$f->checkbox($label, $byline)->withNameFrom($this->name_source);
56 $html = $r->render($checkbox);
58 $expected =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label</label> <div class=\"col-sm-9\"> <input type=\"checkbox\" value=\"checked\" name=\"name_0\" class=\"form-control form-control-sm\" /> <div class=\"help-block\">byline</div> </div></div>";
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ testRenderDisabled()
CheckboxInputTest::testRenderDisabled |
( |
| ) |
|
Definition at line 135 of file CheckboxInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
139 $checkbox =
$f->checkbox($label)->withNameFrom($this->name_source)->withDisabled(
true);
142 $html = $r->render($checkbox);
144 $expected =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label</label> <div class=\"col-sm-9\"> <input type=\"checkbox\" value=\"checked\" name=\"name_0\" disabled=\"disabled\" class=\"form-control form-control-sm\" /> </div></div>";
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ testRenderError()
CheckboxInputTest::testRenderError |
( |
| ) |
|
Definition at line 63 of file CheckboxInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
69 $checkbox =
$f->checkbox($label, $byline)->withNameFrom($this->name_source)->withError($error);
72 $html = $r->render($checkbox);
74 $expected =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label</label> <div class=\"col-sm-9\"> <input type=\"checkbox\" value=\"checked\" name=\"name_0\" class=\"form-control form-control-sm\" /> <div class=\"help-block\">byline</div> <div class=\"help-block alert alert-danger\" role=\"alert\"> <img border=\"0\" src=\" ./templates/default/images/icon_alert.svg\" alt=\"alert\" />" .
" $error" 75 .
" </div></div></div>";
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ testRenderNoByline()
CheckboxInputTest::testRenderNoByline |
( |
| ) |
|
Definition at line 80 of file CheckboxInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
84 $checkbox =
$f->checkbox($label)->withNameFrom($this->name_source);
87 $html = $r->render($checkbox);
89 $expected =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label</label> <div class=\"col-sm-9\"> <input type=\"checkbox\" value=\"checked\" name=\"name_0\" class=\"form-control form-control-sm\" /> </div></div>";
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ testRenderRequired()
CheckboxInputTest::testRenderRequired |
( |
| ) |
|
Definition at line 122 of file CheckboxInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
126 $checkbox =
$f->checkbox($label)->withNameFrom($this->name_source)->withRequired(
true);
129 $html = $r->render($checkbox);
131 $expected =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label<span class=\"asterisk\">*</span></label> <div class=\"col-sm-9\"> <input type=\"checkbox\" value=\"checked\" name=\"name_0\" class=\"form-control form-control-sm\" /> </div></div>";
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ testRenderValue()
CheckboxInputTest::testRenderValue |
( |
| ) |
|
Definition at line 94 of file CheckboxInputTest.php.
References Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
99 $checkbox =
$f->checkbox($label)->withValue($value)->withNameFrom($this->name_source);
102 $html = $r->render($checkbox);
104 $expected =
"<div class=\"form-group row\"> <label for=\"name_0\" class=\"control-label col-sm-3\">label</label> <div class=\"col-sm-9\"> <input type=\"checkbox\" value=\"checked\" checked=\"checked\" name=\"name_0\" class=\"form-control form-control-sm\" /> </div></div>";
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ testTransformation()
CheckboxInputTest::testTransformation |
( |
| ) |
|
Definition at line 201 of file CheckboxInputTest.php.
References Vendor\Package\$f, and buildFactory().
206 $new_value =
"NEW_VALUE";
207 $checkbox =
$f->checkbox($label)
208 ->withNameFrom($this->name_source)
211 ->withAdditionalTransformation($this->refinery->custom()->transformation(
function ($v) use (&$called, $new_value) {
215 ->withInput($this->createMock(InputData::class))
218 $this->assertIsString($checkbox->getContent()->value());
219 $this->assertEquals($new_value, $checkbox->getContent()->value());
◆ testTrueContent()
CheckboxInputTest::testTrueContent |
( |
| ) |
|
Definition at line 148 of file CheckboxInputTest.php.
References Vendor\Package\$f, and buildFactory().
152 $checkbox =
$f->checkbox($label)->withNameFrom($this->name_source);
154 $input_data = $this->createMock(InputData::class);
156 ->expects($this->atLeastOnce())
159 ->willReturn(
"checked");
161 $checkbox_true = $checkbox->withInput($input_data);
163 $this->assertIsBool($checkbox_true->getContent()->value());
164 $this->assertTrue($checkbox_true->getContent()->value());
The documentation for this class was generated from the following file: