diff --git a/build/integration/dav_features/caldav-delegation.feature b/build/integration/dav_features/caldav-delegation.feature index d4cc781f320..33cd928db7f 100644 --- a/build/integration/dav_features/caldav-delegation.feature +++ b/build/integration/dav_features/caldav-delegation.feature @@ -20,4 +20,11 @@ Feature: calendar delegation When "admin" updates property "{DAV:}group-member-set" to href "/remote.php/dav/principals/users/user0" of principal "users/admin/calendar-proxy-write" on the endpoint "/remote.php/dav/principals/" Then The CalDAV response should be multi status And The CalDAV response should contain an href "/remote.php/dav/principals/users/admin/calendar-proxy-write" - And The CalDAV response should contain a property "{DAV:}group-member-set" \ No newline at end of file + And The CalDAV response should contain a property "{DAV:}group-member-set" + + Scenario: Admin cannot grant User1 access to User0's calendar account + Given user "admin" exists + And user "user0" exists + And user "user1" exists + When "admin" updates property "{DAV:}group-member-set" to href "/remote.php/dav/principals/users/user1" of principal "users/user0/calendar-proxy-write" on the endpoint "/remote.php/dav/principals/" + Then The CalDAV HTTP status code should be "404" \ No newline at end of file diff --git a/build/integration/features/bootstrap/CalDavContext.php b/build/integration/features/bootstrap/CalDavContext.php index 22951b3e454..3d990400751 100644 --- a/build/integration/features/bootstrap/CalDavContext.php +++ b/build/integration/features/bootstrap/CalDavContext.php @@ -408,19 +408,23 @@ class CalDavContext implements \Behat\Behat\Context\Context { $xml = new \Sabre\Xml\Service(); $body = $xml->write('{DAV:}propertyupdate', $propPatch, '/'); - $this->response = $this->client->request( - 'PROPPATCH', - $davUrl, - [ - 'headers' => [ - 'Content-Type' => 'application/xml; charset=UTF-8', - ], - 'body' => $body, - 'auth' => [ - $user, - $password, - ], - ] - ); + try { + $this->response = $this->client->request( + 'PROPPATCH', + $davUrl, + [ + 'headers' => [ + 'Content-Type' => 'application/xml; charset=UTF-8', + ], + 'body' => $body, + 'auth' => [ + $user, + $password, + ], + ] + ); + } catch (\GuzzleHttp\Exception\ClientException $e) { + $this->response = $e->getResponse(); + } } }