protected function TermTranslationUITest::createEntity

Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::createEntity().

Overrides EntityTranslationUITest::createEntity

1 call to TermTranslationUITest::createEntity()
TermTranslationUITest::testTranslateLinkVocabularyAdminPage in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTranslationUITest.php
Tests translate link on vocabulary term list.

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTranslationUITest.php, line 82
Definition of Drupal\taxonomy\Tests\TermTranslationUITest.

Class

TermTranslationUITest
Tests the Term Translation UI.

Namespace

Drupal\taxonomy\Tests

Code

protected function createEntity($values, $langcode, $bundle_name = NULL) {
  if (isset($bundle_name)) {
    $vocabulary = taxonomy_vocabulary_machine_name_load($bundle_name);
  }
  else {
    $vocabulary = $this->vocabulary;
  }

  // Term needs vid to be saved.
  $values['vid'] = $vocabulary
    ->id();
  return parent::createEntity($values, $langcode, $bundle_name);
}