summaryrefslogtreecommitdiff
path: root/tests/units/DatetimeHelperTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-09-05 23:30:56 -0400
committerFrederic Guillot <fred@kanboard.net>2015-09-05 23:30:56 -0400
commit710f2c7bb046b43ec9878ae795a181101f6d7515 (patch)
treeb62723b6b49c3b6bf2b3ca41a772f552464a9031 /tests/units/DatetimeHelperTest.php
parent94b38dd94bd819168163003beec8ef693f9d9839 (diff)
Improve unit tests
Diffstat (limited to 'tests/units/DatetimeHelperTest.php')
-rw-r--r--tests/units/DatetimeHelperTest.php56
1 files changed, 0 insertions, 56 deletions
diff --git a/tests/units/DatetimeHelperTest.php b/tests/units/DatetimeHelperTest.php
deleted file mode 100644
index 21d452dd..00000000
--- a/tests/units/DatetimeHelperTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-require_once __DIR__.'/Base.php';
-
-use Helper\Dt;
-
-class DatetimeHelperTest extends Base
-{
- public function testAge()
- {
- $h = new Dt($this->container);
-
- $this->assertEquals('&lt;15m', $h->age(0, 30));
- $this->assertEquals('&lt;30m', $h->age(0, 1000));
- $this->assertEquals('&lt;1h', $h->age(0, 3000));
- $this->assertEquals('~2h', $h->age(0, 2*3600));
- $this->assertEquals('1d', $h->age(0, 30*3600));
- $this->assertEquals('2d', $h->age(0, 65*3600));
- }
-
- public function testGetDayHours()
- {
- $h = new Dt($this->container);
-
- $slots = $h->getDayHours();
-
- $this->assertNotEmpty($slots);
- $this->assertCount(48, $slots);
- $this->assertArrayHasKey('00:00', $slots);
- $this->assertArrayHasKey('00:30', $slots);
- $this->assertArrayHasKey('01:00', $slots);
- $this->assertArrayHasKey('01:30', $slots);
- $this->assertArrayHasKey('23:30', $slots);
- $this->assertArrayNotHasKey('24:00', $slots);
- }
-
- public function testGetWeekDays()
- {
- $h = new Dt($this->container);
-
- $slots = $h->getWeekDays();
-
- $this->assertNotEmpty($slots);
- $this->assertCount(7, $slots);
- $this->assertContains('Monday', $slots);
- $this->assertContains('Sunday', $slots);
- }
-
- public function testGetWeekDay()
- {
- $h = new Dt($this->container);
-
- $this->assertEquals('Monday', $h->getWeekDay(1));
- $this->assertEquals('Sunday', $h->getWeekDay(7));
- }
-}