function CommentHalExportTest::setUp

Overrides CommentTestBase::setUp

File

core/modules/hal/tests/src/Functional/comment/Views/CommentHalExportTest.php, line 43

Class

CommentHalExportTest
Tests a comment rest export view.

Namespace

Drupal\Tests\hal\Functional\comment\Views

Code

protected function setUp($import_test_views = TRUE, $modules = [
    'hal_test_views',
]) : void {
    parent::setUp($import_test_views, $modules);
    // Add another anonymous comment.
    $comment = [
        'uid' => 0,
        'entity_id' => $this->nodeUserCommented
            ->id(),
        'entity_type' => 'node',
        'field_name' => 'comment',
        'subject' => 'A lot, apparently',
        'cid' => '',
        'pid' => $this->comment
            ->id(),
        'mail' => 'someone@example.com',
        'name' => 'bobby tables',
        'hostname' => 'public.example.com',
    ];
    $this->comment = Comment::create($comment);
    $this->comment
        ->save();
    $user = $this->drupalCreateUser([
        'access comments',
    ]);
    $this->drupalLogin($user);
}

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