3 class Sabre_CalDAV_Principal_ProxyReadTest extends PHPUnit_Framework_TestCase {
7 function getInstance() {
9 $backend = new Sabre_DAVACL_MockPrincipalBackend();
10 $principal = new Sabre_CalDAV_Principal_ProxyRead($backend, array(
11 'uri' => 'principal/user',
13 $this->backend = $backend;
18 function testGetName() {
20 $i = $this->getInstance();
21 $this->assertEquals('calendar-proxy-read', $i->getName());
24 function testGetDisplayName() {
26 $i = $this->getInstance();
27 $this->assertEquals('calendar-proxy-read', $i->getDisplayName());
31 function testGetLastModified() {
33 $i = $this->getInstance();
34 $this->assertNull($i->getLastModified());
39 * @expectedException Sabre_DAV_Exception_Forbidden
41 function testDelete() {
43 $i = $this->getInstance();
49 * @expectedException Sabre_DAV_Exception_Forbidden
51 function testSetName() {
53 $i = $this->getInstance();
58 function testGetAlternateUriSet() {
60 $i = $this->getInstance();
61 $this->assertEquals(array(), $i->getAlternateUriSet());
65 function testGetPrincipalUri() {
67 $i = $this->getInstance();
68 $this->assertEquals('principal/user/calendar-proxy-read', $i->getPrincipalUrl());
72 function testGetGroupMemberSet() {
74 $i = $this->getInstance();
75 $this->assertEquals(array(), $i->getGroupMemberSet());
79 function testGetGroupMembership() {
81 $i = $this->getInstance();
82 $this->assertEquals(array(), $i->getGroupMembership());
86 function testSetGroupMemberSet() {
88 $i = $this->getInstance();
89 $i->setGroupMemberSet(array('principals/foo'));
92 $i->getPrincipalUrl() => array('principals/foo')
95 $this->assertEquals($expected, $this->backend->groupMembers);