Skip to content

Commit

Permalink
BcTextHelper::dateTime() のユニットテスト (#3382)
Browse files Browse the repository at this point in the history
Co-authored-by: Đỗ Văn Hùng <[email protected]>
  • Loading branch information
HungDV2022 and dovanhung authored Apr 29, 2024
1 parent 3f94927 commit 1bf6823
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 1 addition & 0 deletions plugins/baser-core/src/View/Helper/BcTextHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ public function moneyFormat($value, $prefix = '¥')
* @return string 日付(例)2015/8/11
* @checked
* @noTodo
* @unitTest
*/
public function dateTime($arrDate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ public function testMoneyFormat()
*/
public function testDateTime()
{
$this->markTestIncomplete('このテストは、まだ実装されていません。');
// 適当な時間を設定
$arrDate = [
'year' => 2015,
Expand All @@ -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 = [
Expand All @@ -340,7 +331,6 @@ public function testDateTime()
$result = $this->Helper->dateTime($arrDate);
$expect = '2015/20/11';
$this->assertEquals($expect, $result);

}

/**
Expand Down

0 comments on commit 1bf6823

Please sign in to comment.