<?php

declare(strict_types=1);

namespace Apexl\Tests\User\UnitTests;

use apexl\Config\ConfigurationMock;
use apexl\Io\modules\user\services\ClientCredentialValidator;
use apexl\Io\TestInfrastructure\UnitTest;
use PHPUnit\Framework\Attributes\Test;
use function apexl\Io\container;

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 */
        container()->make(ClientCredentialValidator::class, [
            'config' => $config,
        ])->assertValid($clientId, $clientSecret);
    }
}