You are here

public function CommentTestBase::setCommentsPerPage in Drupal 8

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

Sets the value specifying the default number of comments per page.

Parameters

int $number: Comments per page value.

string $field_name: (optional) Field name through which the comment should be posted. Defaults to 'comment'.

7 calls to CommentTestBase::setCommentsPerPage()
CommentBlockTest::testRecentCommentBlock in core/modules/comment/tests/src/Functional/CommentBlockTest.php
Tests the recent comments block.
CommentInterfaceTest::testCommentInterface in core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
Tests the comment interface.
CommentPagerTest::testCommentNewPageIndicator in core/modules/comment/tests/src/Functional/CommentPagerTest.php
Tests calculation of first page with new comment.
CommentPagerTest::testCommentOrderingThreading in core/modules/comment/tests/src/Functional/CommentPagerTest.php
Tests comment ordering and threading.
CommentPagerTest::testCommentPaging in core/modules/comment/tests/src/Functional/CommentPagerTest.php
Confirms comment paging works correctly with flat and threaded comments.

... See full list

File

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

Class

CommentTestBase
Provides setup and helper methods for comment tests.

Namespace

Drupal\Tests\comment\Functional

Code

public function setCommentsPerPage($number, $field_name = 'comment') {
  $this
    ->setCommentSettings('per_page', $number, new FormattableMarkup('Number of comments per page set to @number.', [
    '@number' => $number,
  ]), $field_name);
}