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

Public Member Functions

 testNoConditions ()
 
 testLockToken ()
 
 testNotLockToken ()
 
 testLockTokenUrl ()
 
 test2LockTokens ()
 
 test2UriLockTokens ()
 
 test2UriMultiLockTokens ()
 
 testEtag ()
 
 test2Etags ()
 
 testComplexIf ()
 
- Public Member Functions inherited from Sabre\DAV\AbstractServer
 setUp ()
 
 tearDown ()
 

Additional Inherited Members

- Protected Member Functions inherited from Sabre\DAV\AbstractServer
 getRootNode ()
 
- Protected Attributes inherited from Sabre\DAV\AbstractServer
 $response
 
 $request
 
 $server
 
 $tempDir = SABRE_TEMPDIR
 

Detailed Description

Definition at line 10 of file GetIfConditionsTest.php.

Member Function Documentation

◆ test2Etags()

Sabre\DAV\GetIfConditionsTest::test2Etags ( )

Definition at line 246 of file GetIfConditionsTest.php.

246 {
247
248 $serverVars = [
249 'HTTP_IF' => '<http://www.example.org/> (["etag1"]) (["etag2"])',
250 ];
251
253 $conditions = $this->server->getIfConditions($request);
254
255 $compare = [
256
257 [
258 'uri' => '',
259 'tokens' => [
260 [
261 'negate' => false,
262 'token' => '',
263 'etag' => '"etag1"',
264 ],
265 [
266 'negate' => false,
267 'token' => '',
268 'etag' => '"etag2"',
269 ],
270 ],
271 ],
272
273 ];
274 $this->assertEquals($compare, $conditions);
275
276 }
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107

References Sabre\DAV\AbstractServer\$request, and Sabre\HTTP\Sapi\createFromServerArray().

+ Here is the call graph for this function:

◆ test2LockTokens()

Sabre\DAV\GetIfConditionsTest::test2LockTokens ( )

Definition at line 103 of file GetIfConditionsTest.php.

103 {
104
105 $serverVars = [
106 'HTTP_IF' => '(<opaquelocktoken:token1>) (Not <opaquelocktoken:token2>)',
107 'REQUEST_URI' => '/bla',
108 ];
109
111 $conditions = $this->server->getIfConditions($request);
112
113 $compare = [
114
115 [
116 'uri' => 'bla',
117 'tokens' => [
118 [
119 'negate' => false,
120 'token' => 'opaquelocktoken:token1',
121 'etag' => '',
122 ],
123 [
124 'negate' => true,
125 'token' => 'opaquelocktoken:token2',
126 'etag' => '',
127 ],
128 ],
129
130 ],
131
132 ];
133 $this->assertEquals($compare, $conditions);
134
135 }

References Sabre\DAV\AbstractServer\$request, and Sabre\HTTP\Sapi\createFromServerArray().

+ Here is the call graph for this function:

◆ test2UriLockTokens()

Sabre\DAV\GetIfConditionsTest::test2UriLockTokens ( )

Definition at line 137 of file GetIfConditionsTest.php.

137 {
138
139 $serverVars = [
140 'HTTP_IF' => '<http://www.example.org/node1> (<opaquelocktoken:token1>) <http://www.example.org/node2> (Not <opaquelocktoken:token2>)',
141 ];
142
144 $conditions = $this->server->getIfConditions($request);
145
146 $compare = [
147
148 [
149 'uri' => 'node1',
150 'tokens' => [
151 [
152 'negate' => false,
153 'token' => 'opaquelocktoken:token1',
154 'etag' => '',
155 ],
156 ],
157 ],
158 [
159 'uri' => 'node2',
160 'tokens' => [
161 [
162 'negate' => true,
163 'token' => 'opaquelocktoken:token2',
164 'etag' => '',
165 ],
166 ],
167
168 ],
169
170 ];
171 $this->assertEquals($compare, $conditions);
172
173 }

References Sabre\DAV\AbstractServer\$request, and Sabre\HTTP\Sapi\createFromServerArray().

+ Here is the call graph for this function:

◆ test2UriMultiLockTokens()

Sabre\DAV\GetIfConditionsTest::test2UriMultiLockTokens ( )

Definition at line 175 of file GetIfConditionsTest.php.

175 {
176
177 $serverVars = [
178 'HTTP_IF' => '<http://www.example.org/node1> (<opaquelocktoken:token1>) (<opaquelocktoken:token2>) <http://www.example.org/node2> (Not <opaquelocktoken:token3>)',
179 ];
180
182 $conditions = $this->server->getIfConditions($request);
183
184 $compare = [
185
186 [
187 'uri' => 'node1',
188 'tokens' => [
189 [
190 'negate' => false,
191 'token' => 'opaquelocktoken:token1',
192 'etag' => '',
193 ],
194 [
195 'negate' => false,
196 'token' => 'opaquelocktoken:token2',
197 'etag' => '',
198 ],
199 ],
200 ],
201 [
202 'uri' => 'node2',
203 'tokens' => [
204 [
205 'negate' => true,
206 'token' => 'opaquelocktoken:token3',
207 'etag' => '',
208 ],
209 ],
210
211 ],
212
213 ];
214 $this->assertEquals($compare, $conditions);
215
216 }

References Sabre\DAV\AbstractServer\$request, and Sabre\HTTP\Sapi\createFromServerArray().

+ Here is the call graph for this function:

◆ testComplexIf()

Sabre\DAV\GetIfConditionsTest::testComplexIf ( )

Definition at line 278 of file GetIfConditionsTest.php.

278 {
279
280 $serverVars = [
281 'HTTP_IF' => '<http://www.example.org/node1> (<opaquelocktoken:token1> ["etag1"]) ' .
282 '(Not <opaquelocktoken:token2>) (["etag2"]) <http://www.example.org/node2> ' .
283 '(<opaquelocktoken:token3>) (Not <opaquelocktoken:token4>) (["etag3"])',
284 ];
285
287 $conditions = $this->server->getIfConditions($request);
288
289 $compare = [
290
291 [
292 'uri' => 'node1',
293 'tokens' => [
294 [
295 'negate' => false,
296 'token' => 'opaquelocktoken:token1',
297 'etag' => '"etag1"',
298 ],
299 [
300 'negate' => true,
301 'token' => 'opaquelocktoken:token2',
302 'etag' => '',
303 ],
304 [
305 'negate' => false,
306 'token' => '',
307 'etag' => '"etag2"',
308 ],
309 ],
310 ],
311 [
312 'uri' => 'node2',
313 'tokens' => [
314 [
315 'negate' => false,
316 'token' => 'opaquelocktoken:token3',
317 'etag' => '',
318 ],
319 [
320 'negate' => true,
321 'token' => 'opaquelocktoken:token4',
322 'etag' => '',
323 ],
324 [
325 'negate' => false,
326 'token' => '',
327 'etag' => '"etag3"',
328 ],
329 ],
330 ],
331
332 ];
333 $this->assertEquals($compare, $conditions);
334
335 }

References Sabre\DAV\AbstractServer\$request, and Sabre\HTTP\Sapi\createFromServerArray().

+ Here is the call graph for this function:

◆ testEtag()

Sabre\DAV\GetIfConditionsTest::testEtag ( )

Definition at line 218 of file GetIfConditionsTest.php.

218 {
219
220 $serverVars = [
221 'HTTP_IF' => '(["etag1"])',
222 'REQUEST_URI' => '/foo',
223 ];
224
226 $conditions = $this->server->getIfConditions($request);
227
228 $compare = [
229
230 [
231 'uri' => 'foo',
232 'tokens' => [
233 [
234 'negate' => false,
235 'token' => '',
236 'etag' => '"etag1"',
237 ],
238 ],
239 ],
240
241 ];
242 $this->assertEquals($compare, $conditions);
243
244 }

References Sabre\DAV\AbstractServer\$request, and Sabre\HTTP\Sapi\createFromServerArray().

+ Here is the call graph for this function:

◆ testLockToken()

Sabre\DAV\GetIfConditionsTest::testLockToken ( )

Definition at line 21 of file GetIfConditionsTest.php.

21 {
22
23 $request = new HTTP\Request('GET', '/path/', ['If' => '(<opaquelocktoken:token1>)']);
24 $conditions = $this->server->getIfConditions($request);
25
26 $compare = [
27
28 [
29 'uri' => 'path',
30 'tokens' => [
31 [
32 'negate' => false,
33 'token' => 'opaquelocktoken:token1',
34 'etag' => '',
35 ],
36 ],
37
38 ],
39
40 ];
41
42 $this->assertEquals($compare, $conditions);
43
44 }

References Sabre\DAV\AbstractServer\$request.

◆ testLockTokenUrl()

Sabre\DAV\GetIfConditionsTest::testLockTokenUrl ( )

Definition at line 75 of file GetIfConditionsTest.php.

75 {
76
77 $serverVars = [
78 'HTTP_IF' => '<http://www.example.com/> (<opaquelocktoken:token1>)',
79 ];
80
82 $conditions = $this->server->getIfConditions($request);
83
84 $compare = [
85
86 [
87 'uri' => '',
88 'tokens' => [
89 [
90 'negate' => false,
91 'token' => 'opaquelocktoken:token1',
92 'etag' => '',
93 ],
94 ],
95
96 ],
97
98 ];
99 $this->assertEquals($compare, $conditions);
100
101 }

References Sabre\DAV\AbstractServer\$request, and Sabre\HTTP\Sapi\createFromServerArray().

+ Here is the call graph for this function:

◆ testNoConditions()

Sabre\DAV\GetIfConditionsTest::testNoConditions ( )

Definition at line 12 of file GetIfConditionsTest.php.

12 {
13
14 $request = new HTTP\Request();
15
16 $conditions = $this->server->getIfConditions($request);
17 $this->assertEquals([], $conditions);
18
19 }

References Sabre\DAV\AbstractServer\$request.

◆ testNotLockToken()

Sabre\DAV\GetIfConditionsTest::testNotLockToken ( )

Definition at line 46 of file GetIfConditionsTest.php.

46 {
47
48 $serverVars = [
49 'HTTP_IF' => '(Not <opaquelocktoken:token1>)',
50 'REQUEST_URI' => '/bla'
51 ];
52
54 $conditions = $this->server->getIfConditions($request);
55
56 $compare = [
57
58 [
59 'uri' => 'bla',
60 'tokens' => [
61 [
62 'negate' => true,
63 'token' => 'opaquelocktoken:token1',
64 'etag' => '',
65 ],
66 ],
67
68 ],
69
70 ];
71 $this->assertEquals($compare, $conditions);
72
73 }

References Sabre\DAV\AbstractServer\$request, and Sabre\HTTP\Sapi\createFromServerArray().

+ Here is the call graph for this function:

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