X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FTour%2FTourResourceTestBase.php;fp=web%2Fcore%2Fmodules%2Frest%2Ftests%2Fsrc%2FFunctional%2FEntityResource%2FTour%2FTourResourceTestBase.php;h=86842a9ad5e039775c402db73feb28fbda6dd946;hp=294e3eeac8810f72992223f2e3a4bd56bed6bd22;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/rest/tests/src/Functional/EntityResource/Tour/TourResourceTestBase.php b/web/core/modules/rest/tests/src/Functional/EntityResource/Tour/TourResourceTestBase.php index 294e3eeac..86842a9ad 100644 --- a/web/core/modules/rest/tests/src/Functional/EntityResource/Tour/TourResourceTestBase.php +++ b/web/core/modules/rest/tests/src/Functional/EntityResource/Tour/TourResourceTestBase.php @@ -2,122 +2,15 @@ namespace Drupal\Tests\rest\Functional\EntityResource\Tour; -use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase; -use Drupal\tour\Entity\Tour; +@trigger_error('The ' . __NAMESPACE__ . '\TourResourceTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\Tests\tour\Functional\Rest\TourResourceTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED); -abstract class TourResourceTestBase extends EntityResourceTestBase { - - /** - * {@inheritdoc} - */ - public static $modules = ['tour']; - - /** - * {@inheritdoc} - */ - protected static $entityTypeId = 'tour'; - - /** - * @var \Drupal\tour\TourInterface - */ - protected $entity; - - /** - * {@inheritdoc} - */ - protected function setUpAuthorization($method) { - $this->grantPermissionsToTestedRole(['access tour']); - } - - /** - * {@inheritdoc} - */ - protected function createEntity() { - $tour = Tour::create([ - 'id' => 'tour-llama', - 'label' => 'Llama tour', - 'langcode' => 'en', - 'module' => 'tour', - 'routes' => [ - [ - 'route_name' => '', - ], - ], - 'tips' => [ - 'tour-llama-1' => [ - 'id' => 'tour-llama-1', - 'plugin' => 'text', - 'label' => 'Llama', - 'body' => 'Who handle the awesomeness of llamas?', - 'weight' => 100, - 'attributes' => [ - 'data-id' => 'tour-llama-1', - ], - ], - ], - ]); - $tour->save(); - - return $tour; - } - - /** - * {@inheritdoc} - */ - protected function getExpectedNormalizedEntity() { - return [ - 'dependencies' => [], - 'id' => 'tour-llama', - 'label' => 'Llama tour', - 'langcode' => 'en', - 'module' => 'tour', - 'routes' => [ - [ - 'route_name' => '', - ], - ], - 'status' => TRUE, - 'tips' => [ - 'tour-llama-1' => [ - 'id' => 'tour-llama-1', - 'plugin' => 'text', - 'label' => 'Llama', - 'body' => 'Who handle the awesomeness of llamas?', - 'weight' => 100, - 'attributes' => [ - 'data-id' => 'tour-llama-1', - ], - ], - ], - '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 following permissions are required: 'access tour' OR 'administer site configuration'."; - } +use Drupal\Tests\tour\Functional\Rest\TourResourceTestBase as TourResourceTestBaseReal; +/** + * @deprecated in Drupal 8.6.x. Will be removed before Drupal 9.0.0. Use + * Drupal\Tests\tour\Functional\Rest\TourResourceTestBase instead. + * + * @see https://www.drupal.org/node/2971931 + */ +abstract class TourResourceTestBase extends TourResourceTestBaseReal { }