@@ -395,6 +395,7 @@ public function test_verify_hcaptcha(): void {
395395 $ form_fields = [ $ field ];
396396
397397 $ contact_form = Mockery::mock ( WPCF7_ContactForm::class );
398+ $ contact_form ->shouldReceive ( 'id ' )->andReturn ( $ wpcf7_id );
398399 $ contact_form ->shouldReceive ( 'scan_form_tags ' )->andReturn ( $ form_fields );
399400
400401 $ submission = Mockery::mock ( WPCF7_Submission::class );
@@ -515,12 +516,14 @@ public function test_verify_hcaptcha_without_mode_set(): void {
515516 */
516517 public function test_verify_hcaptcha_without_posted_data (): void {
517518 $ data = [];
519+ $ wpcf7_id = 23 ;
518520 $ hcaptcha_site_key = 'some site key ' ;
519521 $ field = Mockery::mock ( WPCF7_FormTag::class );
520522 $ field ->type = 'some ' ;
521523 $ form_fields = [ $ field ];
522524
523525 $ contact_form = Mockery::mock ( WPCF7_ContactForm::class );
526+ $ contact_form ->shouldReceive ( 'id ' )->andReturn ( $ wpcf7_id );
524527 $ contact_form ->shouldReceive ( 'scan_form_tags ' )->andReturn ( $ form_fields );
525528
526529 $ submission = Mockery::mock ( WPCF7_Submission::class );
@@ -561,11 +564,13 @@ public function test_verify_hcaptcha_without_posted_data(): void {
561564 */
562565 public function test_verify_hcaptcha_without_site_key (): void {
563566 $ data = [];
567+ $ wpcf7_id = 23 ;
564568 $ field = Mockery::mock ( WPCF7_FormTag::class );
565569 $ field ->type = 'some ' ;
566570 $ form_fields = [ $ field ];
567571
568572 $ contact_form = Mockery::mock ( WPCF7_ContactForm::class );
573+ $ contact_form ->shouldReceive ( 'id ' )->andReturn ( $ wpcf7_id );
569574 $ contact_form ->shouldReceive ( 'scan_form_tags ' )->andReturn ( $ form_fields );
570575
571576 $ submission = Mockery::mock ( WPCF7_Submission::class );
@@ -619,6 +624,7 @@ public function test_verify_hcaptcha_without_response(): void {
619624 $ form_fields = [ $ field ];
620625
621626 $ contact_form = Mockery::mock ( WPCF7_ContactForm::class );
627+ $ contact_form ->shouldReceive ( 'id ' )->andReturn ( $ wpcf7_id );
622628 $ contact_form ->shouldReceive ( 'scan_form_tags ' )->andReturn ( $ form_fields );
623629
624630 $ submission = Mockery::mock ( WPCF7_Submission::class );
@@ -687,6 +693,7 @@ public function test_verify_hcaptcha_not_verified(): void {
687693 $ form_fields = [ $ field ];
688694
689695 $ contact_form = Mockery::mock ( WPCF7_ContactForm::class );
696+ $ contact_form ->shouldReceive ( 'id ' )->andReturn ( $ wpcf7_id );
690697 $ contact_form ->shouldReceive ( 'scan_form_tags ' )->andReturn ( $ form_fields );
691698
692699 $ submission = Mockery::mock ( WPCF7_Submission::class );
0 commit comments