diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php index a909862..cd280de 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigExportImportUITest.php @@ -101,8 +101,6 @@ function testExport() { // Create a content type. $this->content_type = $this->drupalCreateContentType(); - $type_exists = (bool) entity_load('node_type', $this->content_type->type); - $this->assertTrue($type_exists, 'The new content type has been created in the database.'); // Create a field. $this->field = entity_create('field_entity', array( @@ -167,55 +165,6 @@ function testImport() { $this->assertEqual($this->slogan, \Drupal::config('system.site')->get('slogan')); $this->drupalGet('node/add/' . $this->content_type->type); $this->assertFieldByName("{$this->field->name}[0][value]", '', 'The custom field widget is displayed'); - - // Delete the custom field. - $field_instances = entity_load_multiple('field_instance'); - foreach($field_instances as &$field_instance) { - if($field_instance->field_name == $this->field->name) { - $field_instance->delete(); - } - } - $fields = entity_load_multiple('field_entity'); - foreach($fields as &$field) { - if($field->name == $this->field->name) { - $field->delete(); - } - } - - // Ensure the custom field is deleted. - $this->drupalGet('node/add/' . $this->content_type->type); - $this->assertNoFieldByName("{$this->field->name}[0][value]", '', 'The custom field widget is not displayed'); - - // Recreate the custom field. - $field = entity_create('field_entity', array( - 'name' => $this->field->name, - 'entity_type' => 'node', - 'type' => 'text', - )); - $field->save(); - entity_create('field_instance', array( - 'field_name' => $field->name, - 'entity_type' => 'node', - 'bundle' => $this->content_type->type, - ))->save(); - entity_get_form_display('node', $this->content_type->type, 'default') - ->setComponent($field->name, array( - 'type' => 'text_textfield', - )) - ->save(); - entity_get_display('node', $this->content_type->type, 'full') - ->setComponent($field->name) - ->save(); - - // Ensure the custom field exists. - $this->drupalGet('node/add/' . $this->content_type->type); - $this->assertFieldByName("{$this->field->name}[0][value]", '', 'The custom field widget is displayed'); - - $this->doImport($filename); - - // Ensure the custom field exists. - $this->drupalGet('node/add/' . $this->content_type->type); - $this->assertFieldByName("{$this->field->name}[0][value]", '', 'The custom field widget is displayed'); } /**