Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894684
PhabricatorLocalTimeTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
893 B
Referenced Files
None
Subscribers
None
PhabricatorLocalTimeTestCase.php
View Options
<?php
final
class
PhabricatorLocalTimeTestCase
extends
PhabricatorTestCase
{
public
function
testLocalTimeFormatting
(
)
{
$user
=
new
PhabricatorUser
(
)
;
$user
->
setTimezoneIdentifier
(
'America/Los_Angeles'
)
;
$utc
=
new
PhabricatorUser
(
)
;
$utc
->
setTimezoneIdentifier
(
'UTC'
)
;
$this
->
assertEqual
(
'Jan 1 2000, 12:00 AM'
,
phabricator_datetime
(
946684800
,
$utc
)
,
'Datetime formatting'
)
;
$this
->
assertEqual
(
'Jan 1 2000'
,
phabricator_date
(
946684800
,
$utc
)
,
'Date formatting'
)
;
$this
->
assertEqual
(
'12:00 AM'
,
phabricator_time
(
946684800
,
$utc
)
,
'Time formatting'
)
;
$this
->
assertEqual
(
'Dec 31 1999, 4:00 PM'
,
phabricator_datetime
(
946684800
,
$user
)
,
'Localization'
)
;
$this
->
assertEqual
(
''
,
phabricator_datetime
(
0
,
$user
)
,
'Missing epoch should fail gracefully'
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 20:16 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128366
Default Alt Text
PhabricatorLocalTimeTestCase.php (893 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment