Skip to content

Commit

Permalink
朝時間範囲の検証テストを追加した [FAIL]
Browse files Browse the repository at this point in the history
  • Loading branch information
hidenorigoto committed Jul 23, 2018
1 parent 299b13f commit 2c89594
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/MorningTimeRangeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
namespace Hg\Greeter;

use PHPUnit\Framework\TestCase;

class MorningTimeRangeTest extends TestCase
{
/**
* @var MorningTimeRange
*/
private $SUT;

/**
* @test
* @dataProvider 時間帯テストデータ
*/
public function 時間帯に含むかどうか($target, $expected)
{
$this->assertThat(
$this->SUT->contains(new \DateTimeImmutable($target)),
$this->equalTo($expected)
);
}

public function 時間帯テストデータ()
{
return [
['04:00:00', false],
['05:00:00', true],
['10:00:00', true],
['12:00:00', false],
['20:00:00', false],
];
}

protected function setUp()
{
$this->SUT = new MorningTimeRange();
}
}

0 comments on commit 2c89594

Please sign in to comment.