From 1bf6823ffb96eb4fdde457f8f39f25e2987296bc Mon Sep 17 00:00:00 2001 From: HungDV2022 <110375578+HungDV2022@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:22:15 +0900 Subject: [PATCH] =?UTF-8?q?BcTextHelper::dateTime()=20=E3=81=AE=E3=83=A6?= =?UTF-8?q?=E3=83=8B=E3=83=83=E3=83=88=E3=83=86=E3=82=B9=E3=83=88=20(#3382?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Đỗ Văn Hùng --- plugins/baser-core/src/View/Helper/BcTextHelper.php | 1 + .../tests/TestCase/View/Helper/BcTextHelperTest.php | 12 +----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/plugins/baser-core/src/View/Helper/BcTextHelper.php b/plugins/baser-core/src/View/Helper/BcTextHelper.php index bb52c20183..20708a21ef 100644 --- a/plugins/baser-core/src/View/Helper/BcTextHelper.php +++ b/plugins/baser-core/src/View/Helper/BcTextHelper.php @@ -310,6 +310,7 @@ public function moneyFormat($value, $prefix = '¥') * @return string 日付(例)2015/8/11 * @checked * @noTodo + * @unitTest */ public function dateTime($arrDate) { diff --git a/plugins/baser-core/tests/TestCase/View/Helper/BcTextHelperTest.php b/plugins/baser-core/tests/TestCase/View/Helper/BcTextHelperTest.php index e1cce28f1d..87e9b117cb 100644 --- a/plugins/baser-core/tests/TestCase/View/Helper/BcTextHelperTest.php +++ b/plugins/baser-core/tests/TestCase/View/Helper/BcTextHelperTest.php @@ -308,7 +308,6 @@ public function testMoneyFormat() */ public function testDateTime() { - $this->markTestIncomplete('このテストは、まだ実装されていません。'); // 適当な時間を設定 $arrDate = [ 'year' => 2015, @@ -321,15 +320,7 @@ public function testDateTime() // 異常系 文字列を入力 $result = $this->Helper->dateTime('baser'); - - // PHPのバージョンによって結果が違うので分岐する - if (empty($result)) { - $this->assertNull($result); - } else { - $expect = 'b/b/b'; - $this->assertEquals($expect, $result); - } - + $this->assertEmpty($result); // 不正な日付(現在はそのまま出力してしまう仕様となっている) $arrDate = [ @@ -340,7 +331,6 @@ public function testDateTime() $result = $this->Helper->dateTime($arrDate); $expect = '2015/20/11'; $this->assertEquals($expect, $result); - } /**