<?php
declare(strict_types=1);

namespace App\Core\Testing;

use App\Core\App;
use App\Core\Database;

final class AppTestHarness
{
    private static bool $active = false;

    public static function activate(Database $db, ?object $employee = null): void
    {
        self::$active = true;

        $app = App::getInstance();
        $app->setDb($db);

        if ($employee !== null) {
            $app->setCurrentEmployee($employee);
        }
    }

    public static function deactivate(): void
    {
        self::$active = false;
    }

    public static function isActive(): bool
    {
        return self::$active;
    }
}
