From 310a0ded392cc975055050b2d68438334aa09f8d Mon Sep 17 00:00:00 2001 From: thangnnmd <150879641+thangnnmd@users.noreply.github.com> Date: Mon, 4 Mar 2024 07:53:25 +0700 Subject: [PATCH] BlogHelper::removeCtrlChars (#3184) Co-authored-by: thangnn Co-authored-by: ryuring --- plugins/bc-blog/src/View/Helper/BlogHelper.php | 2 ++ .../bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/bc-blog/src/View/Helper/BlogHelper.php b/plugins/bc-blog/src/View/Helper/BlogHelper.php index f16352a58f..775c1cb8c3 100755 --- a/plugins/bc-blog/src/View/Helper/BlogHelper.php +++ b/plugins/bc-blog/src/View/Helper/BlogHelper.php @@ -1315,8 +1315,10 @@ public function mailFormLink($title, $contentsName, $datas = [], $options = []) /** * 文字列から制御文字を取り除く + * @return string * @checked * @noTodo + * @unitTest */ public function removeCtrlChars($string) { diff --git a/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php b/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php index 8775c5bf4f..21ec54dc42 100755 --- a/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php +++ b/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php @@ -1007,8 +1007,10 @@ public function testMailFormLink() */ public function testRemoveCtrlChars() { - $this->markTestIncomplete('こちらのテストはまだ未確認です'); - $this->markTestIncomplete('このテストは、まだ実装されていません。'); + $string = "\ebaserCMS \t\tHello \v\vWorld\0\f"; + $result = $this->Blog->removeCtrlChars($string); + //戻り値を確認 + $this->assertEquals('baserCMS Hello World', $result); } /**