X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Ftests%2FDrupal%2FFunctionalTests%2FRest%2FEntityFormModeResourceTestBase.php;fp=web%2Fcore%2Ftests%2FDrupal%2FFunctionalTests%2FRest%2FEntityFormModeResourceTestBase.php;h=e03710ab41c71f8873c31c246e2bc8054d7ca871;hp=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/tests/Drupal/FunctionalTests/Rest/EntityFormModeResourceTestBase.php b/web/core/tests/Drupal/FunctionalTests/Rest/EntityFormModeResourceTestBase.php new file mode 100644 index 000000000..e03710ab4 --- /dev/null +++ b/web/core/tests/Drupal/FunctionalTests/Rest/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. + } + +}