diff --git a/plugins/bc-blog/src/Mailer/BlogCommentMailer.php b/plugins/bc-blog/src/Mailer/BlogCommentMailer.php index 2776ed186c..d03bb0d333 100755 --- a/plugins/bc-blog/src/Mailer/BlogCommentMailer.php +++ b/plugins/bc-blog/src/Mailer/BlogCommentMailer.php @@ -29,6 +29,7 @@ class BlogCommentMailer extends BcMailer * @param array $data * @checked * @noTodo + * @UnitTest */ public function sendCommentToAdmin(string $senderName, array $data) { diff --git a/plugins/bc-blog/tests/TestCase/Mailer/BlogCommentMailerTest.php b/plugins/bc-blog/tests/TestCase/Mailer/BlogCommentMailerTest.php new file mode 100644 index 0000000000..49a64fa2ae --- /dev/null +++ b/plugins/bc-blog/tests/TestCase/Mailer/BlogCommentMailerTest.php @@ -0,0 +1,32 @@ + 'email', 'value' => 'basertest@example.com'])->persist(); + $this->BlogCommentMailer = new BlogCommentMailer(); + } + + public function tearDown(): void + { + parent::tearDown(); + } + + /** + * test sendCommentToAdmin + */ + public function testSendCommentToAdmin() + { + $this->BlogCommentMailer->sendCommentToAdmin('test', ['test' => 'test']); + $this->assertEquals('BcBlog.blog_comment_admin', $this->BlogCommentMailer->viewBuilder()->getTemplate()); + $this->assertEquals(['test' => 'test'], $this->BlogCommentMailer->viewBuilder()->getVars()); + } +}