saufen/tests/Feature/Service/Config/AppNameTest.php
2025-06-09 22:05:01 +02:00

18 lines
599 B
PHP

<?php
use App\Enum\SystemSettingKey;
use App\Service\Config\AppName;
use App\Service\ConfigurationService;
test('it returns the system name from configuration service', function () {
/** @var ConfigurationService $configService */
$configService = $this->getContainer()->get(ConfigurationService::class);
$appName = new AppName($configService);
expect((string)$appName)->toBe(SystemSettingKey::SYSTEM_NAME->defaultValue());
$expected = 'Test System Name';
$configService->set(SystemSettingKey::SYSTEM_NAME, $expected);
expect((string)$appName)->toBe($expected);
});