Definition at line 30 of file RadioInputTest.php.
◆ buildFactory()
RadioInputTest::buildFactory |
( |
| ) |
|
|
protected |
Definition at line 39 of file RadioInputTest.php.
Referenced by buildRadio(), and test_implements_factory_interface().
39 : I\Input\Field\Factory
41 $df =
new Data\Factory();
42 $language = $this->createMock(\ilLanguage::class);
43 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...
◆ buildRadio()
RadioInputTest::buildRadio |
( |
| ) |
|
|
protected |
◆ setUp()
RadioInputTest::setUp |
( |
| ) |
|
◆ test_implements_factory_interface()
RadioInputTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 64 of file RadioInputTest.php.
References Vendor\Package\$f, and buildFactory().
67 $radio =
$f->radio(
"label",
"byline");
69 $this->assertInstanceOf(Field\Radio::class, $radio);
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ test_render()
RadioInputTest::test_render |
( |
| ) |
|
Definition at line 72 of file RadioInputTest.php.
References $name, ILIAS_UI_TestBase\assertHTMLEquals(), buildRadio(), and ILIAS_UI_TestBase\getDefaultRenderer().
76 $name = $radio->getName();
77 $label = $radio->getLabel();
78 $byline = $radio->getByline();
79 $options = $radio->getOptions();
82 .
"<div class=\"form-group row\">" 83 .
"<label class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label>" 84 .
"<div class=\"col-sm-8 col-md-9 col-lg-10\">" 85 .
"<div id=\"id_1\" class=\"il-input-radio\">";
87 foreach ($options as $opt_value => $opt_label) {
89 .
"<div class=\"form-control form-control-sm il-input-radiooption\">" 90 .
"<input type=\"radio\" id=\"id_1_" . $opt_value .
"_opt\" name=\"$name\" value=\"$opt_value\" />" 91 .
"<label for=\"id_1_" . $opt_value .
"_opt\">$opt_label</label>" 92 .
"<div class=\"help-block\">{$radio->getBylineFor((string) $opt_value)}</div>" 98 .
"<div class=\"help-block\">$byline</div>" getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_disabled()
RadioInputTest::test_render_disabled |
( |
| ) |
|
Definition at line 142 of file RadioInputTest.php.
References $name, ILIAS_UI_TestBase\assertHTMLEquals(), buildRadio(), and ILIAS_UI_TestBase\getDefaultRenderer().
145 $radio = $this->
buildRadio()->withDisabled(
true);
146 $name = $radio->getName();
147 $label = $radio->getLabel();
148 $byline = $radio->getByline();
149 $options = $radio->getOptions();
152 .
"<div class=\"form-group row\">" 153 .
"<label class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label>" 154 .
"<div class=\"col-sm-8 col-md-9 col-lg-10\">" 155 .
"<div id=\"id_1\" class=\"il-input-radio\">";
157 foreach ($options as $opt_value => $opt_label) {
159 .
"<div class=\"form-control form-control-sm il-input-radiooption\">" 160 .
"<input type=\"radio\" id=\"id_1_" . $opt_value .
"_opt\" name=\"$name\" value=\"$opt_value\" disabled=\"disabled\"/>" 161 .
"<label for=\"id_1_" . $opt_value .
"_opt\">$opt_label</label>" 162 .
"<div class=\"help-block\">{$radio->getBylineFor((string) $opt_value)}</div>" 168 .
"<div class=\"help-block\">$byline</div>" getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_value()
RadioInputTest::test_render_value |
( |
| ) |
|
Definition at line 104 of file RadioInputTest.php.
References $name, ILIAS_UI_TestBase\assertHTMLEquals(), buildRadio(), and ILIAS_UI_TestBase\getDefaultRenderer().
108 $name = $radio->getName();
109 $label = $radio->getLabel();
110 $byline = $radio->getByline();
111 $options = $radio->getOptions();
113 $radio = $radio->withValue($value);
115 .
"<div class=\"form-group row\">" 116 .
"<label class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label>" 117 .
"<div class=\"col-sm-8 col-md-9 col-lg-10\">" 118 .
"<div id=\"id_1\" class=\"il-input-radio\">";
120 foreach ($options as $opt_value => $opt_label) {
121 $expected .=
"<div class=\"form-control form-control-sm il-input-radiooption\">";
122 if ($opt_value == $value) {
123 $expected .=
"<input type=\"radio\" id=\"id_1_" . $opt_value .
"_opt\" name=\"$name\" value=\"$opt_value\" checked=\"checked\"/>";
125 $expected .=
"<input type=\"radio\" id=\"id_1_" . $opt_value .
"_opt\" name=\"$name\" value=\"$opt_value\" />";
128 .
"<label for=\"id_1_" . $opt_value .
"_opt\">$opt_label</label>" 129 .
"<div class=\"help-block\">{$radio->getBylineFor((string) $opt_value)}</div>" 135 .
"<div class=\"help-block\">$byline</div>" getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ $name_source
The documentation for this class was generated from the following file: