You are here

public function CommentTestBase::setCommentAnonymous in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/comment/tests/src/Functional/CommentTestBase.php \Drupal\Tests\comment\Functional\CommentTestBase::setCommentAnonymous()

Sets the value governing restrictions on anonymous comments.

Parameters

int $level: The level of the contact information allowed for anonymous comments:

  • 0: No contact information allowed.
  • 1: Contact information allowed but not required.
  • 2: Contact information required.
9 calls to CommentTestBase::setCommentAnonymous()
CommentAdminTest::testApprovalAdminInterface in core/modules/comment/tests/src/Functional/CommentAdminTest.php
Tests comment approval functionality through admin/content/comment.
CommentAdminTest::testApprovalAdminInterface in core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php
Tests comment approval functionality through admin/content/comment.
CommentAdminTest::testApprovalNodeInterface in core/modules/comment/tests/src/Functional/CommentAdminTest.php
Tests comment approval functionality through the node interface.
CommentAdminTest::testCommentedTranslationDeletion in core/modules/comment/tests/src/Functional/CommentAdminTest.php
Tests commented translation deletion admin view.
CommentAdminTest::testEditComment in core/modules/comment/tests/src/Functional/CommentAdminTest.php
Tests editing a comment as an admin.

... See full list

File

core/modules/comment/tests/src/Functional/CommentTestBase.php, line 305

Class

CommentTestBase
Provides setup and helper methods for comment tests.

Namespace

Drupal\Tests\comment\Functional

Code

public function setCommentAnonymous($level) {
  $this
    ->setCommentSettings('anonymous', $level, new FormattableMarkup('Anonymous commenting set to level @level.', [
    '@level' => $level,
  ]));
}