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

Public Member Functions

 getInstance (array $props=null)
 
 testGetInvites ()
 
 testGetOwner ()
 
 testGetACL ()
 
 testGetChildACL ()
 
 testUpdateInvites ()
 
 testPublish ()
 

Protected Attributes

 $backend
 

Detailed Description

Definition at line 8 of file SharedCalendarTest.php.

Member Function Documentation

◆ getInstance()

Sabre\CalDAV\SharedCalendarTest::getInstance ( array  $props = null)

Definition at line 12 of file SharedCalendarTest.php.

12 {
13
14 if (is_null($props)) {
15 $props = [
16 'id' => 1,
17 '{http://calendarserver.org/ns/}shared-url' => 'calendars/owner/original',
18 '{http://sabredav.org/ns}owner-principal' => 'principals/owner',
19 '{http://sabredav.org/ns}read-only' => false,
20 'share-access' => Sharing\Plugin::ACCESS_READWRITE,
21 'principaluri' => 'principals/sharee',
22 ];
23 }
24
25 $this->backend = new Backend\MockSharing(
26 [$props],
27 [],
28 []
29 );
30
31 $sharee = new Sharee();
32 $sharee->href = 'mailto:removeme@example.org';
33 $sharee->properties['{DAV:}displayname'] = 'To be removed';
34 $sharee->access = Sharing\Plugin::ACCESS_READ;
35 $this->backend->updateInvites(1, [$sharee]);
36
37 return new SharedCalendar($this->backend, $props);
38
39 }

Referenced by Sabre\CalDAV\SharedCalendarTest\testGetACL(), Sabre\CalDAV\SharedCalendarTest\testGetChildACL(), Sabre\CalDAV\SharedCalendarTest\testGetInvites(), Sabre\CalDAV\SharedCalendarTest\testGetOwner(), Sabre\CalDAV\SharedCalendarTest\testPublish(), and Sabre\CalDAV\SharedCalendarTest\testUpdateInvites().

+ Here is the caller graph for this function:

◆ testGetACL()

Sabre\CalDAV\SharedCalendarTest::testGetACL ( )

Definition at line 60 of file SharedCalendarTest.php.

60 {
61
62 $expected = [
63 [
64 'privilege' => '{DAV:}write',
65 'principal' => 'principals/sharee',
66 'protected' => true,
67 ],
68 [
69 'privilege' => '{DAV:}write',
70 'principal' => 'principals/sharee/calendar-proxy-write',
71 'protected' => true,
72 ],
73 [
74 'privilege' => '{DAV:}write-properties',
75 'principal' => 'principals/sharee',
76 'protected' => true,
77 ],
78 [
79 'privilege' => '{DAV:}write-properties',
80 'principal' => 'principals/sharee/calendar-proxy-write',
81 'protected' => true,
82 ],
83 [
84 'privilege' => '{DAV:}read',
85 'principal' => 'principals/sharee',
86 'protected' => true,
87 ],
88 [
89 'privilege' => '{DAV:}read',
90 'principal' => 'principals/sharee/calendar-proxy-read',
91 'protected' => true,
92 ],
93 [
94 'privilege' => '{DAV:}read',
95 'principal' => 'principals/sharee/calendar-proxy-write',
96 'protected' => true,
97 ],
98 [
99 'privilege' => '{' . Plugin::NS_CALDAV . '}read-free-busy',
100 'principal' => '{DAV:}authenticated',
101 'protected' => true,
102 ],
103 ];
104
105 $this->assertEquals($expected, $this->getInstance()->getACL());
106
107 }
const NS_CALDAV
This is the official CalDAV namespace.
Definition: Plugin.php:33

References Sabre\CalDAV\SharedCalendarTest\getInstance(), and Sabre\CalDAV\Plugin\NS_CALDAV.

+ Here is the call graph for this function:

◆ testGetChildACL()

Sabre\CalDAV\SharedCalendarTest::testGetChildACL ( )

Definition at line 109 of file SharedCalendarTest.php.

109 {
110
111 $expected = [
112 [
113 'privilege' => '{DAV:}write',
114 'principal' => 'principals/sharee',
115 'protected' => true,
116 ],
117 [
118 'privilege' => '{DAV:}write',
119 'principal' => 'principals/sharee/calendar-proxy-write',
120 'protected' => true,
121 ],
122 [
123 'privilege' => '{DAV:}read',
124 'principal' => 'principals/sharee',
125 'protected' => true,
126 ],
127 [
128 'privilege' => '{DAV:}read',
129 'principal' => 'principals/sharee/calendar-proxy-write',
130 'protected' => true,
131 ],
132 [
133 'privilege' => '{DAV:}read',
134 'principal' => 'principals/sharee/calendar-proxy-read',
135 'protected' => true,
136 ],
137
138 ];
139
140 $this->assertEquals($expected, $this->getInstance()->getChildACL());
141
142 }

References Sabre\CalDAV\SharedCalendarTest\getInstance().

+ Here is the call graph for this function:

◆ testGetInvites()

Sabre\CalDAV\SharedCalendarTest::testGetInvites ( )

Definition at line 41 of file SharedCalendarTest.php.

41 {
42
43 $sharee = new Sharee();
44 $sharee->href = 'mailto:removeme@example.org';
45 $sharee->properties['{DAV:}displayname'] = 'To be removed';
46 $sharee->access = Sharing\Plugin::ACCESS_READ;
47 $sharee->inviteStatus = Sharing\Plugin::INVITE_NORESPONSE;
48
49 $this->assertEquals(
50 [$sharee],
51 $this->getInstance()->getInvites()
52 );
53
54 }

References Sabre\CalDAV\SharedCalendarTest\getInstance().

+ Here is the call graph for this function:

◆ testGetOwner()

Sabre\CalDAV\SharedCalendarTest::testGetOwner ( )

Definition at line 56 of file SharedCalendarTest.php.

56 {
57 $this->assertEquals('principals/sharee', $this->getInstance()->getOwner());
58 }

References Sabre\CalDAV\SharedCalendarTest\getInstance().

+ Here is the call graph for this function:

◆ testPublish()

Sabre\CalDAV\SharedCalendarTest::testPublish ( )

Definition at line 169 of file SharedCalendarTest.php.

169 {
170
171 $instance = $this->getInstance();
172 $this->assertNull($instance->setPublishStatus(true));
173 $this->assertNull($instance->setPublishStatus(false));
174
175 }

References Sabre\CalDAV\SharedCalendarTest\getInstance().

+ Here is the call graph for this function:

◆ testUpdateInvites()

Sabre\CalDAV\SharedCalendarTest::testUpdateInvites ( )

Definition at line 144 of file SharedCalendarTest.php.

144 {
145
146 $instance = $this->getInstance();
147 $newSharees = [
148 new Sharee(),
149 new Sharee()
150 ];
151 $newSharees[0]->href = 'mailto:test@example.org';
152 $newSharees[0]->properties['{DAV:}displayname'] = 'Foo Bar';
153 $newSharees[0]->comment = 'Booh';
154 $newSharees[0]->access = Sharing\Plugin::ACCESS_READWRITE;
155
156 $newSharees[1]->href = 'mailto:removeme@example.org';
157 $newSharees[1]->access = Sharing\Plugin::ACCESS_NOACCESS;
158
159 $instance->updateInvites($newSharees);
160
161 $expected = [
162 clone $newSharees[0]
163 ];
164 $expected[0]->inviteStatus = Sharing\Plugin::INVITE_NORESPONSE;
165 $this->assertEquals($expected, $instance->getInvites());
166
167 }

References Sabre\CalDAV\SharedCalendarTest\getInstance().

+ Here is the call graph for this function:

Field Documentation

◆ $backend

Sabre\CalDAV\SharedCalendarTest::$backend
protected

Definition at line 10 of file SharedCalendarTest.php.


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