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

Public Member Functions

 setUp ()
 
 testGetInfo ()
 
 setUpTree ()
 
 testSupportedReportSet ()
 
 testGetSyncToken ()
 
 testSyncInitialSyncCollection ()
 
 testSubsequentSyncSyncCollection ()
 
 testSubsequentSyncSyncCollectionLimit ()
 
 testSubsequentSyncSyncCollectionDepthFallBack ()
 
 testSyncNoSyncInfo ()
 
 testSyncNoSyncCollection ()
 
 testSyncInvalidToken ()
 
 testSyncInvalidTokenNoPrefix ()
 
 testSyncNoSyncToken ()
 
 testSyncNoProp ()
 
 testIfConditions ()
 
 testIfConditionsNot ()
 
 testIfConditionsNoSyncToken ()
 
- Public Member Functions inherited from Sabre\DAVServerTest
 setUp ()
 
 initializeEverything ()
 
 request ($request, $expectedStatus=null)
 Makes a request, and returns a response object. More...
 
 autoLogin ($userName)
 This function takes a username and sets the server in a state where this user is logged in, and no longer requires an authentication check. More...
 
 setUpTree ()
 Override this to provide your own Tree for your test-case. More...
 
 setUpBackends ()
 
 assertHttpStatus ($expectedStatus, HTTP\Request $req)
 

Protected Attributes

 $collection
 
- Protected Attributes inherited from Sabre\DAVServerTest
 $setupCalDAV = false
 
 $setupCardDAV = false
 
 $setupACL = false
 
 $setupCalDAVSharing = false
 
 $setupCalDAVScheduling = false
 
 $setupCalDAVSubscriptions = false
 
 $setupCalDAVICSExport = false
 
 $setupLocks = false
 
 $setupFiles = false
 
 $setupSharing = false
 
 $setupPropertyStorage = false
 
 $caldavCalendars = []
 An array with calendars. More...
 
 $caldavCalendarObjects = []
 
 $carddavAddressBooks = []
 
 $carddavCards = []
 
 $server
 
 $tree = []
 
 $caldavBackend
 
 $carddavBackend
 
 $principalBackend
 
 $locksBackend
 
 $propertyStorageBackend
 
 $caldavPlugin
 
 $carddavPlugin
 
 $aclPlugin
 
 $caldavSharingPlugin
 
 $caldavSchedulePlugin
 
 $authPlugin
 
 $locksPlugin
 
 $sharingPlugin
 
 $propertyStoragePlugin
 
 $autoLogin = null
 If this string is set, we will automatically log in the user with this name. More...
 

Detailed Description

Definition at line 10 of file PluginTest.php.

Member Function Documentation

◆ setUp()

Sabre\DAV\Sync\PluginTest::setUp ( )

Definition at line 14 of file PluginTest.php.

14  {
15 
16  parent::setUp();
17  $this->server->addPlugin(new Plugin());
18 
19  }

◆ setUpTree()

Sabre\DAV\Sync\PluginTest::setUpTree ( )

Definition at line 30 of file PluginTest.php.

References Sabre\DAV\Sync\PluginTest\$collection.

30  {
31 
32  $this->collection =
33  new MockSyncCollection('coll', [
34  new DAV\SimpleFile('file1.txt', 'foo'),
35  new DAV\SimpleFile('file2.txt', 'bar'),
36  ]);
37  $this->tree = [
39  new DAV\SimpleCollection('normalcoll', [])
40  ];
41 
42  }

◆ testGetInfo()

Sabre\DAV\Sync\PluginTest::testGetInfo ( )

Definition at line 21 of file PluginTest.php.

21  {
22 
23  $this->assertArrayHasKey(
24  'name',
25  (new Plugin())->getPluginInfo()
26  );
27 
28  }

◆ testGetSyncToken()

Sabre\DAV\Sync\PluginTest::testGetSyncToken ( )

Definition at line 57 of file PluginTest.php.

References $result.

57  {
58 
59  $result = $this->server->getProperties('/coll', ['{DAV:}sync-token']);
60  $this->assertFalse(isset($result['{DAV:}sync-token']));
61 
62  // Making a change
63  $this->collection->addChange(['file1.txt'], [], []);
64 
65  $result = $this->server->getProperties('/coll', ['{DAV:}sync-token']);
66  $this->assertTrue(isset($result['{DAV:}sync-token']));
67 
68  // non-sync-enabled collection
69  $this->collection->addChange(['file1.txt'], [], []);
70 
71  $result = $this->server->getProperties('/normalcoll', ['{DAV:}sync-token']);
72  $this->assertFalse(isset($result['{DAV:}sync-token']));
73  }
$result

◆ testIfConditions()

Sabre\DAV\Sync\PluginTest::testIfConditions ( )

Definition at line 476 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAVServerTest\request().

476  {
477 
478  $this->collection->addChange(['file1.txt'], [], []);
480  'REQUEST_METHOD' => 'DELETE',
481  'REQUEST_URI' => '/coll/file1.txt',
482  'HTTP_IF' => '</coll> (<http://sabre.io/ns/sync/1>)',
483  ]);
484  $response = $this->request($request);
485 
486  // If a 403 is thrown this works correctly. The file in questions
487  // doesn't allow itself to be deleted.
488  // If the If conditions failed, it would have been a 412 instead.
489  $this->assertEquals(403, $response->status);
490 
491  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testIfConditionsNoSyncToken()

Sabre\DAV\Sync\PluginTest::testIfConditionsNoSyncToken ( )

Definition at line 510 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAVServerTest\request().

510  {
511 
512  $this->collection->addChange(['file1.txt'], [], []);
514  'REQUEST_METHOD' => 'DELETE',
515  'REQUEST_URI' => '/coll/file1.txt',
516  'HTTP_IF' => '</coll> (<opaquelocktoken:foo>)',
517  ]);
518  $response = $this->request($request);
519 
520  $this->assertEquals(412, $response->status);
521 
522  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testIfConditionsNot()

Sabre\DAV\Sync\PluginTest::testIfConditionsNot ( )

Definition at line 493 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAVServerTest\request().

493  {
494 
495  $this->collection->addChange(['file1.txt'], [], []);
497  'REQUEST_METHOD' => 'DELETE',
498  'REQUEST_URI' => '/coll/file1.txt',
499  'HTTP_IF' => '</coll> (Not <http://sabre.io/ns/sync/2>)',
500  ]);
501  $response = $this->request($request);
502 
503  // If a 403 is thrown this works correctly. The file in questions
504  // doesn't allow itself to be deleted.
505  // If the If conditions failed, it would have been a 412 instead.
506  $this->assertEquals(403, $response->status);
507 
508  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testSubsequentSyncSyncCollection()

Sabre\DAV\Sync\PluginTest::testSubsequentSyncSyncCollection ( )

Definition at line 132 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), ILIAS\FileDelivery\http(), and Sabre\DAVServerTest\request().

132  {
133 
134  // Making a change
135  $this->collection->addChange(['file1.txt'], [], []);
136  // Making another change
137  $this->collection->addChange([], ['file2.txt'], ['file3.txt']);
138 
140  'REQUEST_METHOD' => 'REPORT',
141  'REQUEST_URI' => '/coll/',
142  'CONTENT_TYPE' => 'application/xml',
143  ]);
144 
145  $body = <<<BLA
146 <?xml version="1.0" encoding="utf-8" ?>
147 <D:sync-collection xmlns:D="DAV:">
148  <D:sync-token>http://sabre.io/ns/sync/1</D:sync-token>
149  <D:sync-level>infinite</D:sync-level>
150  <D:prop>
151  <D:getcontentlength/>
152  </D:prop>
153 </D:sync-collection>
154 BLA;
155 
156  $request->setBody($body);
157 
158  $response = $this->request($request);
159 
160  $this->assertEquals(207, $response->status, 'Full response body:' . $response->body);
161 
162  $multiStatus = $this->server->xml->parse($response->getBodyAsString());
163 
164  // Checking the sync-token
165  $this->assertEquals(
166  'http://sabre.io/ns/sync/2',
167  $multiStatus->getSyncToken()
168  );
169 
170  $responses = $multiStatus->getResponses();
171  $this->assertEquals(2, count($responses), 'We expected exactly 2 {DAV:}response');
172 
173  $response = $responses[0];
174 
175  $this->assertNull($response->getHttpStatus());
176  $this->assertEquals('/coll/file2.txt', $response->getHref());
177  $this->assertEquals([
178  200 => [
179  '{DAV:}getcontentlength' => 3,
180  ]
181  ], $response->getResponseProperties());
182 
183  $response = $responses[1];
184 
185  $this->assertEquals('404', $response->getHttpStatus());
186  $this->assertEquals('/coll/file3.txt', $response->getHref());
187  $this->assertEquals([], $response->getResponseProperties());
188 
189  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
static http()
Fetches the global http state from ILIAS.
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testSubsequentSyncSyncCollectionDepthFallBack()

Sabre\DAV\Sync\PluginTest::testSubsequentSyncSyncCollectionDepthFallBack ( )

Definition at line 243 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), ILIAS\FileDelivery\http(), and Sabre\DAVServerTest\request().

243  {
244 
245  // Making a change
246  $this->collection->addChange(['file1.txt'], [], []);
247  // Making another change
248  $this->collection->addChange([], ['file2.txt'], ['file3.txt']);
249 
251  'REQUEST_METHOD' => 'REPORT',
252  'REQUEST_URI' => '/coll/',
253  'CONTENT_TYPE' => 'application/xml',
254  'HTTP_DEPTH' => "1",
255  ]);
256 
257  $body = <<<BLA
258 <?xml version="1.0" encoding="utf-8" ?>
259 <D:sync-collection xmlns:D="DAV:">
260  <D:sync-token>http://sabre.io/ns/sync/1</D:sync-token>
261  <D:prop>
262  <D:getcontentlength/>
263  </D:prop>
264 </D:sync-collection>
265 BLA;
266 
267  $request->setBody($body);
268 
269  $response = $this->request($request);
270 
271  $this->assertEquals(207, $response->status, 'Full response body:' . $response->body);
272 
273  $multiStatus = $this->server->xml->parse(
274  $response->getBodyAsString()
275  );
276 
277  // Checking the sync-token
278  $this->assertEquals(
279  'http://sabre.io/ns/sync/2',
280  $multiStatus->getSyncToken()
281  );
282 
283  $responses = $multiStatus->getResponses();
284  $this->assertEquals(2, count($responses), 'We expected exactly 2 {DAV:}response');
285 
286  $response = $responses[0];
287 
288  $this->assertNull($response->getHttpStatus());
289  $this->assertEquals('/coll/file2.txt', $response->getHref());
290  $this->assertEquals([
291  200 => [
292  '{DAV:}getcontentlength' => 3,
293  ]
294  ], $response->getResponseProperties());
295 
296  $response = $responses[1];
297 
298  $this->assertEquals('404', $response->getHttpStatus());
299  $this->assertEquals('/coll/file3.txt', $response->getHref());
300  $this->assertEquals([], $response->getResponseProperties());
301 
302  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
static http()
Fetches the global http state from ILIAS.
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testSubsequentSyncSyncCollectionLimit()

Sabre\DAV\Sync\PluginTest::testSubsequentSyncSyncCollectionLimit ( )

Definition at line 191 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), ILIAS\FileDelivery\http(), and Sabre\DAVServerTest\request().

191  {
192 
193  // Making a change
194  $this->collection->addChange(['file1.txt'], [], []);
195  // Making another change
196  $this->collection->addChange([], ['file2.txt'], ['file3.txt']);
197 
199  'REQUEST_METHOD' => 'REPORT',
200  'REQUEST_URI' => '/coll/',
201  'CONTENT_TYPE' => 'application/xml',
202  ]);
203 
204  $body = <<<BLA
205 <?xml version="1.0" encoding="utf-8" ?>
206 <D:sync-collection xmlns:D="DAV:">
207  <D:sync-token>http://sabre.io/ns/sync/1</D:sync-token>
208  <D:sync-level>infinite</D:sync-level>
209  <D:prop>
210  <D:getcontentlength/>
211  </D:prop>
212  <D:limit><D:nresults>1</D:nresults></D:limit>
213 </D:sync-collection>
214 BLA;
215 
216  $request->setBody($body);
217 
218  $response = $this->request($request);
219 
220  $this->assertEquals(207, $response->status, 'Full response body:' . $response->body);
221 
222  $multiStatus = $this->server->xml->parse(
223  $response->getBodyAsString()
224  );
225 
226  // Checking the sync-token
227  $this->assertEquals(
228  'http://sabre.io/ns/sync/2',
229  $multiStatus->getSyncToken()
230  );
231 
232  $responses = $multiStatus->getResponses();
233  $this->assertEquals(1, count($responses), 'We expected exactly 1 {DAV:}response');
234 
235  $response = $responses[0];
236 
237  $this->assertEquals('404', $response->getHttpStatus());
238  $this->assertEquals('/coll/file3.txt', $response->getHref());
239  $this->assertEquals([], $response->getResponseProperties());
240 
241  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
static http()
Fetches the global http state from ILIAS.
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testSupportedReportSet()

Sabre\DAV\Sync\PluginTest::testSupportedReportSet ( )

Definition at line 44 of file PluginTest.php.

References $result.

44  {
45 
46  $result = $this->server->getProperties('/coll', ['{DAV:}supported-report-set']);
47  $this->assertFalse($result['{DAV:}supported-report-set']->has('{DAV:}sync-collection'));
48 
49  // Making a change
50  $this->collection->addChange(['file1.txt'], [], []);
51 
52  $result = $this->server->getProperties('/coll', ['{DAV:}supported-report-set']);
53  $this->assertTrue($result['{DAV:}supported-report-set']->has('{DAV:}sync-collection'));
54 
55  }
$result

◆ testSyncInitialSyncCollection()

Sabre\DAV\Sync\PluginTest::testSyncInitialSyncCollection ( )

Definition at line 75 of file PluginTest.php.

References $request, $response, and Sabre\DAVServerTest\request().

75  {
76 
77  // Making a change
78  $this->collection->addChange(['file1.txt'], [], []);
79 
80  $request = new HTTP\Request('REPORT', '/coll/', ['Content-Type' => 'application/xml']);
81 
82  $body = <<<BLA
83 <?xml version="1.0" encoding="utf-8" ?>
84 <D:sync-collection xmlns:D="DAV:">
85  <D:sync-token/>
86  <D:sync-level>1</D:sync-level>
87  <D:prop>
88  <D:getcontentlength/>
89  </D:prop>
90 </D:sync-collection>
91 BLA;
92 
93  $request->setBody($body);
94 
95  $response = $this->request($request);
96 
97  $this->assertEquals(207, $response->status, 'Full response body:' . $response->body);
98 
99  $multiStatus = $this->server->xml->parse($response->getBodyAsString());
100 
101  // Checking the sync-token
102  $this->assertEquals(
103  'http://sabre.io/ns/sync/1',
104  $multiStatus->getSyncToken()
105  );
106 
107  $responses = $multiStatus->getResponses();
108  $this->assertEquals(2, count($responses), 'We expected exactly 2 {DAV:}response');
109 
110  $response = $responses[0];
111 
112  $this->assertNull($response->getHttpStatus());
113  $this->assertEquals('/coll/file1.txt', $response->getHref());
114  $this->assertEquals([
115  200 => [
116  '{DAV:}getcontentlength' => 3,
117  ]
118  ], $response->getResponseProperties());
119 
120  $response = $responses[1];
121 
122  $this->assertNull($response->getHttpStatus());
123  $this->assertEquals('/coll/file2.txt', $response->getHref());
124  $this->assertEquals([
125  200 => [
126  '{DAV:}getcontentlength' => 3,
127  ]
128  ], $response->getResponseProperties());
129 
130  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
$response
+ Here is the call graph for this function:

◆ testSyncInvalidToken()

Sabre\DAV\Sync\PluginTest::testSyncInvalidToken ( )

Definition at line 362 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), ILIAS\FileDelivery\http(), and Sabre\DAVServerTest\request().

362  {
363 
364  $this->collection->addChange(['file1.txt'], [], []);
366  'REQUEST_METHOD' => 'REPORT',
367  'REQUEST_URI' => '/coll/',
368  'CONTENT_TYPE' => 'application/xml',
369  ]);
370 
371  $body = <<<BLA
372 <?xml version="1.0" encoding="utf-8" ?>
373 <D:sync-collection xmlns:D="DAV:">
374  <D:sync-token>http://sabre.io/ns/sync/invalid</D:sync-token>
375  <D:sync-level>1</D:sync-level>
376  <D:prop>
377  <D:getcontentlength/>
378  </D:prop>
379 </D:sync-collection>
380 BLA;
381 
382  $request->setBody($body);
383 
384  $response = $this->request($request);
385 
386  // The default state has no sync-token, so this report should not yet
387  // be supported.
388  $this->assertEquals(403, $response->status, 'Full response body:' . $response->body);
389 
390  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
static http()
Fetches the global http state from ILIAS.
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testSyncInvalidTokenNoPrefix()

Sabre\DAV\Sync\PluginTest::testSyncInvalidTokenNoPrefix ( )

Definition at line 391 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAVServerTest\request().

391  {
392 
393  $this->collection->addChange(['file1.txt'], [], []);
395  'REQUEST_METHOD' => 'REPORT',
396  'REQUEST_URI' => '/coll/',
397  'CONTENT_TYPE' => 'application/xml',
398  ]);
399 
400  $body = <<<BLA
401 <?xml version="1.0" encoding="utf-8" ?>
402 <D:sync-collection xmlns:D="DAV:">
403  <D:sync-token>invalid</D:sync-token>
404  <D:sync-level>1</D:sync-level>
405  <D:prop>
406  <D:getcontentlength/>
407  </D:prop>
408 </D:sync-collection>
409 BLA;
410 
411  $request->setBody($body);
412 
413  $response = $this->request($request);
414 
415  // The default state has no sync-token, so this report should not yet
416  // be supported.
417  $this->assertEquals(403, $response->status, 'Full response body:' . $response->body);
418 
419  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testSyncNoProp()

Sabre\DAV\Sync\PluginTest::testSyncNoProp ( )

Definition at line 449 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAVServerTest\request().

449  {
450 
451  $this->collection->addChange(['file1.txt'], [], []);
453  'REQUEST_METHOD' => 'REPORT',
454  'REQUEST_URI' => '/coll/',
455  'CONTENT_TYPE' => 'application/xml',
456  ]);
457 
458  $body = <<<BLA
459 <?xml version="1.0" encoding="utf-8" ?>
460 <D:sync-collection xmlns:D="DAV:">
461  <D:sync-token />
462  <D:sync-level>1</D:sync-level>
463 </D:sync-collection>
464 BLA;
465 
466  $request->setBody($body);
467 
468  $response = $this->request($request);
469 
470  // The default state has no sync-token, so this report should not yet
471  // be supported.
472  $this->assertEquals(400, $response->status, 'Full response body:' . $response->body);
473 
474  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testSyncNoSyncCollection()

Sabre\DAV\Sync\PluginTest::testSyncNoSyncCollection ( )

Definition at line 333 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAVServerTest\request().

333  {
334 
336  'REQUEST_METHOD' => 'REPORT',
337  'REQUEST_URI' => '/normalcoll/',
338  'CONTENT_TYPE' => 'application/xml',
339  ]);
340 
341  $body = <<<BLA
342 <?xml version="1.0" encoding="utf-8" ?>
343 <D:sync-collection xmlns:D="DAV:">
344  <D:sync-token/>
345  <D:sync-level>1</D:sync-level>
346  <D:prop>
347  <D:getcontentlength/>
348  </D:prop>
349 </D:sync-collection>
350 BLA;
351 
352  $request->setBody($body);
353 
354  $response = $this->request($request);
355 
356  // The default state has no sync-token, so this report should not yet
357  // be supported.
358  $this->assertEquals(415, $response->status, 'Full response body:' . $response->body);
359 
360  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testSyncNoSyncInfo()

Sabre\DAV\Sync\PluginTest::testSyncNoSyncInfo ( )

Definition at line 304 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAVServerTest\request().

304  {
305 
307  'REQUEST_METHOD' => 'REPORT',
308  'REQUEST_URI' => '/coll/',
309  'CONTENT_TYPE' => 'application/xml',
310  ]);
311 
312  $body = <<<BLA
313 <?xml version="1.0" encoding="utf-8" ?>
314 <D:sync-collection xmlns:D="DAV:">
315  <D:sync-token/>
316  <D:sync-level>1</D:sync-level>
317  <D:prop>
318  <D:getcontentlength/>
319  </D:prop>
320 </D:sync-collection>
321 BLA;
322 
323  $request->setBody($body);
324 
325  $response = $this->request($request);
326 
327  // The default state has no sync-token, so this report should not yet
328  // be supported.
329  $this->assertEquals(415, $response->status, 'Full response body:' . $response->body);
330 
331  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

◆ testSyncNoSyncToken()

Sabre\DAV\Sync\PluginTest::testSyncNoSyncToken ( )

Definition at line 421 of file PluginTest.php.

References $request, $response, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAVServerTest\request().

421  {
422 
424  'REQUEST_METHOD' => 'REPORT',
425  'REQUEST_URI' => '/coll/',
426  'CONTENT_TYPE' => 'application/xml',
427  ]);
428 
429  $body = <<<BLA
430 <?xml version="1.0" encoding="utf-8" ?>
431 <D:sync-collection xmlns:D="DAV:">
432  <D:sync-level>1</D:sync-level>
433  <D:prop>
434  <D:getcontentlength/>
435  </D:prop>
436 </D:sync-collection>
437 BLA;
438 
439  $request->setBody($body);
440 
441  $response = $this->request($request);
442 
443  // The default state has no sync-token, so this report should not yet
444  // be supported.
445  $this->assertEquals(400, $response->status, 'Full response body:' . $response->body);
446 
447  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

Field Documentation

◆ $collection

Sabre\DAV\Sync\PluginTest::$collection
protected

Definition at line 12 of file PluginTest.php.

Referenced by Sabre\DAV\Sync\PluginTest\setUpTree().


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