diff --git a/core/modules/migrate/src/Plugin/migrate/process/FormatDate.php b/core/modules/migrate/src/Plugin/migrate/process/FormatDate.php index e34314e..2148656 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/FormatDate.php +++ b/core/modules/migrate/src/Plugin/migrate/process/FormatDate.php @@ -16,9 +16,8 @@ * @link http://php.net/manual/datetime.createfromformat.php \DateTime::createFromFormat. @endlink * - to_format: The destination format. * - timezone: (deprecated) String identifying the required time zone, see - * DateTimePlus::__construct(). The timezone configuration key is deprecated - * in Drupal 8.4.0 and will be removed before Drupal 9.0.0, use from_timezone - * and to_timezone instead. + * DateTimePlus::__construct(). The timezone configuration key will be removed + * before Drupal 9.0.0, use from_timezone and to_timezone instead. * - from_timezone: String identifying the required source time zone, see * DateTimePlus::__construct(). * - to_timezone: String identifying the required destination time zone, see @@ -116,7 +115,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable if (isset($this->configuration['timezone'])) { @trigger_error('Configuration key "timezone" is deprecated in 8.4.0 and will be removed before Drupal 9.0.0, use "from_timezone" and "to_timezone" instead. See https://www.drupal.org/node/2885746', E_USER_DEPRECATED); $from_timezone = $this->configuration['timezone']; - $to_timezone = NULL; + $to_timezone = isset($this->configuration['to_timezone']) ? $this->configuration['to_timezone'] : NULL; } else { $system_timezone = date_default_timezone_get(); diff --git a/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php b/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php index 67eddae..e84cec1 100644 --- a/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php +++ b/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php @@ -15,17 +15,6 @@ class FormatDateTest extends MigrateProcessTestCase { /** - * Tests the assumption that local time is in 'Australia/Sydney'. - */ - public function testLocalTimeZone() { - // @todo The 'Australia/Sydney' time zone is set in core/tests/bootstrap.php - // This assertion checks that the assumptions about local time in the rest - // of the test methods are accurate. This should be removed when - // @link https://www.drupal.org/node/2889803 @endlink is committed. - $this->assertEquals('Australia/Sydney', date_default_timezone_get()); - } - - /** * Tests that missing configuration will throw an exception. */ public function testMigrateExceptionMissingFromFormat() {