function CommentTranslationUITest::testTranslateLinkCommentAdminPage
Tests translate link on comment content admin page.
File
- 
              core/modules/ comment/ tests/ src/ Functional/ CommentTranslationUITest.php, line 204 
Class
- CommentTranslationUITest
- Tests the Comment Translation UI.
Namespace
Drupal\Tests\comment\FunctionalCode
public function testTranslateLinkCommentAdminPage() {
  $this->adminUser = $this->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), [
    'access administration pages',
    'administer comments',
    'skip comment approval',
  ]));
  $this->drupalLogin($this->adminUser);
  $cid_translatable = $this->createEntity([], $this->langcodes[0]);
  $cid_untranslatable = $this->createEntity([], $this->langcodes[0], 'comment');
  // Verify translation links.
  $this->drupalGet('admin/content/comment');
  $this->assertSession()
    ->statusCodeEquals(200);
  $this->assertSession()
    ->linkByHrefExists('comment/' . $cid_translatable . '/translations');
  $this->assertSession()
    ->linkByHrefNotExists('comment/' . $cid_untranslatable . '/translations');
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
