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

Public Member Functions

 setup ()
 
 testSimple ()
 
 testGetChildNotFound ()
 Sabre testSimple More...
 
 testChildExists ()
 
 testGetOwner ()
 
 testGetGroup ()
 
 testGetACL ()
 
 testSetACL ()
 
 testSetName ()
 testSimple More...
 
 testDelete ()
 testSimple More...
 
 testGetLastModified ()
 testSimple More...
 
 testCreateFile ()
 testSimple More...
 
 testCreateDirectory ()
 Sabre testSimple More...
 
 testCreateExtendedCollection ()
 testSimple More...
 
 testCreateExtendedCollectionBadResourceType ()
 Sabre testSimple More...
 
 testCreateExtendedCollectionNotACalendar ()
 Sabre testSimple More...
 
 testGetSupportedPrivilegesSet ()
 
 testShareReplyFail ()
 Sabre More...
 

Protected Attributes

 $usercalendars
 
 $backend
 

Detailed Description

Definition at line 8 of file CalendarHomeTest.php.

Member Function Documentation

◆ setup()

Sabre\CalDAV\CalendarHomeTest::setup ( )

Definition at line 20 of file CalendarHomeTest.php.

References Sabre\CalDAV\TestUtil\getBackend().

20  {
21 
22  $this->backend = TestUtil::getBackend();
23  $this->usercalendars = new CalendarHome($this->backend, [
24  'uri' => 'principals/user1'
25  ]);
26 
27  }
static getBackend()
Definition: TestUtil.php:7
+ Here is the call graph for this function:

◆ testChildExists()

Sabre\CalDAV\CalendarHomeTest::testChildExists ( )

Definition at line 45 of file CalendarHomeTest.php.

45  {
46 
47  $this->assertFalse($this->usercalendars->childExists('foo'));
48  $this->assertTrue($this->usercalendars->childExists('UUID-123467'));
49 
50  }

◆ testCreateDirectory()

Sabre\CalDAV\CalendarHomeTest::testCreateDirectory ( )

Sabre testSimple

Definition at line 150 of file CalendarHomeTest.php.

150  {
151 
152  $this->usercalendars->createDirectory('bla');
153 
154  }

◆ testCreateExtendedCollection()

Sabre\CalDAV\CalendarHomeTest::testCreateExtendedCollection ( )

testSimple

Definition at line 159 of file CalendarHomeTest.php.

References $result.

159  {
160 
161  $mkCol = new MkCol(
162  ['{DAV:}collection', '{urn:ietf:params:xml:ns:caldav}calendar'],
163  []
164  );
165  $result = $this->usercalendars->createExtendedCollection('newcalendar', $mkCol);
166  $this->assertNull($result);
167  $cals = $this->backend->getCalendarsForUser('principals/user1');
168  $this->assertEquals(3, count($cals));
169 
170  }
$result

◆ testCreateExtendedCollectionBadResourceType()

Sabre\CalDAV\CalendarHomeTest::testCreateExtendedCollectionBadResourceType ( )

Sabre testSimple

Definition at line 176 of file CalendarHomeTest.php.

176  {
177 
178  $mkCol = new MkCol(
179  ['{DAV:}collection', '{DAV:}blabla'],
180  []
181  );
182  $this->usercalendars->createExtendedCollection('newcalendar', $mkCol);
183 
184  }

◆ testCreateExtendedCollectionNotACalendar()

Sabre\CalDAV\CalendarHomeTest::testCreateExtendedCollectionNotACalendar ( )

Sabre testSimple

Definition at line 190 of file CalendarHomeTest.php.

190  {
191 
192  $mkCol = new MkCol(
193  ['{DAV:}collection'],
194  []
195  );
196  $this->usercalendars->createExtendedCollection('newcalendar', $mkCol);
197 
198  }

◆ testCreateFile()

Sabre\CalDAV\CalendarHomeTest::testCreateFile ( )

testSimple

Definition at line 139 of file CalendarHomeTest.php.

139  {
140 
141  $this->usercalendars->createFile('bla');
142 
143  }

◆ testDelete()

Sabre\CalDAV\CalendarHomeTest::testDelete ( )

testSimple

Definition at line 120 of file CalendarHomeTest.php.

120  {
121 
122  $this->usercalendars->delete();
123 
124  }

◆ testGetACL()

Sabre\CalDAV\CalendarHomeTest::testGetACL ( )

Definition at line 64 of file CalendarHomeTest.php.

64  {
65 
66  $expected = [
67  [
68  'privilege' => '{DAV:}read',
69  'principal' => 'principals/user1',
70  'protected' => true,
71  ],
72  [
73  'privilege' => '{DAV:}write',
74  'principal' => 'principals/user1',
75  'protected' => true,
76  ],
77  [
78  'privilege' => '{DAV:}read',
79  'principal' => 'principals/user1/calendar-proxy-write',
80  'protected' => true,
81  ],
82  [
83  'privilege' => '{DAV:}write',
84  'principal' => 'principals/user1/calendar-proxy-write',
85  'protected' => true,
86  ],
87  [
88  'privilege' => '{DAV:}read',
89  'principal' => 'principals/user1/calendar-proxy-read',
90  'protected' => true,
91  ],
92  ];
93  $this->assertEquals($expected, $this->usercalendars->getACL());
94 
95  }

◆ testGetChildNotFound()

Sabre\CalDAV\CalendarHomeTest::testGetChildNotFound ( )

Sabre testSimple

Definition at line 39 of file CalendarHomeTest.php.

39  {
40 
41  $this->usercalendars->getChild('randomname');
42 
43  }

◆ testGetGroup()

Sabre\CalDAV\CalendarHomeTest::testGetGroup ( )

Definition at line 58 of file CalendarHomeTest.php.

58  {
59 
60  $this->assertNull($this->usercalendars->getGroup());
61 
62  }

◆ testGetLastModified()

Sabre\CalDAV\CalendarHomeTest::testGetLastModified ( )

testSimple

Definition at line 129 of file CalendarHomeTest.php.

129  {
130 
131  $this->assertNull($this->usercalendars->getLastModified());
132 
133  }

◆ testGetOwner()

Sabre\CalDAV\CalendarHomeTest::testGetOwner ( )

Definition at line 52 of file CalendarHomeTest.php.

52  {
53 
54  $this->assertEquals('principals/user1', $this->usercalendars->getOwner());
55 
56  }

◆ testGetSupportedPrivilegesSet()

Sabre\CalDAV\CalendarHomeTest::testGetSupportedPrivilegesSet ( )

Definition at line 200 of file CalendarHomeTest.php.

200  {
201 
202  $this->assertNull($this->usercalendars->getSupportedPrivilegeSet());
203 
204  }

◆ testSetACL()

Sabre\CalDAV\CalendarHomeTest::testSetACL ( )

Definition at line 100 of file CalendarHomeTest.php.

100  {
101 
102  $this->usercalendars->setACL([]);
103 
104  }

◆ testSetName()

Sabre\CalDAV\CalendarHomeTest::testSetName ( )

testSimple

Definition at line 110 of file CalendarHomeTest.php.

110  {
111 
112  $this->usercalendars->setName('bla');
113 
114  }

◆ testShareReplyFail()

Sabre\CalDAV\CalendarHomeTest::testShareReplyFail ( )

Sabre

Definition at line 209 of file CalendarHomeTest.php.

209  {
210 
211  $this->usercalendars->shareReply('uri', DAV\Sharing\Plugin::INVITE_DECLINED, 'curi', '1');
212 
213  }

◆ testSimple()

Sabre\CalDAV\CalendarHomeTest::testSimple ( )

Definition at line 29 of file CalendarHomeTest.php.

29  {
30 
31  $this->assertEquals('user1', $this->usercalendars->getName());
32 
33  }

Field Documentation

◆ $backend

Sabre\CalDAV\CalendarHomeTest::$backend
protected

Definition at line 18 of file CalendarHomeTest.php.

◆ $usercalendars

Sabre\CalDAV\CalendarHomeTest::$usercalendars
protected

Definition at line 13 of file CalendarHomeTest.php.


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