18 declare(strict_types=1);
30 require_once(__DIR__ .
"/../../../../Base.php");
38 $name =
"form_input_$this->count";
46 $name = $dedicated_name .
"_$this->count";
65 $this->signal_generator = new \SignalGeneratorMock();
78 $post_url =
'http://ilias.localhost/some_url?param1=foo¶m2=bar';
80 $dummy_input = $this->buildInputFactory()->text(
'test_label');
83 $this->signal_generator,
84 $this->buildInputFactory(),
91 "<form id=\"id_1\" role=\"form\" class=\"il-standard-form form-horizontal\" enctype=\"multipart/form-data\" action=\"$post_url\" method=\"post\" novalidate=\"novalidate\">" .
92 $dummy_input->getCanonicalName() .
95 $renderer = $this->getDefaultRenderer(null, [$dummy_input]);
98 $this->brutallyTrimHTML($expected_html),
99 $this->brutallyTrimHTML($renderer->render($form))
105 $post_url =
'http://ilias.localhost/some_url?param1=foo¶m2=bar';
106 $required_lang_var =
'required_field';
108 $dummy_input = $this->buildInputFactory()->text(
'test_label')->withRequired(
true);
111 $this->signal_generator,
112 $this->buildInputFactory(),
119 "<form id=\"id_1\" role=\"form\" class=\"il-standard-form form-horizontal\" enctype=\"multipart/form-data\" action=\"$post_url\" method=\"post\" novalidate=\"novalidate\">" .
120 $dummy_input->getCanonicalName() .
121 "<div class=\"il-standard-form-footer clearfix\"><span class=\"asterisk\">*</span><span class=\"small\"> $required_lang_var</span></div>" .
124 $renderer = $this->getDefaultRenderer(null, [$dummy_input]);
127 $this->brutallyTrimHTML($expected_html),
128 $this->brutallyTrimHTML($renderer->render($form))
134 $post_url =
'http://ilias.localhost/some_url?param1=foo¶m2=bar';
135 $error_lang_var =
'ui_error_in_group';
137 $dummy_input = $this->buildInputFactory()->text(
'test_label')->withAdditionalTransformation(
138 $this->
refinery->custom()->constraint(
139 static function ($value):
bool {
142 'this message does not matter because the input will not be properly rendered anyways.' 147 $this->signal_generator,
148 $this->buildInputFactory(),
154 $request = $this->createMock(ServerRequestInterface::class);
155 $request->method(
'getParsedBody')->willReturn([
156 'form_0/form_input_1' =>
'',
159 $form = $form->withRequest($request);
160 $data = $form->getData();
163 "<form id=\"id_1\" role=\"form\" class=\"il-standard-form form-horizontal\" enctype=\"multipart/form-data\" action=\"$post_url\" method=\"post\" novalidate=\"novalidate\">" .
164 "<div class=\"help-block alert alert-danger\" role=\"alert\">$error_lang_var</div>" .
165 $dummy_input->getCanonicalName() .
168 $renderer = $this->getDefaultRenderer(null, [$dummy_input]);
171 $this->brutallyTrimHTML($expected_html),
172 $this->brutallyTrimHTML($renderer->render($form))
178 $df = new \ILIAS\Data\Factory();
179 return new \ILIAS\UI\Implementation\Component\Input\Field\Factory(
181 $this->signal_generator,
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Provides common functionality for UI tests.