Issue #2799987 by jonathanshaw, oriol_e9g, Jo Fitzgerald, mpdonadio, GoZ,...
Issue #2799987 by jonathanshaw, oriol_e9g, Jo Fitzgerald, mpdonadio, GoZ, Mixologic, harsha012, jhedstrom: Datetime and Datelist element's timezone handling is fragile, buggy and wrongly documented
$this->assertEquals($this->timezones['user'],drupal_get_user_timezone(),'Subsequent tests assume specific value for drupal_get_user_timezone().');
$this->assertEquals(drupal_get_user_timezone(),date_default_timezone_get(),"Subsequent tests may assume PHP's time is set to Drupal user's time zone.");
$this->assertEquals(drupal_get_user_timezone(),$this->date->getTimezone()->getName(),'Subsequent tests assume DrupalDateTime objects default to Drupal user time zone if none specified');
}
/**
* 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