Skip to content

Commit

Permalink
BlogCommentMailer::sendCommentToUser() のユニットテスト
Browse files Browse the repository at this point in the history
  • Loading branch information
dovanhung committed Nov 18, 2024
1 parent 174c718 commit cf79158
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/bc-blog/src/Mailer/BlogCommentMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function sendCommentToAdmin(string $senderName, array $data)
* @param array $data
* @checked
* @noTodo
* @unitTest
*/
public function sendCommentToUser(string $senderName, string $userMail, array $data)
{
Expand Down
10 changes: 10 additions & 0 deletions plugins/bc-blog/tests/TestCase/Mailer/BlogCommentMailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,14 @@ public function testSendCommentToAdmin()
$this->assertEquals('BcBlog.blog_comment_admin', $this->BlogCommentMailer->viewBuilder()->getTemplate());
$this->assertEquals(['test' => 'test'], $this->BlogCommentMailer->viewBuilder()->getVars());
}

/**
* test sendCommentToUser
*/
public function testSendCommentToUser()
{
$this->BlogCommentMailer->sendCommentToUser('admin baser','[email protected]', ['test' => 'test']);
$this->assertEquals('BcBlog.blog_comment_contributor', $this->BlogCommentMailer->viewBuilder()->getTemplate());
$this->assertEquals(['test' => 'test'], $this->BlogCommentMailer->viewBuilder()->getVars());
}
}

0 comments on commit cf79158

Please sign in to comment.