ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SystemClockTest.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 SystemClockTest 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('Africa/Windhoek');
43
44 $clock = new SystemClock();
45
46 self::assertSame('Africa/Windhoek', $clock->now()->getTimezone()->getName());
47 }
48}