assertInstanceOf(SystemClock::class, $clock); $this->assertEquals('UTC', $clock->now()->getTimezone()->getName()); } public function testCustomTimezone(): void { $initializer = new ClockInitializer('Europe/Berlin'); $clock = $initializer(); $this->assertInstanceOf(SystemClock::class, $clock); $this->assertEquals('Europe/Berlin', $clock->now()->getTimezone()->getName()); } public function testFrozenClockInitialization(): void { $initializer = new ClockInitializer( useFrozenClock: true, frozenTime: '2021-01-01 12:00:00' ); $clock = $initializer(); $this->assertInstanceOf(FrozenClock::class, $clock); $this->assertEquals('2021-01-01 12:00:00', $clock->now()->format('Y-m-d H:i:s')); } public function testFrozenClockWithCustomTimezone(): void { $initializer = new ClockInitializer( timezone: 'Europe/Berlin', useFrozenClock: true, frozenTime: '2021-01-01 12:00:00' ); $clock = $initializer(); $this->assertInstanceOf(FrozenClock::class, $clock); $this->assertEquals('Europe/Berlin', $clock->now()->getTimezone()->getName()); } }