예제 #1
0
 /**
  * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::setupBundle().
  */
 protected function setupBundle()
 {
     parent::setupBundle();
     // Create a vocabulary.
     $this->vocabulary = entity_create('taxonomy_vocabulary', array('name' => $this->bundle, 'description' => $this->randomName(), 'vid' => $this->bundle, 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, 'weight' => mt_rand(0, 10)));
     $this->vocabulary->save();
 }
 /**
  * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::setupBundle().
  */
 function setupBundle()
 {
     parent::setupBundle();
     $this->drupalCreateContentType(array('type' => $this->nodeBundle, 'name' => $this->nodeBundle));
     // Add a comment field to the article content type.
     $this->container->get('comment.manager')->addDefaultField('node', 'article', 'comment_article', CommentItemInterface::OPEN, 'comment_article');
     // Create a page content type.
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'page'));
     // Add a comment field to the page content type - this one won't be
     // translatable.
     $this->container->get('comment.manager')->addDefaultField('node', 'page', 'comment');
     // Mark this bundle as translatable.
     content_translation_set_config('comment', 'comment_article', 'enabled', TRUE);
 }