move into sonardesk

This commit is contained in:
Mark Gregory
2026-10-12 14:50:13 +01:00
parent 5f0d2ceb72
commit 38b4a7406f
879 changed files with 24021 additions and 1 deletions
@@ -0,0 +1,5 @@
<?php
it('boots the Settings module', function (): void {
expect(config('settings.name'))->toBe('Settings');
});
@@ -0,0 +1,9 @@
<?php
use Modules\Settings\Services\SettingsRepository;
it('stores and reads typed site settings from one repository', function (): void {
$repository = app(SettingsRepository::class);
$repository->put('site_name', 'Unified CMS', 'site', 'string', true);
expect($repository->site()['site_name'])->toBe('Unified CMS');
});
@@ -0,0 +1,27 @@
<?php
use Modules\Settings\Services\SettingsRepository;
use Modules\Stylist\Theme\Stylist;
it('stores separate active frontend and backend themes in site settings', function (): void {
$settings = app(SettingsRepository::class);
$settings->put('frontend_theme', 'swiss', 'site', 'string', true);
$settings->put('backend_theme', 'admin', 'site', 'string', true);
expect($settings->site())
->frontend_theme->toBe('swiss')
->backend_theme->toBe('admin');
expect(app(Stylist::class)->frontend()->key())->toBe('swiss')
->and(app(Stylist::class)->backend()->key())->toBe('admin');
});
it('falls back to configured themes when stored theme keys are unavailable', function (): void {
$settings = app(SettingsRepository::class);
$settings->put('frontend_theme', 'missing-theme', 'site', 'string', true);
$settings->put('backend_theme', 'missing-theme', 'site', 'string', true);
expect(app(Stylist::class)->frontend()->key())->toBe(config('stylist.default_frontend_theme'))
->and(app(Stylist::class)->backend()->key())->toBe(config('stylist.default_backend_theme'));
});