function CommentStatisticsTest::setUp

Same name in other branches
  1. 9 core/modules/comment/tests/src/Functional/CommentStatisticsTest.php \Drupal\Tests\comment\Functional\CommentStatisticsTest::setUp()
  2. 8.9.x core/modules/comment/tests/src/Functional/CommentStatisticsTest.php \Drupal\Tests\comment\Functional\CommentStatisticsTest::setUp()
  3. 11.x core/modules/comment/tests/src/Functional/CommentStatisticsTest.php \Drupal\Tests\comment\Functional\CommentStatisticsTest::setUp()

Overrides CommentTestBase::setUp

File

core/modules/comment/tests/src/Functional/CommentStatisticsTest.php, line 33

Class

CommentStatisticsTest
Tests comment statistics on nodes.

Namespace

Drupal\Tests\comment\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // Add more permissions the admin user.
    $this->adminUser
        ->addRole($this->drupalCreateRole([
        'administer permissions',
        'access administration pages',
        'administer site configuration',
    ]))
        ->save();
    // Create a second user to post comments.
    $this->webUser2 = $this->drupalCreateUser([
        'post comments',
        'create article content',
        'edit own comments',
        'skip comment approval',
        'access comments',
        'access content',
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.