ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
UtcClockTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Data\Clock;
22
24use PHPUnit\Framework\TestCase;
25
26class UtcClockTest extends TestCase
27{
28 private string $default_timezone;
29
30 protected function setUp(): void
31 {
32 $this->default_timezone = date_default_timezone_get();
33 }
34
35 protected function tearDown(): void
36 {
37 date_default_timezone_set($this->default_timezone);
38 }
39
41 {
42 date_default_timezone_set('Europe/Berlin');
43 $clock = new UtcClock();
44
45 self::assertSame('UTC', $clock->now()->getTimezone()->getName());
46 }
47}