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

Public Member Functions

 testUpdatePropertiesPassthrough ()
 
 testRemoveGroupMembers ()
 
 testSetGroupMembers ()
 
 testSetBadValue ()
 @expectedException Sabre\DAV\Exception More...
 
 testSetBadNode ()
 

Detailed Description

Definition at line 7 of file PluginUpdatePropertiesTest.php.

Member Function Documentation

◆ testRemoveGroupMembers()

Sabre\DAVACL\PluginUpdatePropertiesTest::testRemoveGroupMembers ( )

Definition at line 30 of file PluginUpdatePropertiesTest.php.

30 {
31
32 $tree = [
33 new MockPrincipal('foo', 'foo'),
34 ];
35 $server = new DAV\Server($tree);
36 $plugin = new Plugin();
37 $plugin->allowUnauthenticatedAccess = false;
38 $server->addPlugin($plugin);
39
40 $result = $server->updateProperties('foo', [
41 '{DAV:}group-member-set' => null,
42 ]);
43
44 $expected = [
45 '{DAV:}group-member-set' => 204
46 ];
47
48 $this->assertEquals($expected, $result);
49 $this->assertEquals([], $tree[0]->getGroupMemberSet());
50
51 }
$result
$server
Definition: sabredav.php:48

References $result, $server, and $tree.

◆ testSetBadNode()

Sabre\DAVACL\PluginUpdatePropertiesTest::testSetBadNode ( )

Definition at line 95 of file PluginUpdatePropertiesTest.php.

95 {
96
97 $tree = [
98 new DAV\SimpleCollection('foo'),
99 ];
100 $server = new DAV\Server($tree);
101 $plugin = new Plugin();
102 $plugin->allowUnauthenticatedAccess = false;
103 $server->addPlugin($plugin);
104
105 $result = $server->updateProperties('foo', [
106 '{DAV:}group-member-set' => new DAV\Xml\Property\Href(['/bar', '/baz'], false),
107 ]);
108
109 $expected = [
110 '{DAV:}group-member-set' => 403,
111 ];
112
113 $this->assertEquals($expected, $result);
114
115 }

References $result, $server, and $tree.

◆ testSetBadValue()

Sabre\DAVACL\PluginUpdatePropertiesTest::testSetBadValue ( )

@expectedException Sabre\DAV\Exception

Definition at line 79 of file PluginUpdatePropertiesTest.php.

79 {
80
81 $tree = [
82 new MockPrincipal('foo', 'foo'),
83 ];
84 $server = new DAV\Server($tree);
85 $plugin = new Plugin();
86 $plugin->allowUnauthenticatedAccess = false;
87 $server->addPlugin($plugin);
88
89 $result = $server->updateProperties('foo', [
90 '{DAV:}group-member-set' => new \StdClass(),
91 ]);
92
93 }

References $result, $server, and $tree.

◆ testSetGroupMembers()

Sabre\DAVACL\PluginUpdatePropertiesTest::testSetGroupMembers ( )

Definition at line 53 of file PluginUpdatePropertiesTest.php.

53 {
54
55 $tree = [
56 new MockPrincipal('foo', 'foo'),
57 ];
58 $server = new DAV\Server($tree);
59 $plugin = new Plugin();
60 $plugin->allowUnauthenticatedAccess = false;
61 $server->addPlugin($plugin);
62
63 $result = $server->updateProperties('foo', [
64 '{DAV:}group-member-set' => new DAV\Xml\Property\Href(['/bar', '/baz'], true),
65 ]);
66
67 $expected = [
68 '{DAV:}group-member-set' => 200
69 ];
70
71 $this->assertEquals($expected, $result);
72 $this->assertEquals(['bar', 'baz'], $tree[0]->getGroupMemberSet());
73
74 }

References $result, $server, and $tree.

◆ testUpdatePropertiesPassthrough()

Sabre\DAVACL\PluginUpdatePropertiesTest::testUpdatePropertiesPassthrough ( )

Definition at line 9 of file PluginUpdatePropertiesTest.php.

9 {
10
11 $tree = [
12 new DAV\SimpleCollection('foo'),
13 ];
14 $server = new DAV\Server($tree);
15 $server->addPlugin(new DAV\Auth\Plugin());
16 $server->addPlugin(new Plugin());
17
18 $result = $server->updateProperties('foo', [
19 '{DAV:}foo' => 'bar',
20 ]);
21
22 $expected = [
23 '{DAV:}foo' => 403,
24 ];
25
26 $this->assertEquals($expected, $result);
27
28 }

References $result, $server, and $tree.


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