X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FFunctional%2FViews%2FCommentTestBase.php;fp=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FFunctional%2FViews%2FCommentTestBase.php;h=a9444a232025eebc912156eb8f6cffc13297f13f;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=0000000000000000000000000000000000000000;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/modules/comment/tests/src/Functional/Views/CommentTestBase.php b/web/core/modules/comment/tests/src/Functional/Views/CommentTestBase.php new file mode 100644 index 000000000..a9444a232 --- /dev/null +++ b/web/core/modules/comment/tests/src/Functional/Views/CommentTestBase.php @@ -0,0 +1,90 @@ +account = $this->drupalCreateUser(['skip comment approval']); + $this->account2 = $this->drupalCreateUser(); + $this->drupalLogin($this->account); + + $this->drupalCreateContentType(['type' => 'page', 'name' => t('Basic page')]); + $this->addDefaultCommentField('node', 'page'); + + $this->nodeUserPosted = $this->drupalCreateNode(); + $this->nodeUserCommented = $this->drupalCreateNode(['uid' => $this->account2->id()]); + + $comment = [ + 'uid' => $this->loggedInUser->id(), + 'entity_id' => $this->nodeUserCommented->id(), + 'entity_type' => 'node', + 'field_name' => 'comment', + 'subject' => 'How much wood would a woodchuck chuck', + 'cid' => '', + 'pid' => '', + 'mail' => 'someone@example.com', + ]; + $this->comment = Comment::create($comment); + $this->comment->save(); + } + +}