You are here

class CommentJsonAnonTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/comment/tests/src/Functional/Rest/CommentJsonAnonTest.php \Drupal\Tests\comment\Functional\Rest\CommentJsonAnonTest
  2. 9 core/modules/comment/tests/src/Functional/Rest/CommentJsonAnonTest.php \Drupal\Tests\comment\Functional\Rest\CommentJsonAnonTest

@group rest

Hierarchy

Expanded class hierarchy of CommentJsonAnonTest

File

core/modules/comment/tests/src/Functional/Rest/CommentJsonAnonTest.php, line 10

Namespace

Drupal\Tests\comment\Functional\Rest
View source
class CommentJsonAnonTest extends CommentResourceTestBase {
  use AnonResourceTestTrait;

  /**
   * {@inheritdoc}
   */
  protected static $format = 'json';

  /**
   * {@inheritdoc}
   */
  protected static $mimeType = 'application/json';

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * {@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.
   *
   * @see ::setUpAuthorization
   */
  protected static $patchProtectedFieldNames = [
    'pid' => NULL,
    'entity_id' => NULL,
    'changed' => NULL,
    'thread' => NULL,
    'entity_type' => NULL,
    'field_name' => NULL,
  ];

}

Members

Namesort descending Modifiers Type Description Overrides
AnonResourceTestTrait::assertAuthenticationEdgeCases protected function
AnonResourceTestTrait::assertResponseWhenMissingAuthentication protected function
CommentJsonAnonTest::$defaultTheme protected property
CommentJsonAnonTest::$format protected static property
CommentJsonAnonTest::$mimeType protected static property
CommentJsonAnonTest::$patchProtectedFieldNames protected static property Anonymous users cannot edit their own comments. Overrides CommentResourceTestBase::$patchProtectedFieldNames
CommentResourceTestBase::$entity protected property
CommentResourceTestBase::$entityTypeId protected static property
CommentResourceTestBase::$modules protected static property 2
CommentResourceTestBase::createEntity protected function
CommentResourceTestBase::getExpectedCacheContexts protected function
CommentResourceTestBase::getExpectedCacheTags protected function
CommentResourceTestBase::getExpectedNormalizedEntity protected function
CommentResourceTestBase::getExpectedUnauthorizedAccessMessage protected function
CommentResourceTestBase::getExpectedUnauthorizedEntityAccessCacheability protected function
CommentResourceTestBase::getNormalizedPatchEntity protected function
CommentResourceTestBase::getNormalizedPostEntity protected function
CommentResourceTestBase::setUpAuthorization protected function
CommentResourceTestBase::testPostDxWithoutCriticalBaseFields public function Tests POSTing a comment without critical base fields. 3
CommentResourceTestBase::testPostSkipCommentApproval public function Tests POSTing a comment with and without 'skip comment approval'. 3
CommentTestTrait::addDefaultCommentField public function Adds the default comment field to an entity.