Files
alrahma_sunday_school_api/tests/Unit/Services/Events/EventChargeQueryServiceTest.php
T
2026-06-09 01:03:53 -04:00

35 lines
924 B
PHP

<?php
namespace Tests\Unit\Services\Events;
use App\Services\Events\EventChargeQueryService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class EventChargeQueryServiceTest extends TestCase
{
use RefreshDatabase;
public function test_list_returns_paginated_charges(): void
{
DB::table('event_charges')->insert([
'id' => 1,
'event_id' => 1,
'parent_id' => 10,
'student_id' => 1,
'participation' => 'yes',
'charged' => 10,
'school_year' => '2025-2026',
'semester' => 'Fall',
'created_at' => now(),
'updated_at' => now(),
]);
$service = new EventChargeQueryService();
$result = $service->list(['per_page' => 10, 'page' => 1]);
$this->assertSame(1, $result['pagination']['total']);
}
}