From e652709d6b04f6f310f1f7e2d47d6ec1b2abde0c Mon Sep 17 00:00:00 2001 From: thangnn Date: Tue, 10 Dec 2024 15:32:24 +0700 Subject: [PATCH] modified --- .../TestCase/View/Helper/MailHelperTest.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php b/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php index f97651d2f6..0779e58e28 100644 --- a/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php +++ b/plugins/bc-mail/tests/TestCase/View/Helper/MailHelperTest.php @@ -149,9 +149,9 @@ public function testGetToken() * メールフォームへのリンクを取得 * @dataProvider linkProvider */ - public function testLink($title, $contentsName, $expected) + public function testLink($title, $contentsName, $url, $expected) { - ContentFactory::make(['plugin' => 'BcMail', 'type' => 'MailContent', 'name' => $contentsName, 'entity_id' => 1])->persist(); + ContentFactory::make(['plugin' => 'BcMail', 'type' => 'MailContent', 'name' => $contentsName, 'url' => $url, 'entity_id' => 1])->persist(); $this->expectOutputString($expected); $this->MailHelper->link($title, $contentsName); } @@ -159,15 +159,10 @@ public function testLink($title, $contentsName, $expected) public static function linkProvider() { return [ - ['タイトル', 'Members', 'タイトル'], - [' ', 'a', ' '], - [' ', ' ', ' '], - [' ', '///', ' '], - [' ', '////a', ' '], - [' ', '////a//a/aa', ' '], - [' ', '/../../../../a', ' '], - ['', 'javascript:void(0);', ''], - ['', '////a', '<script>alert(1)</script>'] + ['タイトル', '/Members/', '/a/', 'タイトル'], + [' ', 'a', '/a/', ' '], + [' ', ' ', '', ' '], + [' ', '///', '///', ' '], ]; }