5 require_once
'Sabre/CalDAV/TestUtil.php';
23 $calendars = $this->backend->getCalendarsForUser(
'principals/user1');
24 $this->assertEquals(2, count($calendars));
25 $this->calendar =
new Calendar($this->backend, $calendars[0]);
31 unset($this->calendar);
32 unset($this->backend);
38 $children = $this->calendar->getChildren();
41 $this->assertInternalType(
'string', $children[0]->getName());
42 $this->assertInternalType(
'string', $children[0]->
get());
43 $this->assertInternalType(
'string', $children[0]->getETag());
44 $this->assertEquals(
'text/calendar; charset=utf-8', $children[0]->getContentType());
54 new Backend\
Mock([], []),
67 new Backend\
Mock([], []),
79 $children = $this->calendar->getChildren();
83 $children[0]->put($newData);
84 $this->assertEquals($newData, $children[0]->
get());
93 $children = $this->calendar->getChildren();
101 $this->assertEquals($newData, $children[0]->
get());
111 $children = $this->calendar->getChildren();
117 $children2 = $this->calendar->getChildren();
118 $this->assertEquals(count($children) - 1, count($children2));
127 $children = $this->calendar->getChildren();
132 $lastMod = $obj->getLastModified();
133 $this->assertTrue(is_int($lastMod) || ctype_digit($lastMod) || is_null($lastMod));
142 $children = $this->calendar->getChildren();
147 $size = $obj->getSize();
148 $this->assertInternalType(
'int',
$size);
154 $children = $this->calendar->getChildren();
158 $this->assertEquals(
'principals/user1', $obj->getOwner());
164 $children = $this->calendar->getChildren();
168 $this->assertNull($obj->getGroup());
176 'privilege' =>
'{DAV:}read',
177 'principal' =>
'principals/user1',
181 'privilege' =>
'{DAV:}read',
182 'principal' =>
'principals/user1/calendar-proxy-write',
186 'privilege' =>
'{DAV:}read',
187 'principal' =>
'principals/user1/calendar-proxy-read',
191 'privilege' =>
'{DAV:}write',
192 'principal' =>
'principals/user1',
196 'privilege' =>
'{DAV:}write',
197 'principal' =>
'principals/user1/calendar-proxy-write',
202 $children = $this->calendar->getChildren();
206 $this->assertEquals($expected, $obj->getACL());
213 $calendarObject =
new CalendarObject(
$backend, [
'principaluri' =>
'principals/user1'], [
'calendarid' => 1,
'uri' =>
'foo']);
216 'privilege' =>
'{DAV:}all',
217 'principal' =>
'principals/user1',
221 'privilege' =>
'{DAV:}all',
222 'principal' =>
'principals/user1/calendar-proxy-write',
226 'privilege' =>
'{DAV:}read',
227 'principal' =>
'principals/user1/calendar-proxy-read',
231 $this->assertEquals($expected, $calendarObject->getACL());
241 $children = $this->calendar->getChildren();
251 $children = $this->calendar->getChildren();
256 $expected =
"BEGIN:VCALENDAR 258 PRODID:-//Apple Inc.//iCal 4.0.1//EN 264 RRULE:FREQ=YEARLY;UNTIL=19880507T150000Z;BYMONTH=5;BYDAY=2SU 265 DTSTART:19870510T000000 271 DTSTART:19881009T000000 277 CREATED:20100225T154229Z 278 UID:39A6B5ED-DD51-4AFE-A683-C35EE3749627 280 SUMMARY:Something here 281 DTSTAMP:20100228T130202Z 282 DTSTART;TZID=Asia/Seoul:20100223T060000 283 DTEND;TZID=Asia/Seoul:20100223T070000 284 ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:lisa@example.com 291 $this->assertEquals($expected, $obj->get());
300 'calendardata' =>
'foo',
307 $this->assertEquals(
'foo', $obj->get());
314 'calendardata' =>
'foo',
323 $this->assertEquals(
'bar', $obj->getETag());
330 'calendardata' =>
'foo',
338 $this->assertEquals(
'"' . md5(
'foo') .
'"', $obj->getETag());
345 'calendardata' =>
'foo',
352 $this->assertNull($obj->getSupportedPrivilegeSet());
359 'calendardata' =>
'foo',
366 $this->assertEquals(3, $obj->getSize());
380 $this->assertEquals(4, $obj->getSize());
static getTestCalendarData($type=1)
The CalendarObject represents a single VEVENT or VTODO within a Calendar.
$stream
PHP stream implementation.
testInvalidArg1()
InvalidArgumentException
testGetLastModified()
testSetup
testGetSupportedPrivilegesSet()
testInvalidArg2()
InvalidArgumentException
This object represents a CalDAV calendar.