Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit 4b0288d

Browse files
committed
recaptcha_v3 default timeout test created
1 parent e5c9d20 commit 4b0288d

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

tests/ReCaptchaTest.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,28 @@
1414
use Biscolab\ReCaptcha\ReCaptchaBuilder;
1515
use Biscolab\ReCaptcha\ReCaptchaBuilderInvisible;
1616
use Biscolab\ReCaptcha\ReCaptchaBuilderV2;
17+
use Biscolab\ReCaptcha\ReCaptchaBuilderV3;
1718

1819
/**
1920
* Class ReCaptchaTest
2021
* @package Biscolab\ReCaptcha\Tests
2122
*/
2223
class ReCaptchaTest extends TestCase {
2324

25+
/**
26+
* @var ReCaptchaBuilderInvisible
27+
*/
2428
protected $recaptcha_invisible = null;
2529

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;
2739

2840
/**
2941
* @tests
@@ -41,7 +53,8 @@ public function testReCaptchaInvisibleHtmlFormButtonDefault() {
4153

4254
$recaptcha = $this->recaptcha_invisible;
4355
$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);
4558
}
4659

4760
/**
@@ -51,7 +64,8 @@ public function testReCaptchaInvisibleHtmlFormButtonCustom() {
5164

5265
$recaptcha = $this->recaptcha_invisible;
5366
$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);
5569
}
5670

5771
/**
@@ -77,8 +91,10 @@ public function testReCaptchaInvisibleHtmlFormSnippetShouldThrowError() {
7791
* @test
7892
*/
7993
public function testDefaultCurlTimeout() {
94+
8095
$this->assertEquals($this->recaptcha_invisible->getCurlTimeout(), ReCaptchaBuilder::DEFAULT_CURL_TIMEOUT);
8196
$this->assertEquals($this->recaptcha_v2->getCurlTimeout(), ReCaptchaBuilder::DEFAULT_CURL_TIMEOUT);
97+
$this->assertEquals($this->recaptcha_v3->getCurlTimeout(), ReCaptchaBuilder::DEFAULT_CURL_TIMEOUT);
8298
}
8399

84100
/**
@@ -96,6 +112,7 @@ protected function setUp(): void {
96112

97113
$this->recaptcha_invisible = new ReCaptchaBuilderInvisible('api_site_key', 'api_secret_key');
98114
$this->recaptcha_v2 = new ReCaptchaBuilderV2('api_site_key', 'api_secret_key');
115+
$this->recaptcha_v3 = new ReCaptchaBuilderV3('api_site_key', 'api_secret_key');
99116

100117
}
101118
}

0 commit comments

Comments
 (0)