diff --git a/plugins/bc-mail/src/View/Helper/MailHelper.php b/plugins/bc-mail/src/View/Helper/MailHelper.php index 3e91a8733d..ddab526f16 100755 --- a/plugins/bc-mail/src/View/Helper/MailHelper.php +++ b/plugins/bc-mail/src/View/Helper/MailHelper.php @@ -127,6 +127,7 @@ public function getFormTemplates($siteId = 1) * @todo 他のヘルパに移動する * @checked * @noTodo + * @unitTest */ public function getMailTemplates($siteId = 1) { diff --git a/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php b/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php index 49f7ff9eb7..fb144e7c27 100644 --- a/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php +++ b/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php @@ -126,19 +126,11 @@ public function testGetFormTemplates() */ public function testGetMailTemplates() { - $this->markTestIncomplete('このテストは、まだ実装されていません。'); - $View = new View(null); - $View->set('siteConfig', Configure::read('BcSite')); - $this->Mail->BcBaser = new BcBaserHelper($View); - $result = $this->Mail->getMailTemplates(); - $expected = [ - 'mail_default' => 'mail_default', - 'default' => 'default', - 'reset_password' => 'reset_password', - 'send_activate_url' => 'send_activate_url', - 'send_activate_urls' => 'send_activate_urls', - ]; - $this->assertEquals($result, $expected, 'メールテンプレートの取得結果が違います。'); + SiteFactory::make(['id' => '1'])->persist(); + $view = new BcFrontAppView($this->getRequest('/')); + $this->MailHelper = new MailHelper($view); + $result = $this->MailHelper->getMailTemplates(1); + $this->assertEquals(['mail_default' => 'mail_default'], $result); } /**