5require_once(__DIR__ .
"/../../../../../libs/composer/vendor/autoload.php");
6require_once(__DIR__ .
"/../../../Base.php");
7require_once(__DIR__ .
"/InputTest.php");
12use \ILIAS\UI\Component\Input\Field;
23 return 'some alternative value';
38 $language = $this->createMock(\ilLanguage::class);
51 $pwd =
$f->password(
"label",
"byline");
52 $this->assertInstanceOf(Field\Input::class, $pwd);
53 $this->assertInstanceOf(Field\Password::class, $pwd);
63 $pwd =
$f->password($label, $byline)->withNameFrom($this->name_source);
67 .
"<div class=\"form-group row\">"
68 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>"
69 .
"<div class=\"col-sm-9\">"
70 .
"<div class=\"il-input-password\">"
71 .
"<input type=\"password\" name=\"$name\" class=\"form-control form-control-sm\" />"
73 .
"<div class=\"help-block\">$byline</div>"
87 $pwd =
$f->password($label, $byline)->withNameFrom($this->name_source)->withError($error);
92 .
"<div class=\"form-group row\">"
93 .
" <label for=\"$name\" class=\"control-label col-sm-3\">$label</label>"
94 .
" <div class=\"col-sm-9\">"
95 .
" <div class=\"il-input-password\">"
96 .
" <input type=\"password\" name=\"$name\" class=\"form-control form-control-sm\" />"
98 .
" <div class=\"help-block\">$byline</div>"
99 .
" <div class=\"help-block alert alert-danger\" role=\"alert\">"
100 .
" <img border=\"0\" src=\"./templates/default/images/icon_alert.svg\" alt=\"alert\" />"
106 $html = preg_replace(
'!\s+!',
' ', $html);
107 $expected = preg_replace(
'!\s+!',
' ', $expected);
108 $html = explode(
' ', $html);
109 $expected = explode(
' ', $expected);
110 $this->assertEquals($expected, $html);
119 $pwd =
$f->password($label)->withNameFrom($this->name_source);
123 .
"<div class=\"form-group row\">"
124 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>"
125 .
"<div class=\"col-sm-9\">"
126 .
"<div class=\"il-input-password\">"
127 .
"<input type=\"password\" name=\"$name\" class=\"form-control form-control-sm\" />"
141 $pwd =
$f->password($label)->withValue($value)->withNameFrom($this->name_source);
145 .
"<div class=\"form-group row\">"
146 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>"
147 .
"<div class=\"col-sm-9\">"
148 .
"<div class=\"il-input-password\">"
149 .
"<input type=\"password\" name=\"$name\" value=\"$value\" class=\"form-control form-control-sm\" />"
162 $pwd =
$f->password($label)->withNameFrom($this->name_source)->withRequired(
true);
165 $html = $r->render($pwd);
168 .
"<div class=\"form-group row\">"
169 .
"<label for=\"$name\" class=\"control-label col-sm-3\">" .
"$label"
170 .
"<span class=\"asterisk\">*</span>"
172 .
"<div class=\"col-sm-9\">"
173 .
"<div class=\"il-input-password\">"
174 .
"<input type=\"password\" name=\"$name\" class=\"form-control form-control-sm\" />"
187 $pwd =
$f->password($label)->withNameFrom($this->name_source)->withDisabled(
true);
190 $html = $r->render($pwd);
193 .
"<div class=\"form-group row\">"
194 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>"
195 .
"<div class=\"col-sm-9\">"
196 .
"<div class=\"il-input-password\">"
197 .
"<input type=\"password\" name=\"$name\" disabled=\"disabled\" class=\"form-control form-control-sm\" />"
210 $pwd =
$f->password($label)->withNameFrom($this->name_source)->withRequired(
true);
213 $value1 = $pwd1->getContent();
214 $this->assertTrue($value1->isOk());
217 $value2 = $pwd2->getContent();
218 $this->assertTrue($value2->isError());
225 $pwd =
$f->password($label)->withNameFrom($this->name_source);
226 $this->assertNull($pwd->getValue());
229 $pwd = $pwd->withInput($post);
230 $this->assertEquals($post->getOr(
'',
''), $pwd->getValue());
231 $this->assertInstanceOf(PWD::class, $pwd->getContent()->value());
An exception for terminatinating execution or to throw for unit testing.
A password is used as part of credentials for authentication.
Provides common functionality for UI tests.
assertHTMLEquals($expected_html_as_string, $html_as_string)
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Class ChatMainBarProvider \MainMenu\Provider.