File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -87,4 +87,35 @@ public function testView3()
87
87
$ this ->assertEquals ('' , $ background );
88
88
89
89
}
90
+
91
+
92
+ public function testView4 ()
93
+ {
94
+ // Create a stub for the SomeClass class.
95
+ $ configStub = $ this ->createMock (ReCaptchaConfigV3::class);
96
+
97
+ // Configure the stub.
98
+ $ configStub ->method ('isServiceEnabled ' )
99
+ ->willReturn (true );
100
+
101
+ $ configStub ->method ('getSiteKey ' )
102
+ ->willReturn ('test1 ' );
103
+
104
+ $ configStub ->method ('isInline ' )
105
+ ->willReturn (false );
106
+
107
+ $ configStub ->method ('getLanguage ' )
108
+ ->willReturn ('en ' );
109
+
110
+ $ configStub ->method ('getBackgroundBadgeDisplay ' )
111
+ ->willReturn (false );
112
+
113
+ $ clientStub = $ this ->createMock (GuzzleRequestClient::class);
114
+
115
+ $ _service = new GoogleReCaptchaV3Service ($ configStub , $ clientStub );
116
+ $ service = new GoogleReCaptchaV3 ($ _service );
117
+ $ data = $ service ->prepareBackgroundData ();
118
+ $ this ->assertEquals (false , $ data ['display ' ]);
119
+ $ this ->assertEquals ('test1 ' , $ data ['publicKey ' ]);
120
+ }
90
121
}
You can’t perform that action at this time.
0 commit comments