diff --git a/core/modules/comment/src/Tests/CommentTypeTargetEntityTest.php b/core/modules/comment/src/Tests/CommentTypeTargetEntityTest.php index 3b7642d..9466aa9 100644 --- a/core/modules/comment/src/Tests/CommentTypeTargetEntityTest.php +++ b/core/modules/comment/src/Tests/CommentTypeTargetEntityTest.php @@ -16,6 +16,23 @@ class CommentTypeTargetEntityTest extends CommentTestBase * Tests the effect of the target entity provider for a comment type being uninstalled. */ public function testTargetEntityProviderUninstalled() { + // Node is the target entity of the default comment type. + // The same message should appear on the status report and update page.if the entity definition is missing. + $message = t('Comment type @comment_type_label is invalid because the module providing the entity type node has been uninstalled.', [ + '@comment_type_label' => CommentType::load('comment')->label() + ]); + + $user = $this->drupalCreateUser(['administer site configuration', 'administer software updates']); + $this->drupalLogin($user); + + // Check the status report + $this->drupalGet('admin/reports/status'); + $this->assertNoText($message); + + // Check the update page + $this->drupalGet('update.php'); + $this->assertNoText($message); + // Delete the sample node and article comment type created by setUp. $nodes = Node::loadMultiple(); foreach($nodes as $node) { @@ -27,15 +44,6 @@ public function testTargetEntityProviderUninstalled() { // uninstall the node module $this->container->get('module_installer')->uninstall(['node']); - $user = $this->drupalCreateUser(['administer site configuration', 'administer software updates']); - $this->drupalLogin($user); - - // Node is the target entity of the default comment type. - // The same message should appear on the status report and update page. - $message = t('Comment type @comment_type_label is invalid because the module providing the entity type node has been uninstalled.', [ - '@comment_type_label' => CommentType::load('comment')->label() - ]); - // Check the status report $this->drupalGet('admin/reports/status'); $this->assertText($message);