function DrupalDateTimeTest::testSystemTimezone

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

File

core/modules/system/tests/src/Functional/Datetime/DrupalDateTimeTest.php, line 37

Class

DrupalDateTimeTest
Tests DrupalDateTime functionality.

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->assertEqual($response, '"Europe\\/London"', 'Timezone AJAX callback successfully identifies and responds to a long-format date.');
}

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