You are here

protected function SchedulerUiTrait::setUpTimeZone in Lightning Workflow 8.3

Sets the time zone.

Functional tests normally run in the Syndey, Australia time zone in order to catch time zone-related edge cases and bugs. However, the scheduler UI is extremely sensitive to time zones, so to reduce craziness it's best to set it to the time zone configured in php.ini.

Parameters

string $default: (optional) The time zone to set if none is configured in php.ini. Defaults to UTC.

2 calls to SchedulerUiTrait::setUpTimeZone()
TransitionTest::setUp in modules/lightning_scheduler/tests/src/FunctionalJavascript/TransitionTest.php
UiTest::setUp in modules/lightning_scheduler/tests/src/FunctionalJavascript/UiTest.php

File

modules/lightning_scheduler/tests/src/Traits/SchedulerUiTrait.php, line 25

Class

SchedulerUiTrait
Contains methods for interacting with the scheduler UI.

Namespace

Drupal\Tests\lightning_scheduler\Traits

Code

protected function setUpTimeZone($default = 'UTC') {
  $this
    ->config('system.date')
    ->clear('timezone.default')
    ->save();
  date_default_timezone_set(ini_get('date.timezone') ?: $default);
}