You are here

public function DrupalDateTimeTest::testSystemTimezone in Drupal 9

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

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