Commit 8451a498 authored by catch's avatar catch
Browse files

Issue #3368071 by tstoeckler, longwave: Installing Content Translation module breaks Rest resources

(cherry picked from commit 45bcde63)
(cherry picked from commit ac56748d)
parent 3f397e20
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ abstract class BlockContentResourceTestBase extends EntityResourceTestBase {
  /**
   * {@inheritdoc}
   */
  protected static $modules = ['block_content'];
  protected static $modules = ['block_content', 'content_translation'];

  /**
   * {@inheritdoc}
+14 −0
Original line number Diff line number Diff line
# Content Translation extension relation types.
# See https://tools.ietf.org/html/rfc5988#section-4.2.
drupal:content-translation-overview:
  uri: https://drupal.org/link-relations/drupal-content-translation-overview
  description: A page where translations of a resource can be viewed.
drupal:content-translation-add:
  uri: https://drupal.org/link-relations/drupal-content-translation-add
  description: A page where a translation of a resource can be created.
drupal:content-translation-edit:
  uri: https://drupal.org/link-relations/drupal-content-translation-edit
  description: A page where a translation of a resource can be edited.
drupal:content-translation-delete:
  uri: https://drupal.org/link-relations/drupal-content-translation-delete
  description: A page where a translation of a resource can be deleted.
+12 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ abstract class MediaResourceTestBase extends EntityResourceTestBase {
  /**
   * {@inheritdoc}
   */
  protected static $modules = ['media'];
  protected static $modules = ['content_translation', 'media'];

  /**
   * {@inheritdoc}
@@ -309,6 +309,17 @@ protected function getExpectedUnauthorizedAccessMessage($method) {
    }
  }

  /**
   * {@inheritdoc}
   */
  protected function getExpectedCacheContexts() {
    return [
      'languages:language_interface',
      'url.site',
      'user.permissions',
    ];
  }

  /**
   * {@inheritdoc}
   */
+12 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ abstract class MenuLinkContentResourceTestBase extends EntityResourceTestBase {
  /**
   * {@inheritdoc}
   */
  protected static $modules = ['menu_link_content'];
  protected static $modules = ['content_translation', 'menu_link_content'];

  /**
   * {@inheritdoc}
@@ -231,4 +231,15 @@ protected function getExpectedUnauthorizedAccessMessage($method) {
    }
  }

  /**
   * {@inheritdoc}
   */
  protected function getExpectedCacheContexts() {
    return [
      'languages:language_interface',
      'url.site',
      'user.permissions',
    ];
  }

}
+12 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ abstract class NodeResourceTestBase extends EntityResourceTestBase {
  /**
   * {@inheritdoc}
   */
  protected static $modules = ['node', 'path'];
  protected static $modules = ['content_translation', 'node', 'path'];

  /**
   * {@inheritdoc}
@@ -222,6 +222,17 @@ protected function getExpectedUnauthorizedAccessMessage($method) {
    return parent::getExpectedUnauthorizedAccessMessage($method);
  }

  /**
   * {@inheritdoc}
   */
  protected function getExpectedCacheContexts() {
    return [
      'languages:language_interface',
      'url.site',
      'user.permissions',
    ];
  }

  /**
   * Tests PATCHing a node's path with and without 'create url aliases'.
   *
Loading