X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FEntityFormDisplay%2FEntityFormDisplayResourceTestBase.php;fp=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FEntityFormDisplay%2FEntityFormDisplayResourceTestBase.php;h=1862084a71bc1a771140259ab7295cd90968e784;hp=cc4cf588a78ab5bbb7d654eedf78f83fd1105821;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/rest/tests/src/Functional/EntityResource/EntityFormDisplay/EntityFormDisplayResourceTestBase.php b/web/core/modules/rest/tests/src/Functional/EntityResource/EntityFormDisplay/EntityFormDisplayResourceTestBase.php index cc4cf588a..1862084a7 100644 --- a/web/core/modules/rest/tests/src/Functional/EntityResource/EntityFormDisplay/EntityFormDisplayResourceTestBase.php +++ b/web/core/modules/rest/tests/src/Functional/EntityResource/EntityFormDisplay/EntityFormDisplayResourceTestBase.php @@ -2,160 +2,15 @@ namespace Drupal\Tests\rest\Functional\EntityResource\EntityFormDisplay; -use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\node\Entity\NodeType; -use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase; +@trigger_error('The ' . __NAMESPACE__ . '\EntityFormDisplayResourceTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\FunctionalTests\Rest\EntityFormDisplayResourceTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED); -abstract class EntityFormDisplayResourceTestBase extends EntityResourceTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = ['node']; - - /** - * {@inheritdoc} - */ - protected static $entityTypeId = 'entity_form_display'; - - /** - * @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface - */ - protected $entity; - - /** - * {@inheritdoc} - */ - protected function setUpAuthorization($method) { - $this->grantPermissionsToTestedRole(['administer node form display']); - } - - /** - * {@inheritdoc} - */ - protected function createEntity() { - // Create a "Camelids" node type. - $camelids = NodeType::create([ - 'name' => 'Camelids', - 'type' => 'camelids', - ]); - - $camelids->save(); - - // Create a form display. - $form_display = EntityFormDisplay::create([ - 'targetEntityType' => 'node', - 'bundle' => 'camelids', - 'mode' => 'default', - ]); - $form_display->save(); - - return $form_display; - } - - /** - * {@inheritdoc} - */ - protected function getExpectedNormalizedEntity() { - return [ - 'bundle' => 'camelids', - 'content' => [ - 'created' => [ - 'type' => 'datetime_timestamp', - 'weight' => 10, - 'region' => 'content', - 'settings' => [], - 'third_party_settings' => [], - ], - 'promote' => [ - 'type' => 'boolean_checkbox', - 'settings' => [ - 'display_label' => TRUE, - ], - 'weight' => 15, - 'region' => 'content', - 'third_party_settings' => [], - ], - 'status' => [ - 'type' => 'boolean_checkbox', - 'weight' => 120, - 'region' => 'content', - 'settings' => [ - 'display_label' => TRUE, - ], - 'third_party_settings' => [], - ], - 'sticky' => [ - 'type' => 'boolean_checkbox', - 'settings' => [ - 'display_label' => TRUE, - ], - 'weight' => 16, - 'region' => 'content', - 'third_party_settings' => [], - ], - 'title' => [ - 'type' => 'string_textfield', - 'weight' => -5, - 'region' => 'content', - 'settings' => [ - 'size' => 60, - 'placeholder' => '', - ], - 'third_party_settings' => [], - ], - 'uid' => [ - 'type' => 'entity_reference_autocomplete', - 'weight' => 5, - 'settings' => [ - 'match_operator' => 'CONTAINS', - 'size' => 60, - 'placeholder' => '', - ], - 'region' => 'content', - 'third_party_settings' => [], - ], - ], - 'dependencies' => [ - 'config' => [ - 'node.type.camelids', - ], - ], - 'hidden' => [], - 'id' => 'node.camelids.default', - 'langcode' => 'en', - 'mode' => 'default', - 'status' => NULL, - 'targetEntityType' => 'node', - 'uuid' => $this->entity->uuid(), - ]; - } - - /** - * {@inheritdoc} - */ - protected function getNormalizedPostEntity() { - // @todo Update in https://www.drupal.org/node/2300677. - } - - /** - * {@inheritdoc} - */ - protected function getExpectedCacheContexts() { - return [ - 'user.permissions', - ]; - } - - /** - * {@inheritdoc} - */ - protected function getExpectedUnauthorizedAccessMessage($method) { - if ($this->config('rest.settings')->get('bc_entity_resource_permissions')) { - return parent::getExpectedUnauthorizedAccessMessage($method); - } - - return "The 'administer node form display' permission is required."; - } +use Drupal\FunctionalTests\Rest\EntityFormDisplayResourceTestBase as EntityFormDisplayResourceTestBaseReal; +/** + * @deprecated in Drupal 8.6.x. Will be removed before Drupal 9.0.0. Use + * Drupal\FunctionalTests\Rest\EntityFormDisplayResourceTestBase instead. + * + * @see https://www.drupal.org/node/2971931 + */ +abstract class EntityFormDisplayResourceTestBase extends EntityFormDisplayResourceTestBaseReal { }