Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78668951
PhabricatorLocalTimeTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 22, 07:28
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Aug 24, 07:28 (2 d)
Engine
blob
Format
Raw Data
Handle
20083615
Attached To
rPH Phabricator
PhabricatorLocalTimeTestCase.php
View Options
<?php
final
class
PhabricatorLocalTimeTestCase
extends
PhabricatorTestCase
{
protected
function
getPhabricatorTestCaseConfiguration
()
{
return
array
(
self
::
PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES
=>
true
,
);
}
public
function
testLocalTimeFormatting
()
{
$user
=
$this
->
generateNewTestUser
();
$user
->
overrideTimezoneIdentifier
(
'America/Los_Angeles'
);
$utc
=
$this
->
generateNewTestUser
();
$utc
->
overrideTimezoneIdentifier
(
'UTC'
);
$this
->
assertEqual
(
'Jan 1 2000, 12:00 AM'
,
phabricator_datetime
(
946684800
,
$utc
),
pht
(
'Datetime formatting'
));
$this
->
assertEqual
(
'Jan 1 2000'
,
phabricator_date
(
946684800
,
$utc
),
pht
(
'Date formatting'
));
$this
->
assertEqual
(
'12:00 AM'
,
phabricator_time
(
946684800
,
$utc
),
pht
(
'Time formatting'
));
$this
->
assertEqual
(
'Dec 31 1999, 4:00 PM'
,
phabricator_datetime
(
946684800
,
$user
),
pht
(
'Localization'
));
$this
->
assertEqual
(
''
,
phabricator_datetime
(
0
,
$user
),
pht
(
'Missing epoch should fail gracefully'
));
}
}
Event Timeline
Log In to Comment