fix unit tests as well as missing code
API CI/CD / Validate (composer + pint) (push) Successful in 2m7s
API CI/CD / Test (PHPUnit) (push) Failing after 2m23s
API CI/CD / Build frontend assets (push) Successful in 2m18s
API CI/CD / Security audit (push) Successful in 31s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 2m7s
API CI/CD / Test (PHPUnit) (push) Failing after 2m23s
API CI/CD / Build frontend assets (push) Successful in 2m18s
API CI/CD / Security audit (push) Successful in 31s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -30,6 +30,7 @@ class IpBanControllerTest extends TestCase
|
||||
DB::table('ip_attempts')->insert([
|
||||
'ip_address' => '10.0.0.1',
|
||||
'attempts' => 5,
|
||||
'last_attempt_at' => now('UTC'),
|
||||
'blocked_until' => now('UTC')->addHours(2),
|
||||
]);
|
||||
|
||||
@@ -48,6 +49,7 @@ class IpBanControllerTest extends TestCase
|
||||
DB::table('ip_attempts')->insert([
|
||||
'ip_address' => '10.0.0.2',
|
||||
'attempts' => 3,
|
||||
'last_attempt_at' => now('UTC'),
|
||||
'blocked_until' => now('UTC')->addHours(1),
|
||||
]);
|
||||
|
||||
@@ -65,6 +67,7 @@ class IpBanControllerTest extends TestCase
|
||||
DB::table('ip_attempts')->insert([
|
||||
'ip_address' => '10.0.0.3',
|
||||
'attempts' => 1,
|
||||
'last_attempt_at' => now('UTC'),
|
||||
]);
|
||||
|
||||
$response = $this->postJson('/api/v1/ip-bans/ban', [
|
||||
@@ -87,6 +90,7 @@ class IpBanControllerTest extends TestCase
|
||||
DB::table('ip_attempts')->insert([
|
||||
'ip_address' => '10.0.0.4',
|
||||
'attempts' => 5,
|
||||
'last_attempt_at' => now('UTC'),
|
||||
'blocked_until' => now('UTC')->addHours(2),
|
||||
]);
|
||||
|
||||
@@ -111,11 +115,13 @@ class IpBanControllerTest extends TestCase
|
||||
[
|
||||
'ip_address' => '10.0.0.5',
|
||||
'attempts' => 5,
|
||||
'last_attempt_at' => now('UTC'),
|
||||
'blocked_until' => now('UTC')->addHours(2),
|
||||
],
|
||||
[
|
||||
'ip_address' => '10.0.0.6',
|
||||
'attempts' => 2,
|
||||
'last_attempt_at' => now('UTC'),
|
||||
'blocked_until' => now('UTC')->addHours(2),
|
||||
],
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user