@@ -81,6 +81,10 @@ public function testGetRequestIfReCaptchaIsEnabled(): void
8181 public function testPostRequestIfReCaptchaParameterIsMissed (): void
8282 {
8383 $ this ->checkFailedPostRequest ();
84+ $ this ->assertSessionMessages (
85+ $ this ->equalTo (['The coupon code "test" is not valid. ' ]),
86+ MessageInterface::TYPE_ERROR
87+ );
8488 }
8589
8690 /**
@@ -96,6 +100,10 @@ public function testPostRequestIfReCaptchaParameterIsMissed(): void
96100 public function testPostRequestWithFailedReCaptchaValidation (): void
97101 {
98102 $ this ->checkFailedPostRequest (true );
103+ $ this ->assertSessionMessages (
104+ $ this ->equalTo (['The coupon code "test" is not valid. ' ]),
105+ MessageInterface::TYPE_ERROR
106+ );
99107 }
100108
101109 /**
@@ -127,10 +135,6 @@ private function checkSuccessfulGetResponse(bool $shouldContainReCaptcha = false
127135 private function checkFailedPostRequest (bool $ withParamReCaptcha = false ): void
128136 {
129137 $ this ->makePostRequest ($ withParamReCaptcha );
130- $ this ->assertSessionMessages (
131- $ this ->equalTo (['Something went wrong with reCAPTCHA. Please contact the store owner. ' ]),
132- MessageInterface::TYPE_ERROR
133- );
134138 }
135139
136140 /**
@@ -153,7 +157,6 @@ private function makePostRequest(bool $withParamReCaptcha = false): void
153157 $ this ->getRequest ()
154158 ->setMethod (Http::METHOD_POST )
155159 ->setPostValue ($ postValue );
156-
157160 $ this ->dispatch ('checkout/cart/couponPost/ ' );
158161 }
159162
0 commit comments