/** * @covers Desk\Filter\Date::objectToString * @dataProvider dataObjectToString * * @param DateTime $date Input date object * @param string $expected Expected string to result */ public function testObjectToString($date, $expected) { $originalOffset = $date->getOffset(); $actual = Date::objectToString($date); $this->assertSame($expected, $actual); // make sure timezone of the DateTime object is unchanged $this->assertSame($originalOffset, $date->getOffset()); }
/** * @dataProvider dataToTimestamp * @param $date * @param $expected */ public function testToTimestamp($date, $expected) { $actual = Date::toTimestamp($date); $this->assertSame($expected, $actual); }