Files
alrahma_sunday_school_api/tests/Unit/Services/Notifications/NotificationDeletedServiceTest.php
T
2026-06-08 23:45:55 -04:00

34 lines
951 B
PHP

<?php
namespace Tests\Unit\Services\Notifications;
use App\Services\Notifications\NotificationDeletedService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class NotificationDeletedServiceTest extends TestCase
{
use RefreshDatabase;
public function test_list_returns_deleted_notifications(): void
{
DB::table('notifications')->insert([
'id' => 1,
'title' => 'Deleted',
'message' => 'Message',
'target_group' => 'parent',
'delivery_channels' => json_encode(['in_app']),
'deleted_at' => now(),
'created_at' => now(),
'updated_at' => now(),
]);
$service = new NotificationDeletedService();
$result = $service->list();
$this->assertCount(1, $result['notifications']);
$this->assertSame(1, $result['notifications'][0]['id']);
}
}