You are here

protected function ConfigTestResourceTestBase::createEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/config/tests/config_test/tests/src/Functional/Rest/ConfigTestResourceTestBase.php \Drupal\Tests\config_test\Functional\Rest\ConfigTestResourceTestBase::createEntity()

Creates the entity to be tested.

Return value

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

Overrides EntityResourceTestBase::createEntity

File

core/modules/config/tests/config_test/tests/src/Functional/Rest/ConfigTestResourceTestBase.php, line 35

Class

ConfigTestResourceTestBase

Namespace

Drupal\Tests\config_test\Functional\Rest

Code

protected function createEntity() {
  $config_test = ConfigTest::create([
    'id' => 'llama',
    'label' => 'Llama',
  ]);
  $config_test
    ->save();
  return $config_test;
}