You are here

public function DrupalDateTimeTest::testSystemTimezone in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Datetime/DrupalDateTimeTest.php \Drupal\system\Tests\Datetime\DrupalDateTimeTest::testSystemTimezone()

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

File

core/modules/system/src/Tests/Datetime/DrupalDateTimeTest.php, line 37
Contains \Drupal\system\Tests\Datetime\DrupalDateTimeTest.

Class

DrupalDateTimeTest
Tests DrupalDateTime functionality.

Namespace

Drupal\system\Tests\Datetime

Code

public function testSystemTimezone() {
  $options = array(
    'query' => array(
      '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.');
}