You are here

protected function VocabularyResourceTestBase::createEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/tests/src/Functional/Rest/VocabularyResourceTestBase.php \Drupal\Tests\taxonomy\Functional\Rest\VocabularyResourceTestBase::createEntity()
  2. 9 core/modules/taxonomy/tests/src/Functional/Rest/VocabularyResourceTestBase.php \Drupal\Tests\taxonomy\Functional\Rest\VocabularyResourceTestBase::createEntity()

Creates the entity to be tested.

Return value

\Drupal\Core\Entity\EntityInterface The entity to be tested.

Overrides EntityResourceTestBase::createEntity

File

core/modules/taxonomy/tests/src/Functional/Rest/VocabularyResourceTestBase.php, line 35

Class

VocabularyResourceTestBase

Namespace

Drupal\Tests\taxonomy\Functional\Rest

Code

protected function createEntity() {
  $vocabulary = Vocabulary::create([
    'name' => 'Llama',
    'vid' => 'llama',
  ]);
  $vocabulary
    ->save();
  return $vocabulary;
}