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 / Vocabulary / VocabularyResourceTestBase.php
index 5d03512921387fa31e0e1c39b758fa99d54fac40..9571cbec20935fdb7510a3d9c013d84a9d2261d5 100644 (file)
@@ -2,82 +2,15 @@
 
 namespace Drupal\Tests\rest\Functional\EntityResource\Vocabulary;
 
-use Drupal\taxonomy\Entity\Vocabulary;
-use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
+@trigger_error('The ' . __NAMESPACE__ . '\VocabularyResourceTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\Tests\taxonomy\Functional\Rest\VocabularyResourceTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED);
 
-abstract class VocabularyResourceTestBase extends EntityResourceTestBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  public static $modules = ['taxonomy'];
-
-  /**
-   * {@inheritdoc}
-   */
-  protected static $entityTypeId = 'taxonomy_vocabulary';
-
-  /**
-   * @var \Drupal\taxonomy\VocabularyInterface
-   */
-  protected $entity;
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUpAuthorization($method) {
-    $this->grantPermissionsToTestedRole(['administer taxonomy']);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function createEntity() {
-    $vocabulary = Vocabulary::create([
-      'name' => 'Llama',
-      'vid' => 'llama',
-    ]);
-    $vocabulary->save();
-
-    return $vocabulary;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function getExpectedNormalizedEntity() {
-    return [
-      'uuid' => $this->entity->uuid(),
-      'vid' => 'llama',
-      'langcode' => 'en',
-      'status' => TRUE,
-      'dependencies' => [],
-      'name' => 'Llama',
-      'description' => NULL,
-      'hierarchy' => 0,
-      'weight' => 0,
-    ];
-  }
-
-  /**
-   * {@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);
-    }
-
-    if ($method === 'GET') {
-      return "The following permissions are required: 'access taxonomy overview' OR 'administer taxonomy'.";
-    }
-    return parent::getExpectedUnauthorizedAccessMessage($method);
-  }
+use Drupal\Tests\taxonomy\Functional\Rest\VocabularyResourceTestBase as VocabularyResourceTestBaseReal;
 
+/**
+ * @deprecated in Drupal 8.6.x. Will be removed before Drupal 9.0.0. Use
+ *   Drupal\Tests\taxonomy\Functional\Rest\VocabularyResourceTestBase instead.
+ *
+ * @see https://www.drupal.org/node/2971931
+ */
+abstract class VocabularyResourceTestBase extends VocabularyResourceTestBaseReal {
 }