function NodeTranslationUITest::testFieldTranslationForm

Tests field translation form.

File

drupal/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php, line 82
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(
    'translate any entity',
    'access administration pages',
    'bypass node access',
  ));
  $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');
}