5 require_once(__DIR__ .
"/../../../../../libs/composer/vendor/autoload.php");
6 require_once(__DIR__ .
"/../../../Base.php");
7 require_once(__DIR__ .
"/InputTest.php");
10 use \ILIAS\UI\Component\Input\Field;
12 use \ILIAS\Validation;
13 use \ILIAS\Transformation;
25 $df =
new Data\Factory();
29 new Validation\
Factory($df, $this->createMock(\ilLanguage::class)),
39 $checkbox =
$f->checkbox(
"label",
"byline");
41 $this->assertInstanceOf(Field\Input::class, $checkbox);
42 $this->assertInstanceOf(Field\Checkbox::class, $checkbox);
51 $checkbox =
$f->checkbox($label, $byline)->withNameFrom($this->name_source);
56 $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>";
67 $checkbox =
$f->checkbox($label, $byline)->withNameFrom($this->name_source)->withError($error);
72 $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" 73 .
" </div></div></div>";
82 $checkbox =
$f->checkbox($label)->withNameFrom($this->name_source);
87 $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>";
97 $checkbox =
$f->checkbox($label)->withValue($value)->withNameFrom($this->name_source);
102 $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>";
112 $f->checkbox($label)->withValue($value);
113 $this->assertFalse(
true);
115 $this->assertTrue(
true);
124 $checbox =
$f->checkbox($label)->withNameFrom($this->name_source)->withRequired(
true);
129 $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)
Provides common functionality for UI tests.
assertHTMLEquals($expected_html_as_string, $html_as_string)