X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FFunctional%2FUpdate%2FCommentAdminViewUpdateTest.php;fp=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FFunctional%2FUpdate%2FCommentAdminViewUpdateTest.php;h=7e2ba6278f5a8cd9cde9a0ca9ae95f5ff6e63eaf;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php b/web/core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php new file mode 100644 index 000000000..7e2ba6278 --- /dev/null +++ b/web/core/modules/comment/tests/src/Functional/Update/CommentAdminViewUpdateTest.php @@ -0,0 +1,51 @@ +databaseDumpFiles = [ + __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', + ]; + } + + /** + * Tests that comment admin view is enabled after update. + */ + public function testCommentAdminPostUpdateHook() { + $this->runUpdates(); + // Ensure we can load the view from the storage after the update and it's + // enabled. + $entity_type_manager = \Drupal::entityTypeManager(); + /** @var \Drupal\views\ViewEntityInterface $comment_admin_view */ + $comment_admin_view = $entity_type_manager->getStorage('view')->load('comment'); + $this->assertNotNull($comment_admin_view, 'Comment admin view exist in storage.'); + $this->assertTrue($comment_admin_view->enable(), 'Comment admin view is enabled.'); + $comment_delete_action = $entity_type_manager->getStorage('action')->load('comment_delete_action'); + $this->assertNotNull($comment_delete_action, 'Comment delete action imported'); + // Verify comment admin page is working after updates. + $account = $this->drupalCreateUser(['administer comments']); + $this->drupalLogin($account); + $this->drupalGet('admin/content/comment'); + $this->assertText(t('No comments available.')); + } + +}