[Pkg-owncloud-commits] [php-sabredav] 119/275: Removed calendar-schedule compatible behavior for broken iCal versions.

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:55:58 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 4e21831773531ff80bfebe55e8ddd7d3466c6094
Author: Evert Pot <me at evertpot.com>
Date:   Thu Jul 31 16:35:23 2014 -0400

    Removed calendar-schedule compatible behavior for broken iCal versions.
---
 lib/CalDAV/Schedule/Plugin.php                     | 199 +---------
 .../Sabre/CalDAV/Schedule/FreeBusyRequestTest.php  |   2 +-
 tests/Sabre/CalDAV/Schedule/OutboxPostTest.php     | 432 ---------------------
 3 files changed, 3 insertions(+), 630 deletions(-)

diff --git a/lib/CalDAV/Schedule/Plugin.php b/lib/CalDAV/Schedule/Plugin.php
index fde6087..7acffcf 100644
--- a/lib/CalDAV/Schedule/Plugin.php
+++ b/lib/CalDAV/Schedule/Plugin.php
@@ -66,33 +66,6 @@ class Plugin extends ServerPlugin {
     protected $server;
 
     /**
-     * The email handler for invites and other scheduling messages.
-     *
-     * @var IMip
-     */
-    protected $imipHandler;
-
-    /**
-     * Sets the iMIP handler.
-     *
-     * iMIP = The email transport of iCalendar scheduling messages. Setting
-     * this is optional, but if you want the server to allow invites to be sent
-     * out, you must set a handler.
-     *
-     * Specifically iCal will plain assume that the server supports this. If
-     * the server doesn't, iCal will display errors when inviting people to
-     * events.
-     *
-     * @param IMip $imipHandler
-     * @return void
-     */
-    public function setIMipHandler(IMip $imipHandler) {
-
-        $this->imipHandler = $imipHandler;
-
-    }
-
-    /**
      * Returns a list of features for the DAV: HTTP header.
      *
      * @return array
@@ -126,7 +99,7 @@ class Plugin extends ServerPlugin {
     public function initialize(Server $server) {
 
         $this->server = $server;
-        $server->on('method:POST', [$this,'httpPost']);
+        $server->on('method:POST',         [$this, 'httpPost']);
         $server->on('propFind',            [$this, 'propFind']);
         $server->on('beforeCreateFile',    [$this, 'beforeCreateFile']);
         $server->on('beforeWriteContent',  [$this, 'beforeWriteContent']);
@@ -679,180 +652,12 @@ class Plugin extends ServerPlugin {
             $acl && $acl->checkPrivileges($outboxPath, '{' . self::NS_CALDAV . '}schedule-query-freebusy');
             $this->handleFreeBusyRequest($outboxNode, $vObject, $request, $response);
 
-        } elseif ($componentType === 'VEVENT' && in_array($method, ['REQUEST','REPLY','ADD','CANCEL'])) {
-
-            $acl && $acl->checkPrivileges($outboxPath, '{' . Plugin::NS_CALDAV . '}schedule-post-vevent');
-            $this->handleEventNotification($outboxNode, $vObject, $request, $response);
-
-        } else {
-
-            throw new NotImplemented('SabreDAV supports only VFREEBUSY (REQUEST) and VEVENT (REQUEST, REPLY, ADD, CANCEL)');
-
-        }
-
-    }
-
-    /**
-     * This method handles the REQUEST, REPLY, ADD and CANCEL methods for
-     * VEVENT iTip messages.
-     *
-     * @param IOutbox $outboxNode
-     * @param VObject\Component $vObject
-     * @param RequestInterface $request
-     * @param ResponseInterface $response
-     * @return void
-     */
-    protected function handleEventNotification(IOutbox $outboxNode, VObject\Component $vObject, RequestInterface $request, ResponseInterface $response) {
-
-        $originator = $request->getHeader('Originator');
-        $recipients = $request->getHeader('Recipient');
-
-        if (!$originator) {
-            throw new BadRequest('The Originator: header must be specified when making POST requests');
-        }
-        if (!$recipients) {
-            throw new BadRequest('The Recipient: header must be specified when making POST requests');
-        }
-
-        $recipients = explode(',',$recipients);
-        foreach($recipients as $k=>$recipient) {
-
-            $recipient = trim($recipient);
-            if (!preg_match('/^mailto:(.*)@(.*)$/i', $recipient)) {
-                throw new BadRequest('Recipients must start with mailto: and must be valid email address');
-            }
-            $recipient = substr($recipient, 7);
-            $recipients[$k] = $recipient;
-        }
-
-        // We need to make sure that 'originator' matches the currently
-        // authenticated user.
-        $aclPlugin = $this->server->getPlugin('acl');
-        if (is_null($aclPlugin)) throw new DAV\Exception('The ACL plugin must be loaded for scheduling to work');
-        $principal = $aclPlugin->getCurrentUserPrincipal();
-
-        $props = $this->server->getProperties($principal, [
-            '{' . self::NS_CALDAV . '}calendar-user-address-set',
-        ]);
-
-        $addresses = [];
-        if (isset($props['{' . self::NS_CALDAV . '}calendar-user-address-set'])) {
-            $addresses = $props['{' . self::NS_CALDAV . '}calendar-user-address-set']->getHrefs();
-        }
-
-        $found = false;
-        foreach($addresses as $address) {
-
-            // Trimming the / on both sides, just in case..
-            if (rtrim(strtolower($originator),'/') === rtrim(strtolower($address),'/')) {
-                $found = true;
-                break;
-            }
-
-        }
-
-        if (!$found) {
-            throw new Forbidden('The addresses specified in the Originator header did not match any addresses in the owners calendar-user-address-set header');
-        }
-
-        // If the Originator header was a url, and not a mailto: address..
-        // we're going to try to pull the mailto: from the vobject body.
-        if (strtolower(substr($originator,0,7)) !== 'mailto:') {
-            $originator = (string)$vObject->VEVENT->ORGANIZER;
-
-        }
-        if (strtolower(substr($originator,0,7)) !== 'mailto:') {
-            throw new Forbidden('Could not find mailto: address in both the Orignator header, and the ORGANIZER property in the VEVENT');
-        }
-        $originator = substr($originator,7);
-
-        $result = $this->iMIPMessage($originator, $recipients, $vObject, $principal);
-        $response->setStatus(200);
-        $response->setHeader('Content-Type','application/xml');
-        $response->setBody($this->generateScheduleResponse($result));
-
-    }
-
-    /**
-     * Sends an iMIP message by email.
-     *
-     * This method must return an array with status codes per recipient.
-     * This should look something like:
-     *
-     * [
-     *    'user1 at example.org' => '2.0;Success'
-     * ]
-     *
-     * Formatting for this status code can be found at:
-     * https://tools.ietf.org/html/rfc5545#section-3.8.8.3
-     *
-     * A list of valid status codes can be found at:
-     * https://tools.ietf.org/html/rfc5546#section-3.6
-     *
-     * @param string $originator
-     * @param array $recipients
-     * @param VObject\Component $vObject
-     * @param string $principal Principal url
-     * @return array
-     */
-    protected function iMIPMessage($originator, array $recipients, VObject\Component $vObject, $principal) {
-
-        if (!$this->imipHandler) {
-            $resultStatus = '5.2;This server does not support this operation';
         } else {
-            $this->imipHandler->sendMessage($originator, $recipients, $vObject, $principal);
-            $resultStatus = '2.0;Success';
-        }
 
-        $result = [];
-        foreach($recipients as $recipient) {
-            $result[$recipient] = $resultStatus;
-        }
-
-        return $result;
-
-    }
-
-    /**
-     * Generates a schedule-response XML body
-     *
-     * The recipients array is a key->value list, containing email addresses
-     * and iTip status codes. See the iMIPMessage method for a description of
-     * the value.
-     *
-     * @param array $recipients
-     * @return string
-     */
-    public function generateScheduleResponse(array $recipients) {
-
-        $dom = new \DOMDocument('1.0','utf-8');
-        $dom->formatOutput = true;
-        $xscheduleResponse = $dom->createElement('cal:schedule-response');
-        $dom->appendChild($xscheduleResponse);
-
-        foreach($this->server->xmlNamespaces as $namespace=>$prefix) {
-
-            $xscheduleResponse->setAttribute('xmlns:' . $prefix, $namespace);
-
-        }
-
-        foreach($recipients as $recipient=>$status) {
-            $xresponse = $dom->createElement('cal:response');
-
-            $xrecipient = $dom->createElement('cal:recipient');
-            $xrecipient->appendChild($dom->createTextNode($recipient));
-            $xresponse->appendChild($xrecipient);
-
-            $xrequestStatus = $dom->createElement('cal:request-status');
-            $xrequestStatus->appendChild($dom->createTextNode($status));
-            $xresponse->appendChild($xrequestStatus);
-
-            $xscheduleResponse->appendChild($xresponse);
+            throw new NotImplemented('We only support VFREEBUSY (REQUEST) on this endpoint');
 
         }
 
-        return $dom->saveXML();
-
     }
 
     /**
diff --git a/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php b/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
index eb860fd..c021fec 100644
--- a/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
+++ b/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
@@ -140,7 +140,7 @@ ICS;
     }
 
     /**
-     * @expectedException Sabre\DAV\Exception\BadRequest
+     * @expectedException \Sabre\DAV\Exception\NotImplemented
      */
     function testNoVFreeBusy() {
 
diff --git a/tests/Sabre/CalDAV/Schedule/OutboxPostTest.php b/tests/Sabre/CalDAV/Schedule/OutboxPostTest.php
index af90066..a6bea13 100644
--- a/tests/Sabre/CalDAV/Schedule/OutboxPostTest.php
+++ b/tests/Sabre/CalDAV/Schedule/OutboxPostTest.php
@@ -48,135 +48,6 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
 
     }
 
-    function testNoOriginator() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD' => 'POST',
-            'REQUEST_URI' => '/calendars/user1/outbox',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-        $req->setBody(implode("\r\n",$body));
-
-        $this->assertHTTPStatus(400, $req);
-
-    }
-
-    function testNoRecipient() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/user1/outbox',
-            'HTTP_ORIGINATOR' => 'mailto:user1 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-        $req->setBody(implode("\r\n",$body));
-
-        $this->assertHTTPStatus(400, $req);
-
-    }
-
-    function testBadOriginator() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/admin/outbox',
-            'HTTP_ORIGINATOR' => 'nomailto:orig at example.org',
-            'HTTP_RECIPIENT'  => 'mailto:user1 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-        $req->setBody(implode("\r\n",$body));
-
-        $this->assertHTTPStatus(403, $req);
-
-    }
-
-    function testBadOriginator2() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/user1/outbox',
-            'HTTP_ORIGINATOR' => 'mailto:orig at example.org',
-            'HTTP_RECIPIENT'  => 'mailto:user1 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-        $req->setBody(implode("\r\n",$body));
-
-        $this->assertHTTPStatus(403, $req);
-
-    }
-
-    function testBadRecipient() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/user1/outbox',
-            'HTTP_ORIGINATOR' => 'mailto:user1 at example.org',
-            'HTTP_RECIPIENT'  => 'http://user1@example.org, mailto:user2 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-        $req->setBody(implode("\r\n",$body));
-
-        $this->assertHTTPStatus(400, $req);
-
-    }
-
-    function testIncorrectOriginator() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/admin/outbox',
-            'HTTP_ORIGINATOR' => 'mailto:orig at example.org',
-            'HTTP_RECIPIENT'  => 'mailto:user1 at example.org, mailto:user2 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-        $req->setBody(implode("\r\n",$body));
-
-        $this->assertHTTPStatus(403, $req);
-
-    }
-
     function testInvalidIcalBody() {
 
         $req = HTTP\Sapi::createFromServerArray(array(
@@ -262,307 +133,4 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
 
     }
 
-    function testNoIMIPHandler() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/user1/outbox',
-            'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
-            'HTTP_RECIPIENT'  => 'mailto:user2 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-
-        $req->setBody(implode("\r\n",$body));
-
-
-        $response = $this->request($req);
-        $this->assertEquals(200, $response->status);
-        $this->assertEquals(array(
-            'Content-Type' => 'application/xml',
-        ), $response->headers);
-
-        // Lazily checking the body for a few expected values.
-        $this->assertTrue(strpos($response->body, '5.2;')!==false);
-        $this->assertTrue(strpos($response->body,'user2 at example.org')!==false);
-
-
-    }
-
-    function testSuccessRequest() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/user1/outbox',
-            'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
-            'HTTP_RECIPIENT'  => 'mailto:user2 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'SUMMARY:An invitation',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-
-        $req->setBody(implode("\r\n",$body));
-
-        $handler = new IMip\Mock('server at example.org');
-
-        $this->caldavSchedulePlugin->setIMIPhandler($handler);
-
-        $response = $this->request($req);
-        $this->assertEquals(200, $response->status);
-        $this->assertEquals(array(
-            'Content-Type' => 'application/xml',
-        ), $response->headers);
-
-        // Lazily checking the body for a few expected values.
-        $this->assertTrue(strpos($response->body, '2.0;')!==false);
-        $this->assertTrue(strpos($response->body,'user2 at example.org')!==false);
-
-        $this->assertEquals(array(
-            array(
-                'to' => 'user2 at example.org',
-                'subject' => 'Invitation for: An invitation',
-                'body' => implode("\r\n", $body) . "\r\n",
-                'headers' => array(
-                    'Reply-To: user1.sabredav at sabredav.org',
-                    'From: server at example.org',
-                    'Content-Type: text/calendar; method=REQUEST; charset=utf-8',
-                    'X-Sabre-Version: ' . DAV\Version::VERSION,
-                ),
-           )
-        ), $handler->getSentEmails());
-
-    }
-
-    function testSuccessRequestUseRelativePrincipal() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/user1/outbox',
-            'HTTP_ORIGINATOR' => '/principals/user1/',
-            'HTTP_RECIPIENT'  => 'mailto:user2 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'SUMMARY:An invitation',
-            'ORGANIZER:mailto:user1.sabredav at sabredav.org',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-
-        $req->setBody(implode("\r\n",$body));
-
-        $handler = new IMip\Mock('server at example.org');
-
-        $this->caldavSchedulePlugin->setIMIPhandler($handler);
-
-        $response = $this->request($req);
-        $this->assertEquals(200, $response->status, 'Full body: ' . $response->body);
-        $this->assertEquals(array(
-            'Content-Type' => 'application/xml',
-        ), $response->headers);
-
-        // Lazily checking the body for a few expected values.
-        $this->assertTrue(strpos($response->body, '2.0;')!==false);
-        $this->assertTrue(strpos($response->body,'user2 at example.org')!==false);
-
-        $this->assertEquals(array(
-            array(
-                'to' => 'user2 at example.org',
-                'subject' => 'Invitation for: An invitation',
-                'body' => implode("\r\n", $body) . "\r\n",
-                'headers' => array(
-                    'Reply-To: user1.sabredav at sabredav.org',
-                    'From: server at example.org',
-                    'Content-Type: text/calendar; method=REQUEST; charset=utf-8',
-                    'X-Sabre-Version: ' . DAV\Version::VERSION,
-                ),
-           )
-        ), $handler->getSentEmails());
-
-    }
-
-    function testSuccessRequestUpperCased() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/user1/outbox',
-            'HTTP_ORIGINATOR' => 'MAILTO:user1.sabredav at sabredav.org',
-            'HTTP_RECIPIENT'  => 'MAILTO:user2 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'SUMMARY:An invitation',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-
-        $req->setBody(implode("\r\n",$body));
-
-        $handler = new IMip\Mock('server at example.org');
-
-        $this->caldavSchedulePlugin->setIMIPhandler($handler);
-
-        $response = $this->request($req);
-        $this->assertEquals(200, $response->status);
-        $this->assertEquals(array(
-            'Content-Type' => 'application/xml',
-        ), $response->headers);
-
-        // Lazily checking the body for a few expected values.
-        $this->assertTrue(strpos($response->body, '2.0;')!==false);
-        $this->assertTrue(strpos($response->body,'user2 at example.org')!==false);
-
-        $this->assertEquals(array(
-            array(
-                'to' => 'user2 at example.org',
-                'subject' => 'Invitation for: An invitation',
-                'body' => implode("\r\n", $body) . "\r\n",
-                'headers' => array(
-                    'Reply-To: user1.sabredav at sabredav.org',
-                    'From: server at example.org',
-                    'Content-Type: text/calendar; method=REQUEST; charset=utf-8',
-                    'X-Sabre-Version: ' . DAV\Version::VERSION,
-                ),
-           )
-        ), $handler->getSentEmails());
-
-    }
-
-    function testSuccessReply() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/user1/outbox',
-            'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
-            'HTTP_RECIPIENT'  => 'mailto:user2 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REPLY',
-            'BEGIN:VEVENT',
-            'SUMMARY:An invitation',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-
-        $req->setBody(implode("\r\n",$body));
-
-        $handler = new IMip\Mock('server at example.org');
-
-        $this->caldavSchedulePlugin->setIMIPhandler($handler);
-        $this->assertHTTPStatus(200, $req);
-
-        $this->assertEquals(array(
-            array(
-                'to' => 'user2 at example.org',
-                'subject' => 'Response for: An invitation',
-                'body' => implode("\r\n", $body) . "\r\n",
-                'headers' => array(
-                    'Reply-To: user1.sabredav at sabredav.org',
-                    'From: server at example.org',
-                    'Content-Type: text/calendar; method=REPLY; charset=utf-8',
-                    'X-Sabre-Version: ' . DAV\Version::VERSION,
-                ),
-           )
-        ), $handler->getSentEmails());
-
-    }
-
-    function testSuccessCancel() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/user1/outbox',
-            'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
-            'HTTP_RECIPIENT'  => 'mailto:user2 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:CANCEL',
-            'BEGIN:VEVENT',
-            'SUMMARY:An invitation',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-
-        $req->setBody(implode("\r\n",$body));
-
-        $handler = new IMip\Mock('server at example.org');
-
-        $this->caldavSchedulePlugin->setIMIPhandler($handler);
-        $this->assertHTTPStatus(200, $req);
-
-        $this->assertEquals(array(
-            array(
-                'to' => 'user2 at example.org',
-                'subject' => 'Cancelled event: An invitation',
-                'body' => implode("\r\n", $body) . "\r\n",
-                'headers' => array(
-                    'Reply-To: user1.sabredav at sabredav.org',
-                    'From: server at example.org',
-                    'Content-Type: text/calendar; method=CANCEL; charset=utf-8',
-                    'X-Sabre-Version: ' . DAV\Version::VERSION,
-                ),
-           )
-        ), $handler->getSentEmails());
-
-
-    }
-
-    function testUseRelativePrincipalNoFallback() {
-
-        $req = HTTP\Sapi::createFromServerArray(array(
-            'REQUEST_METHOD'  => 'POST',
-            'REQUEST_URI'     => '/calendars/user1/outbox',
-            'HTTP_ORIGINATOR' => '/principals/user1/',
-            'HTTP_RECIPIENT'  => 'mailto:user2 at example.org',
-            'HTTP_CONTENT_TYPE' => 'text/calendar',
-        ));
-
-        $body = array(
-            'BEGIN:VCALENDAR',
-            'METHOD:REQUEST',
-            'BEGIN:VEVENT',
-            'SUMMARY:An invitation',
-            'ORGANIZER:rrrrrr',
-            'END:VEVENT',
-            'END:VCALENDAR',
-        );
-
-        $req->setBody(implode("\r\n",$body));
-
-        $handler = new IMip\Mock('server at example.org');
-
-        $this->caldavSchedulePlugin->setIMIPhandler($handler);
-
-        $response = $this->request($req);
-        $this->assertEquals(403, $response->status, 'Full body: ' . $response->body);
-
-    }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list