From ac57ee9c0734ec8bd05dd97bcaa9a9ac9b9a76f0 Mon Sep 17 00:00:00 2001 From: Italo Date: Wed, 10 Apr 2024 13:59:40 -0400 Subject: [PATCH] [2.x] Fixes tests --- tests/Http/Middleware/ScoreMiddlewareTest.php | 3 +-- tests/ReCaptchaTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/Http/Middleware/ScoreMiddlewareTest.php b/tests/Http/Middleware/ScoreMiddlewareTest.php index dd48d77..00e4ad8 100644 --- a/tests/Http/Middleware/ScoreMiddlewareTest.php +++ b/tests/Http/Middleware/ScoreMiddlewareTest.php @@ -14,7 +14,6 @@ use Laragear\ReCaptcha\ReCaptchaFake; use Tests\CreatesFulfilledResponse; use Tests\TestCase; - use function now; class ScoreMiddlewareTest extends TestCase @@ -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, diff --git a/tests/ReCaptchaTest.php b/tests/ReCaptchaTest.php index bbd7b50..667bc00 100644 --- a/tests/ReCaptchaTest.php +++ b/tests/ReCaptchaTest.php @@ -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, @@ -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, @@ -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( @@ -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',