ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CollectionTest.php
Go to the documentation of this file.
1 <?php
2 
4 
5 use Sabre\CalDAV;
6 
8 
9  protected $caldavBackend;
10  protected $principalUri;
11  protected $notification;
12 
13  function getInstance() {
14 
15  $this->principalUri = 'principals/user1';
16 
18 
19  $this->caldavBackend = new CalDAV\Backend\MockSharing([], [], [
20  'principals/user1' => [
21  $this->notification
22  ]
23  ]);
24 
25  return new Collection($this->caldavBackend, $this->principalUri);
26 
27  }
28 
29  function testGetChildren() {
30 
31  $col = $this->getInstance();
32  $this->assertEquals('notifications', $col->getName());
33 
34  $this->assertEquals([
35  new Node($this->caldavBackend, $this->principalUri, $this->notification)
36  ], $col->getChildren());
37 
38  }
39 
40  function testGetOwner() {
41 
42  $col = $this->getInstance();
43  $this->assertEquals('principals/user1', $col->getOwner());
44 
45  }
46 
47  function testGetGroup() {
48 
49  $col = $this->getInstance();
50  $this->assertNull($col->getGroup());
51 
52  }
53 
54  function testGetACL() {
55 
56  $col = $this->getInstance();
57  $expected = [
58  [
59  'privilege' => '{DAV:}all',
60  'principal' => '{DAV:}owner',
61  'protected' => true,
62  ],
63  ];
64 
65  $this->assertEquals($expected, $col->getACL());
66 
67  }
68 
72  function testSetACL() {
73 
74  $col = $this->getInstance();
75  $col->setACL([]);
76 
77  }
78 
80 
81  $col = $this->getInstance();
82  $this->assertNull($col->getSupportedPrivilegeSet());
83 
84  }
85 }
This node represents a list of notifications.
Definition: Collection.php:23
This node represents a single notification.
Definition: Node.php:21
notification()
Definition: notification.php:2