mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
additional date mask checks.
This commit is contained in:
@@ -80,7 +80,27 @@
|
|||||||
$this->assertEquals($expected, $actual);
|
$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()
|
public function testSupported()
|
||||||
|
Reference in New Issue
Block a user