Files
alrahma_sunday_school_api/tests/Unit/Services/Communication/CommunicationTemplateServiceTest.php
T
2026-06-09 01:25:14 -04:00

32 lines
873 B
PHP

<?php
namespace Tests\Unit\Services\Communication;
use App\Services\Communication\CommunicationTemplateService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class CommunicationTemplateServiceTest extends TestCase
{
use RefreshDatabase;
public function test_list_active_templates_maps_columns(): void
{
DB::table('email_templates')->insert([
'id' => 1,
'code' => 'welcome',
'variant' => 'default',
'subject' => 'Hello',
'body_html' => 'Body',
'is_active' => 1,
]);
$service = new CommunicationTemplateService;
$templates = $service->listActiveTemplates();
$this->assertSame('welcome', $templates[0]['template_key']);
$this->assertSame('Body', $templates[0]['body']);
}
}