function NodeTranslationUITest::testTranslateLinkContentAdminPage

Tests translate link on content admin page.

File

drupal/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php, line 65
Definition of Drupal\node\Tests\NodeTranslationUITest.

Class

NodeTranslationUITest
Tests the Node Translation UI.

Namespace

Drupal\node\Tests

Code

function testTranslateLinkContentAdminPage() {
  $this->admin_user = $this
    ->drupalCreateUser(array(
    'access administration pages',
    'access content overview',
    'administer nodes',
    'bypass node access',
  ));
  $this
    ->drupalLogin($this->admin_user);
  $page = $this
    ->drupalCreateNode(array(
    'type' => 'page',
  ));
  $article = $this
    ->drupalCreateNode(array(
    'type' => 'article',
  ));

  // Verify translation links.
  $this
    ->drupalGet('admin/content');
  $this
    ->assertResponse(200);
  $this
    ->assertLinkByHref('node/' . $article->nid . '/translations');
  $this
    ->assertNoLinkByHref('node/' . $page->nid . '/translations');
}