aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-12-16 15:02:51 +0100
committerGitHub <noreply@github.com>2024-12-16 15:02:51 +0100
commitf9ee3505a073c84e86c3d76485096883e2fff7e6 (patch)
treedc836edaf4448ab645dc0e4324a18d2c6012135f /apps/dav/tests
parentb9da727b9ba8770881e4d441733806daaac5cd09 (diff)
parentfddbc54003996c59302ed459c361118e99a52b6f (diff)
downloadnextcloud-server-f9ee3505a073c84e86c3d76485096883e2fff7e6.tar.gz
nextcloud-server-f9ee3505a073c84e86c3d76485096883e2fff7e6.zip
Merge pull request #49731 from nextcloud/bugfix/noid/allow-to-get-permissions-of-a-principal
fix(calendar): Fix getting the permissions of the user
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarImplTest.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/apps/dav/tests/unit/CalDAV/CalendarImplTest.php b/apps/dav/tests/unit/CalDAV/CalendarImplTest.php
index a0b2965f223..ee9b85fafe8 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarImplTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarImplTest.php
@@ -40,7 +40,8 @@ class CalendarImplTest extends \Test\TestCase {
'id' => 'fancy_id_123',
'{DAV:}displayname' => 'user readable name 123',
'{http://apple.com/ns/ical/}calendar-color' => '#AABBCC',
- 'uri' => '/this/is/a/uri'
+ 'uri' => '/this/is/a/uri',
+ 'principaluri' => 'principal/users/foobar'
];
$this->backend = $this->createMock(CalDavBackend::class);
@@ -76,7 +77,10 @@ class CalendarImplTest extends \Test\TestCase {
->method('getACL')
->with()
->willReturn([
- ['privilege' => '{DAV:}read']
+ ['privilege' => '{DAV:}read', 'principal' => 'principal/users/foobar'],
+ ['privilege' => '{DAV:}read', 'principal' => 'principal/users/other'],
+ ['privilege' => '{DAV:}write', 'principal' => 'principal/users/other'],
+ ['privilege' => '{DAV:}all', 'principal' => 'principal/users/other'],
]);
$this->assertEquals(1, $this->calendarImpl->getPermissions());
@@ -87,7 +91,9 @@ class CalendarImplTest extends \Test\TestCase {
->method('getACL')
->with()
->willReturn([
- ['privilege' => '{DAV:}write']
+ ['privilege' => '{DAV:}write', 'principal' => 'principal/users/foobar'],
+ ['privilege' => '{DAV:}read', 'principal' => 'principal/users/other'],
+ ['privilege' => '{DAV:}all', 'principal' => 'principal/users/other'],
]);
$this->assertEquals(6, $this->calendarImpl->getPermissions());
@@ -98,8 +104,9 @@ class CalendarImplTest extends \Test\TestCase {
->method('getACL')
->with()
->willReturn([
- ['privilege' => '{DAV:}read'],
- ['privilege' => '{DAV:}write']
+ ['privilege' => '{DAV:}write', 'principal' => 'principal/users/foobar'],
+ ['privilege' => '{DAV:}read', 'principal' => 'principal/users/foobar'],
+ ['privilege' => '{DAV:}all', 'principal' => 'principal/users/other'],
]);
$this->assertEquals(7, $this->calendarImpl->getPermissions());
@@ -110,7 +117,7 @@ class CalendarImplTest extends \Test\TestCase {
->method('getACL')
->with()
->willReturn([
- ['privilege' => '{DAV:}all']
+ ['privilege' => '{DAV:}all', 'principal' => 'principal/users/foobar'],
]);
$this->assertEquals(31, $this->calendarImpl->getPermissions());