From 00d4f47bf48d331505856c82564c328d42abab1d Mon Sep 17 00:00:00 2001 From: HungDV2022 Date: Tue, 3 Dec 2024 11:38:14 +0900 Subject: [PATCH 1/2] =?UTF-8?q?MailHelper::getMailTemplates=E3=83=A6?= =?UTF-8?q?=E3=83=8B=E3=83=83=E3=83=88=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bc-mail/src/View/Helper/MailHelper.php | 1 + .../TestCase/View/Helper/MailHelperTest.php | 19 ++++++------------- 2 files changed, 7 insertions(+), 13 deletions(-) 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..e173b1a65a 100644 --- a/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php +++ b/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php @@ -15,6 +15,7 @@ use BaserCore\View\BcFrontAppView; use BcMail\Model\Entity\MailContent; use BcMail\View\Helper\MailHelper; +use Cake\Core\Configure; use Cake\ORM\Entity; use Cake\View\View; @@ -126,19 +127,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); } /** From 782e5aa4913c951661ad2f5c67ba3633647efef8 Mon Sep 17 00:00:00 2001 From: HungDV2022 Date: Tue, 3 Dec 2024 11:40:53 +0900 Subject: [PATCH 2/2] =?UTF-8?q?MailHelper::getMailTemplates=E3=83=A6?= =?UTF-8?q?=E3=83=8B=E3=83=83=E3=83=88=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php b/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php index e173b1a65a..fb144e7c27 100644 --- a/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php +++ b/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php @@ -15,7 +15,6 @@ use BaserCore\View\BcFrontAppView; use BcMail\Model\Entity\MailContent; use BcMail\View\Helper\MailHelper; -use Cake\Core\Configure; use Cake\ORM\Entity; use Cake\View\View;