diff --git a/core/modules/block_content/tests/src/Functional/Rest/BlockContentResourceTestBase.php b/core/modules/block_content/tests/src/Functional/Rest/BlockContentResourceTestBase.php index f3af50a1f58c12fbf29fd1e5f09c334e5c558391..00f5a0b8f2a7f661307270c970d913eb800b282d 100644 --- a/core/modules/block_content/tests/src/Functional/Rest/BlockContentResourceTestBase.php +++ b/core/modules/block_content/tests/src/Functional/Rest/BlockContentResourceTestBase.php @@ -17,7 +17,7 @@ abstract class BlockContentResourceTestBase extends EntityResourceTestBase { /** * {@inheritdoc} */ - protected static $modules = ['block_content']; + protected static $modules = ['block_content', 'content_translation']; /** * {@inheritdoc} diff --git a/core/modules/content_translation/content_translation.link_relation_types.yml b/core/modules/content_translation/content_translation.link_relation_types.yml new file mode 100644 index 0000000000000000000000000000000000000000..6c1f0916ba406838957d4dad4600f5b460ef58af --- /dev/null +++ b/core/modules/content_translation/content_translation.link_relation_types.yml @@ -0,0 +1,14 @@ +# 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. diff --git a/core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php b/core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php index a0bab34bd445f26b6984922bf2da08a1c8320787..7b797b8e9678f2b88d351e6477f302bce191fb6b 100644 --- a/core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php +++ b/core/modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php @@ -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} */ diff --git a/core/modules/menu_link_content/tests/src/Functional/Rest/MenuLinkContentResourceTestBase.php b/core/modules/menu_link_content/tests/src/Functional/Rest/MenuLinkContentResourceTestBase.php index f959e31160718a79f5b3147bc3140b26e4221b18..e8490810beb7803d4de659c6269ebc7ead6f09fa 100644 --- a/core/modules/menu_link_content/tests/src/Functional/Rest/MenuLinkContentResourceTestBase.php +++ b/core/modules/menu_link_content/tests/src/Functional/Rest/MenuLinkContentResourceTestBase.php @@ -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', + ]; + } + } diff --git a/core/modules/node/tests/src/Functional/Rest/NodeResourceTestBase.php b/core/modules/node/tests/src/Functional/Rest/NodeResourceTestBase.php index 484f73791cf240cf67182efbdedf866b235b856d..d8c663bb03c0d3e022b5e638e180c7e93f09b39f 100644 --- a/core/modules/node/tests/src/Functional/Rest/NodeResourceTestBase.php +++ b/core/modules/node/tests/src/Functional/Rest/NodeResourceTestBase.php @@ -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'. * diff --git a/core/modules/taxonomy/tests/src/Functional/Rest/TermResourceTestBase.php b/core/modules/taxonomy/tests/src/Functional/Rest/TermResourceTestBase.php index 2c64a7b04c9b8ffae55adc43c07871838fd3965f..cdd3d8fbb9d68e841b94e72778c347f0f3b3f7dd 100644 --- a/core/modules/taxonomy/tests/src/Functional/Rest/TermResourceTestBase.php +++ b/core/modules/taxonomy/tests/src/Functional/Rest/TermResourceTestBase.php @@ -15,7 +15,7 @@ abstract class TermResourceTestBase extends EntityResourceTestBase { /** * {@inheritdoc} */ - protected static $modules = ['taxonomy', 'path']; + protected static $modules = ['content_translation', 'path', 'taxonomy']; /** * {@inheritdoc}