X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FCommentType%2FCommentTypeResourceTestBase.php;fp=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FCommentType%2FCommentTypeResourceTestBase.php;h=11cccc14497190d770a1d69976ca8683b730842d;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=9d882117f909899e28aba07da676294ae01f0d65;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php b/web/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php index 9d882117f..11cccc144 100644 --- a/web/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php +++ b/web/core/modules/rest/tests/src/Functional/EntityResource/CommentType/CommentTypeResourceTestBase.php @@ -2,76 +2,15 @@ namespace Drupal\Tests\rest\Functional\EntityResource\CommentType; -use Drupal\comment\Entity\CommentType; -use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase; +@trigger_error('The ' . __NAMESPACE__ . '\CommentTypeResourceTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\Tests\comment\Functional\Rest\CommentTypeResourceTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED); + +use Drupal\Tests\comment\Functional\Rest\CommentTypeResourceTestBase as CommentTypeResourceTestBaseReal; /** - * ResourceTestBase for CommentType entity. + * @deprecated in Drupal 8.6.x. Will be removed before Drupal 9.0.0. Use + * Drupal\Tests\comment\Functional\Rest\CommentTypeResourceTestBase instead. + * + * @see https://www.drupal.org/node/2971931 */ -abstract class CommentTypeResourceTestBase extends EntityResourceTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = ['node', 'comment']; - - /** - * {@inheritdoc} - */ - protected static $entityTypeId = 'comment_type'; - - /** - * The CommentType entity. - * - * @var \Drupal\comment\CommentTypeInterface - */ - protected $entity; - - /** - * {@inheritdoc} - */ - protected function setUpAuthorization($method) { - $this->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. - } - +abstract class CommentTypeResourceTestBase extends CommentTypeResourceTestBaseReal { }