Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93572187
ConpherenceTimeUtilTestCase.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
Fri, Nov 29, 20:26
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 20:26 (2 d)
Engine
blob
Format
Raw Data
Handle
22666245
Attached To
rPH Phabricator
ConpherenceTimeUtilTestCase.php
View Options
<?php
final
class
ConpherenceTimeUtilTestCase
extends
PhabricatorTestCase
{
public
function
testWidgetTimestampsAtMidnight
()
{
$u
=
new
PhabricatorUser
();
$u
->
setTimezoneIdentifier
(
'America/Los_Angeles'
);
$days
=
$this
->
getAllDays
();
foreach
(
$days
as
$day
)
{
$data
=
ConpherenceTimeUtil
::
getCalendarWidgetTimestamps
(
$u
,
$day
);
$this
->
assertEqual
(
'000000'
,
$data
[
'epoch_stamps'
][
0
]->
format
(
'His'
));
}
}
public
function
testWidgetTimestampsStartDay
()
{
$u
=
new
PhabricatorUser
();
$u
->
setTimezoneIdentifier
(
'America/Los_Angeles'
);
$days
=
$this
->
getAllDays
();
foreach
(
$days
as
$day
)
{
$data
=
ConpherenceTimeUtil
::
getCalendarWidgetTimestamps
(
$u
,
$day
);
$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
=
ConpherenceTimeUtil
::
getCalendarWidgetTimestamps
(
$u
,
$day
);
$this
->
assertEqual
(
$day
,
$data
[
'epoch_stamps'
][
0
]->
format
(
'l'
));
}
unset
(
$time
);
}
private
function
getAllDays
()
{
return
array
(
'Sunday'
,
'Monday'
,
'Tuesday'
,
'Wednesday'
,
'Thursday'
,
'Friday'
,
'Saturday'
);
}
}
Event Timeline
Log In to Comment