mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
first few tests testToTime() still fails. Needs investigation
This commit is contained in:
@@ -90,17 +90,36 @@
|
|||||||
|
|
||||||
public function testIsValidTimezone()
|
public function testIsValidTimezone()
|
||||||
{
|
{
|
||||||
|
// should exists
|
||||||
|
$result = $this->dateObj->isValidTimezone('Europe/Berlin');
|
||||||
|
$this->assertTrue($result);
|
||||||
|
|
||||||
|
// should not exist
|
||||||
|
$result = $this->dateObj->isValidTimezone('Europe/Bonn');
|
||||||
|
$this->assertFalse($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testBuildDateLocale()
|
public function testBuildDateLocale()
|
||||||
{
|
{
|
||||||
|
$actual = $this->dateObj->buildDateLocale();
|
||||||
|
|
||||||
|
$this->assertContains('$.fn.datetimepicker.dates["en"]', $actual);
|
||||||
|
$this->assertContains('days: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],', $actual);
|
||||||
|
$this->assertContains('monthsShort: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],', $actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testToTime()
|
public function testToTime()
|
||||||
{
|
{
|
||||||
|
// This tests fail on my machine.
|
||||||
|
// strptime substracts a month which results in the wrong time // BUG?
|
||||||
|
|
||||||
|
$actual = $this->dateObj->toTime('2018/05/13', '%Y/%m/%d');
|
||||||
|
$expected = mktime(0, 0,0,5, 13, 2018);
|
||||||
|
$this->assertEquals($expected, $actual);
|
||||||
|
|
||||||
|
$actual = $this->dateObj->toTime('2018/05/13 20:10', '%Y/%m/%d %H:%M');
|
||||||
|
$expected = mktime(20, 10,0,5, 13, 2018);
|
||||||
|
$this->assertEquals($expected, $actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDecodeDateTime()
|
public function testDecodeDateTime()
|
||||||
|
Reference in New Issue
Block a user