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

Public Member Functions

 getInstance ()
 
 testSimple ()
 
 testGetChildren ()
 
 testCreateSubscription ()
 
 testNoSubscriptionSupport ()
 @expectedException \Sabre\DAV\Exception\InvalidResourceType More...
 

Protected Attributes

 $backend
 

Detailed Description

Definition at line 7 of file CalendarHomeSubscriptionsTest.php.

Member Function Documentation

◆ getInstance()

Sabre\CalDAV\CalendarHomeSubscriptionsTest::getInstance ( )

Definition at line 11 of file CalendarHomeSubscriptionsTest.php.

11 {
12
13 $props = [
14 '{DAV:}displayname' => 'baz',
15 '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/test.ics'),
16 ];
17 $principal = [
18 'uri' => 'principals/user1'
19 ];
20 $this->backend = new Backend\MockSubscriptionSupport([], []);
21 $this->backend->createSubscription('principals/user1', 'uri', $props);
22
23 return new CalendarHome($this->backend, $principal);
24
25 }

Referenced by Sabre\CalDAV\CalendarHomeSubscriptionsTest\testCreateSubscription(), Sabre\CalDAV\CalendarHomeSubscriptionsTest\testGetChildren(), and Sabre\CalDAV\CalendarHomeSubscriptionsTest\testSimple().

+ Here is the caller graph for this function:

◆ testCreateSubscription()

Sabre\CalDAV\CalendarHomeSubscriptionsTest::testCreateSubscription ( )

Definition at line 48 of file CalendarHomeSubscriptionsTest.php.

48 {
49
50 $instance = $this->getInstance();
51 $rt = ['{DAV:}collection', '{http://calendarserver.org/ns/}subscribed'];
52
53 $props = [
54 '{DAV:}displayname' => 'baz',
55 '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/test2.ics'),
56 ];
57 $instance->createExtendedCollection('sub2', new MkCol($rt, $props));
58
59 $children = $instance->getChildren();
60 $this->assertEquals(2, count($children));
61
62 }

References Sabre\CalDAV\CalendarHomeSubscriptionsTest\getInstance().

+ Here is the call graph for this function:

◆ testGetChildren()

Sabre\CalDAV\CalendarHomeSubscriptionsTest::testGetChildren ( )

Definition at line 34 of file CalendarHomeSubscriptionsTest.php.

34 {
35
36 $instance = $this->getInstance();
37 $children = $instance->getChildren();
38 $this->assertEquals(1, count($children));
39 foreach ($children as $child) {
40 if ($child instanceof Subscriptions\Subscription) {
41 return;
42 }
43 }
44 $this->fail('There were no subscription nodes in the calendar home');
45
46 }

References Sabre\CalDAV\CalendarHomeSubscriptionsTest\getInstance().

+ Here is the call graph for this function:

◆ testNoSubscriptionSupport()

Sabre\CalDAV\CalendarHomeSubscriptionsTest::testNoSubscriptionSupport ( )

@expectedException \Sabre\DAV\Exception\InvalidResourceType

Definition at line 67 of file CalendarHomeSubscriptionsTest.php.

67 {
68
69 $principal = [
70 'uri' => 'principals/user1'
71 ];
72 $backend = new Backend\Mock([], []);
73 $uC = new CalendarHome($backend, $principal);
74
75 $rt = ['{DAV:}collection', '{http://calendarserver.org/ns/}subscribed'];
76
77 $props = [
78 '{DAV:}displayname' => 'baz',
79 '{http://calendarserver.org/ns/}source' => new \Sabre\DAV\Xml\Property\Href('http://example.org/test2.ics'),
80 ];
81 $uC->createExtendedCollection('sub2', new MkCol($rt, $props));
82
83 }

References Sabre\CalDAV\CalendarHomeSubscriptionsTest\$backend.

◆ testSimple()

Sabre\CalDAV\CalendarHomeSubscriptionsTest::testSimple ( )

Definition at line 27 of file CalendarHomeSubscriptionsTest.php.

27 {
28
29 $instance = $this->getInstance();
30 $this->assertEquals('user1', $instance->getName());
31
32 }

References Sabre\CalDAV\CalendarHomeSubscriptionsTest\getInstance().

+ Here is the call graph for this function:

Field Documentation

◆ $backend

Sabre\CalDAV\CalendarHomeSubscriptionsTest::$backend
protected

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