ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Data\Clock\LocalClockTest Class Reference
+ Inheritance diagram for ILIAS\Data\Clock\LocalClockTest:
+ Collaboration diagram for ILIAS\Data\Clock\LocalClockTest:

Public Member Functions

 testUtcClockIsNotAffectedByGlobalTimezoneChanges ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Private Attributes

string $default_timezone
 

Detailed Description

Definition at line 27 of file LocalClockTest.php.

Member Function Documentation

◆ setUp()

ILIAS\Data\Clock\LocalClockTest::setUp ( )
protected

Definition at line 31 of file LocalClockTest.php.

31 : void
32 {
33 $this->default_timezone = date_default_timezone_get();
34 }

◆ tearDown()

ILIAS\Data\Clock\LocalClockTest::tearDown ( )
protected

Definition at line 36 of file LocalClockTest.php.

36 : void
37 {
38 date_default_timezone_set($this->default_timezone);
39 }

◆ testUtcClockIsNotAffectedByGlobalTimezoneChanges()

ILIAS\Data\Clock\LocalClockTest::testUtcClockIsNotAffectedByGlobalTimezoneChanges ( )

Definition at line 41 of file LocalClockTest.php.

41 : void
42 {
43 date_default_timezone_set('UTC');
44
45 $clock = new LocalClock(new DateTimeZone('Africa/Windhoek'));
46
47 self::assertSame('Africa/Windhoek', $clock->now()->getTimezone()->getName());
48 }

Field Documentation

◆ $default_timezone

string ILIAS\Data\Clock\LocalClockTest::$default_timezone
private

Definition at line 29 of file LocalClockTest.php.


The documentation for this class was generated from the following file: