Exemplo n.º 1
0
 function testSetup()
 {
     $inbox = new Inbox(new CalDAV\Backend\MockScheduling(), 'principals/user1');
     $this->assertEquals('inbox', $inbox->getName());
     $this->assertEquals([], $inbox->getChildren());
     $this->assertEquals('principals/user1', $inbox->getOwner());
     $this->assertEquals(null, $inbox->getGroup());
     $this->assertEquals([['privilege' => '{DAV:}read', 'principal' => '{DAV:}authenticated', 'protected' => true], ['privilege' => '{DAV:}write-properties', 'principal' => 'principals/user1', 'protected' => true], ['privilege' => '{DAV:}unbind', 'principal' => 'principals/user1', 'protected' => true], ['privilege' => '{DAV:}unbind', 'principal' => 'principals/user1/calendar-proxy-write', 'protected' => true], ['privilege' => '{urn:ietf:params:xml:ns:caldav}schedule-deliver', 'principal' => '{DAV:}authenticated', 'protected' => true]], $inbox->getACL());
     $ok = false;
 }
Exemplo n.º 2
0
 function testSetup()
 {
     $inbox = new Inbox(new CalDAV\Backend\MockScheduling(), 'principals/user1');
     $this->assertEquals('inbox', $inbox->getName());
     $this->assertEquals([], $inbox->getChildren());
     $this->assertEquals('principals/user1', $inbox->getOwner());
     $this->assertEquals(null, $inbox->getGroup());
     $this->assertEquals([['privilege' => '{DAV:}read', 'principal' => '{DAV:}authenticated', 'protected' => true], ['privilege' => '{DAV:}write-properties', 'principal' => 'principals/user1', 'protected' => true], ['privilege' => '{DAV:}unbind', 'principal' => 'principals/user1', 'protected' => true], ['privilege' => '{DAV:}unbind', 'principal' => 'principals/user1/calendar-proxy-write', 'protected' => true], ['privilege' => '{urn:ietf:params:xml:ns:caldav}schedule-deliver-invite', 'principal' => '{DAV:}authenticated', 'protected' => true], ['privilege' => '{urn:ietf:params:xml:ns:caldav}schedule-deliver-reply', 'principal' => '{DAV:}authenticated', 'protected' => true]], $inbox->getACL());
     $ok = false;
     try {
         $inbox->setACL([]);
     } catch (DAV\Exception\MethodNotAllowed $e) {
         $ok = true;
     }
     if (!$ok) {
         $this->fail('Exception was not emitted');
     }
 }