You are here

protected function ContentTranslationEntityBundleInfoTest::getBundledNode in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationEntityBundleInfoTest::getBundledNode()
  2. 9 core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationEntityBundleInfoTest::getBundledNode()

Gets a new bundled node for testing.

Return value

\Drupal\node\Entity\Node The new node.

Throws

\Drupal\Core\Entity\EntityStorageException

File

core/modules/content_translation/tests/src/Kernel/ContentTranslationEntityBundleInfoTest.php, line 138

Class

ContentTranslationEntityBundleInfoTest
Tests the Content Translation bundle info logic.

Namespace

Drupal\Tests\content_translation\Kernel

Code

protected function getBundledNode() {
  $this
    ->installEntitySchema('node');
  $bundle = NodeType::create([
    'type' => 'bundle_test',
    'label' => 'Bundle Test',
  ]);
  $bundle
    ->save();
  $node = Node::create([
    'type' => 'bundle_test',
  ]);
  return $node;
}