Пример #1
0
 function setUp()
 {
     $this->caldavCalendars = [['principaluri' => 'principals/user1', 'id' => 1, 'uri' => 'cal1'], ['principaluri' => 'principals/user1', 'id' => 2, 'uri' => 'cal2', 'share-access' => \Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE], ['principaluri' => 'principals/user1', 'id' => 3, 'uri' => 'cal3']];
     parent::setUp();
     // Making the logged in user an admin, for full access:
     $this->aclPlugin->adminPrincipals[] = 'principals/user2';
 }
Пример #2
0
 function setUp()
 {
     parent::setUp();
     $this->backend = new Backend\Mock();
     $this->plugin = new Plugin($this->backend);
     $this->server->addPlugin($this->plugin);
 }
Пример #3
0
    function setUp()
    {
        parent::setUp();
        $this->icsExportPlugin = new ICSExportPlugin();
        $this->server->addPlugin($this->icsExportPlugin);
        $id = $this->caldavBackend->createCalendar('principals/admin', 'UUID-123467', ['{DAV:}displayname' => 'Hello!', '{http://apple.com/ns/ical/}calendar-color' => '#AA0000FF']);
        $this->caldavBackend->createCalendarObject($id, 'event-1', <<<ICS
BEGIN:VCALENDAR
BEGIN:VTIMEZONE
TZID:Europe/Amsterdam
END:VTIMEZONE
BEGIN:VEVENT
UID:event-1
DTSTART;TZID=Europe/Amsterdam:20151020T000000
END:VEVENT
END:VCALENDAR
ICS
);
        $this->caldavBackend->createCalendarObject($id, 'todo-1', <<<ICS
BEGIN:VCALENDAR
BEGIN:VTODO
UID:todo-1
END:VTODO
END:VCALENDAR
ICS
);
    }
Пример #4
0
 function setUp()
 {
     $this->caldavCalendars = array(array('principaluri' => 'principals/user1', 'id' => 1, 'uri' => 'cal1'), array('principaluri' => 'principals/user1', 'id' => 2, 'uri' => 'cal2', '{' . Plugin::NS_CALENDARSERVER . '}shared-url' => 'calendars/user1/cal2', '{http://sabredav.org/ns}owner-principal' => 'principals/user2', '{http://sabredav.org/ns}read-only' => 'true'), array('principaluri' => 'principals/user1', 'id' => 3, 'uri' => 'cal3'));
     parent::setUp();
     // Making the logged in user an admin, for full access:
     $this->aclPlugin->adminPrincipals[] = 'principals/user1';
     $this->aclPlugin->adminPrincipals[] = 'principals/user2';
 }
Пример #5
0
 public function setUp()
 {
     $this->node = new FileMock();
     $this->tree[] = $this->node;
     parent::setUp();
     $this->plugin = new Plugin();
     $this->server->addPlugin($this->plugin);
 }
Пример #6
0
 function setUp()
 {
     parent::setUp();
     $this->server->createFile('files/test.txt', 'Test contents');
     $this->lastModified = HTTP\Util::toHTTPDate(new DateTime('@' . $this->server->tree->getNodeForPath('files/test.txt')->getLastModified()));
     $stream = popen('echo "Test contents"', 'r');
     $streamingFile = new Mock\StreamingFile('no-seeking.txt', $stream);
     $streamingFile->setSize(12);
     $this->server->tree->getNodeForPath('files')->addNode($streamingFile);
 }
Пример #7
0
 function setUp()
 {
     parent::setUp();
     $plugin = new VCFExportPlugin();
     $this->server->addPlugin($plugin);
 }
Пример #8
0
 public function setUp()
 {
     parent::setUp();
     $this->server->addPlugin(new Plugin());
 }
Пример #9
0
    function testInviteNoACLPlugin()
    {
        $this->setupACL = false;
        parent::setUp();
        $newObject = <<<ICS
BEGIN:VCALENDAR
BEGIN:VEVENT
UID:foo
DTSTART:20140811T230000Z
ORGANIZER:mailto:user1.sabredav@sabredav.org
ATTENDEE:mailto:user2.sabredav@sabredav.org
END:VEVENT
END:VCALENDAR
ICS;
        $this->deliver(null, $newObject);
        $expected = <<<ICS
BEGIN:VCALENDAR
BEGIN:VEVENT
UID:foo
DTSTART:20140811T230000Z
ORGANIZER:mailto:user1.sabredav@sabredav.org
ATTENDEE;SCHEDULE-STATUS="5.2;There was no system capable of delivering the scheduling message":mailto:user2.sabredav@sabredav.org
END:VEVENT
END:VCALENDAR
ICS;
        $this->assertVObjEquals($expected, $newObject);
    }
 function setUp()
 {
     parent::setUp();
     $this->caldavBackend->createCalendar('principals/user1', 'default', []);
 }
 function setUp()
 {
     parent::setUp();
     $this->caldavBackend->createCalendar('principals/user1', 'shared', ['{http://calendarserver.org/ns/}shared-url' => new DAV\Xml\Property\Href('calendars/user2/default/'), '{http://sabredav.org/ns}read-only' => false, '{http://sabredav.org/ns}owner-principal' => 'principals/user2']);
     $this->caldavBackend->createCalendar('principals/user1', 'default', []);
 }
 function setUp()
 {
     parent::setUp();
     $this->caldavBackend->createCalendar('principals/user1', 'shared', ['share-access' => DAV\Sharing\Plugin::ACCESS_READWRITE]);
     $this->caldavBackend->createCalendar('principals/user1', 'default', []);
 }
Пример #13
0
 function setUp()
 {
     parent::setUp();
     $this->caldavBackend->createCalendar('principals/user1', 'default', []);
     $this->principalBackend->addPrincipal(['uri' => 'principals/user1/calendar-proxy-read']);
 }
Пример #14
0
    function testInviteNoACLPlugin()
    {
        $this->setupACL = false;
        parent::setUp();
        $newObject = <<<ICS
BEGIN:VCALENDAR
BEGIN:VEVENT
UID:foo
DTSTART:20140811T230000Z
ORGANIZER:mailto:user1.sabredav@sabredav.org
ATTENDEE:mailto:user2.sabredav@sabredav.org
END:VEVENT
END:VCALENDAR
ICS;
        $this->deliver(null, $newObject);
        $expected = <<<ICS
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:foo
DTSTART:20140811T230000Z
ORGANIZER:mailto:user1.sabredav@sabredav.org
ATTENDEE;SCHEDULE-STATUS=5.2:mailto:user2.sabredav@sabredav.org
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS;
        $this->assertVObjectEqualsVObject($expected, $newObject);
    }