- Introduced new `SettingsRepository` and `CacheRepository` classes in the `autoload\Domain` namespace. - Updated `SettingsController` in the `admin\Controllers` namespace to enhance settings management. - Added new templates for settings in `admin\templates\settings` and `admin\templates\site`. - Improved overall structure and organization of settings-related files.
34 lines
1008 B
PHP
34 lines
1008 B
PHP
<?php
|
|
namespace Tests\Unit\Domain\Settings;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Domain\Settings\SettingsRepository;
|
|
|
|
/**
|
|
* Testy dla SettingsRepository
|
|
*
|
|
* UWAGA: SettingsRepository jest krokiem pośrednim migracji - deleguje do
|
|
* statycznych metod admin\factory\Settings. Pełne testy jednostkowe z mockami
|
|
* będą możliwe po migracji do DI (jak ProductRepository/BannerRepository).
|
|
*
|
|
* Na razie testujemy tylko to, co da się zweryfikować bez bazy danych.
|
|
*/
|
|
class SettingsRepositoryTest extends TestCase
|
|
{
|
|
public function testCanBeInstantiated(): void
|
|
{
|
|
$repository = new SettingsRepository();
|
|
$this->assertInstanceOf(SettingsRepository::class, $repository);
|
|
}
|
|
|
|
public function testHasSaveSettingsMethod(): void
|
|
{
|
|
$this->assertTrue(method_exists(SettingsRepository::class, 'saveSettings'));
|
|
}
|
|
|
|
public function testHasGetSettingsMethod(): void
|
|
{
|
|
$this->assertTrue(method_exists(SettingsRepository::class, 'getSettings'));
|
|
}
|
|
}
|