Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / rest / tests / src / Functional / EntityResource / EntityViewDisplay / EntityViewDisplayResourceTestBase.php
index ccc3aad3c02b0d35b588388b73bf1c0c9d7d7515..83b6be5f9bb8150fd08a6ff93d97b8eaf06dffed 100644 (file)
 
 namespace Drupal\Tests\rest\Functional\EntityResource\EntityViewDisplay;
 
-use Drupal\Core\Entity\Entity\EntityViewDisplay;
-use Drupal\node\Entity\NodeType;
-use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
+@trigger_error('The ' . __NAMESPACE__ . '\EntityViewDisplayResourceTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\FunctionalTests\Rest\EntityViewDisplayResourceTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED);
 
-abstract class EntityViewDisplayResourceTestBase extends EntityResourceTestBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  public static $modules = ['node'];
-
-  /**
-   * {@inheritdoc}
-   */
-  protected static $entityTypeId = 'entity_view_display';
-
-  /**
-   * {@inheritdoc}
-   */
-  protected static $patchProtectedFieldNames = [];
-
-  /**
-   * @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface
-   */
-  protected $entity;
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUpAuthorization($method) {
-    $this->grantPermissionsToTestedRole(['administer node display']);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function createEntity() {
-    // Create a "Camelids" node type.
-    $camelids = NodeType::create([
-      'name' => 'Camelids',
-      'type' => 'camelids',
-    ]);
-    $camelids->save();
-
-    // Create a view display.
-    $view_display = EntityViewDisplay::create([
-      'targetEntityType' => 'node',
-      'bundle' => 'camelids',
-      'mode' => 'default',
-      'status' => TRUE,
-    ]);
-    $view_display->save();
-
-    return $view_display;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function getExpectedNormalizedEntity() {
-    return [
-      'bundle' => 'camelids',
-      'content' => [
-        'links' => [
-          'region' => 'content',
-          'weight' => 100,
-        ],
-      ],
-      'dependencies' => [
-        'config' => [
-          'node.type.camelids',
-        ],
-        'module' => [
-          'user',
-        ],
-      ],
-      'hidden' => [],
-      'id' => 'node.camelids.default',
-      'langcode' => 'en',
-      'mode' => 'default',
-      'status' => TRUE,
-      '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 display' permission is required.";
-  }
+use Drupal\FunctionalTests\Rest\EntityViewDisplayResourceTestBase as EntityViewDisplayResourceTestBaseReal;
 
+/**
+ * @deprecated in Drupal 8.6.x. Will be removed before Drupal 9.0.0. Use
+ *   Drupal\FunctionalTests\Rest\EntityViewDisplayResourceTestBase instead.
+ *
+ * @see https://www.drupal.org/node/2971931
+ */
+abstract class EntityViewDisplayResourceTestBase extends EntityViewDisplayResourceTestBaseReal {
 }