ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\CalendarHomeSharedCalendarsTest Class Reference
+ Inheritance diagram for Sabre\CalDAV\CalendarHomeSharedCalendarsTest:
+ Collaboration diagram for Sabre\CalDAV\CalendarHomeSharedCalendarsTest:

Public Member Functions

 getInstance ()
 
 testSimple ()
 
 testGetChildren ()
 
 testShareReply ()
 

Protected Attributes

 $backend
 

Detailed Description

Definition at line 7 of file CalendarHomeSharedCalendarsTest.php.

Member Function Documentation

◆ getInstance()

Sabre\CalDAV\CalendarHomeSharedCalendarsTest::getInstance ( )

Definition at line 11 of file CalendarHomeSharedCalendarsTest.php.

Referenced by Sabre\CalDAV\CalendarHomeSharedCalendarsTest\testGetChildren(), Sabre\CalDAV\CalendarHomeSharedCalendarsTest\testShareReply(), and Sabre\CalDAV\CalendarHomeSharedCalendarsTest\testSimple().

11  {
12 
13  $calendars = [
14  [
15  'id' => 1,
16  'principaluri' => 'principals/user1',
17  ],
18  [
19  'id' => 2,
20  '{http://calendarserver.org/ns/}shared-url' => 'calendars/owner/cal1',
21  '{http://sabredav.org/ns}owner-principal' => 'principal/owner',
22  '{http://sabredav.org/ns}read-only' => false,
23  'principaluri' => 'principals/user1',
24  ],
25  ];
26 
27  $this->backend = new Backend\MockSharing(
28  $calendars,
29  [],
30  []
31  );
32 
33  return new CalendarHome($this->backend, [
34  'uri' => 'principals/user1'
35  ]);
36 
37  }
+ Here is the caller graph for this function:

◆ testGetChildren()

Sabre\CalDAV\CalendarHomeSharedCalendarsTest::testGetChildren ( )

Definition at line 46 of file CalendarHomeSharedCalendarsTest.php.

References Sabre\CalDAV\CalendarHomeSharedCalendarsTest\getInstance().

46  {
47 
48  $instance = $this->getInstance();
49  $children = $instance->getChildren();
50  $this->assertEquals(3, count($children));
51 
52  // Testing if we got all the objects back.
53  $sharedCalendars = 0;
54  $hasOutbox = false;
55  $hasNotifications = false;
56 
57  foreach ($children as $child) {
58 
59  if ($child instanceof ISharedCalendar) {
60  $sharedCalendars++;
61  }
62  if ($child instanceof Notifications\ICollection) {
63  $hasNotifications = true;
64  }
65 
66  }
67  $this->assertEquals(2, $sharedCalendars);
68  $this->assertTrue($hasNotifications);
69 
70  }
+ Here is the call graph for this function:

◆ testShareReply()

Sabre\CalDAV\CalendarHomeSharedCalendarsTest::testShareReply ( )

Definition at line 72 of file CalendarHomeSharedCalendarsTest.php.

References $result, and Sabre\CalDAV\CalendarHomeSharedCalendarsTest\getInstance().

72  {
73 
74  $instance = $this->getInstance();
75  $result = $instance->shareReply('uri', DAV\Sharing\Plugin::INVITE_DECLINED, 'curi', '1');
76  $this->assertNull($result);
77 
78  }
$result
+ Here is the call graph for this function:

◆ testSimple()

Sabre\CalDAV\CalendarHomeSharedCalendarsTest::testSimple ( )

Definition at line 39 of file CalendarHomeSharedCalendarsTest.php.

References Sabre\CalDAV\CalendarHomeSharedCalendarsTest\getInstance().

39  {
40 
41  $instance = $this->getInstance();
42  $this->assertEquals('user1', $instance->getName());
43 
44  }
+ Here is the call graph for this function:

Field Documentation

◆ $backend

Sabre\CalDAV\CalendarHomeSharedCalendarsTest::$backend
protected

Definition at line 9 of file CalendarHomeSharedCalendarsTest.php.


The documentation for this class was generated from the following file: