Skip to content

Commit f7d8943

Browse files
committed
add test for date being just zeros
1 parent 470d4a2 commit f7d8943

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/Api/ApiElementTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,13 @@ public function testDateTimeElements()
185185
$actual = $dateElement->cast('20191030');
186186
static::assertSame('2019-10-30', $actual->format('Y-m-d'));
187187

188+
$dateElement = new Element(Element::TYPE_DATE, 'Cf8FwZZe');
189+
$actual = $dateElement->cast('00000000');
190+
static::assertNull($actual);
191+
188192
$timeElement = new Element(Element::TYPE_TIME, 'Ma0NRVdj');
189193
$actual = $timeElement->cast('102030');
190-
static::assertSame('10:20:30', $actual->format('H:i:s'));
194+
static::assertSame('10:20:30', $actual->format('%H:%I:%S'));
191195

192196
$timestampElement = new Element(Element::TYPE_TIMESTAMP, '2SNTkpDJ');
193197
$actual = $timestampElement->cast('20191030102030');

0 commit comments

Comments
 (0)