You are here

private function TranslationOperationsFieldPermissionsTest::translateNode in Translation Views 8

Translate node all specified languages.

2 calls to TranslationOperationsFieldPermissionsTest::translateNode()
TranslationOperationsFieldPermissionsTest::testTranslationOperationsDeletePermissions in tests/src/Functional/TranslationOperationsFieldPermissionsTest.php
Test translation operation delete permissions.
TranslationOperationsFieldPermissionsTest::testTranslationOperationsUpdatePermissions in tests/src/Functional/TranslationOperationsFieldPermissionsTest.php
Test translation operation update permissions.

File

tests/src/Functional/TranslationOperationsFieldPermissionsTest.php, line 105

Class

TranslationOperationsFieldPermissionsTest
Class TranslationOperationsFieldPermissionsTest.

Namespace

Drupal\Tests\translation_views\Functional

Code

private function translateNode() {
  $node = Node::load(1);
  foreach (self::$langcodes as $langcode) {
    if (!$node
      ->hasTranslation($langcode)) {
      $node
        ->addTranslation($langcode, [
        'title' => $this
          ->randomMachineName(),
      ])
        ->save();
    }
  }
}