You are here

public function TimezoneTest::testDatetimeElementTimesUnderstoodCorrectly in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php \Drupal\KernelTests\Core\Datetime\Element\TimezoneTest::testDatetimeElementTimesUnderstoodCorrectly()
  2. 10 core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php \Drupal\KernelTests\Core\Datetime\Element\TimezoneTest::testDatetimeElementTimesUnderstoodCorrectly()

Tests datetime elements interpret their times correctly when saving.

Initial times are inevitably presented to the user using a timezone, and so the time must be interpreted using the same timezone when it is time to save the form, otherwise stored times may be changed without the user changing the element's values.

File

core/tests/Drupal/KernelTests/Core/Datetime/Element/TimezoneTest.php, line 206

Class

TimezoneTest
Tests the timezone handling of datetime and datelist element types.

Namespace

Drupal\KernelTests\Core\Datetime\Element

Code

public function testDatetimeElementTimesUnderstoodCorrectly() {
  $this
    ->assertTimesUnderstoodCorrectly('datetime', [
    'date',
    'time',
  ]);
}