function CommentTranslationUITest::testTranslateLinkCommentAdminPage

Tests translate link on comment content admin page.

File

drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php, line 101
Definition of Drupal\comment\Tests\CommentTranslationUITest.

Class

CommentTranslationUITest
Tests the Comment Translation UI.

Namespace

Drupal\comment\Tests

Code

function testTranslateLinkCommentAdminPage() {
  $this->admin_user = $this
    ->drupalCreateUser(array(
    'access administration pages',
    'administer comments',
    'translate any entity',
  ));
  $this
    ->drupalLogin($this->admin_user);
  $cid_translatable = $this
    ->createEntity(array(), $this->langcodes[0], $this->nodeBundle);
  $cid_untranslatable = $this
    ->createEntity(array(), $this->langcodes[0], 'page');

  // Verify translation links.
  $this
    ->drupalGet('admin/content/comment');
  $this
    ->assertResponse(200);
  $this
    ->assertLinkByHref('comment/' . $cid_translatable . '/translations');
  $this
    ->assertNoLinkByHref('comment/' . $cid_untranslatable . '/translations');
}