diff --git a/core/lib/Drupal/Core/Entity/Event/BundleConfigImportValidate.php b/core/lib/Drupal/Core/Entity/Event/BundleConfigImportValidate.php index a29efa2..5a1e2c8 100644 --- a/core/lib/Drupal/Core/Entity/Event/BundleConfigImportValidate.php +++ b/core/lib/Drupal/Core/Entity/Event/BundleConfigImportValidate.php @@ -48,7 +48,7 @@ public function __construct(ConfigManagerInterface $config_manager, EntityManage /** * Ensures bundles that will be deleted are not in use. * - * @param ConfigImporterEvent $event + * @param \Drupal\Core\Config\ConfigImporterEvent $event * The config import event. */ public function onConfigImporterValidate(ConfigImporterEvent $event) { diff --git a/core/modules/config/src/Tests/ConfigImportUITest.php b/core/modules/config/src/Tests/ConfigImportUITest.php index 4e85976..1dece05 100644 --- a/core/modules/config/src/Tests/ConfigImportUITest.php +++ b/core/modules/config/src/Tests/ConfigImportUITest.php @@ -405,19 +405,39 @@ public function testEntityBundleDelete() { $node_type = $this->drupalCreateContentType(); $node = $this->drupalCreateNode(array('type' => $node_type->id())); $this->drupalGet('admin/config/development/configuration'); - // There will be one delete of the newly created node type. - $this->assertNoText(t('There are no configuration changes to import.')); + // The node type, body field and entity displays will be scheduled for + // removal. + $this->assertText(t('5 removed')); + $this->assertText(format_string('node.type.@type', array('@type' => $node_type->id()))); + $this->assertText(format_string('field.field.node.@type.body', array('@type' => $node_type->id()))); + $this->assertText(format_string('core.entity_view_display.node.@type.teaser', array('@type' => $node_type->id()))); + $this->assertText(format_string('core.entity_view_display.node.@type.default', array('@type' => $node_type->id()))); + $this->assertText(format_string('core.entity_form_display.node.@type.default', array('@type' => $node_type->id()))); - // Attempt to import configuration and verify that an error message appears. + // Attempt to import configuration and verify that an error message appears + // and the node type, body field and entity displays are still scheduled for + // removal. $this->drupalPostForm(NULL, array(), t('Import all')); $validation_message = t('Entities exist of type %entity_type and %bundle_label %bundle. These entities need to be deleted before importing.', array('%entity_type' => $node->getEntityType()->getLabel(), '%bundle_label' => $node->getEntityType()->getBundleLabel(), '%bundle' => $node_type->label())); $this->assertRaw($validation_message); + $this->assertText(t('5 removed')); + $this->assertText(format_string('node.type.@type', array('@type' => $node_type->id()))); + $this->assertText(format_string('field.field.node.@type.body', array('@type' => $node_type->id()))); + $this->assertText(format_string('core.entity_view_display.node.@type.teaser', array('@type' => $node_type->id()))); + $this->assertText(format_string('core.entity_view_display.node.@type.default', array('@type' => $node_type->id()))); + $this->assertText(format_string('core.entity_form_display.node.@type.default', array('@type' => $node_type->id()))); // Delete the node and try to import again. $node->delete(); $this->drupalPostForm(NULL, array(), t('Import all')); $this->assertNoRaw($validation_message); $this->assertText(t('There are no configuration changes to import.')); + $this->assertNoText(t('5 removed')); + $this->assertNoText(format_string('node.type.@type', array('@type' => $node_type->id()))); + $this->assertNoText(format_string('field.field.node.@type.body', array('@type' => $node_type->id()))); + $this->assertNoText(format_string('core.entity_view_display.node.@type.teaser', array('@type' => $node_type->id()))); + $this->assertNoText(format_string('core.entity_view_display.node.@type.default', array('@type' => $node_type->id()))); + $this->assertNoText(format_string('core.entity_form_display.node.@type.default', array('@type' => $node_type->id()))); } }