]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add a unit test for the broken case
authorJoas Schilling <coding@schilljs.com>
Thu, 2 Mar 2017 11:27:59 +0000 (12:27 +0100)
committerJoas Schilling <coding@schilljs.com>
Thu, 2 Mar 2017 11:28:56 +0000 (12:28 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php
apps/dav/tests/unit/CalDAV/CalDavBackendTest.php

index d15be72c77be16e6938b273fffb2b5054f02f08b..ffdba9c5c8a812e2f88423d5cfb2d3676fb59bcf 100644 (file)
@@ -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();
index 60be690eb35ccbe7cbbf2309c90d36f30422d3c1..22ef232dac4714abaec7d5c8c776aed907d60529 100644 (file)
@@ -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,