Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F555118
CalendarTimeUtilTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
CalendarTimeUtilTestCase.php
View Options
<?php
final
class
CalendarTimeUtilTestCase
extends
PhabricatorTestCase
{
public
function
testTimestampsAtMidnight
()
{
$u
=
new
PhabricatorUser
();
$u
->
overrideTimezoneIdentifier
(
'America/Los_Angeles'
);
$days
=
$this
->
getAllDays
();
foreach
(
$days
as
$day
)
{
$data
=
CalendarTimeUtil
::
getTimestamps
(
$u
,
$day
,
1
);
$this
->
assertEqual
(
'000000'
,
$data
[
'epoch_stamps'
][
0
]->
format
(
'His'
));
}
}
public
function
testTimestampsStartDay
()
{
$u
=
new
PhabricatorUser
();
$u
->
overrideTimezoneIdentifier
(
'America/Los_Angeles'
);
$days
=
$this
->
getAllDays
();
foreach
(
$days
as
$day
)
{
$data
=
CalendarTimeUtil
::
getTimestamps
(
$u
,
$day
,
1
);
$this
->
assertEqual
(
$day
,
$data
[
'epoch_stamps'
][
0
]->
format
(
'l'
));
}
$t
=
1370202281
;
// 2013-06-02 12:44:41 -0700 -- a Sunday
$time
=
PhabricatorTime
::
pushTime
(
$t
,
'America/Los_Angeles'
);
foreach
(
$days
as
$day
)
{
$data
=
CalendarTimeUtil
::
getTimestamps
(
$u
,
$day
,
1
);
$this
->
assertEqual
(
$day
,
$data
[
'epoch_stamps'
][
0
]->
format
(
'l'
));
}
unset
(
$time
);
}
private
function
getAllDays
()
{
return
array
(
'Sunday'
,
'Monday'
,
'Tuesday'
,
'Wednesday'
,
'Thursday'
,
'Friday'
,
'Saturday'
,
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 6:24 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
124769
Default Alt Text
CalendarTimeUtilTestCase.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment