defaultTimeZone = date_default_timezone_get(); } protected function tearDown(): void { date_default_timezone_set($this->defaultTimeZone); } /** * @test * * @covers ::__construct * @covers ::create * @covers ::now */ public function itUsesTheSystemTimeZone(): void { $timeZone = 'Europe/Berlin'; self::assertNotSame($timeZone, $this->defaultTimeZone); date_default_timezone_set($timeZone); $clock = SystemClock::create(); $now = $clock->now(); self::assertSame($timeZone, $now->getTimezone()->getName()); } }