Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / comment / tests / src / Functional / Hal / CommentHalJsonAnonTest.php
diff --git a/web/core/modules/comment/tests/src/Functional/Hal/CommentHalJsonAnonTest.php b/web/core/modules/comment/tests/src/Functional/Hal/CommentHalJsonAnonTest.php
new file mode 100644 (file)
index 0000000..723df95
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+
+namespace Drupal\Tests\comment\Functional\Hal;
+
+use Drupal\Tests\rest\Functional\AnonResourceTestTrait;
+
+/**
+ * @group hal
+ */
+class CommentHalJsonAnonTest extends CommentHalJsonTestBase {
+
+  use AnonResourceTestTrait;
+
+  /**
+   * {@inheritdoc}
+   *
+   * Anonymous users cannot edit their own comments.
+   *
+   * @see \Drupal\comment\CommentAccessControlHandler::checkAccess
+   *
+   * Therefore we grant them the 'administer comments' permission for the
+   * purpose of this test. Then they are able to edit their own comments, but
+   * some fields are still not editable, even with that permission.
+   *
+   * @see ::setUpAuthorization
+   */
+  protected static $patchProtectedFieldNames = [
+    'changed' => NULL,
+    'thread' => NULL,
+    'entity_type' => NULL,
+    'field_name' => NULL,
+    'entity_id' => NULL,
+  ];
+
+}