function TimeZoneAbbreviationRouteTest::testSystemTimezone

Same name in other branches
  1. 10 core/modules/system/tests/src/Functional/Datetime/TimeZoneAbbreviationRouteTest.php \Drupal\Tests\system\Functional\Datetime\TimeZoneAbbreviationRouteTest::testSystemTimezone()
  2. 11.x core/modules/system/tests/src/Functional/Datetime/TimeZoneAbbreviationRouteTest.php \Drupal\Tests\system\Functional\Datetime\TimeZoneAbbreviationRouteTest::testSystemTimezone()

Test that the AJAX Timezone Callback can deal with various formats.

File

core/modules/system/tests/src/Functional/Datetime/TimeZoneAbbreviationRouteTest.php, line 29

Class

TimeZoneAbbreviationRouteTest
Tests converting JavaScript time zone abbreviations to time zone identifiers.

Namespace

Drupal\Tests\system\Functional\Datetime

Code

public function testSystemTimezone() {
    $options = [
        'query' => [
            'date' => 'Tue+Sep+17+2013+21%3A35%3A31+GMT%2B0100+(BST)#',
        ],
    ];
    // Query the AJAX Timezone Callback with a long-format date.
    $response = $this->drupalGet('system/timezone/BST/3600/1', $options);
    $this->assertEquals($response, '"Europe\\/London"');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.