Definition at line 15 of file RadioInputTest.php.
◆ buildFactory()
RadioInputTest::buildFactory |
( |
| ) |
|
|
protected |
◆ buildRadio()
RadioInputTest::buildRadio |
( |
| ) |
|
|
protected |
◆ setUp()
RadioInputTest::setUp |
( |
| ) |
|
◆ test_implements_factory_interface()
RadioInputTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 46 of file RadioInputTest.php.
References $f, and buildFactory().
49 $radio =
$f->radio(
"label",
"byline");
50 $this->assertInstanceOf(Field\Input::class, $radio);
51 $this->assertInstanceOf(Field\Radio::class, $radio);
◆ test_render()
RadioInputTest::test_render |
( |
| ) |
|
Definition at line 55 of file RadioInputTest.php.
References $name, PHPMailer\PHPMailer\$options, $r, ILIAS_UI_TestBase\assertHTMLEquals(), buildRadio(), and ILIAS_UI_TestBase\getDefaultRenderer().
59 $name = $radio->getName();
60 $label = $radio->getLabel();
61 $byline = $radio->getByline();
65 .
"<div class=\"form-group row\">" 66 .
"<label for=\"\" class=\"control-label col-sm-3\">$label</label>" 67 .
"<div class=\"col-sm-9\">" 68 .
"<div id=\"id_1\" class=\"il-input-radio\">";
70 foreach (
$options as $opt_value => $opt_label) {
72 .
"<div class=\"form-control form-control-sm il-input-radiooption\">" 73 .
"<input type=\"radio\" id=\"id_1_" . $opt_value .
"_opt\" name=\"$name\" value=\"$opt_value\" />" 74 .
"<label for=\"id_1_" . $opt_value .
"_opt\">$opt_label</label>" 75 .
"<div class=\"help-block\">{$radio->getBylineFor($opt_value)}</div>" 81 .
"<div class=\"help-block\">$byline</div>"
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_render_value()
RadioInputTest::test_render_value |
( |
| ) |
|
Definition at line 88 of file RadioInputTest.php.
References $name, PHPMailer\PHPMailer\$options, $r, ILIAS_UI_TestBase\assertHTMLEquals(), buildRadio(), and ILIAS_UI_TestBase\getDefaultRenderer().
92 $name = $radio->getName();
93 $label = $radio->getLabel();
94 $byline = $radio->getByline();
97 $radio = $radio->withValue($value);
99 .
"<div class=\"form-group row\">" 100 .
"<label for=\"\" class=\"control-label col-sm-3\">$label</label>" 101 .
"<div class=\"col-sm-9\">" 102 .
"<div id=\"id_1\" class=\"il-input-radio\">";
104 foreach (
$options as $opt_value => $opt_label) {
105 $expected .=
"<div class=\"form-control form-control-sm il-input-radiooption\">";
106 if ($opt_value === $value) {
107 $expected .=
"<input type=\"radio\" id=\"id_1_" . $opt_value .
"_opt\" name=\"$name\" value=\"$opt_value\" checked=\"checked\"/>";
109 $expected .=
"<input type=\"radio\" id=\"id_1_" . $opt_value .
"_opt\" name=\"$name\" value=\"$opt_value\" />";
112 .
"<label for=\"id_1_" . $opt_value .
"_opt\">$opt_label</label>" 113 .
"<div class=\"help-block\">{$radio->getBylineFor($opt_value)}</div>" 119 .
"<div class=\"help-block\">$byline</div>"
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_with_dependant()
RadioInputTest::test_with_dependant |
( |
| ) |
|
Definition at line 127 of file RadioInputTest.php.
References $f, $r, buildFactory(), and ILIAS_UI_TestBase\getDefaultRenderer().
131 $dep_field =
$f->text(
'text',
'text');
132 $radio =
$f->radio(
'label',
'byline')
133 ->withOption(
'value0',
'label0',
'byline0');
135 $this->assertNull($radio->getDependantFieldsFor(
'value0'));
137 $dep = [
'dep1' => $dep_field];
138 $radio = $radio->withOption(
'value1',
'label1',
'byline1', $dep);
141 $radio->getDependantFieldsFor(
'value1')
getDefaultRenderer(JavaScriptBinding $js_binding=null)
The documentation for this class was generated from the following file: