.../EntityResource/Comment/CommentHalJsonAnonTest.php | 2 +- .../EntityResource/Comment/CommentHalJsonTestBase.php | 19 +++++++++++++++++++ .../EntityResource/Node/NodeHalJsonAnonTest.php | 13 +++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonAnonTest.php b/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonAnonTest.php index 9b0cee2..3edd9b1 100644 --- a/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonAnonTest.php +++ b/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonAnonTest.php @@ -25,11 +25,11 @@ class CommentHalJsonAnonTest extends CommentHalJsonTestBase { * @see ::setUpAuthorization */ protected static $patchProtectedFieldNames = [ - 'entity_id', 'changed', 'thread', 'entity_type', 'field_name', + 'entity_id', ]; } diff --git a/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php b/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php index 3deb0ea..1939e04 100644 --- a/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php +++ b/core/modules/hal/tests/src/Functional/EntityResource/Comment/CommentHalJsonTestBase.php @@ -26,6 +26,25 @@ */ protected static $mimeType = 'application/hal+json'; + /** + * {@inheritdoc} + * + * The HAL+JSON format causes different PATCH-protected fields. For some + * reason, the 'pid' and 'homepage' fields are NOT PATCH-protected, even + * though they are for non-HAL+JSON serializations. + * + * @todo fix in https://www.drupal.org/node/2824271 + */ + protected static $patchProtectedFieldNames = [ + 'status', + 'created', + 'changed', + 'thread', + 'entity_type', + 'field_name', + 'entity_id', + 'uid', + ]; /** * {@inheritdoc} diff --git a/core/modules/hal/tests/src/Functional/EntityResource/Node/NodeHalJsonAnonTest.php b/core/modules/hal/tests/src/Functional/EntityResource/Node/NodeHalJsonAnonTest.php index 2de6539..e218a73 100644 --- a/core/modules/hal/tests/src/Functional/EntityResource/Node/NodeHalJsonAnonTest.php +++ b/core/modules/hal/tests/src/Functional/EntityResource/Node/NodeHalJsonAnonTest.php @@ -33,6 +33,19 @@ class NodeHalJsonAnonTest extends NodeResourceTestBase { /** * {@inheritdoc} */ + protected static $patchProtectedFieldNames = [ + 'revision_timestamp', + 'created', + 'changed', + 'promote', + 'sticky', + 'path', + 'revision_uid', + ]; + + /** + * {@inheritdoc} + */ protected function getExpectedNormalizedEntity() { $default_normalization = parent::getExpectedNormalizedEntity();