ILIAS
release_8 Revision v8.19
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
j
l
m
p
s
t
u
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
LocalClockTest.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
DateTimeZone
;
22
use
ILIAS\Data\Clock\LocalClock
;
23
use
PHPUnit\Framework\TestCase
;
24
25
class
LocalClockTest
extends
TestCase
26
{
27
private
string
$default_timezone
;
28
29
protected
function
setUp
(): void
30
{
31
$this->default_timezone = date_default_timezone_get();
32
}
33
34
protected
function
tearDown
(): void
35
{
36
date_default_timezone_set($this->default_timezone);
37
}
38
39
public
function
testUtcClockIsNotAffectedByGlobalTimezoneChanges
(): void
40
{
41
date_default_timezone_set(
'UTC'
);
42
43
$clock =
new
LocalClock
(
new
DateTimeZone
(
'Africa/Windhoek'
));
44
45
self::assertSame(
'Africa/Windhoek'
, $clock->now()->getTimezone()->getName());
46
}
47
}
DateTimeZone
ILIAS\Data\Clock\LocalClock
Definition:
LocalClock.php:24
LocalClock
ILIAS\Data\Clock
Definition:
ClockFactory.php:19
ILIAS\Data\Clock\LocalClockTest\$default_timezone
string $default_timezone
Definition:
LocalClockTest.php:27
ILIAS\Data\Clock\LocalClockTest\setUp
setUp()
Definition:
LocalClockTest.php:29
ILIAS\Data\Clock\LocalClockTest\testUtcClockIsNotAffectedByGlobalTimezoneChanges
testUtcClockIsNotAffectedByGlobalTimezoneChanges()
Definition:
LocalClockTest.php:39
ILIAS\Data\Clock\LocalClockTest
Definition:
LocalClockTest.php:25
ILIAS\Data\Clock\LocalClockTest\tearDown
tearDown()
Definition:
LocalClockTest.php:34
TestCase
tests
Data
LocalClockTest.php
Generated on Tue Apr 1 2025 22:02:50 for ILIAS by
1.8.13 (using
Doxyfile
)