- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Framework\Config\AppConfig;
|
|
use App\Framework\DateTime\ClockInitializer;
|
|
use App\Framework\DateTime\SystemClock;
|
|
use App\Framework\DateTime\SystemTimer;
|
|
use App\Framework\DateTime\Timezone;
|
|
|
|
beforeEach(function () {
|
|
$this->config = new AppConfig(
|
|
timezone: Timezone::UTC
|
|
);
|
|
$this->initializer = new ClockInitializer($this->config);
|
|
});
|
|
|
|
test('default initialization creates system clock with UTC', function () {
|
|
$clock = ($this->initializer)();
|
|
|
|
expect($clock)->toBeInstanceOf(SystemClock::class)
|
|
->and($clock->now()->getTimezone()->getName())->toBe('UTC');
|
|
});
|
|
|
|
test('custom timezone in config is respected', function () {
|
|
$config = new AppConfig(
|
|
timezone: Timezone::EuropeBerlin
|
|
);
|
|
$initializer = new ClockInitializer($config);
|
|
$clock = $initializer();
|
|
|
|
expect($clock)->toBeInstanceOf(SystemClock::class)
|
|
->and($clock->now()->getTimezone()->getName())->toBe('Europe/Berlin');
|
|
});
|
|
|
|
test('timer initialization works', function () {
|
|
$timer = $this->initializer->initTimer();
|
|
|
|
expect($timer)->toBeInstanceOf(SystemTimer::class);
|
|
});
|