function NodeTranslationUITest::testFieldTranslationForm

Tests field translation form.

File

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

Class

NodeTranslationUITest
Tests the Node Translation UI.

Namespace

Drupal\node\Tests

Code

function testFieldTranslationForm() {
  $admin_user = $this
    ->drupalCreateUser(array_merge($this
    ->getTranslatorPermissions(), array(
    'access administration pages',
    'bypass node access',
    'administer node fields',
  )));
  $this
    ->drupalLogin($admin_user);
  $article = $this
    ->drupalCreateNode(array(
    'type' => 'article',
    'langcode' => 'en',
  ));

  // Visit translation page.
  $this
    ->drupalGet('node/' . $article->nid . '/translations');
  $this
    ->assertRaw('Not translated');

  // Delete the only translatable field.
  field_delete_field('field_test_et_ui_test');

  // Visit translation page.
  $this
    ->drupalGet('node/' . $article->nid . '/translations');
  $this
    ->assertRaw('No translatable fields');
}