ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
UtcClockTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Data\Clock;
22 
25 
26 class 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 }