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\System;
|
||||
|
||||
use App\Services\System\ConfigUpdateService;
|
||||
use DateTimeZone;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ConfigUpdateServiceTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_run_task_rejects_unknown_task(): void
|
||||
{
|
||||
$service = new ConfigUpdateService();
|
||||
$result = $service->runTask('unknown', false, false, new DateTimeZone('UTC'));
|
||||
|
||||
$this->assertFalse($result['ok']);
|
||||
}
|
||||
|
||||
public function test_run_task_sets_config_when_forced(): void
|
||||
{
|
||||
$service = new ConfigUpdateService();
|
||||
$result = $service->runTask('enable_attendance_on', false, true, new DateTimeZone('UTC'));
|
||||
|
||||
$this->assertTrue($result['ok']);
|
||||
$this->assertDatabaseHas('configuration', [
|
||||
'config_key' => 'enable_attendance',
|
||||
'config_value' => '1',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user