<?php

use PHPUnit\Framework\TestCase;
use App\Services\JwtService;

class JwtTest extends TestCase
{
    public function testTokenGenerationAndValidation(): void
    {
        $token = JwtService::generateToken([
            'uid' => 1,
            'license' => 1
        ]);

        $this->assertIsString($token);

        $payload = JwtService::validateToken($token);

        $this->assertEquals(1, $payload->uid);
        $this->assertEquals(1, $payload->license);
    }
}
