function VocabularyResourceTestBase::createEntity

Same name in other branches
  1. 9 core/modules/taxonomy/tests/src/Functional/Rest/VocabularyResourceTestBase.php \Drupal\Tests\taxonomy\Functional\Rest\VocabularyResourceTestBase::createEntity()
  2. 8.9.x core/modules/taxonomy/tests/src/Functional/Rest/VocabularyResourceTestBase.php \Drupal\Tests\taxonomy\Functional\Rest\VocabularyResourceTestBase::createEntity()
  3. 10 core/modules/taxonomy/tests/src/Functional/Rest/VocabularyResourceTestBase.php \Drupal\Tests\taxonomy\Functional\Rest\VocabularyResourceTestBase::createEntity()

Overrides EntityResourceTestBase::createEntity

File

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

Class

VocabularyResourceTestBase

Namespace

Drupal\Tests\taxonomy\Functional\Rest

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.