69 lines
2.4 KiB
PHP
69 lines
2.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Integration\Infra\Providers;
|
|
|
|
use Application\Arcadia\Config\AppConfig;
|
|
use Application\Arcadia\Config\ThrottlingConfig;
|
|
use Application\Security\Config\HmacAuthConfig;
|
|
use Application\Security\Config\SecurityAlertMailConfig;
|
|
use Infra\Config\ArcadiaStorageConfig;
|
|
use Infra\Providers\ConfigServiceProvider;
|
|
use Tests\TestCase;
|
|
|
|
uses(TestCase::class);
|
|
covers(ConfigServiceProvider::class);
|
|
|
|
describe('ConfigServiceProvider Integration Tests', function (): void {
|
|
it('resolves SecurityAlertMailConfig with typed Email VO', function (): void {
|
|
// WHEN
|
|
$config = resolve(SecurityAlertMailConfig::class);
|
|
|
|
// THEN
|
|
expect($config)->toBeInstanceOf(SecurityAlertMailConfig::class)
|
|
->and($config->recipientEmail->value)->not->toBeEmpty();
|
|
});
|
|
|
|
it('resolves HmacAuthConfig with dev client credentials', function (): void {
|
|
// WHEN
|
|
$config = resolve(HmacAuthConfig::class);
|
|
|
|
// THEN
|
|
expect($config)->toBeInstanceOf(HmacAuthConfig::class)
|
|
->and($config->devClient)->not->toBeNull()
|
|
->and($config->devClient?->name->value)->toBe('Arcadia Dev Test Client');
|
|
});
|
|
|
|
it('resolves ThrottlingConfig with typed RequestsPerMinute VOs', function (): void {
|
|
// WHEN
|
|
$config = resolve(ThrottlingConfig::class);
|
|
|
|
// THEN
|
|
expect($config)->toBeInstanceOf(ThrottlingConfig::class)
|
|
->and($config->webLimit->toInt())->toBeGreaterThanOrEqual(1)
|
|
->and($config->apiV1Limit->toInt())->toBeGreaterThanOrEqual(1);
|
|
});
|
|
|
|
it('resolves AppConfig with typed timezone and locale VOs', function (): void {
|
|
// WHEN
|
|
$config = resolve(AppConfig::class);
|
|
|
|
// THEN
|
|
expect($config)->toBeInstanceOf(AppConfig::class)
|
|
->and($config->name->value)->not->toBeEmpty()
|
|
->and($config->timezone->name)->toBe('UTC')
|
|
->and($config->locale->value())->not->toBeEmpty()
|
|
->and($config->fallbackLocale->value())->not->toBeEmpty();
|
|
});
|
|
|
|
it('resolves ArcadiaStorageConfig with database and cache settings', function (): void {
|
|
// WHEN
|
|
$config = resolve(ArcadiaStorageConfig::class);
|
|
|
|
// THEN
|
|
expect($config)->toBeInstanceOf(ArcadiaStorageConfig::class)
|
|
->and($config->cacheStore)->not->toBeEmpty()
|
|
->and($config->databaseConnection)->not->toBeEmpty();
|
|
});
|
|
});
|