Add a unit test for the broken case
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
ba30fa0e10
commit
67da65f83b
|
@ -55,6 +55,7 @@ abstract class AbstractCalDavBackendTest extends TestCase {
|
||||||
const UNIT_TEST_USER = 'principals/users/caldav-unit-test';
|
const UNIT_TEST_USER = 'principals/users/caldav-unit-test';
|
||||||
const UNIT_TEST_USER1 = 'principals/users/caldav-unit-test1';
|
const UNIT_TEST_USER1 = 'principals/users/caldav-unit-test1';
|
||||||
const UNIT_TEST_GROUP = 'principals/groups/caldav-unit-test-group';
|
const UNIT_TEST_GROUP = 'principals/groups/caldav-unit-test-group';
|
||||||
|
const UNIT_TEST_GROUP2 = 'principals/groups/caldav-unit-test-group2';
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
@ -71,7 +72,7 @@ abstract class AbstractCalDavBackendTest extends TestCase {
|
||||||
]);
|
]);
|
||||||
$this->principal->expects($this->any())->method('getGroupMembership')
|
$this->principal->expects($this->any())->method('getGroupMembership')
|
||||||
->withAnyParameters()
|
->withAnyParameters()
|
||||||
->willReturn([self::UNIT_TEST_GROUP]);
|
->willReturn([self::UNIT_TEST_GROUP, self::UNIT_TEST_GROUP2]);
|
||||||
|
|
||||||
$db = \OC::$server->getDatabaseConnection();
|
$db = \OC::$server->getDatabaseConnection();
|
||||||
$this->random = \OC::$server->getSecureRandom();
|
$this->random = \OC::$server->getSecureRandom();
|
||||||
|
|
|
@ -83,6 +83,26 @@ class CalDavBackendTest extends AbstractCalDavBackendTest {
|
||||||
'readOnly' => true
|
'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, [
|
[true, false, false, false, [
|
||||||
[
|
[
|
||||||
'href' => 'principal:' . self::UNIT_TEST_USER1,
|
'href' => 'principal:' . self::UNIT_TEST_USER1,
|
||||||
|
|
Loading…
Reference in New Issue