add notifications logic and add support of both JWT and Sanctum
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?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']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user