<?php

declare(strict_types=1);

namespace Apexl\Io\User\Tests\UnitTests;

use Apexl\Config\ConfigurationMock;
use Apexl\Io\TestInfrastructure\UnitTest;
use Apexl\Io\User\Services\ClientCredentialValidator;
use PHPUnit\Framework\Attributes\Test;

final class ClientValidatorTest extends UnitTest
{
    #[Test]
    public function assertValid(): void
    {
        $clientId = 'myClientId';
        $clientSecret = 'myClientSecret';

        $config = new ConfigurationMock([
            'auth.client_id' => $clientId,
            'auth.client_secret' => $clientSecret,
        ]);

        $this->expectNotToPerformAssertions();

        /** @noinspection PhpUnhandledExceptionInspection */
        \Apexl\Io\container()->make(ClientCredentialValidator::class, [
            'config' => $config,
        ])->assertValid($clientId, $clientSecret);
    }
}