X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FFieldStorageConfig%2FFieldStorageConfigResourceTestBase.php;fp=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FFieldStorageConfig%2FFieldStorageConfigResourceTestBase.php;h=594e275e0dc59511ea7766b12bb03eb96acd5fb3;hp=aafc2531e71e32cae6bb17bb2d6a2a1046049654;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/rest/tests/src/Functional/EntityResource/FieldStorageConfig/FieldStorageConfigResourceTestBase.php b/web/core/modules/rest/tests/src/Functional/EntityResource/FieldStorageConfig/FieldStorageConfigResourceTestBase.php index aafc2531e..594e275e0 100644 --- a/web/core/modules/rest/tests/src/Functional/EntityResource/FieldStorageConfig/FieldStorageConfigResourceTestBase.php +++ b/web/core/modules/rest/tests/src/Functional/EntityResource/FieldStorageConfig/FieldStorageConfigResourceTestBase.php @@ -2,103 +2,15 @@ namespace Drupal\Tests\rest\Functional\EntityResource\FieldStorageConfig; -use Drupal\field\Entity\FieldStorageConfig; -use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase; +@trigger_error('The ' . __NAMESPACE__ . '\FieldStorageConfigResourceTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\Tests\field\Functional\Rest\FieldStorageConfigResourceTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED); -abstract class FieldStorageConfigResourceTestBase extends EntityResourceTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = ['node']; - - /** - * {@inheritdoc} - */ - protected static $entityTypeId = 'field_storage_config'; - - /** - * @var \Drupal\field\FieldConfigStorage - */ - protected $entity; - - /** - * {@inheritdoc} - */ - protected function setUpAuthorization($method) { - $this->grantPermissionsToTestedRole(['administer node fields']); - } - - /** - * {@inheritdoc} - */ - protected function createEntity() { - $field_storage = FieldStorageConfig::create([ - 'field_name' => 'true_llama', - 'entity_type' => 'node', - 'type' => 'boolean', - ]); - $field_storage->save(); - return $field_storage; - } - - /** - * {@inheritdoc} - */ - protected function getExpectedNormalizedEntity() { - return [ - 'cardinality' => 1, - 'custom_storage' => FALSE, - 'dependencies' => [ - 'module' => ['node'], - ], - 'entity_type' => 'node', - 'field_name' => 'true_llama', - 'id' => 'node.true_llama', - 'indexes' => [], - 'langcode' => 'en', - 'locked' => FALSE, - 'module' => 'core', - 'persist_with_no_fields' => FALSE, - 'settings' => [], - 'status' => TRUE, - 'translatable' => TRUE, - 'type' => 'boolean', - 'uuid' => $this->entity->uuid(), - ]; - } - - /** - * {@inheritdoc} - */ - protected function getNormalizedPostEntity() { - // @todo Update in https://www.drupal.org/node/2300677. - } - - /** - * {@inheritdoc} - */ - protected function getExpectedUnauthorizedAccessMessage($method) { - if ($this->config('rest.settings')->get('bc_entity_resource_permissions')) { - return parent::getExpectedUnauthorizedAccessMessage($method); - } - - switch ($method) { - case 'GET': - return "The 'administer node fields' permission is required."; - - default: - return parent::getExpectedUnauthorizedAccessMessage($method); - } - } - - /** - * {@inheritdoc} - */ - protected function getExpectedCacheContexts() { - return [ - 'user.permissions', - ]; - } +use Drupal\Tests\field\Functional\Rest\FieldStorageConfigResourceTestBase as FieldStorageConfigResourceTestBaseReal; +/** + * @deprecated in Drupal 8.6.x. Will be removed before Drupal 9.0.0. Use + * Drupal\Tests\field\Functional\Rest\FieldStorageConfigResourceTestBase instead. + * + * @see https://www.drupal.org/node/2971931 + */ +abstract class FieldStorageConfigResourceTestBase extends FieldStorageConfigResourceTestBaseReal { }