You are here

function CommentTranslationUITest::testTranslateLinkCommentAdminPage in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/Tests/CommentTranslationUITest.php \Drupal\comment\Tests\CommentTranslationUITest::testTranslateLinkCommentAdminPage()

Tests translate link on comment content admin page.

File

core/modules/comment/src/Tests/CommentTranslationUITest.php, line 185
Contains \Drupal\comment\Tests\CommentTranslationUITest.

Class

CommentTranslationUITest
Tests the Comment Translation UI.

Namespace

Drupal\comment\Tests

Code

function testTranslateLinkCommentAdminPage() {
  $this->adminUser = $this
    ->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), array(
    'access administration pages',
    'administer comments',
    'skip comment approval',
  )));
  $this
    ->drupalLogin($this->adminUser);
  $cid_translatable = $this
    ->createEntity(array(), $this->langcodes[0]);
  $cid_untranslatable = $this
    ->createEntity(array(), $this->langcodes[0], 'comment');

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