Skip to content

Commit

Permalink
[2.x] Fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGhostHunter committed Apr 10, 2024
1 parent 2f033d9 commit ac57ee9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions tests/Http/Middleware/ScoreMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Laragear\ReCaptcha\ReCaptchaFake;
use Tests\CreatesFulfilledResponse;
use Tests\TestCase;

use function now;

class ScoreMiddlewareTest extends TestCase
Expand Down Expand Up @@ -432,7 +431,7 @@ public function test_checks_for_human_score(): void

$mock->expects('async')->withNoArgs()->times(4)->andReturnSelf();
$mock->expects('asForm')->withNoArgs()->times(4)->andReturnSelf();
$mock->expects('withOptions')->with(['version' => 2.0])->times(4)->andReturnSelf();
$mock->expects('withOptions')->with(['version' => 3.0])->times(4)->andReturnSelf();
$mock->expects('post')
->with(
ReCaptcha::SERVER_ENDPOINT,
Expand Down
8 changes: 4 additions & 4 deletions tests/ReCaptchaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function test_returns_response(): void

$mock->expects('asForm')->withNoArgs()->once()->andReturnSelf();
$mock->expects('async')->withNoArgs()->once()->andReturnSelf();
$mock->expects('withOptions')->with(['version' => 2.0])->once()->andReturnSelf();
$mock->expects('withOptions')->with(['version' => 3.0])->once()->andReturnSelf();
$mock->expects('post')
->with(
ReCaptcha::SERVER_ENDPOINT,
Expand Down Expand Up @@ -62,7 +62,7 @@ public function test_uses_v2_test_credentials_by_default(): void

$mock->expects('asForm')->withNoArgs()->times(3)->andReturnSelf();
$mock->expects('async')->withNoArgs()->times(3)->andReturnSelf();
$mock->expects('withOptions')->with(['version' => 2.0])->times(3)->andReturnSelf();
$mock->expects('withOptions')->with(['version' => 3.0])->times(3)->andReturnSelf();
$mock->expects('post')
->with(
ReCaptcha::SERVER_ENDPOINT,
Expand Down Expand Up @@ -114,7 +114,7 @@ public function test_uses_v2_custom_credentials(): void

$mock->expects('asForm')->withNoArgs()->times(3)->andReturnSelf();
$mock->expects('async')->withNoArgs()->times(3)->andReturnSelf();
$mock->expects('withOptions')->with(['version' => 2.0])->times(3)->andReturnSelf();
$mock->expects('withOptions')->with(['version' => 3.0])->times(3)->andReturnSelf();

$mock->expects('post')
->with(
Expand Down Expand Up @@ -207,7 +207,7 @@ public function test_receives_v3_secret(): void

$mock->expects('asForm')->withNoArgs()->once()->andReturnSelf();
$mock->expects('async')->withNoArgs()->once()->andReturnSelf();
$mock->expects('withOptions')->with(['version' => 2.0])->once()->andReturnSelf();
$mock->expects('withOptions')->with(['version' => 3.0])->once()->andReturnSelf();
$mock->expects('post')
->with(ReCaptcha::SERVER_ENDPOINT, [
'secret' => 'secret',
Expand Down

0 comments on commit ac57ee9

Please sign in to comment.