ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
AbstractPDOTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\CalDAV\Backend;
4 
5 use Sabre\CalDAV;
6 use Sabre\DAV;
9 
11 
13 
14  protected $pdo;
15 
16  function setUp() {
17 
18  $this->dropTables([
19  'calendarobjects',
20  'calendars',
21  'calendarinstances',
22  'calendarchanges',
23  'calendarsubscriptions',
24  'schedulingobjects',
25  ]);
26  $this->createSchema('calendars');
27 
28  $this->pdo = $this->getDb();
29 
30  }
31 
32  function testConstruct() {
33 
34  $backend = new PDO($this->pdo);
35  $this->assertTrue($backend instanceof PDO);
36 
37  }
38 
43 
44  $backend = new PDO($this->pdo);
45  $calendars = $backend->getCalendarsForUser('principals/user2');
46  $this->assertEquals([], $calendars);
47 
48  }
49 
54 
55  $backend = new PDO($this->pdo);
56  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', [
57  '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set' => new CalDAV\Xml\Property\SupportedCalendarComponentSet(['VEVENT']),
58  '{DAV:}displayname' => 'Hello!',
59  '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp' => new CalDAV\Xml\Property\ScheduleCalendarTransp('transparent'),
60  ]);
61  $calendars = $backend->getCalendarsForUser('principals/user2');
62 
63  $elementCheck = [
64  'uri' => 'somerandomid',
65  '{DAV:}displayname' => 'Hello!',
66  '{urn:ietf:params:xml:ns:caldav}calendar-description' => '',
67  '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp' => new CalDAV\Xml\Property\ScheduleCalendarTransp('transparent'),
69  ];
70 
71  $this->assertInternalType('array', $calendars);
72  $this->assertEquals(1, count($calendars));
73 
74  foreach ($elementCheck as $name => $value) {
75 
76  $this->assertArrayHasKey($name, $calendars[0]);
77  $this->assertEquals($value, $calendars[0][$name]);
78 
79  }
80 
81  }
82 
87 
88  $backend = new PDO($this->pdo);
89 
90  //Creating a new calendar
91  $newId = $backend->createCalendar('principals/user2', 'somerandomid', []);
92 
93  $propPatch = new PropPatch([
94  '{DAV:}displayname' => 'myCalendar',
95  '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp' => new CalDAV\Xml\Property\ScheduleCalendarTransp('transparent'),
96  ]);
97 
98  // Updating the calendar
99  $backend->updateCalendar($newId, $propPatch);
100  $result = $propPatch->commit();
101 
102  // Verifying the result of the update
103  $this->assertTrue($result);
104 
105  // Fetching all calendars from this user
106  $calendars = $backend->getCalendarsForUser('principals/user2');
107 
108  // Checking if all the information is still correct
109  $elementCheck = [
110  'id' => $newId,
111  'uri' => 'somerandomid',
112  '{DAV:}displayname' => 'myCalendar',
113  '{urn:ietf:params:xml:ns:caldav}calendar-description' => '',
114  '{urn:ietf:params:xml:ns:caldav}calendar-timezone' => '',
115  '{http://calendarserver.org/ns/}getctag' => 'http://sabre.io/ns/sync/2',
116  '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp' => new CalDAV\Xml\Property\ScheduleCalendarTransp('transparent'),
117  ];
118 
119  $this->assertInternalType('array', $calendars);
120  $this->assertEquals(1, count($calendars));
121 
122  foreach ($elementCheck as $name => $value) {
123 
124  $this->assertArrayHasKey($name, $calendars[0]);
125  $this->assertEquals($value, $calendars[0][$name]);
126 
127  }
128 
129  }
130 
136 
137  $backend = new PDO($this->pdo);
138 
139  //Creating a new calendar
140  $newId = $backend->createCalendar('principals/user2', 'somerandomid', []);
141 
142  $propPatch = new PropPatch([
143  '{DAV:}displayname' => 'myCalendar',
144  '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp' => new CalDAV\Xml\Property\ScheduleCalendarTransp('transparent'),
145  ]);
146 
147  // Updating the calendar
148  $backend->updateCalendar('raaaa', $propPatch);
149 
150  }
151 
156 
157  $backend = new PDO($this->pdo);
158 
159  //Creating a new calendar
160  $newId = $backend->createCalendar('principals/user2', 'somerandomid', []);
161 
162  $propPatch = new PropPatch([
163  '{DAV:}displayname' => 'myCalendar',
164  '{DAV:}yourmom' => 'wittycomment',
165  ]);
166 
167  // Updating the calendar
168  $backend->updateCalendar($newId, $propPatch);
169  $propPatch->commit();
170 
171  // Verifying the result of the update
172  $this->assertEquals([
173  '{DAV:}yourmom' => 403,
174  '{DAV:}displayname' => 424,
175  ], $propPatch->getResult());
176 
177  }
178 
182  function testDeleteCalendar() {
183 
184  $backend = new PDO($this->pdo);
185  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', [
186  '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set' => new CalDAV\Xml\Property\SupportedCalendarComponentSet(['VEVENT']),
187  '{DAV:}displayname' => 'Hello!',
188  ]);
189 
190  $backend->deleteCalendar($returnedId);
191 
192  $calendars = $backend->getCalendarsForUser('principals/user2');
193  $this->assertEquals([], $calendars);
194 
195  }
196 
202 
203  $backend = new PDO($this->pdo);
204  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', [
205  '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set' => new CalDAV\Xml\Property\SupportedCalendarComponentSet(['VEVENT']),
206  '{DAV:}displayname' => 'Hello!',
207  ]);
208 
209  $backend->deleteCalendar('bad-id');
210 
211  }
212 
218 
219  $backend = new PDO($this->pdo);
220 
221  //Creating a new calendar
222  $newId = $backend->createCalendar('principals/user2', 'somerandomid', [
223  '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set' => 'blabla',
224  ]);
225 
226  }
227 
229 
230  $backend = new PDO($this->pdo);
231  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
232 
233  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
234 
235  $backend->createCalendarObject($returnedId, 'random-id', $object);
236 
237  $result = $this->pdo->query('SELECT etag, size, calendardata, firstoccurence, lastoccurence, componenttype FROM calendarobjects WHERE uri = \'random-id\'');
238 
239  $row = $result->fetch(\PDO::FETCH_ASSOC);
240  if (is_resource($row['calendardata'])) {
241  $row['calendardata'] = stream_get_contents($row['calendardata']);
242  }
243 
244  $this->assertEquals([
245  'etag' => md5($object),
246  'size' => strlen($object),
247  'calendardata' => $object,
248  'firstoccurence' => strtotime('20120101'),
249  'lastoccurence' => strtotime('20120101') + (3600 * 24),
250  'componenttype' => 'VEVENT',
251  ], $row);
252 
253  }
255 
256  $backend = new PDO($this->pdo);
257  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
258 
259  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
260 
261  $backend->createCalendarObject($returnedId, 'id-1', $object);
262  $backend->createCalendarObject($returnedId, 'id-2', $object);
263 
264  $check = [
265  [
266  'id' => 1,
267  'etag' => '"' . md5($object) . '"',
268  'uri' => 'id-1',
269  'size' => strlen($object),
270  'calendardata' => $object,
271  'lastmodified' => null,
272  ],
273  [
274  'id' => 2,
275  'etag' => '"' . md5($object) . '"',
276  'uri' => 'id-2',
277  'size' => strlen($object),
278  'calendardata' => $object,
279  'lastmodified' => null,
280  ],
281  ];
282 
283  $result = $backend->getMultipleCalendarObjects($returnedId, ['id-1', 'id-2']);
284 
285  foreach ($check as $index => $props) {
286 
287  foreach ($props as $key => $expected) {
288 
289  $actual = $result[$index][$key];
290 
291  switch ($key) {
292  case 'lastmodified' :
293  $this->assertInternalType('int', $actual);
294  break;
295  case 'calendardata' :
296  if (is_resource($actual)) {
297  $actual = stream_get_contents($actual);
298  }
299  // no break intentional
300  default :
301  $this->assertEquals($expected, $actual);
302 
303  }
304 
305  }
306 
307  }
308 
309  }
310 
316 
317  $backend = new PDO($this->pdo);
318  $backend->getMultipleCalendarObjects('bad-id', ['foo-bar']);
319 
320  }
321 
327 
328  $backend = new PDO($this->pdo);
329  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
330 
331  $object = "BEGIN:VCALENDAR\r\nBEGIN:VTIMEZONE\r\nEND:VTIMEZONE\r\nEND:VCALENDAR\r\n";
332 
333  $backend->createCalendarObject($returnedId, 'random-id', $object);
334 
335  }
336 
341 
342  $backend = new PDO($this->pdo);
343  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
344 
345  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nDURATION:P2D\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
346 
347  $backend->createCalendarObject($returnedId, 'random-id', $object);
348 
349  $result = $this->pdo->query('SELECT etag, size, calendardata, firstoccurence, lastoccurence, componenttype FROM calendarobjects WHERE uri = \'random-id\'');
350 
351  $row = $result->fetch(\PDO::FETCH_ASSOC);
352  if (is_resource($row['calendardata'])) {
353  $row['calendardata'] = stream_get_contents($row['calendardata']);
354  }
355 
356  $this->assertEquals([
357  'etag' => md5($object),
358  'size' => strlen($object),
359  'calendardata' => $object,
360  'firstoccurence' => strtotime('20120101'),
361  'lastoccurence' => strtotime('20120101') + (3600 * 48),
362  'componenttype' => 'VEVENT',
363  ], $row);
364 
365  }
366 
372 
373  $backend = new PDO($this->pdo);
374  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
375 
376  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nDURATION:P2D\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
377 
378  $backend->createCalendarObject('bad-id', 'random-id', $object);
379 
380  }
381 
382 
387 
388  $backend = new PDO($this->pdo);
389  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
390 
391  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE-TIME:20120101T100000Z\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
392 
393  $backend->createCalendarObject($returnedId, 'random-id', $object);
394 
395  $result = $this->pdo->query('SELECT etag, size, calendardata, firstoccurence, lastoccurence, componenttype FROM calendarobjects WHERE uri = \'random-id\'');
396  $row = $result->fetch(\PDO::FETCH_ASSOC);
397  if (is_resource($row['calendardata'])) {
398  $row['calendardata'] = stream_get_contents($row['calendardata']);
399  }
400 
401  $this->assertEquals([
402  'etag' => md5($object),
403  'size' => strlen($object),
404  'calendardata' => $object,
405  'firstoccurence' => strtotime('2012-01-01 10:00:00'),
406  'lastoccurence' => strtotime('2012-01-01 10:00:00'),
407  'componenttype' => 'VEVENT',
408  ], $row);
409 
410  }
411 
416 
417  $backend = new PDO($this->pdo);
418  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
419 
420  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE-TIME:20120101T100000Z\r\nDTEND:20120101T110000Z\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
421 
422  $backend->createCalendarObject($returnedId, 'random-id', $object);
423 
424  $result = $this->pdo->query('SELECT etag, size, calendardata, firstoccurence, lastoccurence, componenttype FROM calendarobjects WHERE uri = \'random-id\'');
425  $row = $result->fetch(\PDO::FETCH_ASSOC);
426  if (is_resource($row['calendardata'])) {
427  $row['calendardata'] = stream_get_contents($row['calendardata']);
428  }
429 
430  $this->assertEquals([
431  'etag' => md5($object),
432  'size' => strlen($object),
433  'calendardata' => $object,
434  'firstoccurence' => strtotime('2012-01-01 10:00:00'),
435  'lastoccurence' => strtotime('2012-01-01 11:00:00'),
436  'componenttype' => 'VEVENT',
437  ], $row);
438 
439  }
440 
445 
446  $backend = new PDO($this->pdo);
447  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
448 
449  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE-TIME:20120101T100000Z\r\nRRULE:FREQ=DAILY\r\nUID:foo\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
450 
451  $backend->createCalendarObject($returnedId, 'random-id', $object);
452 
453  $result = $this->pdo->query('SELECT etag, size, calendardata, firstoccurence, lastoccurence, componenttype FROM calendarobjects WHERE uri = \'random-id\'');
454  $row = $result->fetch(\PDO::FETCH_ASSOC);
455  if (is_resource($row['calendardata'])) {
456  $row['calendardata'] = stream_get_contents($row['calendardata']);
457  }
458 
459  $this->assertEquals([
460  'etag' => md5($object),
461  'size' => strlen($object),
462  'calendardata' => $object,
463  'firstoccurence' => strtotime('2012-01-01 10:00:00'),
464  'lastoccurence' => strtotime(PDO::MAX_DATE),
465  'componenttype' => 'VEVENT',
466  ], $row);
467 
468  }
469 
474 
475  $backend = new PDO($this->pdo);
476  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
477 
478  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE-TIME:20120101T100000Z\r\nDTEND;VALUE=DATE-TIME:20120101T110000Z\r\nUID:foo\r\nRRULE:FREQ=DAILY;COUNT=1000\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
479 
480  $backend->createCalendarObject($returnedId, 'random-id', $object);
481 
482  $result = $this->pdo->query('SELECT etag, size, calendardata, firstoccurence, lastoccurence, componenttype FROM calendarobjects WHERE uri = \'random-id\'');
483  $row = $result->fetch(\PDO::FETCH_ASSOC);
484  if (is_resource($row['calendardata'])) {
485  $row['calendardata'] = stream_get_contents($row['calendardata']);
486  }
487 
488  $this->assertEquals([
489  'etag' => md5($object),
490  'size' => strlen($object),
491  'calendardata' => $object,
492  'firstoccurence' => strtotime('2012-01-01 10:00:00'),
493  'lastoccurence' => strtotime('2012-01-01 11:00:00') + (3600 * 24 * 999),
494  'componenttype' => 'VEVENT',
495  ], $row);
496 
497  }
498 
503 
504  $backend = new PDO($this->pdo);
505  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
506 
507  $object = "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nDUE;VALUE=DATE-TIME:20120101T100000Z\r\nEND:VTODO\r\nEND:VCALENDAR\r\n";
508 
509  $backend->createCalendarObject($returnedId, 'random-id', $object);
510 
511  $result = $this->pdo->query('SELECT etag, size, calendardata, firstoccurence, lastoccurence, componenttype FROM calendarobjects WHERE uri = \'random-id\'');
512  $row = $result->fetch(\PDO::FETCH_ASSOC);
513  if (is_resource($row['calendardata'])) {
514  $row['calendardata'] = stream_get_contents($row['calendardata']);
515  }
516 
517  $this->assertEquals([
518  'etag' => md5($object),
519  'size' => strlen($object),
520  'calendardata' => $object,
521  'firstoccurence' => null,
522  'lastoccurence' => null,
523  'componenttype' => 'VTODO',
524  ], $row);
525 
526  }
527 
532 
533  $backend = new PDO($this->pdo);
534  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
535 
536  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
537  $backend->createCalendarObject($returnedId, 'random-id', $object);
538 
539  $data = $backend->getCalendarObjects($returnedId);
540 
541  $this->assertEquals(1, count($data));
542  $data = $data[0];
543 
544  $this->assertEquals('random-id', $data['uri']);
545  $this->assertEquals(strlen($object), $data['size']);
546 
547  }
548 
554 
555  $backend = new PDO($this->pdo);
556  $backend->getCalendarObjects('bad-id');
557 
558  }
559 
565 
566  $backend = new PDO($this->pdo);
567  $backend->getCalendarObject('bad-id', 'foo-bar');
568 
569  }
570 
575 
576  $backend = new PDO($this->pdo);
577  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
578 
579  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nUID:foo\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
580  $backend->createCalendarObject($returnedId, 'random-id', $object);
581 
582  $this->assertNull(
583  $backend->getCalendarObjectByUID('principals/user2', 'bar')
584  );
585  $this->assertEquals(
586  'somerandomid/random-id',
587  $backend->getCalendarObjectByUID('principals/user2', 'foo')
588  );
589 
590  }
591 
596 
597  $backend = new PDO($this->pdo);
598  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
599 
600  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
601  $object2 = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20130101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
602  $backend->createCalendarObject($returnedId, 'random-id', $object);
603  $backend->updateCalendarObject($returnedId, 'random-id', $object2);
604 
605  $data = $backend->getCalendarObject($returnedId, 'random-id');
606 
607  if (is_resource($data['calendardata'])) {
608  $data['calendardata'] = stream_get_contents($data['calendardata']);
609  }
610 
611  $this->assertEquals($object2, $data['calendardata']);
612  $this->assertEquals('random-id', $data['uri']);
613 
614 
615  }
616 
622 
623  $backend = new PDO($this->pdo);
624  $backend->updateCalendarObject('bad-id', 'object-id', 'objectdata');
625 
626  }
627 
632 
633  $backend = new PDO($this->pdo);
634  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
635 
636  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
637  $backend->createCalendarObject($returnedId, 'random-id', $object);
638  $backend->deleteCalendarObject($returnedId, 'random-id');
639 
640  $data = $backend->getCalendarObject($returnedId, 'random-id');
641  $this->assertNull($data);
642 
643  }
644 
650 
651  $backend = new PDO($this->pdo);
652  $returnedId = $backend->createCalendar('principals/user2', 'somerandomid', []);
653 
654  $object = "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n";
655  $backend->createCalendarObject($returnedId, 'random-id', $object);
656  $backend->deleteCalendarObject('bad-id', 'random-id');
657 
658  }
659 
661 
662  $abstract = new PDO($this->pdo);
663  $filters = [
664  'name' => 'VCALENDAR',
665  'comp-filters' => [
666  [
667  'name' => 'VJOURNAL',
668  'comp-filters' => [],
669  'prop-filters' => [],
670  'is-not-defined' => false,
671  'time-range' => null,
672  ],
673  ],
674  'prop-filters' => [],
675  'is-not-defined' => false,
676  'time-range' => null,
677  ];
678 
679  $this->assertEquals([
680  ], $abstract->calendarQuery([1, 1], $filters));
681 
682  }
683 
689 
690  $abstract = new PDO($this->pdo);
691  $filters = [
692  'name' => 'VCALENDAR',
693  'comp-filters' => [
694  [
695  'name' => 'VJOURNAL',
696  'comp-filters' => [],
697  'prop-filters' => [],
698  'is-not-defined' => false,
699  'time-range' => null,
700  ],
701  ],
702  'prop-filters' => [],
703  'is-not-defined' => false,
704  'time-range' => null,
705  ];
706 
707  $abstract->calendarQuery('bad-id', $filters);
708 
709  }
710 
712 
713  $backend = new PDO($this->pdo);
714  $backend->createCalendarObject([1, 1], "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
715  $backend->createCalendarObject([1, 1], "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
716 
717  $filters = [
718  'name' => 'VCALENDAR',
719  'comp-filters' => [
720  [
721  'name' => 'VTODO',
722  'comp-filters' => [],
723  'prop-filters' => [],
724  'is-not-defined' => false,
725  'time-range' => null,
726  ],
727  ],
728  'prop-filters' => [],
729  'is-not-defined' => false,
730  'time-range' => null,
731  ];
732 
733  $this->assertEquals([
734  "todo",
735  ], $backend->calendarQuery([1, 1], $filters));
736 
737  }
739 
740  $backend = new PDO($this->pdo);
741  $backend->createCalendarObject([1, 1], "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
742  $backend->createCalendarObject([1, 1], "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
743 
744  $filters = [
745  'name' => 'VCALENDAR',
746  'comp-filters' => [
747  [
748  'name' => 'VTODO',
749  'comp-filters' => [],
750  'prop-filters' => [
751  [
752  'name' => 'summary',
753  'text-match' => null,
754  'time-range' => null,
755  'param-filters' => [],
756  'is-not-defined' => false,
757  ],
758  ],
759  'is-not-defined' => false,
760  'time-range' => null,
761  ],
762  ],
763  'prop-filters' => [],
764  'is-not-defined' => false,
765  'time-range' => null,
766  ];
767 
768  $this->assertEquals([
769  ], $backend->calendarQuery([1, 1], $filters));
770 
771  }
772 
774 
775  $backend = new PDO($this->pdo);
776  $backend->createCalendarObject([1, 1], "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
777  $backend->createCalendarObject([1, 1], "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
778 
779  $filters = [
780  'name' => 'VCALENDAR',
781  'comp-filters' => [],
782  'prop-filters' => [],
783  'is-not-defined' => false,
784  'time-range' => null,
785  ];
786 
787  $result = $backend->calendarQuery([1, 1], $filters);
788  $this->assertTrue(in_array('todo', $result));
789  $this->assertTrue(in_array('event', $result));
790 
791  }
792 
794 
795  $backend = new PDO($this->pdo);
796  $backend->createCalendarObject([1, 1], "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
797  $backend->createCalendarObject([1, 1], "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
798  $backend->createCalendarObject([1, 1], "event2", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART;VALUE=DATE:20120103\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
799 
800  $filters = [
801  'name' => 'VCALENDAR',
802  'comp-filters' => [
803  [
804  'name' => 'VEVENT',
805  'comp-filters' => [],
806  'prop-filters' => [],
807  'is-not-defined' => false,
808  'time-range' => [
809  'start' => new \DateTime('20120103'),
810  'end' => new \DateTime('20120104'),
811  ],
812  ],
813  ],
814  'prop-filters' => [],
815  'is-not-defined' => false,
816  'time-range' => null,
817  ];
818 
819  $this->assertEquals([
820  "event2",
821  ], $backend->calendarQuery([1, 1], $filters));
822 
823  }
825 
826  $backend = new PDO($this->pdo);
827  $backend->createCalendarObject([1, 1], "todo", "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n");
828  $backend->createCalendarObject([1, 1], "event", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120101\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
829  $backend->createCalendarObject([1, 1], "event2", "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20120103\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n");
830 
831  $filters = [
832  'name' => 'VCALENDAR',
833  'comp-filters' => [
834  [
835  'name' => 'VEVENT',
836  'comp-filters' => [],
837  'prop-filters' => [],
838  'is-not-defined' => false,
839  'time-range' => [
840  'start' => new \DateTime('20120102'),
841  'end' => null,
842  ],
843  ],
844  ],
845  'prop-filters' => [],
846  'is-not-defined' => false,
847  'time-range' => null,
848  ];
849 
850  $this->assertEquals([
851  "event2",
852  ], $backend->calendarQuery([1, 1], $filters));
853 
854  }
855 
856  function testGetChanges() {
857 
858  $backend = new PDO($this->pdo);
859  $id = $backend->createCalendar(
860  'principals/user1',
861  'bla',
862  []
863  );
864  $result = $backend->getChangesForCalendar($id, null, 1);
865 
866  $this->assertEquals([
867  'syncToken' => 1,
868  'modified' => [],
869  'deleted' => [],
870  'added' => [],
871  ], $result);
872 
873  $currentToken = $result['syncToken'];
874 
875  $dummyTodo = "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n";
876 
877  $backend->createCalendarObject($id, "todo1.ics", $dummyTodo);
878  $backend->createCalendarObject($id, "todo2.ics", $dummyTodo);
879  $backend->createCalendarObject($id, "todo3.ics", $dummyTodo);
880  $backend->updateCalendarObject($id, "todo1.ics", $dummyTodo);
881  $backend->deleteCalendarObject($id, "todo2.ics");
882 
883  $result = $backend->getChangesForCalendar($id, $currentToken, 1);
884 
885  $this->assertEquals([
886  'syncToken' => 6,
887  'modified' => ["todo1.ics"],
888  'deleted' => ["todo2.ics"],
889  'added' => ["todo3.ics"],
890  ], $result);
891 
892  $result = $backend->getChangesForCalendar($id, null, 1);
893 
894  $this->assertEquals([
895  'syncToken' => 6,
896  'modified' => [],
897  'deleted' => [],
898  'added' => ["todo1.ics", "todo3.ics"],
899  ], $result);
900  }
901 
906  function testGetChangesBadId() {
907 
908  $backend = new PDO($this->pdo);
909  $id = $backend->createCalendar(
910  'principals/user1',
911  'bla',
912  []
913  );
914  $backend->getChangesForCalendar('bad-id', null, 1);
915 
916  }
917 
919 
920  $props = [
921  '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal.ics', false),
922  '{DAV:}displayname' => 'cal',
923  '{http://apple.com/ns/ical/}refreshrate' => 'P1W',
924  '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF',
925  '{http://calendarserver.org/ns/}subscribed-strip-todos' => true,
926  //'{http://calendarserver.org/ns/}subscribed-strip-alarms' => true,
927  '{http://calendarserver.org/ns/}subscribed-strip-attachments' => true,
928  ];
929 
930  $backend = new PDO($this->pdo);
931  $backend->createSubscription('principals/user1', 'sub1', $props);
932 
933  $subs = $backend->getSubscriptionsForUser('principals/user1');
934 
935  $expected = $props;
936  $expected['id'] = 1;
937  $expected['uri'] = 'sub1';
938  $expected['principaluri'] = 'principals/user1';
939 
940  unset($expected['{http://calendarserver.org/ns/}source']);
941  $expected['source'] = 'http://example.org/cal.ics';
942 
943  $this->assertEquals(1, count($subs));
944  foreach ($expected as $k => $v) {
945  $this->assertEquals($subs[0][$k], $expected[$k]);
946  }
947 
948  }
949 
954 
955  $props = [
956  ];
957 
958  $backend = new PDO($this->pdo);
959  $backend->createSubscription('principals/user1', 'sub1', $props);
960 
961  }
962 
964 
965  $props = [
966  '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal.ics', false),
967  '{DAV:}displayname' => 'cal',
968  '{http://apple.com/ns/ical/}refreshrate' => 'P1W',
969  '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF',
970  '{http://calendarserver.org/ns/}subscribed-strip-todos' => true,
971  //'{http://calendarserver.org/ns/}subscribed-strip-alarms' => true,
972  '{http://calendarserver.org/ns/}subscribed-strip-attachments' => true,
973  ];
974 
975  $backend = new PDO($this->pdo);
976  $backend->createSubscription('principals/user1', 'sub1', $props);
977 
978  $newProps = [
979  '{DAV:}displayname' => 'new displayname',
980  '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal2.ics', false),
981  ];
982 
983  $propPatch = new DAV\PropPatch($newProps);
984  $backend->updateSubscription(1, $propPatch);
985  $result = $propPatch->commit();
986 
987  $this->assertTrue($result);
988 
989  $subs = $backend->getSubscriptionsForUser('principals/user1');
990 
991  $expected = array_merge($props, $newProps);
992  $expected['id'] = 1;
993  $expected['uri'] = 'sub1';
994  $expected['principaluri'] = 'principals/user1';
995 
996  unset($expected['{http://calendarserver.org/ns/}source']);
997  $expected['source'] = 'http://example.org/cal2.ics';
998 
999  $this->assertEquals(1, count($subs));
1000  foreach ($expected as $k => $v) {
1001  $this->assertEquals($subs[0][$k], $expected[$k]);
1002  }
1003 
1004  }
1005 
1007 
1008  $props = [
1009  '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal.ics', false),
1010  '{DAV:}displayname' => 'cal',
1011  '{http://apple.com/ns/ical/}refreshrate' => 'P1W',
1012  '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF',
1013  '{http://calendarserver.org/ns/}subscribed-strip-todos' => true,
1014  //'{http://calendarserver.org/ns/}subscribed-strip-alarms' => true,
1015  '{http://calendarserver.org/ns/}subscribed-strip-attachments' => true,
1016  ];
1017 
1018  $backend = new PDO($this->pdo);
1019  $backend->createSubscription('principals/user1', 'sub1', $props);
1020 
1021  $propPatch = new DAV\PropPatch([
1022  '{DAV:}displayname' => 'new displayname',
1023  '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal2.ics', false),
1024  '{DAV:}unknown' => 'foo',
1025  ]);
1026 
1027  $backend->updateSubscription(1, $propPatch);
1028  $propPatch->commit();
1029 
1030  $this->assertEquals([
1031  '{DAV:}unknown' => 403,
1032  '{DAV:}displayname' => 424,
1033  '{http://calendarserver.org/ns/}source' => 424,
1034  ], $propPatch->getResult());
1035 
1036  }
1037 
1039 
1040  $props = [
1041  '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal.ics', false),
1042  '{DAV:}displayname' => 'cal',
1043  '{http://apple.com/ns/ical/}refreshrate' => 'P1W',
1044  '{http://apple.com/ns/ical/}calendar-color' => '#FF00FFFF',
1045  '{http://calendarserver.org/ns/}subscribed-strip-todos' => true,
1046  //'{http://calendarserver.org/ns/}subscribed-strip-alarms' => true,
1047  '{http://calendarserver.org/ns/}subscribed-strip-attachments' => true,
1048  ];
1049 
1050  $backend = new PDO($this->pdo);
1051  $backend->createSubscription('principals/user1', 'sub1', $props);
1052 
1053  $newProps = [
1054  '{DAV:}displayname' => 'new displayname',
1055  '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/cal2.ics', false),
1056  ];
1057 
1058  $backend->deleteSubscription(1);
1059 
1060  $subs = $backend->getSubscriptionsForUser('principals/user1');
1061  $this->assertEquals(0, count($subs));
1062  }
1063 
1065 
1066  $backend = new PDO($this->pdo);
1067 
1068  $calData = "BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n";
1069 
1070  $backend->createSchedulingObject(
1071  'principals/user1',
1072  'schedule1.ics',
1073  $calData
1074  );
1075 
1076  $expected = [
1077  'calendardata' => $calData,
1078  'uri' => 'schedule1.ics',
1079  'etag' => '"' . md5($calData) . '"',
1080  'size' => strlen($calData)
1081  ];
1082 
1083  $result = $backend->getSchedulingObject('principals/user1', 'schedule1.ics');
1084  foreach ($expected as $k => $v) {
1085  $this->assertArrayHasKey($k, $result);
1086  if (is_resource($result[$k])) {
1087  $result[$k] = stream_get_contents($result[$k]);
1088  }
1089  $this->assertEquals($v, $result[$k]);
1090  }
1091 
1092  $results = $backend->getSchedulingObjects('principals/user1');
1093 
1094  $this->assertEquals(1, count($results));
1095  $result = $results[0];
1096  foreach ($expected as $k => $v) {
1097  if (is_resource($result[$k])) {
1098  $result[$k] = stream_get_contents($result[$k]);
1099  }
1100  $this->assertEquals($v, $result[$k]);
1101  }
1102 
1103  $backend->deleteSchedulingObject('principals/user1', 'schedule1.ics');
1104  $result = $backend->getSchedulingObject('principals/user1', 'schedule1.ics');
1105 
1106  $this->assertNull($result);
1107 
1108  }
1109 
1110  function testGetInvites() {
1111 
1112  $backend = new PDO($this->pdo);
1113 
1114  // creating a new calendar
1115  $backend->createCalendar('principals/user1', 'somerandomid', []);
1116  $calendar = $backend->getCalendarsForUser('principals/user1')[0];
1117 
1118  $result = $backend->getInvites($calendar['id']);
1119  $expected = [
1120  new Sharee([
1121  'href' => 'principals/user1',
1122  'principal' => 'principals/user1',
1123  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER,
1124  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1125  ])
1126  ];
1127 
1128  $this->assertEquals($expected, $result);
1129 
1130  }
1131 
1136  function testGetInvitesBadId() {
1137 
1138  $backend = new PDO($this->pdo);
1139 
1140  // creating a new calendar
1141  $backend->createCalendar('principals/user1', 'somerandomid', []);
1142  $calendar = $backend->getCalendarsForUser('principals/user1')[0];
1143 
1144  $backend->getInvites('bad-id');
1145 
1146  }
1147 
1151  function testUpdateInvites() {
1152 
1153  $backend = new PDO($this->pdo);
1154 
1155  // creating a new calendar
1156  $backend->createCalendar('principals/user1', 'somerandomid', []);
1157  $calendar = $backend->getCalendarsForUser('principals/user1')[0];
1158 
1159  $ownerSharee = new Sharee([
1160  'href' => 'principals/user1',
1161  'principal' => 'principals/user1',
1162  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER,
1163  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1164  ]);
1165 
1166  // Add a new invite
1167  $backend->updateInvites(
1168  $calendar['id'],
1169  [
1170  new Sharee([
1171  'href' => 'mailto:user@example.org',
1172  'principal' => 'principals/user2',
1173  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ,
1174  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1175  'properties' => ['{DAV:}displayname' => 'User 2'],
1176  ])
1177  ]
1178  );
1179 
1180  $result = $backend->getInvites($calendar['id']);
1181  $expected = [
1182  $ownerSharee,
1183  new Sharee([
1184  'href' => 'mailto:user@example.org',
1185  'principal' => 'principals/user2',
1186  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ,
1187  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1188  'properties' => [
1189  '{DAV:}displayname' => 'User 2',
1190  ],
1191  ])
1192  ];
1193  $this->assertEquals($expected, $result);
1194 
1195  // Checking calendar_instances too
1196  $expectedCalendar = [
1197  'id' => [1,2],
1198  'principaluri' => 'principals/user2',
1199  '{http://calendarserver.org/ns/}getctag' => 'http://sabre.io/ns/sync/1',
1200  '{http://sabredav.org/ns}sync-token' => '1',
1201  'share-access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ,
1202  'read-only' => true,
1203  'share-resource-uri' => '/ns/share/1',
1204  ];
1205  $calendars = $backend->getCalendarsForUser('principals/user2');
1206 
1207  foreach ($expectedCalendar as $k => $v) {
1208  $this->assertEquals(
1209  $v,
1210  $calendars[0][$k],
1211  "Key " . $k . " in calendars array did not have the expected value."
1212  );
1213  }
1214 
1215 
1216  // Updating an invite
1217  $backend->updateInvites(
1218  $calendar['id'],
1219  [
1220  new Sharee([
1221  'href' => 'mailto:user@example.org',
1222  'principal' => 'principals/user2',
1223  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE,
1224  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1225  ])
1226  ]
1227  );
1228 
1229  $result = $backend->getInvites($calendar['id']);
1230  $expected = [
1231  $ownerSharee,
1232  new Sharee([
1233  'href' => 'mailto:user@example.org',
1234  'principal' => 'principals/user2',
1235  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE,
1236  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1237  'properties' => [
1238  '{DAV:}displayname' => 'User 2',
1239  ],
1240  ])
1241  ];
1242  $this->assertEquals($expected, $result);
1243 
1244  // Removing an invite
1245  $backend->updateInvites(
1246  $calendar['id'],
1247  [
1248  new Sharee([
1249  'href' => 'mailto:user@example.org',
1250  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_NOACCESS,
1251  ])
1252  ]
1253  );
1254 
1255  $result = $backend->getInvites($calendar['id']);
1256  $expected = [
1257  $ownerSharee
1258  ];
1259  $this->assertEquals($expected, $result);
1260 
1261  // Preventing the owner share from being removed
1262  $backend->updateInvites(
1263  $calendar['id'],
1264  [
1265  new Sharee([
1266  'href' => 'principals/user2',
1267  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_NOACCESS,
1268  ])
1269  ]
1270  );
1271 
1272  $result = $backend->getInvites($calendar['id']);
1273  $expected = [
1274  new Sharee([
1275  'href' => 'principals/user1',
1276  'principal' => 'principals/user1',
1277  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER,
1278  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1279  ]),
1280  ];
1281  $this->assertEquals($expected, $result);
1282 
1283  }
1284 
1290 
1291  $backend = new PDO($this->pdo);
1292  // Add a new invite
1293  $backend->updateInvites(
1294  'bad-id',
1295  []
1296  );
1297 
1298  }
1299 
1304 
1305  $backend = new PDO($this->pdo);
1306 
1307  // creating a new calendar
1308  $backend->createCalendar('principals/user1', 'somerandomid', []);
1309  $calendar = $backend->getCalendarsForUser('principals/user1')[0];
1310 
1311  $ownerSharee = new Sharee([
1312  'href' => 'principals/user1',
1313  'principal' => 'principals/user1',
1314  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER,
1315  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1316  ]);
1317 
1318  // Add a new invite
1319  $backend->updateInvites(
1320  $calendar['id'],
1321  [
1322  new Sharee([
1323  'href' => 'mailto:user@example.org',
1324  'principal' => null,
1325  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ,
1326  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1327  'properties' => ['{DAV:}displayname' => 'User 2'],
1328  ])
1329  ]
1330  );
1331 
1332  $result = $backend->getInvites($calendar['id']);
1333  $expected = [
1334  $ownerSharee,
1335  new Sharee([
1336  'href' => 'mailto:user@example.org',
1337  'principal' => null,
1338  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ,
1339  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_INVALID,
1340  'properties' => [
1341  '{DAV:}displayname' => 'User 2',
1342  ],
1343  ])
1344  ];
1345  $this->assertEquals($expected, $result, null, 0.0, 10, true); // Last argument is $canonicalize = true, which allows us to compare, ignoring the order, because it's different between MySQL and Sqlite.
1346 
1347  }
1348 
1353 
1354  $backend = new PDO($this->pdo);
1355 
1356  // creating a new calendar
1357  $backend->createCalendar('principals/user1', 'somerandomid', []);
1358  $calendar = $backend->getCalendarsForUser('principals/user1')[0];
1359 
1360  $ownerSharee = new Sharee([
1361  'href' => 'principals/user1',
1362  'principal' => 'principals/user1',
1363  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER,
1364  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1365  ]);
1366 
1367  // Add a new invite
1368  $backend->updateInvites(
1369  $calendar['id'],
1370  [
1371  new Sharee([
1372  'href' => 'mailto:user@example.org',
1373  'principal' => 'principals/user2',
1374  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ,
1375  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1376  'properties' => ['{DAV:}displayname' => 'User 2'],
1377  ])
1378  ]
1379  );
1380 
1381  $expectedCalendar = [
1382  'id' => [1,2],
1383  'principaluri' => 'principals/user2',
1384  '{http://calendarserver.org/ns/}getctag' => 'http://sabre.io/ns/sync/1',
1385  '{http://sabredav.org/ns}sync-token' => '1',
1386  'share-access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READ,
1387  'read-only' => true,
1388  'share-resource-uri' => '/ns/share/1',
1389  ];
1390  $calendars = $backend->getCalendarsForUser('principals/user2');
1391 
1392  foreach ($expectedCalendar as $k => $v) {
1393  $this->assertEquals(
1394  $v,
1395  $calendars[0][$k],
1396  "Key " . $k . " in calendars array did not have the expected value."
1397  );
1398  }
1399 
1400  // Removing the shared calendar.
1401  $backend->deleteCalendar($calendars[0]['id']);
1402 
1403  $this->assertEquals(
1404  [],
1405  $backend->getCalendarsForUser('principals/user2')
1406  );
1407 
1408  $result = $backend->getInvites($calendar['id']);
1409  $expected = [
1410  new Sharee([
1411  'href' => 'principals/user1',
1412  'principal' => 'principals/user1',
1413  'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER,
1414  'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_ACCEPTED,
1415  ]),
1416  ];
1417  $this->assertEquals($expected, $result);
1418 
1419  }
1420 
1425 
1426  $backend = new PDO($this->pdo);
1427  $backend->setPublishStatus([1, 1], true);
1428 
1429  }
1430 
1431 }
testGetCalendarsForUserNoCalendars()
testConstruct
This class represents the {DAV:}sharee element.
Definition: Sharee.php:21
testCreateCalendarObjectDuration()
testCreateCalendarObject
This class represents a set of properties that are going to be updated.
Definition: PropPatch.php:20
$result
testDeleteCalendarObjectBadId()
testDeleteCalendarObject
testDeleteCalendarBadID()
testCreateCalendarAndFetch
testDeleteCalendarObject()
testCreateCalendarObject
if(!array_key_exists('StateId', $_REQUEST)) $id
testGetCalendarObjectByUID()
testCreateCalendarObject
testUpdateCalendarObject()
testCreateCalendarObject
testCreateCalendarIncorrectComponentSet()
testCreateCalendarAndFetch
$index
Definition: metadata.php:60
testCalendarQueryBadId()
testCalendarQueryNoResult
testUpdateInvitesNoPrincipal()
testUpdateInvites
dropTables($tableNames)
Drops tables, if they exist.
testDeleteCalendar()
testCreateCalendarAndFetch
testCreateCalendarObjectNoComponent()
Sabre testCreateCalendarObject
const MAX_DATE
We need to specify a max date, because we need to stop somewhere
Definition: PDO.php:36
testCreateCalendarObjectNoDTEND()
testCreateCalendarObject
Href property.
Definition: Href.php:26
createSchema($schemaName)
Uses .sql files from the examples directory to initialize the database.
testGetCalendarObjects()
testCreateCalendarObject
testGetCalendarObjectBadId()
testGetCalendarObjects
getDb()
Returns a fully configured PDO object.
testUpdateInvites()
testCreateCalendarAndFetch
testCreateCalendarObjectBadId()
testCreateCalendarObject
$row
testUpdateCalendarUnknownProperty()
testUpdateCalendarAndFetch
trait DbTestHelperTrait
testCreateCalendarObjectInfiniteRecurrence()
testCreateCalendarObject
testCreateCalendarObjectEndingRecurrence()
testCreateCalendarObject
$results
Definition: svg-scanner.php:47
testGetMultipleObjectsBadId()
testGetMultipleObjects
testGetCalendarObjectsBadId()
testGetCalendarObjects
testCreateCalendarObjectWithDTEND()
testCreateCalendarObject
$key
Definition: croninfo.php:18
$data
Definition: bench.php:6
testCreateCalendarObjectTask()
testCreateCalendarObject
testUpdateCalendarObjectBadId()
testUpdateCalendarObject