<?php

namespace MintyPHP\Tests\Service\Security;

use MintyPHP\Repository\Security\RateLimitRepository;
use MintyPHP\Service\Security\RateLimiterService;
use MintyPHP\Service\Security\SecurityServicesFactory;
use PHPUnit\Framework\TestCase;

class SecurityServicesFactoryTest extends TestCase
{
    public function testFactoryReturnsStableInstancesPerFactoryObject(): void
    {
        $factory = new SecurityServicesFactory();

        $this->assertInstanceOf(RateLimitRepository::class, $factory->createRateLimitRepository());
        $this->assertSame($factory->createRateLimitRepository(), $factory->createRateLimitRepository());

        $this->assertInstanceOf(RateLimiterService::class, $factory->createRateLimiterService());
        $this->assertSame($factory->createRateLimiterService(), $factory->createRateLimiterService());
    }
}
