add all controllers logic

This commit is contained in:
root
2026-03-11 17:53:15 -04:00
parent 3e6c577085
commit 2ef71cc92b
421 changed files with 12009 additions and 5211 deletions
@@ -0,0 +1,35 @@
<?php
namespace Tests\Unit\Services\Security;
use App\Services\Security\IpBanQueryService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class IpBanQueryServiceTest extends TestCase
{
use RefreshDatabase;
public function test_paginate_filters_active(): void
{
DB::table('ip_attempts')->insert([
[
'ip_address' => '10.0.0.1',
'attempts' => 2,
'blocked_until' => now('UTC')->addHours(2),
],
[
'ip_address' => '10.0.0.2',
'attempts' => 2,
'blocked_until' => now('UTC')->subHours(1),
],
]);
$service = app(IpBanQueryService::class);
$pager = $service->paginate(['status' => 'active'], 1, 10);
$this->assertSame(1, $pager->total());
$this->assertSame('10.0.0.1', $pager->items()[0]->ip_address);
}
}