diff --git a/plugins/bc-mail/src/View/Helper/MailHelper.php b/plugins/bc-mail/src/View/Helper/MailHelper.php index 3e91a8733d..74ab576b24 100755 --- a/plugins/bc-mail/src/View/Helper/MailHelper.php +++ b/plugins/bc-mail/src/View/Helper/MailHelper.php @@ -209,6 +209,7 @@ public function descriptionExists() * @return void * @checked * @noTodo + * @unitTest */ public function link($title, $contentsName, $datas = [], $options = []) { diff --git a/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php b/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php index 49f7ff9eb7..b07804c494 100644 --- a/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php +++ b/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php @@ -158,23 +158,23 @@ public function testGetToken() */ public function testLink($title, $contentsName, $expected) { - $this->markTestIncomplete('このテストは、まだ実装されていません。'); + ContentFactory::make(['plugin' => 'BcMail', 'type' => 'MailContent', 'name' => $contentsName, 'entity_id' => 1])->persist(); $this->expectOutputString($expected); - $this->Mail->link($title, $contentsName, $datas = [], $options = []); + $this->MailHelper->link($title, $contentsName); } public static function linkProvider() { return [ - ['タイトル', 'Members', 'タイトル'], - [' ', 'a', ' '], - [' ', ' ', ' '], - [' ', '///', ' '], - [' ', '////a', ' '], - [' ', '////a//a/aa', ' '], - [' ', '/../../../../a', ' '], - ['', 'javascript:void(0);', ''], - ['', '////a', ''] + ['タイトル', 'Members', 'タイトル'], + [' ', 'a', ' '], + [' ', ' ', ' '], + [' ', '///', ' '], + [' ', '////a', ' '], + [' ', '////a//a/aa', ' '], + [' ', '/../../../../a', ' '], + ['', 'javascript:void(0);', ''], + ['', '////a', '<script>alert(1)</script>'] ]; }