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

Commit e5c9d20

Browse files
committed
curl_timeout tests
1 parent 5418ae1 commit e5c9d20

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

tests/ReCaptchaConfigurationTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testSkipIpWhiteListIsArray() {
4141
* @test
4242
*/
4343
public function testCurlTimeoutIsSet() {
44-
$this->assertEquals($this->recaptcha->getCurlTimeout(), 3);
44+
$this->assertEquals(3, $this->recaptcha->getCurlTimeout());
4545
}
4646

4747
/**
@@ -54,6 +54,7 @@ public function testCurlTimeoutIsSet() {
5454
protected function getEnvironmentSetUp($app) {
5555

5656
$app['config']->set('recaptcha.skip_ip', '10.0.0.1,10.0.0.2');
57+
$app['config']->set('recaptcha.curl_timeout', 3);
5758
}
5859

5960
/**
@@ -63,6 +64,6 @@ protected function setUp(): void {
6364

6465
parent::setUp(); // TODO: Change the autogenerated stub
6566

66-
$this->recaptcha = new ReCaptchaBuilderV2('api_site_key', 'api_secret_key', 3);
67+
$this->recaptcha = new ReCaptchaBuilderV2('api_site_key', 'api_secret_key');
6768
}
6869
}

tests/ReCaptchaTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public function testReCaptchaInvisibleHtmlFormSnippetShouldThrowError() {
7373
$this->recaptcha_invisible->htmlFormSnippet();
7474
}
7575

76+
/**
77+
* @test
78+
*/
7679
public function testDefaultCurlTimeout() {
7780
$this->assertEquals($this->recaptcha_invisible->getCurlTimeout(), ReCaptchaBuilder::DEFAULT_CURL_TIMEOUT);
7881
$this->assertEquals($this->recaptcha_v2->getCurlTimeout(), ReCaptchaBuilder::DEFAULT_CURL_TIMEOUT);

tests/ReCaptchaV3Test.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ public function testValidateController() {
8787
$this->assertArrayHasKey("error-codes", $return);
8888
}
8989

90+
/**
91+
* @test
92+
*/
93+
public function testCurlTimeoutIsSet() {
94+
$this->assertEquals($this->recaptcha_v3->getCurlTimeout(), 3);
95+
}
96+
9097
/**
9198
* Define environment setup.
9299
*
@@ -97,6 +104,7 @@ public function testValidateController() {
97104
protected function getEnvironmentSetUp($app) {
98105

99106
$app['config']->set('recaptcha.version', 'v3');
107+
$app['config']->set('recaptcha.curl_timeout', 3);
100108
}
101109

102110
/**
@@ -106,7 +114,7 @@ protected function setUp(): void {
106114

107115
parent::setUp(); // TODO: Change the autogenerated stub
108116

109-
$this->recaptcha_v3 = new ReCaptchaBuilderV3('api_site_key', 'api_secret_key', 3);
117+
$this->recaptcha_v3 = new ReCaptchaBuilderV3('api_site_key', 'api_secret_key');
110118

111119
}
112120
}

0 commit comments

Comments
 (0)