<?php

use App\Services\WorkflowGuardService;
use CodeIgniter\Database\BaseConnection;
use PHPUnit\Framework\TestCase;

final class WorkflowGuardServiceTest extends TestCase
{
    public function testAllowedTransitions(): void
    {
        $db    = $this->createMock(BaseConnection::class);
        $guard = new WorkflowGuardService($db);
        $this->assertTrue($guard->canTransition('new', 'assigned'));
        $this->assertTrue($guard->canTransition('in_progress', 'completed'));
        $this->assertFalse($guard->canTransition('new', 'completed'));
        $this->assertFalse($guard->canTransition('cancelled', 'in_progress'));
    }
}
