[Pkg-owncloud-commits] [php-sabredav] 40/220: Merge branch 'master' into sharing-take-2

David Prévot taffit at moszumanska.debian.org
Thu May 12 01:21:05 UTC 2016


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

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

commit e4d74b61baf135b1ff2d76f8347de8185a007129
Merge: 855c6f6 bf5363a
Author: Evert Pot <me at evertpot.com>
Date:   Mon Jan 11 18:50:01 2016 -0500

    Merge branch 'master' into sharing-take-2

 .gitignore                                         |   3 +
 CHANGELOG.md                                       |  57 ++++-
 LICENSE                                            |   2 +-
 bin/build.php                                      |  18 +-
 bin/migrateto17.php                                |  52 ++--
 bin/migrateto20.php                                |  40 +--
 bin/migrateto21.php                                |  16 +-
 bin/migrateto30.php                                |  18 +-
 bin/sabredav.php                                   |  10 +-
 composer.json                                      |  10 +-
 examples/webserver/apache2_vhost.conf              |   4 -
 lib/CalDAV/Backend/AbstractBackend.php             |   2 +-
 lib/CalDAV/Backend/BackendInterface.php            |   2 +-
 lib/CalDAV/Backend/NotificationSupport.php         |   2 +-
 lib/CalDAV/Backend/PDO.php                         |   2 +-
 lib/CalDAV/Backend/SchedulingSupport.php           |   2 +-
 lib/CalDAV/Backend/SharingSupport.php              |   2 +-
 lib/CalDAV/Backend/SubscriptionSupport.php         |   2 +-
 lib/CalDAV/Backend/SyncSupport.php                 |   2 +-
 lib/CalDAV/Calendar.php                            |   2 +-
 lib/CalDAV/CalendarHome.php                        |   2 +-
 lib/CalDAV/CalendarObject.php                      |   2 +-
 lib/CalDAV/CalendarQueryValidator.php              |   2 +-
 lib/CalDAV/CalendarRoot.php                        |   2 +-
 lib/CalDAV/Exception/InvalidComponentType.php      |   2 +-
 lib/CalDAV/ICSExportPlugin.php                     |   4 +-
 lib/CalDAV/ICalendar.php                           |   2 +-
 lib/CalDAV/ICalendarObject.php                     |   2 +-
 lib/CalDAV/ICalendarObjectContainer.php            |   2 +-
 lib/CalDAV/ISharedCalendar.php                     |   2 +-
 lib/CalDAV/Notifications/Collection.php            |   2 +-
 lib/CalDAV/Notifications/ICollection.php           |   2 +-
 lib/CalDAV/Notifications/INode.php                 |   2 +-
 lib/CalDAV/Notifications/Node.php                  |   2 +-
 lib/CalDAV/Notifications/Plugin.php                |   2 +-
 lib/CalDAV/Plugin.php                              |  29 ++-
 lib/CalDAV/Principal/Collection.php                |   2 +-
 lib/CalDAV/Principal/IProxyRead.php                |   2 +-
 lib/CalDAV/Principal/IProxyWrite.php               |   2 +-
 lib/CalDAV/Principal/ProxyRead.php                 |   2 +-
 lib/CalDAV/Principal/ProxyWrite.php                |   2 +-
 lib/CalDAV/Principal/User.php                      |   2 +-
 lib/CalDAV/Schedule/IInbox.php                     |   2 +-
 lib/CalDAV/Schedule/IMipPlugin.php                 |   2 +-
 lib/CalDAV/Schedule/IOutbox.php                    |   2 +-
 lib/CalDAV/Schedule/ISchedulingObject.php          |   2 +-
 lib/CalDAV/Schedule/Inbox.php                      |   2 +-
 lib/CalDAV/Schedule/Outbox.php                     |   2 +-
 lib/CalDAV/Schedule/Plugin.php                     |  12 +-
 lib/CalDAV/Schedule/SchedulingObject.php           |   2 +-
 lib/CalDAV/SharedCalendar.php                      |   2 +-
 lib/CalDAV/SharingPlugin.php                       |   2 +-
 lib/CalDAV/Subscriptions/ISubscription.php         |   2 +-
 lib/CalDAV/Subscriptions/Plugin.php                |   2 +-
 lib/CalDAV/Subscriptions/Subscription.php          |   2 +-
 lib/CalDAV/Xml/Filter/CalendarData.php             |   2 +-
 lib/CalDAV/Xml/Filter/CompFilter.php               |   2 +-
 lib/CalDAV/Xml/Filter/ParamFilter.php              |   2 +-
 lib/CalDAV/Xml/Filter/PropFilter.php               |   2 +-
 lib/CalDAV/Xml/Notification/Invite.php             |   2 +-
 lib/CalDAV/Xml/Notification/InviteReply.php        |   2 +-
 .../Xml/Notification/NotificationInterface.php     |   2 +-
 lib/CalDAV/Xml/Notification/SystemStatus.php       |   2 +-
 lib/CalDAV/Xml/Property/AllowedSharingModes.php    |   2 +-
 lib/CalDAV/Xml/Property/EmailAddressSet.php        |   2 +-
 lib/CalDAV/Xml/Property/Invite.php                 |   2 +-
 lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php |   2 +-
 .../Xml/Property/SupportedCalendarComponentSet.php |   2 +-
 lib/CalDAV/Xml/Property/SupportedCalendarData.php  |   2 +-
 lib/CalDAV/Xml/Property/SupportedCollationSet.php  |   2 +-
 lib/CalDAV/Xml/Request/CalendarMultiGetReport.php  |   2 +-
 lib/CalDAV/Xml/Request/CalendarQueryReport.php     |   2 +-
 lib/CalDAV/Xml/Request/FreeBusyQueryReport.php     |   2 +-
 lib/CalDAV/Xml/Request/InviteReply.php             |   2 +-
 lib/CalDAV/Xml/Request/MkCalendar.php              |   2 +-
 lib/CalDAV/Xml/Request/Share.php                   |   2 +-
 lib/CardDAV/AddressBook.php                        |   2 +-
 lib/CardDAV/AddressBookHome.php                    |   2 +-
 lib/CardDAV/AddressBookRoot.php                    |   2 +-
 lib/CardDAV/Backend/AbstractBackend.php            |   2 +-
 lib/CardDAV/Backend/BackendInterface.php           |   2 +-
 lib/CardDAV/Backend/PDO.php                        |   4 +-
 lib/CardDAV/Backend/SyncSupport.php                |   2 +-
 lib/CardDAV/Card.php                               |   2 +-
 lib/CardDAV/IAddressBook.php                       |   2 +-
 lib/CardDAV/ICard.php                              |   2 +-
 lib/CardDAV/IDirectory.php                         |   2 +-
 lib/CardDAV/Plugin.php                             |   5 +-
 lib/CardDAV/VCFExportPlugin.php                    |   2 +-
 lib/CardDAV/Xml/Filter/AddressData.php             |   2 +-
 lib/CardDAV/Xml/Filter/ParamFilter.php             |   2 +-
 lib/CardDAV/Xml/Filter/PropFilter.php              |   2 +-
 lib/CardDAV/Xml/Property/SupportedAddressData.php  |   2 +-
 lib/CardDAV/Xml/Property/SupportedCollationSet.php |   2 +-
 .../Xml/Request/AddressBookMultiGetReport.php      |   2 +-
 lib/CardDAV/Xml/Request/AddressBookQueryReport.php |   2 +-
 lib/DAV/Auth/Backend/AbstractBasic.php             |   4 +-
 .../{AbstractBasic.php => AbstractBearer.php}      |  50 ++--
 lib/DAV/Auth/Backend/AbstractDigest.php            |   2 +-
 lib/DAV/Auth/Backend/Apache.php                    |   2 +-
 lib/DAV/Auth/Backend/BackendInterface.php          |   2 +-
 lib/DAV/Auth/Backend/BasicCallBack.php             |   2 +-
 lib/DAV/Auth/Backend/File.php                      |   2 +-
 lib/DAV/Auth/Backend/PDO.php                       |   2 +-
 lib/DAV/Auth/Plugin.php                            |   2 +-
 lib/DAV/Browser/GuessContentType.php               |   2 +-
 lib/DAV/Browser/HtmlOutput.php                     |   2 +-
 lib/DAV/Browser/HtmlOutputHelper.php               |   2 +-
 lib/DAV/Browser/MapGetToPropFind.php               |   2 +-
 lib/DAV/Browser/Plugin.php                         |   4 +-
 lib/DAV/Browser/PropFindAll.php                    |   2 +-
 lib/DAV/Client.php                                 |  39 ++-
 lib/DAV/Collection.php                             |   2 +-
 lib/DAV/CorePlugin.php                             |   8 +-
 lib/DAV/Exception.php                              |   2 +-
 lib/DAV/Exception/BadRequest.php                   |   2 +-
 lib/DAV/Exception/Conflict.php                     |   2 +-
 lib/DAV/Exception/ConflictingLock.php              |   2 +-
 lib/DAV/Exception/Forbidden.php                    |   2 +-
 lib/DAV/Exception/InsufficientStorage.php          |   2 +-
 lib/DAV/Exception/InvalidResourceType.php          |   2 +-
 lib/DAV/Exception/InvalidSyncToken.php             |   2 +-
 lib/DAV/Exception/LengthRequired.php               |   2 +-
 lib/DAV/Exception/LockTokenMatchesRequestUri.php   |   2 +-
 lib/DAV/Exception/Locked.php                       |   2 +-
 lib/DAV/Exception/MethodNotAllowed.php             |   2 +-
 lib/DAV/Exception/NotAuthenticated.php             |   2 +-
 lib/DAV/Exception/NotFound.php                     |   2 +-
 lib/DAV/Exception/NotImplemented.php               |   2 +-
 lib/DAV/Exception/PaymentRequired.php              |   2 +-
 lib/DAV/Exception/PreconditionFailed.php           |   2 +-
 lib/DAV/Exception/ReportNotSupported.php           |   2 +-
 lib/DAV/Exception/RequestedRangeNotSatisfiable.php |   2 +-
 lib/DAV/Exception/ServiceUnavailable.php           |   2 +-
 lib/DAV/Exception/TooManyMatches.php               |   2 +-
 lib/DAV/Exception/UnsupportedMediaType.php         |   2 +-
 lib/DAV/FS/Directory.php                           |   2 +-
 lib/DAV/FS/File.php                                |   2 +-
 lib/DAV/FS/Node.php                                |   2 +-
 lib/DAV/FSExt/Directory.php                        |   2 +-
 lib/DAV/FSExt/File.php                             |   2 +-
 lib/DAV/File.php                                   |   2 +-
 lib/DAV/ICollection.php                            |   2 +-
 lib/DAV/IExtendedCollection.php                    |   2 +-
 lib/DAV/IFile.php                                  |   2 +-
 lib/DAV/IMoveTarget.php                            |   2 +-
 lib/DAV/IMultiGet.php                              |   2 +-
 lib/DAV/INode.php                                  |   2 +-
 lib/DAV/IProperties.php                            |   2 +-
 lib/DAV/IQuota.php                                 |   2 +-
 lib/DAV/Locks/Backend/AbstractBackend.php          |   2 +-
 lib/DAV/Locks/Backend/BackendInterface.php         |   2 +-
 lib/DAV/Locks/Backend/File.php                     |   2 +-
 lib/DAV/Locks/Backend/PDO.php                      |   2 +-
 lib/DAV/Locks/LockInfo.php                         |   2 +-
 lib/DAV/Locks/Plugin.php                           |   2 +-
 lib/DAV/MkCol.php                                  |   2 +-
 lib/DAV/Mount/Plugin.php                           |   2 +-
 lib/DAV/Node.php                                   |   2 +-
 lib/DAV/PartialUpdate/IPatchSupport.php            |   2 +-
 lib/DAV/PartialUpdate/Plugin.php                   |   2 +-
 lib/DAV/PropPatch.php                              |   2 +-
 .../PropertyStorage/Backend/BackendInterface.php   |   2 +-
 lib/DAV/PropertyStorage/Backend/PDO.php            |   2 +-
 lib/DAV/PropertyStorage/Plugin.php                 |   2 +-
 lib/DAV/Server.php                                 |   5 +-
 lib/DAV/ServerPlugin.php                           |   2 +-
 lib/DAV/SimpleCollection.php                       |   2 +-
 lib/DAV/SimpleFile.php                             |   2 +-
 lib/DAV/StringUtil.php                             |   2 +-
 lib/DAV/Sync/ISyncCollection.php                   |   2 +-
 lib/DAV/Sync/Plugin.php                            |   2 +-
 lib/DAV/TemporaryFileFilterPlugin.php              |   7 +-
 lib/DAV/Tree.php                                   |   2 +-
 lib/DAV/UUIDUtil.php                               |   2 +-
 lib/DAV/Version.php                                |   4 +-
 lib/DAV/Xml/Element/Prop.php                       |   2 +-
 lib/DAV/Xml/Element/Response.php                   |   4 +-
 lib/DAV/Xml/Property/Complex.php                   |   2 +-
 lib/DAV/Xml/Property/GetLastModified.php           |   2 +-
 lib/DAV/Xml/Property/Href.php                      |   2 +-
 lib/DAV/Xml/Property/LockDiscovery.php             |   2 +-
 lib/DAV/Xml/Property/ResourceType.php              |   2 +-
 lib/DAV/Xml/Property/SupportedLock.php             |   2 +-
 lib/DAV/Xml/Property/SupportedMethodSet.php        |   2 +-
 lib/DAV/Xml/Property/SupportedReportSet.php        |   2 +-
 lib/DAV/Xml/Request/Lock.php                       |   2 +-
 lib/DAV/Xml/Request/MkCol.php                      |   2 +-
 lib/DAV/Xml/Request/PropFind.php                   |   2 +-
 lib/DAV/Xml/Request/PropPatch.php                  |   2 +-
 lib/DAV/Xml/Request/SyncCollectionReport.php       |   2 +-
 lib/DAV/Xml/Response/MultiStatus.php               |   2 +-
 lib/DAV/Xml/Service.php                            |   2 +-
 lib/DAVACL/AbstractPrincipalCollection.php         |   2 +-
 lib/DAVACL/Exception/AceConflict.php               |   2 +-
 lib/DAVACL/Exception/NeedPrivileges.php            |   2 +-
 lib/DAVACL/Exception/NoAbstract.php                |   2 +-
 lib/DAVACL/Exception/NotRecognizedPrincipal.php    |   2 +-
 lib/DAVACL/Exception/NotSupportedPrivilege.php     |   2 +-
 lib/DAVACL/FS/Collection.php                       |   2 +-
 lib/DAVACL/FS/File.php                             |   2 +-
 lib/DAVACL/FS/HomeCollection.php                   |   2 +-
 lib/DAVACL/IACL.php                                |   2 +-
 lib/DAVACL/IPrincipal.php                          |   2 +-
 lib/DAVACL/IPrincipalCollection.php                |   2 +-
 lib/DAVACL/Plugin.php                              |   5 +-
 lib/DAVACL/Principal.php                           |   2 +-
 lib/DAVACL/PrincipalBackend/AbstractBackend.php    |   2 +-
 lib/DAVACL/PrincipalBackend/BackendInterface.php   |   2 +-
 .../PrincipalBackend/CreatePrincipalSupport.php    |   2 +-
 lib/DAVACL/PrincipalBackend/PDO.php                |  63 ++++-
 lib/DAVACL/PrincipalCollection.php                 |   2 +-
 lib/DAVACL/Xml/Property/Acl.php                    |   2 +-
 lib/DAVACL/Xml/Property/AclRestrictions.php        |   2 +-
 .../Xml/Property/CurrentUserPrivilegeSet.php       |   2 +-
 lib/DAVACL/Xml/Property/Principal.php              |   2 +-
 lib/DAVACL/Xml/Property/SupportedPrivilegeSet.php  |   4 +-
 lib/DAVACL/Xml/Request/ExpandPropertyReport.php    |   2 +-
 .../Xml/Request/PrincipalPropertySearchReport.php  |   2 +-
 .../Request/PrincipalSearchPropertySetReport.php   |   2 +-
 tests/Sabre/CalDAV/Backend/AbstractPDOTest.php     |   2 +
 tests/Sabre/CalDAV/Backend/AbstractTest.php        | 128 +++++-----
 tests/Sabre/CalDAV/Backend/MockScheduling.php      |  16 +-
 .../CalDAV/Backend/MockSubscriptionSupport.php     |  21 +-
 tests/Sabre/CalDAV/Backend/PDOMySQLTest.php        |   4 +-
 tests/Sabre/CalDAV/Backend/PDOSqliteTest.php       |   6 +-
 .../CalDAV/ExpandEventsDTSTARTandDTENDTest.php     |   2 +-
 .../ExpandEventsDTSTARTandDTENDbyDayTest.php       |   2 +-
 .../Sabre/CalDAV/ExpandEventsDoubleEventsTest.php  |   2 +-
 .../Sabre/CalDAV/ExpandEventsFloatingTimeTest.php  |   8 +-
 tests/Sabre/CalDAV/GetEventsByTimerangeTest.php    |   2 +-
 tests/Sabre/CalDAV/ICSExportPluginTest.php         |   3 +
 tests/Sabre/CalDAV/Issue203Test.php                |   2 +-
 tests/Sabre/CalDAV/Issue205Test.php                |   2 +-
 tests/Sabre/CalDAV/Issue211Test.php                |   2 +-
 tests/Sabre/CalDAV/Issue220Test.php                |   2 +-
 tests/Sabre/CalDAV/Issue228Test.php                |   2 +-
 tests/Sabre/CalDAV/PluginTest.php                  |   8 +-
 tests/Sabre/CalDAV/Schedule/IMip/MockPlugin.php    |   2 +-
 .../Sabre/CalDAV/Schedule/PluginPropertiesTest.php |  46 ++++
 tests/Sabre/CardDAV/AddressBookTest.php            |   5 +-
 tests/Sabre/CardDAV/Backend/AbstractPDOTest.php    |   2 +-
 tests/Sabre/CardDAV/Backend/PDOSqliteTest.php      |   9 +
 tests/Sabre/CardDAV/PluginTest.php                 |   2 +-
 tests/Sabre/CardDAV/TestUtil.php                   |  18 +-
 tests/Sabre/CardDAV/VCFExportTest.php              |  21 +-
 tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php |   2 -
 ...bstractBasicTest.php => AbstractBearerTest.php} |  31 ++-
 .../Sabre/DAV/Auth/Backend/AbstractDigestTest.php  |   5 -
 tests/Sabre/DAV/Auth/Backend/FileTest.php          |   2 +-
 tests/Sabre/DAV/Auth/Backend/PDOMySQLTest.php      |  18 +-
 tests/Sabre/DAV/Auth/PluginTest.php                |   2 +-
 tests/Sabre/DAV/ClientTest.php                     | 130 ++++++----
 tests/Sabre/DAV/CopyTest.php                       |  37 ---
 tests/Sabre/DAV/CorePluginTest.php                 |  16 ++
 tests/Sabre/DAV/FSExt/ServerTest.php               |   4 +-
 tests/Sabre/DAV/HttpCopyTest.php                   | 199 +++++++++++++++
 tests/Sabre/DAV/HttpDeleteTest.php                 |   2 +-
 tests/Sabre/DAV/HttpGetTest.php                    |   2 +-
 tests/Sabre/DAV/HttpHeadTest.php                   |   2 +-
 tests/Sabre/DAV/HttpMoveTest.php                   |  18 +-
 tests/Sabre/DAV/HttpPutTest.php                    |   2 +-
 tests/Sabre/DAV/Locks/Backend/Mock.php             |   2 +-
 tests/Sabre/DAV/Locks/MSWordTest.php               |  12 +-
 tests/Sabre/DAV/Mock/Collection.php                |  11 +-
 tests/Sabre/DAV/Mock/File.php                      |  23 +-
 tests/Sabre/DAV/Mock/PropertiesCollection.php      |   2 +-
 tests/Sabre/DAV/Mock/StreamingFile.php             |  18 +-
 tests/Sabre/DAV/PartialUpdate/PluginTest.php       |  30 +--
 tests/Sabre/DAV/PropPatchTest.php                  |   9 +-
 tests/Sabre/DAV/ServerCopyMoveTest.php             | 209 ---------------
 tests/Sabre/DAV/ServerEventsTest.php               |  51 ++--
 tests/Sabre/DAV/ServerPreconditionTest.php         |   2 -
 tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php   |   4 -
 tests/Sabre/DAV/ServerPropsTest.php                |  81 +++---
 tests/Sabre/DAV/ServerRangeTest.php                | 280 ++++++++++-----------
 tests/Sabre/DAV/ServerSimpleTest.php               |  67 +++--
 tests/Sabre/DAV/ServerUpdatePropertiesTest.php     |  24 --
 tests/Sabre/DAV/SimpleFileTest.php                 |   2 +-
 tests/Sabre/DAV/Sync/MockSyncCollection.php        |   2 +-
 tests/Sabre/DAV/Xml/Element/ResponseTest.php       |   2 +-
 tests/Sabre/DAV/Xml/Request/SyncCollectionTest.php |   8 +-
 tests/Sabre/DAVACL/PluginAdminTest.php             |  43 ++--
 tests/Sabre/DAVACL/PluginPropertiesTest.php        |  12 +-
 .../DAVACL/PrincipalBackend/AbstractPDOTest.php    |  20 ++
 .../Sabre/DAVACL/PrincipalBackend/PDOMySQLTest.php |  33 +--
 .../DAVACL/PrincipalBackend/PDOSqliteTest.php      |  15 +-
 tests/Sabre/DAVACL/PrincipalPropertySearchTest.php |   2 +-
 .../DAVACL/PrincipalSearchPropertySetTest.php      |   2 +-
 tests/Sabre/DAVACL/SimplePluginTest.php            |   8 +-
 tests/Sabre/DAVServerTest.php                      |   4 +-
 tests/Sabre/HTTP/ResponseMock.php                  |   2 +-
 tests/Sabre/HTTP/SapiMock.php                      |   2 +-
 tests/bootstrap.php                                |   7 +
 294 files changed, 1454 insertions(+), 1191 deletions(-)

diff --cc lib/CalDAV/Backend/SharingSupport.php
index 5d2adde,6a11b0a..84f1070
--- a/lib/CalDAV/Backend/SharingSupport.php
+++ b/lib/CalDAV/Backend/SharingSupport.php
@@@ -94,22 -153,19 +94,22 @@@ namespace Sabre\CalDAV\Backend
   * will actually publish it.
   *
   *
 - * Selectively disabling publish or share feature
 - * ==============================================
 + * Integration with notifications
 + * ==============================
 + *
 + * If the SharingSupport interface is implemented, it's possible to allow
 + * people to immediately share calendars with other users.
   *
 - * If Sabre\CalDAV\Property\AllowedSharingModes is returned from
 - * getCalendarsForUser, this allows the server to specify whether either sharing,
 - * or publishing is supported.
 + * However, in some cases it may be desired to let the invitee first know
 + * that someone is trying to share something with them, and allow them to
 + * accept or reject the share.
   *
 - * This allows a client to determine in advance which features are available,
 - * and update the interface appropriately. If this property is not returned by
 - * the backend, the SharingPlugin automatically injects it and assumes both
 - * features are available.
 + * If this behavior is desired, it's also required to implement the
 + * NotificationSupport interface. Implementing that interface will allow
 + * supporting clients to display invitations and let users accept or reject
 + * them straight from within their calendaring application.
   *
-  * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
+  * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
   * @author Evert Pot (http://evertpot.com/)
   * @license http://sabre.io/license/ Modified BSD License
   */
diff --cc tests/Sabre/CalDAV/ICSExportPluginTest.php
index b48c58f,c123bd0..5f2bcd3
--- a/tests/Sabre/CalDAV/ICSExportPluginTest.php
+++ b/tests/Sabre/CalDAV/ICSExportPluginTest.php
@@@ -18,106 -14,116 +18,109 @@@ class ICSExportPluginTest extends \Sabr
  
      function setUp() {
  
 -        if (!SABRE_HASSQLITE) $this->markTestSkipped('SQLite driver is not available');
 +        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',
 +            ]
 +        );
  
 -    function testInit() {
 +        $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
 +        );
  
 -        $p = new ICSExportPlugin();
 -        $s = new DAV\Server();
 -        $s->addPlugin($p);
 -        $this->assertEquals($p, $s->getPlugin('ics-export'));
 -        $this->assertEquals('ics-export', $p->getPluginInfo()['name']);
++        $this->assertEquals($this->icsExportPlugin, $this->server->getPlugin('ics-export'));
++        $this->assertEquals('ics-export', $this->icsExportplugin->getPluginInfo()['name']);
+ 
      }
  
 -    function testBeforeMethod() {
 +    function testInit() {
  
 -        $cbackend = TestUtil::getBackend();
 -
 -        $props = [
 -            'uri'=>'UUID-123467',
 -            'principaluri' => 'admin',
 -            'id' => 1,
 -            '{DAV:}displayname' => 'Hello!',
 -            '{http://apple.com/ns/ical/}calendar-color' => '#AA0000FF',
 -        ];
 -        $tree = [
 -            new Calendar($cbackend,$props),
 -        ];
 -
 -        $p = new ICSExportPlugin();
 -
 -        $s = new DAV\Server($tree);
 -        $s->addPlugin($p);
 -        $s->addPlugin(new Plugin());
 -
 -        $h = HTTP\Sapi::createFromServerArray([
 -            'REQUEST_URI' => '/UUID-123467?export',
 -            'REQUEST_METHOD' => 'GET',
 -        ]);
 -
 -        $s->httpRequest = $h;
 -        $s->httpResponse = new HTTP\ResponseMock();
 -
 -        $this->assertFalse($p->httpGet($h, $s->httpResponse));
 -
 -        $this->assertEquals(200, $s->httpResponse->status);
 -        $this->assertEquals([
 -            'Content-Type' => ['text/calendar'],
 -        ], $s->httpResponse->getHeaders());
 -
 -        $obj = VObject\Reader::read($s->httpResponse->body);
 -
 -        $this->assertEquals(7,count($obj->children()));
 -        $this->assertEquals(1,count($obj->VERSION));
 -        $this->assertEquals(1,count($obj->CALSCALE));
 -        $this->assertEquals(1,count($obj->PRODID));
 -        $this->assertTrue(strpos((string)$obj->PRODID, DAV\Version::VERSION)!==false);
 -        $this->assertEquals(1,count($obj->VTIMEZONE));
 -        $this->assertEquals(1,count($obj->VEVENT));
 -        $this->assertEquals("Hello!", $obj->{"X-WR-CALNAME"});
 -        $this->assertEquals("#AA0000FF", $obj->{"X-APPLE-CALENDAR-COLOR"});
 +        $this->assertEquals(
 +            $this->icsExportPlugin,
 +            $this->server->getPlugin('ics-export')
 +        );
  
      }
 -    function testBeforeMethodNoVersion() {
  
 -        if (!SABRE_HASSQLITE) $this->markTestSkipped('SQLite driver is not available');
 -        $cbackend = TestUtil::getBackend();
 +    function testBeforeMethod() {
  
 -        $props = [
 -            'uri'=>'UUID-123467',
 -            'principaluri' => 'admin',
 -            'id' => 1,
 -        ];
 -        $tree = [
 -            new Calendar($cbackend,$props),
 -        ];
 +        $request = new HTTP\Request(
 +            'GET',
 +            '/calendars/admin/UUID-123467?export'
 +        );
  
 -        $p = new ICSExportPlugin();
 +        $response = $this->request($request);
  
 -        $s = new DAV\Server($tree);
 +        $this->assertEquals(200, $response->getStatus());
 +        $this->assertEquals('text/calendar', $response->getHeader('Content-Type'));
  
 -        $s->addPlugin($p);
 -        $s->addPlugin(new Plugin());
 +        $obj = VObject\Reader::read($response->body);
  
 -        $h = HTTP\Sapi::createFromServerArray([
 -            'REQUEST_URI' => '/UUID-123467?export',
 -            'REQUEST_METHOD' => 'GET',
 -        ]);
 +        $this->assertEquals(8, count($obj->children()));
 +        $this->assertEquals(1, count($obj->VERSION));
 +        $this->assertEquals(1, count($obj->CALSCALE));
 +        $this->assertEquals(1, count($obj->PRODID));
 +        $this->assertTrue(strpos((string)$obj->PRODID, DAV\Version::VERSION) !== false);
 +        $this->assertEquals(1, count($obj->VTIMEZONE));
 +        $this->assertEquals(1, count($obj->VEVENT));
 +        $this->assertEquals("Hello!", $obj->{"X-WR-CALNAME"});
 +        $this->assertEquals("#AA0000FF", $obj->{"X-APPLE-CALENDAR-COLOR"});
  
 -        $s->httpRequest = $h;
 -        $s->httpResponse = new HTTP\ResponseMock();
 +    }
 +    function testBeforeMethodNoVersion() {
  
 +        $request = new HTTP\Request(
 +            'GET',
 +            '/calendars/admin/UUID-123467?export'
 +        );
          DAV\Server::$exposeVersion = false;
 -        $this->assertFalse($p->httpGet($h, $s->httpResponse));
 +        $response = $this->request($request);
          DAV\Server::$exposeVersion = true;
  
 -        $this->assertEquals(200, $s->httpResponse->status);
 -        $this->assertEquals([
 -            'Content-Type' => ['text/calendar'],
 -        ], $s->httpResponse->getHeaders());
 +        $this->assertEquals(200, $response->getStatus());
 +        $this->assertEquals('text/calendar', $response->getHeader('Content-Type'));
  
 -        $obj = VObject\Reader::read($s->httpResponse->body);
 +        $obj = VObject\Reader::read($response->body);
  
 -        $this->assertEquals(5,count($obj->children()));
 -        $this->assertEquals(1,count($obj->VERSION));
 -        $this->assertEquals(1,count($obj->CALSCALE));
 -        $this->assertEquals(1,count($obj->PRODID));
 -        $this->assertFalse(strpos((string)$obj->PRODID, DAV\Version::VERSION)!==false);
 -        $this->assertEquals(1,count($obj->VTIMEZONE));
 -        $this->assertEquals(1,count($obj->VEVENT));
 +        $this->assertEquals(8, count($obj->children()));
 +        $this->assertEquals(1, count($obj->VERSION));
 +        $this->assertEquals(1, count($obj->CALSCALE));
 +        $this->assertEquals(1, count($obj->PRODID));
 +        $this->assertFalse(strpos((string)$obj->PRODID, DAV\Version::VERSION) !== false);
 +        $this->assertEquals(1, count($obj->VTIMEZONE));
 +        $this->assertEquals(1, count($obj->VEVENT));
  
      }
  

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



More information about the Pkg-owncloud-commits mailing list