+ // Make sure that datetime fields get the right datetime_type setting
+ $field = FieldStorageConfig::load('node.field_date');
+ $this->assertEquals('datetime', $field->getSetting('datetime_type'));
+ $field = FieldStorageConfig::load('node.field_date_without_time');
+ $this->assertEquals('date', $field->getSetting('datetime_type'));
+ $field = FieldStorageConfig::load('node.field_datetime_without_time');
+ $this->assertEquals('date', $field->getSetting('datetime_type'));
+ // Except for field_date_with_end_time which is a timestamp and so does not
+ // have a datetime_type setting.
+ $field = FieldStorageConfig::load('node.field_date_with_end_time');
+ $this->assertNull($field->getSetting('datetime_type'));
+ }
+
+ /**
+ * Tests the migration of text fields with different text processing.
+ */
+ public function testTextFields() {
+ // All text and text_long field bases that have only plain text instances
+ // should be migrated to string and string_long fields.
+ // All text_with_summary field bases that have only plain text instances
+ // should not have been migrated since there's no such thing as a
+ // string_with_summary field.
+ $this->assertEntity('node.field_text_plain', 'string', TRUE, 1);
+ $this->assertEntity('node.field_text_long_plain', 'string_long', TRUE, 1);
+ $this->assertNull(FieldStorageConfig::load('node.field_text_sum_plain'));
+
+ // All text, text_long and text_with_summary field bases that have only
+ // filtered text instances should be migrated to text, text_long and
+ // text_with_summary fields.
+ $this->assertEntity('node.field_text_filtered', 'text', TRUE, 1);
+ $this->assertEntity('node.field_text_long_filtered', 'text_long', TRUE, 1);
+ $this->assertEntity('node.field_text_sum_filtered', 'text_with_summary', TRUE, 1);
+
+ // All text, text_long and text_with_summary field bases that have both
+ // plain text and filtered text instances should not have been migrated.
+ $this->assertNull(FieldStorageConfig::load('node.field_text_plain_filtered'));
+ $this->assertNull(FieldStorageConfig::load('node.field_text_long_plain_filtered'));
+ $this->assertNull(FieldStorageConfig::load('node.field_text_sum_plain_filtered'));
+
+ // For each text field bases that were skipped, there should be a log
+ // message with the required steps to fix this.