fedi-feed-router/tests/Unit/Services/SystemStatusServiceTest.php
myrmidex 6784af2ff6
Some checks failed
CI / ci (push) Failing after 4m31s
25 - Fix all PHPStan errors and add mockery extension
2026-03-08 14:18:28 +01:00

47 lines
1.4 KiB
PHP

<?php
namespace Tests\Unit\Services;
use App\Services\SystemStatusService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
class SystemStatusServiceTest extends TestCase
{
use RefreshDatabase;
protected function setUp(): void
{
parent::setUp();
// Mock HTTP requests to prevent external calls
Http::fake([
'*' => Http::response('', 500),
]);
}
public function test_service_instantiation(): void
{
$service = new SystemStatusService;
$this->assertInstanceOf(SystemStatusService::class, $service);
}
public function test_get_system_status_returns_correct_structure(): void
{
$service = new SystemStatusService;
$status = $service->getSystemStatus();
$this->assertIsArray($status);
$this->assertArrayHasKey('is_enabled', $status);
$this->assertArrayHasKey('status', $status);
$this->assertArrayHasKey('status_class', $status);
$this->assertArrayHasKey('reasons', $status);
// Without database setup, system should be disabled
$this->assertFalse($status['is_enabled']);
$this->assertEquals('Disabled', $status['status']);
$this->assertEquals('text-red-600', $status['status_class']);
$this->assertIsArray($status['reasons']);
}
}