/** * {@inheritdoc} */ protected function setupBundle() { parent::setupBundle(); // Create a vocabulary. $this->vocabulary = Vocabulary::create(['name' => $this->bundle, 'description' => $this->randomMachineName(), 'vid' => $this->bundle, 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, 'weight' => mt_rand(0, 10)]); $this->vocabulary->save(); }
/** * {@inheritdoc} */ function setupBundle() { parent::setupBundle(); $this->drupalCreateContentType(array('type' => $this->nodeBundle, 'name' => $this->nodeBundle)); // Add a comment field to the article content type. $this->addDefaultCommentField('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->addDefaultCommentField('node', 'page', 'comment'); // Mark this bundle as translatable. $this->container->get('content_translation.manager')->setEnabled('comment', 'comment_article', TRUE); }