ILIAS
release_8 Revision v8.23
◀ ilDoc Overview
UtcClockTest.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
/******************************************************************************
6
*
7
* This file is part of ILIAS, a powerful learning management system.
8
*
9
* ILIAS is licensed with the GPL-3.0, you should have received a copy
10
* of said license along with the source code.
11
*
12
* If this is not the case or you just want to try ILIAS, you'll find
13
* us at:
14
* https://www.ilias.de
15
* https://github.com/ILIAS-eLearning
16
*
17
*****************************************************************************/
18
19
namespace
ILIAS\Data\Clock
;
20
21
use
ILIAS\Data\Clock\UtcClock
;
22
use
PHPUnit\Framework\TestCase
;
23
24
class
UtcClockTest
extends
TestCase
25
{
26
private
string
$default_timezone
;
27
28
protected
function
setUp
(): void
29
{
30
$this->default_timezone = date_default_timezone_get();
31
}
32
33
protected
function
tearDown
(): void
34
{
35
date_default_timezone_set($this->default_timezone);
36
}
37
38
public
function
testUtcClockIsNotAffectedByGlobalTimezoneChanges
(): void
39
{
40
date_default_timezone_set(
'Europe/Berlin'
);
41
$clock =
new
UtcClock
();
42
43
self::assertSame(
'UTC'
, $clock->now()->getTimezone()->getName());
44
}
45
}
ILIAS\Data\Clock
Definition:
ClockFactory.php:19
ILIAS\Data\Clock\UtcClockTest
Definition:
UtcClockTest.php:24
ILIAS\Data\Clock\UtcClockTest\tearDown
tearDown()
Definition:
UtcClockTest.php:33
ILIAS\Data\Clock\UtcClock
Definition:
UtcClock.php:24
ILIAS\Data\Clock\UtcClockTest\$default_timezone
string $default_timezone
Definition:
UtcClockTest.php:26
UtcClock
ILIAS\Data\Clock\UtcClockTest\testUtcClockIsNotAffectedByGlobalTimezoneChanges
testUtcClockIsNotAffectedByGlobalTimezoneChanges()
Definition:
UtcClockTest.php:38
ILIAS\Data\Clock\UtcClockTest\setUp
setUp()
Definition:
UtcClockTest.php:28
TestCase
tests
Data
UtcClockTest.php
Generated on Wed Sep 3 2025 22:03:00 for ILIAS by
1.8.13 (using
Doxyfile
)