summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-03-02 12:27:59 +0100
committerJoas Schilling <coding@schilljs.com>2017-03-02 12:28:56 +0100
commitd8b769bd856cb9b57243ce38fb994e96463f239e (patch)
tree00f9c22d5b13e85e9a0827f24b7c2f889a72d5e4 /apps/dav/tests
parent2da490bf256382af599a67cbf7633c2137c49ed2 (diff)
downloadnextcloud-server-d8b769bd856cb9b57243ce38fb994e96463f239e.tar.gz
nextcloud-server-d8b769bd856cb9b57243ce38fb994e96463f239e.zip
Add a unit test for the broken case
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php3
-rw-r--r--apps/dav/tests/unit/CalDAV/CalDavBackendTest.php20
2 files changed, 22 insertions, 1 deletions
diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php
index d15be72c77b..ffdba9c5c8a 100644
--- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php
@@ -55,6 +55,7 @@ abstract class AbstractCalDavBackendTest extends TestCase {
const UNIT_TEST_USER = 'principals/users/caldav-unit-test';
const UNIT_TEST_USER1 = 'principals/users/caldav-unit-test1';
const UNIT_TEST_GROUP = 'principals/groups/caldav-unit-test-group';
+ const UNIT_TEST_GROUP2 = 'principals/groups/caldav-unit-test-group2';
public function setUp() {
parent::setUp();
@@ -71,7 +72,7 @@ abstract class AbstractCalDavBackendTest extends TestCase {
]);
$this->principal->expects($this->any())->method('getGroupMembership')
->withAnyParameters()
- ->willReturn([self::UNIT_TEST_GROUP]);
+ ->willReturn([self::UNIT_TEST_GROUP, self::UNIT_TEST_GROUP2]);
$db = \OC::$server->getDatabaseConnection();
$this->random = \OC::$server->getSecureRandom();
diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
index 60be690eb35..22ef232dac4 100644
--- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
@@ -83,6 +83,26 @@ class CalDavBackendTest extends AbstractCalDavBackendTest {
'readOnly' => true
]
]],
+ [true, true, true, false, [
+ [
+ 'href' => 'principal:' . self::UNIT_TEST_GROUP,
+ 'readOnly' => true,
+ ],
+ [
+ 'href' => 'principal:' . self::UNIT_TEST_GROUP2,
+ 'readOnly' => false,
+ ],
+ ]],
+ [true, true, true, true, [
+ [
+ 'href' => 'principal:' . self::UNIT_TEST_GROUP,
+ 'readOnly' => false,
+ ],
+ [
+ 'href' => 'principal:' . self::UNIT_TEST_GROUP2,
+ 'readOnly' => true,
+ ],
+ ]],
[true, false, false, false, [
[
'href' => 'principal:' . self::UNIT_TEST_USER1,