Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1841110
ByMonthInDailyTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
ByMonthInDailyTest.php
View Options
<?php
namespace
Sabre\VObject\Recur
;
use
Sabre\VObject\Reader
,
DateTime
;
class
ByMonthInDailyTest
extends
\PHPUnit_Framework_TestCase
{
/**
* This tests the expansion of dates with DAILY frequency in RRULE with BYMONTH restrictions
*/
function
testExpand
()
{
$ics
=
<<<ICS
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Apple Inc.//iCal 4.0.4//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
TRANSP:OPAQUE
DTEND:20070925T183000Z
UID:uuid
DTSTAMP:19700101T000000Z
LOCATION:
DESCRIPTION:
STATUS:CONFIRMED
SEQUENCE:18
SUMMARY:Stuff
DTSTART:20070925T160000Z
CREATED:20071004T144642Z
RRULE:FREQ=DAILY;BYMONTH=9,10;BYDAY=SU
END:VEVENT
END:VCALENDAR
ICS;
$vcal
=
Reader
::
read
(
$ics
);
$this
->
assertInstanceOf
(
'Sabre
\\
VObject
\\
Component
\\
VCalendar'
,
$vcal
);
$vcal
->
expand
(
new
DateTime
(
'2013-09-28'
),
new
DateTime
(
'2014-09-11'
));
foreach
(
$vcal
->
VEVENT
as
$event
)
{
$dates
[]
=
$event
->
DTSTART
->
getValue
();
}
$expectedDates
=
array
(
"20130929T160000Z"
,
"20131006T160000Z"
,
"20131013T160000Z"
,
"20131020T160000Z"
,
"20131027T160000Z"
,
"20140907T160000Z"
);
$this
->
assertEquals
(
$expectedDates
,
$dates
,
'Recursed dates are restricted by month'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jan 7, 2:10 PM (3 d, 9 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
916953
Default Alt Text
ByMonthInDailyTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment