Mercurial > hg > isophonics-drupal-site
diff core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | 1fec387a4317 |
children |
line wrap: on
line diff
--- a/core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php Thu May 09 15:33:08 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.