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

Public Member Functions

 testUpdatePropertiesFail ()
 
 testUpdatePropertiesProtected ()
 
 testUpdatePropertiesEventFail ()
 
 testUpdatePropertiesEventSuccess ()
 

Detailed Description

Definition at line 5 of file ServerUpdatePropertiesTest.php.

Member Function Documentation

◆ testUpdatePropertiesEventFail()

Sabre\DAV\ServerUpdatePropertiesTest::testUpdatePropertiesEventFail ( )

Definition at line 48 of file ServerUpdatePropertiesTest.php.

48 {
49
50 $tree = [
51 new SimpleCollection('foo'),
52 ];
53 $server = new Server($tree);
54 $server->on('propPatch', function($path, PropPatch $propPatch) {
55 $propPatch->setResultCode('{DAV:}foo', 404);
56 $propPatch->handleRemaining(function() { return true; });
57 });
58
59 $result = $server->updateProperties('foo', [
60 '{DAV:}foo' => 'bar',
61 '{DAV:}foo2' => 'bla',
62 ]);
63
64 $expected = [
65 '{DAV:}foo' => 404,
66 '{DAV:}foo2' => 424,
67 ];
68 $this->assertEquals($expected, $result);
69
70 }
$result
$path
Definition: aliased.php:25
$server
Definition: sabredav.php:48

References $path, $result, $server, $tree, Sabre\DAV\PropPatch\handleRemaining(), and Sabre\DAV\PropPatch\setResultCode().

+ Here is the call graph for this function:

◆ testUpdatePropertiesEventSuccess()

Sabre\DAV\ServerUpdatePropertiesTest::testUpdatePropertiesEventSuccess ( )

Definition at line 72 of file ServerUpdatePropertiesTest.php.

72 {
73
74 $tree = [
75 new SimpleCollection('foo'),
76 ];
77 $server = new Server($tree);
78 $server->on('propPatch', function($path, PropPatch $propPatch) {
79
80 $propPatch->handle(['{DAV:}foo', '{DAV:}foo2'], function() {
81 return [
82 '{DAV:}foo' => 200,
83 '{DAV:}foo2' => 201,
84 ];
85 });
86
87 });
88
89 $result = $server->updateProperties('foo', [
90 '{DAV:}foo' => 'bar',
91 '{DAV:}foo2' => 'bla',
92 ]);
93
94 $expected = [
95 '{DAV:}foo' => 200,
96 '{DAV:}foo2' => 201,
97 ];
98 $this->assertEquals($expected, $result);
99
100 }

References $path, $result, $server, $tree, and Sabre\DAV\PropPatch\handle().

+ Here is the call graph for this function:

◆ testUpdatePropertiesFail()

Sabre\DAV\ServerUpdatePropertiesTest::testUpdatePropertiesFail ( )

Definition at line 7 of file ServerUpdatePropertiesTest.php.

7 {
8
9 $tree = [
10 new SimpleCollection('foo'),
11 ];
12 $server = new Server($tree);
13
14 $result = $server->updateProperties('foo', [
15 '{DAV:}foo' => 'bar'
16 ]);
17
18 $expected = [
19 '{DAV:}foo' => 403,
20 ];
21 $this->assertEquals($expected, $result);
22
23 }

References $result, $server, and $tree.

◆ testUpdatePropertiesProtected()

Sabre\DAV\ServerUpdatePropertiesTest::testUpdatePropertiesProtected ( )

Definition at line 25 of file ServerUpdatePropertiesTest.php.

25 {
26
27 $tree = [
28 new SimpleCollection('foo'),
29 ];
30 $server = new Server($tree);
31
32 $server->on('propPatch', function($path, PropPatch $propPatch) {
33 $propPatch->handleRemaining(function() { return true; });
34 });
35 $result = $server->updateProperties('foo', [
36 '{DAV:}getetag' => 'bla',
37 '{DAV:}foo' => 'bar'
38 ]);
39
40 $expected = [
41 '{DAV:}getetag' => 403,
42 '{DAV:}foo' => 424,
43 ];
44 $this->assertEquals($expected, $result);
45
46 }

References $path, $result, $server, $tree, and Sabre\DAV\PropPatch\handleRemaining().

+ Here is the call graph for this function:

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