ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\Principal\UserTest Class Reference
+ Inheritance diagram for Sabre\CalDAV\Principal\UserTest:
+ Collaboration diagram for Sabre\CalDAV\Principal\UserTest:

Public Member Functions

 getInstance ()
 
 testCreateFile ()
 @expectedException Sabre\DAV\Exception\Forbidden More...
 
 testCreateDirectory ()
 @expectedException Sabre\DAV\Exception\Forbidden More...
 
 testGetChildProxyRead ()
 
 testGetChildProxyWrite ()
 
 testGetChildNotFound ()
 @expectedException Sabre\DAV\Exception\NotFound More...
 
 testGetChildNotFound2 ()
 @expectedException Sabre\DAV\Exception\NotFound More...
 
 testGetChildren ()
 
 testChildExist ()
 
 testGetACL ()
 

Detailed Description

Definition at line 7 of file UserTest.php.

Member Function Documentation

◆ getInstance()

Sabre\CalDAV\Principal\UserTest::getInstance ( )

Definition at line 9 of file UserTest.php.

9 {
10
11 $backend = new DAVACL\PrincipalBackend\Mock();
12 $backend->addPrincipal([
13 'uri' => 'principals/user/calendar-proxy-read',
14 ]);
15 $backend->addPrincipal([
16 'uri' => 'principals/user/calendar-proxy-write',
17 ]);
18 $backend->addPrincipal([
19 'uri' => 'principals/user/random',
20 ]);
21 return new User($backend, [
22 'uri' => 'principals/user',
23 ]);
24
25 }

Referenced by Sabre\CalDAV\Principal\UserTest\testChildExist(), Sabre\CalDAV\Principal\UserTest\testCreateDirectory(), Sabre\CalDAV\Principal\UserTest\testCreateFile(), Sabre\CalDAV\Principal\UserTest\testGetACL(), Sabre\CalDAV\Principal\UserTest\testGetChildNotFound(), Sabre\CalDAV\Principal\UserTest\testGetChildNotFound2(), Sabre\CalDAV\Principal\UserTest\testGetChildProxyRead(), Sabre\CalDAV\Principal\UserTest\testGetChildProxyWrite(), and Sabre\CalDAV\Principal\UserTest\testGetChildren().

+ Here is the caller graph for this function:

◆ testChildExist()

Sabre\CalDAV\Principal\UserTest::testChildExist ( )

Definition at line 93 of file UserTest.php.

93 {
94
95 $u = $this->getInstance();
96 $this->assertTrue($u->childExists('calendar-proxy-read'));
97 $this->assertTrue($u->childExists('calendar-proxy-write'));
98 $this->assertFalse($u->childExists('foo'));
99
100 }

References Sabre\CalDAV\Principal\UserTest\getInstance().

+ Here is the call graph for this function:

◆ testCreateDirectory()

Sabre\CalDAV\Principal\UserTest::testCreateDirectory ( )

@expectedException Sabre\DAV\Exception\Forbidden

Definition at line 40 of file UserTest.php.

40 {
41
42 $u = $this->getInstance();
43 $u->createDirectory('test');
44
45 }

References Sabre\CalDAV\Principal\UserTest\getInstance().

+ Here is the call graph for this function:

◆ testCreateFile()

Sabre\CalDAV\Principal\UserTest::testCreateFile ( )

@expectedException Sabre\DAV\Exception\Forbidden

Definition at line 30 of file UserTest.php.

30 {
31
32 $u = $this->getInstance();
33 $u->createFile('test');
34
35 }

References Sabre\CalDAV\Principal\UserTest\getInstance().

+ Here is the call graph for this function:

◆ testGetACL()

Sabre\CalDAV\Principal\UserTest::testGetACL ( )

Definition at line 102 of file UserTest.php.

102 {
103
104 $expected = [
105 [
106 'privilege' => '{DAV:}all',
107 'principal' => '{DAV:}owner',
108 'protected' => true,
109 ],
110 [
111 'privilege' => '{DAV:}read',
112 'principal' => 'principals/user/calendar-proxy-read',
113 'protected' => true,
114 ],
115 [
116 'privilege' => '{DAV:}read',
117 'principal' => 'principals/user/calendar-proxy-write',
118 'protected' => true,
119 ],
120 ];
121
122 $u = $this->getInstance();
123 $this->assertEquals($expected, $u->getACL());
124
125 }

References Sabre\CalDAV\Principal\UserTest\getInstance().

+ Here is the call graph for this function:

◆ testGetChildNotFound()

Sabre\CalDAV\Principal\UserTest::testGetChildNotFound ( )

@expectedException Sabre\DAV\Exception\NotFound

Definition at line 66 of file UserTest.php.

66 {
67
68 $u = $this->getInstance();
69 $child = $u->getChild('foo');
70
71 }

References Sabre\CalDAV\Principal\UserTest\getInstance().

+ Here is the call graph for this function:

◆ testGetChildNotFound2()

Sabre\CalDAV\Principal\UserTest::testGetChildNotFound2 ( )

@expectedException Sabre\DAV\Exception\NotFound

Definition at line 76 of file UserTest.php.

76 {
77
78 $u = $this->getInstance();
79 $child = $u->getChild('random');
80
81 }

References Sabre\CalDAV\Principal\UserTest\getInstance().

+ Here is the call graph for this function:

◆ testGetChildProxyRead()

Sabre\CalDAV\Principal\UserTest::testGetChildProxyRead ( )

Definition at line 47 of file UserTest.php.

47 {
48
49 $u = $this->getInstance();
50 $child = $u->getChild('calendar-proxy-read');
51 $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyRead', $child);
52
53 }

References Sabre\CalDAV\Principal\UserTest\getInstance().

+ Here is the call graph for this function:

◆ testGetChildProxyWrite()

Sabre\CalDAV\Principal\UserTest::testGetChildProxyWrite ( )

Definition at line 55 of file UserTest.php.

55 {
56
57 $u = $this->getInstance();
58 $child = $u->getChild('calendar-proxy-write');
59 $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyWrite', $child);
60
61 }

References Sabre\CalDAV\Principal\UserTest\getInstance().

+ Here is the call graph for this function:

◆ testGetChildren()

Sabre\CalDAV\Principal\UserTest::testGetChildren ( )

Definition at line 83 of file UserTest.php.

83 {
84
85 $u = $this->getInstance();
86 $children = $u->getChildren();
87 $this->assertEquals(2, count($children));
88 $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyRead', $children[0]);
89 $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyWrite', $children[1]);
90
91 }

References Sabre\CalDAV\Principal\UserTest\getInstance().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: