You are here

public function ViewsUITourTest::createTranslation in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views_ui/src/Tests/ViewsUITourTest.php \Drupal\views_ui\Tests\ViewsUITourTest::createTranslation()

Creates single translation for source string.

1 call to ViewsUITourTest::createTranslation()
ViewsUITourTest::testViewsUiTourTipsTranslated in core/modules/views_ui/src/Tests/ViewsUITourTest.php
Tests views_ui tour tip availability in a different language.

File

core/modules/views_ui/src/Tests/ViewsUITourTest.php, line 108
Contains \Drupal\views_ui\Tests\ViewsUITourTest.

Class

ViewsUITourTest
Tests the Views UI tour.

Namespace

Drupal\views_ui\Tests

Code

public function createTranslation($source, $langcode) {
  return $this->localeStorage
    ->createTranslation(array(
    'lid' => $source->lid,
    'language' => $langcode,
    'translation' => $this
      ->randomMachineName(100),
  ))
    ->save();
}