Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions tests/unit/suites/libraries/joomla/date/JDateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,44 @@ public function test__construct($date, $tz, $expectedTime)
);
}

/**
* Testing the Constructor for now when not using UTC
*
* @return void
*
* @since __DEPLOY_VERSION__
* @covers JDate::__construct
*/
public function test__constructForNowWhenNotUsingUTC()
{
$jdate = new JDate('now', new DateTimeZone('US/Central'));
$phpdate = new DateTime('now', new DateTimeZone('US/Central'));

$this->assertSame(
$jdate->format('D m/d/Y H:i'),
$phpdate->format('D m/d/Y H:i')
);
}

/**
* Testing the Constructor for now when using UTC
*
* @return void
*
* @since __DEPLOY_VERSION__
* @covers JDate::__construct
*/
public function test__constructForNowWhenUsingUTC()
{
$jdate = new JDate('now', new DateTimeZone('UTC'));
$phpdate = new DateTime('now', new DateTimeZone('UTC'));

$this->assertSame(
$jdate->format('D m/d/Y H:i'),
$phpdate->format('D m/d/Y H:i')
);
}

/**
* Testing the Constructor
*
Expand Down