1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-07 06:03:25 +02:00

additional date mask checks.

This commit is contained in:
Cameron 2018-05-24 11:50:13 -07:00
parent 6fe881a94f
commit f81fd805a9

@ -80,7 +80,27 @@
$this->assertEquals($expected, $actual);
// $this->fail('end');
$unix = strtotime('December 21, 2012 3:45pm');
$strftime = "%A, %d %b, %Y %I:%M %p"; // expected Friday, 21 Dec, 2012 03:45 PM
$expected = "Friday, 21 Dec, 2012 03:45 PM";
// test strtotime mask (default)
$actual = $this->dateObj->convert_date($unix, $strftime);
$this->assertEquals($expected, $actual);
// test DateTimePicker mask
$datepicker = $this->dateObj->toMask($strftime);
$actual2 = $this->dateObj->convert_date($unix, $datepicker);
$this->assertEquals($expected, $actual2);
// test DateTime mask
$dateTime= $this->dateObj->toMask($strftime, 'DateTime');
$d = new DateTime('@'.$unix);
$actual3 = $d->format($dateTime);
$this->assertEquals($expected, $actual3);
}
public function testSupported()