X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FCommentType%2FCommentTypeResourceTestBase.php;fp=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FCommentType%2FCommentTypeResourceTestBase.php;h=9d882117f909899e28aba07da676294ae01f0d65;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php b/web/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php new file mode 100644 index 000000000..9d882117f --- /dev/null +++ b/web/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php @@ -0,0 +1,77 @@ +grantPermissionsToTestedRole(['administer comment types']); + } + + /** + * {@inheritdoc} + */ + 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; + } + + /** + * {@inheritdoc} + */ + protected function getExpectedNormalizedEntity() { + return [ + 'dependencies' => [], + 'description' => 'Camelids are large, strictly herbivorous animals with slender necks and long legs.', + 'id' => 'camelids', + 'label' => 'Camelids', + 'langcode' => 'en', + 'status' => TRUE, + 'target_entity_type_id' => 'node', + 'uuid' => $this->entity->uuid(), + ]; + } + + /** + * {@inheritdoc} + */ + protected function getNormalizedPostEntity() { + // @todo Update in https://www.drupal.org/node/2300677. + } + +}