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 / ContentLanguageSettings / ContentLanguageSettingsResourceTestBase.php
index a8b3f8ca35df4e12e0a4d160d0da8bde29c31056..dfe5494baf0b0f3f75eb3c43c3b5f2da8baed38f 100644 (file)
@@ -2,91 +2,15 @@
 
 namespace Drupal\Tests\rest\Functional\EntityResource\ContentLanguageSettings;
 
-use Drupal\language\Entity\ContentLanguageSettings;
-use Drupal\node\Entity\NodeType;
-use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
+@trigger_error('The ' . __NAMESPACE__ . '\ContentLanguageSettingsResourceTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use Drupal\Tests\language\Functional\Rest\ContentLanguageSettingsResourceTestBase. See https://www.drupal.org/node/2971931.', E_USER_DEPRECATED);
 
-abstract class ContentLanguageSettingsResourceTestBase extends EntityResourceTestBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  public static $modules = ['language', 'node'];
-
-  /**
-   * {@inheritdoc}
-   */
-  protected static $entityTypeId = 'language_content_settings';
-
-  /**
-   * @var \Drupal\language\ContentLanguageSettingsInterface
-   */
-  protected $entity;
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUpAuthorization($method) {
-    $this->grantPermissionsToTestedRole(['administer languages']);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function createEntity() {
-    // Create a "Camelids" node type.
-    $camelids = NodeType::create([
-      'name' => 'Camelids',
-      'type' => 'camelids',
-    ]);
-    $camelids->save();
-
-    $entity = ContentLanguageSettings::create([
-      'target_entity_type_id' => 'node',
-      'target_bundle' => 'camelids',
-    ]);
-    $entity->setDefaultLangcode('site_default')
-      ->save();
-
-    return $entity;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function getExpectedNormalizedEntity() {
-    return [
-      'default_langcode' => 'site_default',
-      'dependencies' => [
-        'config' => [
-          'node.type.camelids',
-        ],
-      ],
-      'id' => 'node.camelids',
-      'langcode' => 'en',
-      'language_alterable' => FALSE,
-      'status' => TRUE,
-      'target_bundle' => 'camelids',
-      'target_entity_type_id' => 'node',
-      'uuid' => $this->entity->uuid(),
-    ];
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function getNormalizedPostEntity() {
-    // @todo Update in https://www.drupal.org/node/2300677.
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function getExpectedCacheContexts() {
-    return [
-      'languages:language_interface',
-      'user.permissions',
-    ];
-  }
+use Drupal\Tests\language\Functional\Rest\ContentLanguageSettingsResourceTestBase as ContentLanguageSettingsResourceTestBaseReal;
 
+/**
+ * @deprecated in Drupal 8.6.x. Will be removed before Drupal 9.0.0. Use
+ *   Drupal\Tests\language\Functional\Rest\ContentLanguageSettingsResourceTestBase instead.
+ *
+ * @see https://www.drupal.org/node/2971931
+ */
+abstract class ContentLanguageSettingsResourceTestBase extends ContentLanguageSettingsResourceTestBaseReal {
 }