function ConfigTestResourceTestBase::createEntity

Same name 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()
  2. 8.9.x core/modules/config/tests/config_test/tests/src/Functional/Rest/ConfigTestResourceTestBase.php \Drupal\Tests\config_test\Functional\Rest\ConfigTestResourceTestBase::createEntity()
  3. 10 core/modules/config/tests/config_test/tests/src/Functional/Rest/ConfigTestResourceTestBase.php \Drupal\Tests\config_test\Functional\Rest\ConfigTestResourceTestBase::createEntity()

Overrides EntityResourceTestBase::createEntity

File

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

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;
}

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