diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-01-25 18:55:11 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-01-25 18:55:11 -0500 |
commit | 28a7f57d86c2c2fbef92da37eacb19980a133ed2 (patch) | |
tree | fd9c19da9d81535b35d4118e741acc931d82f40f /tests/units/DateParserTest.php | |
parent | 1fc6d69e2e25d6e4feaa38fe03dab98c75cfb36c (diff) |
Store due date without the time
Diffstat (limited to 'tests/units/DateParserTest.php')
-rw-r--r-- | tests/units/DateParserTest.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/units/DateParserTest.php b/tests/units/DateParserTest.php index e98fa6a5..5828fc48 100644 --- a/tests/units/DateParserTest.php +++ b/tests/units/DateParserTest.php @@ -29,4 +29,22 @@ class DateParserTest extends Base $this->assertEquals('2014-03-05', date('Y-m-d', $d->getTimestamp('2014_03_05'))); $this->assertEquals('2014-03-05', date('Y-m-d', $d->getTimestamp('03/05/2014'))); } + + public function testConvert() + { + $d = new DateParser($this->container); + + $values = array( + 'date_due' => '2015-01-25', + 'date_started' => '2015_01_25', + ); + + $d->convert($values, array('date_due', 'date_started')); + + $this->assertEquals(mktime(0, 0, 0, 1, 25, 2015), $values['date_due']); + $this->assertEquals('2015-01-25', date('Y-m-d', $values['date_due'])); + + $this->assertEquals(mktime(0, 0, 0, 1, 25, 2015), $values['date_started']); + $this->assertEquals('2015-01-25', date('Y-m-d', $values['date_started'])); + } } |