Mercurial > hg > cmmr2012-drupal-site
diff core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | c75dbcec494b |
children |
line wrap: on
line diff
--- a/core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php Thu Feb 28 13:11:55 2019 +0000 +++ b/core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php Thu May 09 15:34:47 2019 +0100 @@ -81,18 +81,21 @@ $this->assertTrue($entity->field_datetime[0] instanceof FieldItemInterface, 'Field item implements interface.'); $this->assertEqual($entity->field_datetime->value, $value); $this->assertEqual($entity->field_datetime[0]->value, $value); + $this->assertEqual(DateTimeItemInterface::STORAGE_TIMEZONE, $entity->field_datetime[0]->getProperties()['value']->getDateTime()->getTimeZone()->getName()); $this->assertEquals(DateTimeItemInterface::STORAGE_TIMEZONE, $entity->field_datetime->date->getTimeZone()->getName()); // Verify changing the date value. $new_value = '2016-11-04T00:21:00'; $entity->field_datetime->value = $new_value; $this->assertEqual($entity->field_datetime->value, $new_value); + $this->assertEqual(DateTimeItemInterface::STORAGE_TIMEZONE, $entity->field_datetime[0]->getProperties()['value']->getDateTime()->getTimeZone()->getName()); $this->assertEquals(DateTimeItemInterface::STORAGE_TIMEZONE, $entity->field_datetime->date->getTimeZone()->getName()); // Read changed entity and assert changed values. $this->entityValidateAndSave($entity); $entity = EntityTest::load($id); $this->assertEqual($entity->field_datetime->value, $new_value); + $this->assertEqual(DateTimeItemInterface::STORAGE_TIMEZONE, $entity->field_datetime[0]->getProperties()['value']->getDateTime()->getTimeZone()->getName()); $this->assertEquals(DateTimeItemInterface::STORAGE_TIMEZONE, $entity->field_datetime->date->getTimeZone()->getName()); // Test the generateSampleValue() method.