X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FEntityFormMode%2FEntityFormModeResourceTestBase.php;fp=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FEntityFormMode%2FEntityFormModeResourceTestBase.php;h=a9035e0ad1864b231b95725e2501615540e7abdf;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=0000000000000000000000000000000000000000;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/modules/rest/tests/src/Functional/EntityResource/EntityFormMode/EntityFormModeResourceTestBase.php b/web/core/modules/rest/tests/src/Functional/EntityResource/EntityFormMode/EntityFormModeResourceTestBase.php new file mode 100644 index 000000000..a9035e0ad --- /dev/null +++ b/web/core/modules/rest/tests/src/Functional/EntityResource/EntityFormMode/EntityFormModeResourceTestBase.php @@ -0,0 +1,74 @@ +grantPermissionsToTestedRole(['administer display modes']); + } + + /** + * {@inheritdoc} + */ + protected function createEntity() { + $entity_form_mode = EntityFormMode::create([ + 'id' => 'user.test', + 'label' => 'Test', + 'targetEntityType' => 'user', + ]); + $entity_form_mode->save(); + return $entity_form_mode; + } + + /** + * {@inheritdoc} + */ + protected function getExpectedNormalizedEntity() { + return [ + 'cache' => TRUE, + 'dependencies' => [ + 'module' => [ + 'user', + ], + ], + 'id' => 'user.test', + 'label' => 'Test', + 'langcode' => 'en', + 'status' => TRUE, + 'targetEntityType' => 'user', + 'uuid' => $this->entity->uuid(), + ]; + } + + /** + * {@inheritdoc} + */ + protected function getNormalizedPostEntity() { + // @todo Update in https://www.drupal.org/node/2300677. + } + +}