1
1
<?php
2
+
2
3
/**
3
4
* Copyright (c) 2017 - present
4
5
* LaravelGoogleRecaptcha - ReCaptchaTest.php
@@ -56,8 +57,10 @@ public function testReCaptchaInvisibleHtmlFormButtonDefault()
56
57
57
58
$ recaptcha = $ this ->recaptcha_invisible ;
58
59
$ html_button = $ recaptcha ->htmlFormButton ();
59
- $ this ->assertEquals ('<button class="g-recaptcha" data-callback="biscolabLaravelReCaptcha" data-sitekey="api_site_key">Submit</button> ' ,
60
- $ html_button );
60
+ $ this ->assertEquals (
61
+ '<button class="g-recaptcha" data-callback="biscolabLaravelReCaptcha" data-sitekey="api_site_key">Submit</button> ' ,
62
+ $ html_button
63
+ );
61
64
}
62
65
63
66
/**
@@ -68,8 +71,10 @@ public function testReCaptchaInvisibleHtmlFormButtonCustom()
68
71
69
72
$ recaptcha = $ this ->recaptcha_invisible ;
70
73
$ html_button = $ recaptcha ->htmlFormButton ('Custom Text ' );
71
- $ this ->assertEquals ('<button class="g-recaptcha" data-callback="biscolabLaravelReCaptcha" data-sitekey="api_site_key">Custom Text</button> ' ,
72
- $ html_button );
74
+ $ this ->assertEquals (
75
+ '<button class="g-recaptcha" data-callback="biscolabLaravelReCaptcha" data-sitekey="api_site_key">Custom Text</button> ' ,
76
+ $ html_button
77
+ );
73
78
}
74
79
75
80
/**
@@ -156,19 +161,31 @@ public function testReCaptchaV2htmlFormButtonShouldThrowError()
156
161
$ this ->recaptcha_v2 ->htmlFormButton ();
157
162
}
158
163
159
- /**
160
- * @test
161
- */
162
- public function testRecaptchaFieldNameHelperReturnsReCaptchaBuilderDefaultFieldName () {
163
- $ this ->assertEquals (ReCaptchaBuilder::DEFAULT_RECAPTCHA_FIELD_NAME , recaptchaFieldName ());
164
- }
164
+ /**
165
+ * @test
166
+ */
167
+ public function testRecaptchaFieldNameHelperReturnsReCaptchaBuilderDefaultFieldName ()
168
+ {
169
+ $ this ->assertEquals (ReCaptchaBuilder::DEFAULT_RECAPTCHA_FIELD_NAME , recaptchaFieldName ());
170
+ }
171
+
172
+ /**
173
+ * @test
174
+ */
175
+ public function testRecaptchaRuleNameHelperReturnsReCaptchaBuilderDefaultRuleName ()
176
+ {
177
+ $ this ->assertEquals (ReCaptchaBuilder::DEFAULT_RECAPTCHA_RULE_NAME , recaptchaRuleName ());
178
+ }
165
179
166
- /**
167
- * @test
168
- */
169
- public function testRecaptchaRuleNameHelperReturnsReCaptchaBuilderDefaultRuleName () {
170
- $ this ->assertEquals (ReCaptchaBuilder::DEFAULT_RECAPTCHA_RULE_NAME , recaptchaRuleName ());
171
- }
180
+ /**
181
+ * @test
182
+ */
183
+ public function testDefaultRecaptchaApiDomainIsGoogleDotCom ()
184
+ {
185
+ $ this ->assertEquals ("www.google.com " , $ this ->recaptcha_v2 ->getApiDomain ());
186
+ $ this ->assertEquals ("www.google.com " , $ this ->recaptcha_invisible ->getApiDomain ());
187
+ $ this ->assertEquals ("www.google.com " , $ this ->recaptcha_v3 ->getApiDomain ());
188
+ }
172
189
173
190
protected function setSkipByIp (ReCaptchaBuilder $ builder , bool $ value )
174
191
{
@@ -190,6 +207,5 @@ protected function setUp(): void
190
207
$ this ->recaptcha_invisible = new ReCaptchaBuilderInvisible ('api_site_key ' , 'api_secret_key ' );
191
208
$ this ->recaptcha_v2 = new ReCaptchaBuilderV2 ('api_site_key ' , 'api_secret_key ' );
192
209
$ this ->recaptcha_v3 = new ReCaptchaBuilderV3 ('api_site_key ' , 'api_secret_key ' );
193
-
194
210
}
195
- }
211
+ }
0 commit comments