Files
alrahma_sunday_school_api/tests/Unit/Services/Finance/FinancialPdfReportServiceTest.php
T
2026-06-08 23:30:22 -04:00

38 lines
1002 B
PHP

<?php
namespace Tests\Unit\Services\Finance;
use App\Services\Finance\FinancialChartService;
use App\Services\Finance\FinancialPdfReportService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class FinancialPdfReportServiceTest extends TestCase
{
use RefreshDatabase;
public function test_build_pdf_returns_bytes(): void
{
$service = new FinancialPdfReportService(new FinancialChartService);
$summary = [
'schoolYear' => '2025-2026',
'totalCharges' => 100,
'totalExtraCharges' => 20,
'totalDiscounts' => 10,
'totalRefunds' => 5,
'totalExpenses' => 15,
'totalReimbursements' => 8,
'donationToSchool' => 3,
'netAmount' => 85,
'amountCollected' => 60,
'totalUnpaid' => 40,
];
$pdf = $service->buildPdf($summary);
$this->assertIsString($pdf);
$this->assertNotSame('', $pdf);
}
}