File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,34 @@ public function testView2()
79
79
$ this ->assertEquals (false , $ data ['inline ' ]);
80
80
$ this ->assertEquals ('en ' , $ data ['language ' ]);
81
81
}
82
+ public function testView4 ()
83
+ {
84
+ // Create a stub for the SomeClass class.
85
+ $ configStub = $ this ->createMock (ReCaptchaConfigV3::class);
86
+
87
+ // Configure the stub.
88
+ $ configStub ->method ('isServiceEnabled ' )
89
+ ->willReturn (true );
90
+
91
+ $ configStub ->method ('getSiteKey ' )
92
+ ->willReturn ('test1 ' );
82
93
94
+ $ configStub ->method ('isInline ' )
95
+ ->willReturn (false );
83
96
97
+ $ configStub ->method ('getLanguage ' )
98
+ ->willReturn ('en ' );
99
+
100
+ $ configStub ->method ('getBackgroundBadgeDisplay ' )
101
+ ->willReturn (false );
102
+
103
+ $ clientStub = $ this ->createMock (GuzzleRequestClient::class);
104
+
105
+ $ _service = new GoogleReCaptchaV3Service ($ configStub , $ clientStub );
106
+ $ service = new GoogleReCaptchaV3 ($ _service );
107
+ GoogleReCaptchaV3::$ hasAction = false ;
108
+ $ data = $ service ->prepareData ();
109
+ $ this ->assertEquals (false , $ data ['display ' ]);
110
+ $ this ->assertEquals ('test1 ' , $ data ['publicKey ' ]);
111
+ }
84
112
}
You can’t perform that action at this time.
0 commit comments