File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
ReCaptchaUser/Test/Integration Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,36 @@ public function testPostRequestIfReCaptchaParameterIsMissed(): void
156156 $ this ->checkFailedPostResponse ();
157157 }
158158
159+ /**
160+ * @magentoAdminConfigFixture admin/security/use_form_key 0
161+ * @magentoAdminConfigFixture admin/captcha/enable 0
162+ * @magentoAdminConfigFixture recaptcha_backend/type_invisible/public_key test_public_key
163+ * @magentoAdminConfigFixture recaptcha_backend/type_invisible/private_key test_private_key
164+ * @magentoAdminConfigFixture recaptcha_backend/type_for/user_login invisible
165+ */
166+ public function testPostRequestIfReCaptchaParameterIsMissedWithRef (): void
167+ {
168+ $ postValues = [];
169+ $ this ->getRequest ()
170+ ->setMethod (Http::METHOD_POST )
171+ ->setPostValue (array_replace_recursive (
172+ [
173+ 'form_key ' => $ this ->formKey ->getFormKey (),
174+ 'login ' => [
175+ 'username ' => Bootstrap::ADMIN_NAME ,
176+ 'password ' => Bootstrap::ADMIN_PASSWORD ,
177+ ],
178+ ],
179+ $ postValues
180+ ));
181+ $ this ->dispatch ('backend/admin/dashboard/index ' );
182+ $ this ->assertSessionMessages (
183+ self ::equalTo (['Something went wrong with reCAPTCHA. Please contact the store owner. ' ]),
184+ MessageInterface::TYPE_ERROR
185+ );
186+ self ::assertFalse ($ this ->auth ->isLoggedIn ());
187+ }
188+
159189 /**
160190 * @magentoAdminConfigFixture admin/security/use_form_key 0
161191 * @magentoAdminConfigFixture admin/captcha/enable 0
You can’t perform that action at this time.
0 commit comments