mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
test(integration): write integration tests for calendar delegation
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
This commit is contained in:
parent
1b126eb400
commit
d9426a2b22
2 changed files with 26 additions and 15 deletions
|
|
@ -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"
|
||||
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"
|
||||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue