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 ()
 Sabre More...
 
 testCreateDirectory ()
 Sabre More...
 
 testGetChildProxyRead ()
 
 testGetChildProxyWrite ()
 
 testGetChildNotFound ()
 Sabre More...
 
 testGetChildNotFound2 ()
 Sabre 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.

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().

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  }
+ Here is the caller graph for this function:

◆ testChildExist()

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

Definition at line 93 of file UserTest.php.

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

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  }
+ Here is the call graph for this function:

◆ testCreateDirectory()

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

Sabre

Definition at line 40 of file UserTest.php.

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

40  {
41 
42  $u = $this->getInstance();
43  $u->createDirectory('test');
44 
45  }
+ Here is the call graph for this function:

◆ testCreateFile()

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

Sabre

Definition at line 30 of file UserTest.php.

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

30  {
31 
32  $u = $this->getInstance();
33  $u->createFile('test');
34 
35  }
+ Here is the call graph for this function:

◆ testGetACL()

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

Definition at line 102 of file UserTest.php.

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

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  }
+ Here is the call graph for this function:

◆ testGetChildNotFound()

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

Sabre

Definition at line 66 of file UserTest.php.

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

66  {
67 
68  $u = $this->getInstance();
69  $child = $u->getChild('foo');
70 
71  }
+ Here is the call graph for this function:

◆ testGetChildNotFound2()

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

Sabre

Definition at line 76 of file UserTest.php.

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

76  {
77 
78  $u = $this->getInstance();
79  $child = $u->getChild('random');
80 
81  }
+ Here is the call graph for this function:

◆ testGetChildProxyRead()

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

Definition at line 47 of file UserTest.php.

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

47  {
48 
49  $u = $this->getInstance();
50  $child = $u->getChild('calendar-proxy-read');
51  $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyRead', $child);
52 
53  }
+ Here is the call graph for this function:

◆ testGetChildProxyWrite()

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

Definition at line 55 of file UserTest.php.

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

55  {
56 
57  $u = $this->getInstance();
58  $child = $u->getChild('calendar-proxy-write');
59  $this->assertInstanceOf('Sabre\\CalDAV\\Principal\\ProxyWrite', $child);
60 
61  }
+ Here is the call graph for this function:

◆ testGetChildren()

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

Definition at line 83 of file UserTest.php.

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

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  }
+ Here is the call graph for this function:

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