Chris@0: account = $this->drupalCreateUser(['skip comment approval']); Chris@0: $this->account2 = $this->drupalCreateUser(); Chris@0: $this->drupalLogin($this->account); Chris@0: Chris@0: $this->drupalCreateContentType(['type' => 'page', 'name' => t('Basic page')]); Chris@0: $this->addDefaultCommentField('node', 'page'); Chris@0: Chris@0: $this->nodeUserPosted = $this->drupalCreateNode(); Chris@0: $this->nodeUserCommented = $this->drupalCreateNode(['uid' => $this->account2->id()]); Chris@0: Chris@0: $comment = [ Chris@0: 'uid' => $this->loggedInUser->id(), Chris@0: 'entity_id' => $this->nodeUserCommented->id(), Chris@0: 'entity_type' => 'node', Chris@0: 'field_name' => 'comment', Chris@0: 'subject' => 'How much wood would a woodchuck chuck', Chris@0: 'cid' => '', Chris@0: 'pid' => '', Chris@0: 'mail' => 'someone@example.com', Chris@0: ]; Chris@0: $this->comment = Comment::create($comment); Chris@0: $this->comment->save(); Chris@0: } Chris@0: Chris@0: }