X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FFunctional%2FRest%2FCommentTypeResourceTestBase.php;fp=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FFunctional%2FRest%2FCommentTypeResourceTestBase.php;h=5d9b4133620cc85431c7723fe3d57b521f2f5180;hp=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/comment/tests/src/Functional/Rest/CommentTypeResourceTestBase.php b/web/core/modules/comment/tests/src/Functional/Rest/CommentTypeResourceTestBase.php new file mode 100644 index 000000000..5d9b41336 --- /dev/null +++ b/web/core/modules/comment/tests/src/Functional/Rest/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. + } + +}