Definition at line 29 of file PasswordInputTest.php.
◆ buildFactory()
PasswordInputTest::buildFactory |
( |
| ) |
|
|
protected |
Definition at line 37 of file PasswordInputTest.php.
39 $df =
new Data\Factory();
43 new Validation\
Factory($df, $this->createMock(\ilLanguage::class)),
◆ setUp()
PasswordInputTest::setUp |
( |
| ) |
|
◆ test_implements_factory_interface()
PasswordInputTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 49 of file PasswordInputTest.php.
References $f.
52 $pwd =
$f->password(
"label",
"byline");
53 $this->assertInstanceOf(Field\Input::class, $pwd);
54 $this->assertInstanceOf(Field\Password::class, $pwd);
◆ test_render()
PasswordInputTest::test_render |
( |
| ) |
|
Definition at line 58 of file PasswordInputTest.php.
References $f, $name, and $r.
64 $pwd =
$f->password($label, $byline)->withNameFrom($this->name_source);
68 .
"<div class=\"form-group row\">" 69 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>" 70 .
"<div class=\"col-sm-9\">" 71 .
"<div class=\"il-input-password\">" 72 .
"<input type=\"password\" name=\"$name\" class=\"form-control form-control-sm\" />" 74 .
"<div class=\"help-block\">$byline</div>" getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_render_error()
PasswordInputTest::test_render_error |
( |
| ) |
|
Definition at line 81 of file PasswordInputTest.php.
References $f, $html, $name, and $r.
88 $pwd =
$f->password($label, $byline)->withNameFrom($this->name_source)->withError($error);
93 .
"<div class=\"form-group row\">" 94 .
" <label for=\"$name\" class=\"control-label col-sm-3\">$label</label>" 95 .
" <div class=\"col-sm-9\">" 96 .
" <div class=\"il-input-password\">" 97 .
" <input type=\"password\" name=\"$name\" class=\"form-control form-control-sm\" />" 99 .
" <div class=\"help-block\">$byline</div>" 100 .
" <div class=\"help-block alert alert-danger\" role=\"alert\">" 101 .
" <img border=\"0\" src=\"./templates/default/images/icon_alert.svg\" alt=\"alert\" />" 108 $expected = preg_replace(
'!\s+!',
' ', $expected);
110 $expected = explode(
' ', $expected);
111 $this->assertEquals($expected,
$html);
getDefaultRenderer(JavaScriptBinding $js_binding=null)
◆ test_render_no_byline()
PasswordInputTest::test_render_no_byline |
( |
| ) |
|
Definition at line 115 of file PasswordInputTest.php.
References $f, $name, and $r.
120 $pwd =
$f->password($label)->withNameFrom($this->name_source);
124 .
"<div class=\"form-group row\">" 125 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>" 126 .
"<div class=\"col-sm-9\">" 127 .
"<div class=\"il-input-password\">" 128 .
"<input type=\"password\" name=\"$name\" class=\"form-control form-control-sm\" />" getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_render_required()
PasswordInputTest::test_render_required |
( |
| ) |
|
Definition at line 158 of file PasswordInputTest.php.
References $f, $html, $name, and $r.
163 $pwd =
$f->password($label)->withNameFrom($this->name_source)->withRequired(
true);
169 .
"<div class=\"form-group row\">" 170 .
"<label for=\"$name\" class=\"control-label col-sm-3\">" .
"$label" 171 .
"<span class=\"asterisk\">*</span>" 173 .
"<div class=\"col-sm-9\">" 174 .
"<div class=\"il-input-password\">" 175 .
"<input type=\"password\" name=\"$name\" class=\"form-control form-control-sm\" />" getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_render_value()
PasswordInputTest::test_render_value |
( |
| ) |
|
Definition at line 136 of file PasswordInputTest.php.
References $f, $name, and $r.
142 $pwd =
$f->password($label)->withValue($value)->withNameFrom($this->name_source);
146 .
"<div class=\"form-group row\">" 147 .
"<label for=\"$name\" class=\"control-label col-sm-3\">$label</label>" 148 .
"<div class=\"col-sm-9\">" 149 .
"<div class=\"il-input-password\">" 150 .
"<input type=\"password\" name=\"$name\" value=\"$value\" class=\"form-control form-control-sm\" />" getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_value_required()
PasswordInputTest::test_value_required |
( |
| ) |
|
Definition at line 183 of file PasswordInputTest.php.
References $f, and $name.
188 $pwd =
$f->password($label)->withNameFrom($this->name_source)->withRequired(
true);
191 $value1 = $pwd1->getContent();
192 $this->assertTrue($value1->isOk());
195 $value2 = $pwd2->getContent();
196 $this->assertTrue($value2->isError());
◆ test_value_type()
PasswordInputTest::test_value_type |
( |
| ) |
|
Definition at line 199 of file PasswordInputTest.php.
References $f, and $post.
203 $pwd =
$f->password($label);
204 $this->assertNull($pwd->getValue());
207 $pwd = $pwd->withInput($post);
208 $this->assertEquals($post->getOr(
'',
''), $pwd->getValue());
209 $this->assertInstanceOf(PWD::class, $pwd->getContent()->value());
The documentation for this class was generated from the following file: