diff --git a/plugins/bc-mail/src/View/Helper/MailHelper.php b/plugins/bc-mail/src/View/Helper/MailHelper.php index 1236b3a709..3e91a8733d 100755 --- a/plugins/bc-mail/src/View/Helper/MailHelper.php +++ b/plugins/bc-mail/src/View/Helper/MailHelper.php @@ -96,6 +96,7 @@ public function setMailContent($mailContentId = null) * @todo 他のヘルパーに移動する * @checked * @noTodo + * @unitTest */ public function getFormTemplates($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 1a83d9c728..49f7ff9eb7 100644 --- a/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php +++ b/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php @@ -10,7 +10,9 @@ */ namespace BcMail\Test\TestCase\View\Helper; use BaserCore\Test\Factory\ContentFactory; +use BaserCore\Test\Factory\SiteFactory; use BaserCore\TestSuite\BcTestCase; +use BaserCore\View\BcFrontAppView; use BcMail\Model\Entity\MailContent; use BcMail\View\Helper\MailHelper; use Cake\ORM\Entity; @@ -112,16 +114,11 @@ public function testGetForm() */ public function testGetFormTemplates() { - $this->markTestIncomplete('このテストは、まだ実装されていません。'); - $View = new View(null); - $View->set('siteConfig', Configure::read('BcSite')); - $this->Mail->BcBaser = new BcBaserHelper($View); - $result = $this->Mail->getFormTemplates(); - $expected = [ - 'default' => 'default', - 'smartphone' => 'smartphone' - ]; - $this->assertEquals($result, $expected, 'フォームテンプレートの取得結果が違います。'); + SiteFactory::make(['id' => '1'])->persist(); + $view = new BcFrontAppView($this->getRequest('/')); + $this->MailHelper = new MailHelper($view); + $result = $this->MailHelper->getFormTemplates(1); + $this->assertEquals(['default' => 'default'], $result); } /**