14
14
use Biscolab \ReCaptcha \ReCaptchaBuilder ;
15
15
use Biscolab \ReCaptcha \ReCaptchaBuilderInvisible ;
16
16
use Biscolab \ReCaptcha \ReCaptchaBuilderV2 ;
17
+ use Biscolab \ReCaptcha \ReCaptchaBuilderV3 ;
17
18
18
19
/**
19
20
* Class ReCaptchaTest
20
21
* @package Biscolab\ReCaptcha\Tests
21
22
*/
22
23
class ReCaptchaTest extends TestCase {
23
24
25
+ /**
26
+ * @var ReCaptchaBuilderInvisible
27
+ */
24
28
protected $ recaptcha_invisible = null ;
25
29
26
- protected $ recaptcha_v2 = null ;
30
+ /**
31
+ * @var ReCaptchaBuilderV2
32
+ */
33
+ protected $ recaptcha_v2 = null ;
34
+
35
+ /**
36
+ * @var ReCaptchaBuilderV3
37
+ */
38
+ protected $ recaptcha_v3 = null ;
27
39
28
40
/**
29
41
* @tests
@@ -41,7 +53,8 @@ public function testReCaptchaInvisibleHtmlFormButtonDefault() {
41
53
42
54
$ recaptcha = $ this ->recaptcha_invisible ;
43
55
$ html_button = $ recaptcha ->htmlFormButton ();
44
- $ this ->assertEquals ('<button class="g-recaptcha" data-sitekey="api_site_key" data-callback="biscolabLaravelReCaptcha">Submit</button> ' , $ html_button );
56
+ $ this ->assertEquals ('<button class="g-recaptcha" data-sitekey="api_site_key" data-callback="biscolabLaravelReCaptcha">Submit</button> ' ,
57
+ $ html_button );
45
58
}
46
59
47
60
/**
@@ -51,7 +64,8 @@ public function testReCaptchaInvisibleHtmlFormButtonCustom() {
51
64
52
65
$ recaptcha = $ this ->recaptcha_invisible ;
53
66
$ html_button = $ recaptcha ->htmlFormButton ('Custom Text ' );
54
- $ this ->assertEquals ('<button class="g-recaptcha" data-sitekey="api_site_key" data-callback="biscolabLaravelReCaptcha">Custom Text</button> ' , $ html_button );
67
+ $ this ->assertEquals ('<button class="g-recaptcha" data-sitekey="api_site_key" data-callback="biscolabLaravelReCaptcha">Custom Text</button> ' ,
68
+ $ html_button );
55
69
}
56
70
57
71
/**
@@ -77,8 +91,10 @@ public function testReCaptchaInvisibleHtmlFormSnippetShouldThrowError() {
77
91
* @test
78
92
*/
79
93
public function testDefaultCurlTimeout () {
94
+
80
95
$ this ->assertEquals ($ this ->recaptcha_invisible ->getCurlTimeout (), ReCaptchaBuilder::DEFAULT_CURL_TIMEOUT );
81
96
$ this ->assertEquals ($ this ->recaptcha_v2 ->getCurlTimeout (), ReCaptchaBuilder::DEFAULT_CURL_TIMEOUT );
97
+ $ this ->assertEquals ($ this ->recaptcha_v3 ->getCurlTimeout (), ReCaptchaBuilder::DEFAULT_CURL_TIMEOUT );
82
98
}
83
99
84
100
/**
@@ -96,6 +112,7 @@ protected function setUp(): void {
96
112
97
113
$ this ->recaptcha_invisible = new ReCaptchaBuilderInvisible ('api_site_key ' , 'api_secret_key ' );
98
114
$ this ->recaptcha_v2 = new ReCaptchaBuilderV2 ('api_site_key ' , 'api_secret_key ' );
115
+ $ this ->recaptcha_v3 = new ReCaptchaBuilderV3 ('api_site_key ' , 'api_secret_key ' );
99
116
100
117
}
101
118
}
0 commit comments