[Pkg-owncloud-commits] [php-sabredav] 114/220: iCal is now working. + fixed tests.

David Prévot taffit at moszumanska.debian.org
Thu May 12 01:21:14 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 681ceb4d78e1299e238542897d31a5eb8e8dc16e
Author: Evert Pot <me at evertpot.com>
Date:   Wed Mar 30 01:04:26 2016 -0400

    iCal is now working. + fixed tests.
---
 lib/CalDAV/Backend/PDO.php                    | 4 ++--
 tests/Sabre/DAV/Mock/SharedNode.php           | 6 ++++++
 tests/Sabre/DAV/Sharing/ShareResourceTest.php | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php
index 933e235..cd38e87 100644
--- a/lib/CalDAV/Backend/PDO.php
+++ b/lib/CalDAV/Backend/PDO.php
@@ -1400,7 +1400,7 @@ INSERT INTO ' . $this->calendarInstancesTableName . '
                     $updateStmt->execute([
                         $sharee->access,
                         isset($sharee->properties['{DAV:}displayname']) ? $sharee->properties['{DAV:}displayname'] : null,
-                        $sharee->inviteStatus ? : $oldSharee->inviteStatus,
+                        $sharee->inviteStatus ?: $oldSharee->inviteStatus,
                         $calendarId,
                         $sharee->href
                     ]);
@@ -1416,7 +1416,7 @@ INSERT INTO ' . $this->calendarInstancesTableName . '
                 \Sabre\DAV\UUIDUtil::getUUID(),
                 $sharee->href,
                 isset($sharee->properties['{DAV:}displayname']) ? $sharee->properties['{DAV:}displayname'] : null,
-                $sharee->inviteStatus ? : \Sabre\DAV\Sharing\Plugin::INVITE_NORESPONSE,
+                $sharee->inviteStatus ?: \Sabre\DAV\Sharing\Plugin::INVITE_NORESPONSE,
                 $instanceId
             ]);
 
diff --git a/tests/Sabre/DAV/Mock/SharedNode.php b/tests/Sabre/DAV/Mock/SharedNode.php
index bc28061..503d640 100644
--- a/tests/Sabre/DAV/Mock/SharedNode.php
+++ b/tests/Sabre/DAV/Mock/SharedNode.php
@@ -81,12 +81,18 @@ class SharedNode extends \Sabre\DAV\Node implements ISharedNode {
                 foreach ($this->invites as $k => $invitee) {
 
                     if ($invitee->href = $sharee->href) {
+                        if (!$sharee->inviteStatus) {
+                            $sharee->inviteStatus = $invitee->inviteStatus;
+                        }
                         // Overwriting an existing invitee
                         $this->invites[$k] = $sharee;
                         continue 2;
                     }
 
                 }
+                if (!$sharee->inviteStatus) {
+                    $sharee->inviteStatus = \Sabre\DAV\Sharing\Plugin::INVITE_NORESPONSE;
+                }
                 // Adding a new invitee
                 $this->invites[] = $sharee;
             }
diff --git a/tests/Sabre/DAV/Sharing/ShareResourceTest.php b/tests/Sabre/DAV/Sharing/ShareResourceTest.php
index efac845..122ccfa 100644
--- a/tests/Sabre/DAV/Sharing/ShareResourceTest.php
+++ b/tests/Sabre/DAV/Sharing/ShareResourceTest.php
@@ -50,7 +50,7 @@ XML;
                 ],
                 'access'       => Plugin::ACCESS_READWRITE,
                 'comment'      => 'Shared workspace',
-                'inviteStatus' => Plugin::INVITE_NORESPONSE,
+                'inviteStatus' => \Sabre\DAV\Sharing\Plugin::INVITE_NORESPONSE,
             ])
         ];
 

-- 
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