function CommentTypeResourceTestBase::createEntity
Same name in other branches
- 9 core/modules/comment/tests/src/Functional/Rest/CommentTypeResourceTestBase.php \Drupal\Tests\comment\Functional\Rest\CommentTypeResourceTestBase::createEntity()
- 10 core/modules/comment/tests/src/Functional/Rest/CommentTypeResourceTestBase.php \Drupal\Tests\comment\Functional\Rest\CommentTypeResourceTestBase::createEntity()
- 11.x core/modules/comment/tests/src/Functional/Rest/CommentTypeResourceTestBase.php \Drupal\Tests\comment\Functional\Rest\CommentTypeResourceTestBase::createEntity()
Overrides EntityResourceTestBase::createEntity
File
-
core/
modules/ comment/ tests/ src/ Functional/ Rest/ CommentTypeResourceTestBase.php, line 40
Class
- CommentTypeResourceTestBase
- ResourceTestBase for CommentType entity.
Namespace
Drupal\Tests\comment\Functional\RestCode
protected function createEntity() {
// Create a "Camelids" comment type.
$camelids = CommentType::create([
'id' => 'camelids',
'label' => 'Camelids',
'description' => 'Camelids are large, strictly herbivorous animals with slender necks and long legs.',
'target_entity_type_id' => 'node',
]);
$camelids->save();
return $camelids;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.