diff --git a/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php b/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php index 970aa65..d778595 100644 --- a/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php +++ b/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php @@ -15,11 +15,14 @@ class FormatDateTest extends MigrateProcessTestCase { /** - * {@inheritdoc} + * Tests the assumption that local time is in 'Australia/Sydney'. */ - public function setUp() { - parent::setUp(); - date_default_timezone_set('UTC'); + 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()); } /** @@ -74,14 +77,14 @@ public function testMigrateExceptionBadFormat() { */ public function testDeprecatedTimezoneConfigurationKey() { $configuration = [ - 'from_format' => 'Y-m-d\TH:i:sO', - 'to_format' => 'Y-m-d\TH:i:s', + 'from_format' => 'Y-m-d\TH:i:s', + 'to_format' => 'Y-m-d\TH:i:s e', 'timezone' => 'America/Managua', ]; $this->plugin = new FormatDate($configuration, 'test_format_date', []); - $actual = $this->plugin->transform('2004-12-19T10:19:42-0600', $this->migrateExecutable, $this->row, 'field_date'); + $actual = $this->plugin->transform('2004-12-19T10:19:42', $this->migrateExecutable, $this->row, 'field_date'); - $this->assertEquals('2004-12-19T10:19:42', $actual); + $this->assertEquals('2004-12-19T10:19:42 America/Managua', $actual); } /**