Definition at line 10 of file PluginTest.php.
◆ setUp()
Sabre\DAV\Sync\PluginTest::setUp |
( |
| ) |
|
Definition at line 14 of file PluginTest.php.
17 $this->server->addPlugin(
new Plugin());
◆ setUpTree()
Sabre\DAV\Sync\PluginTest::setUpTree |
( |
| ) |
|
◆ testGetInfo()
Sabre\DAV\Sync\PluginTest::testGetInfo |
( |
| ) |
|
Definition at line 21 of file PluginTest.php.
23 $this->assertArrayHasKey(
25 (
new Plugin())->getPluginInfo()
◆ testGetSyncToken()
Sabre\DAV\Sync\PluginTest::testGetSyncToken |
( |
| ) |
|
Definition at line 57 of file PluginTest.php.
References $result.
59 $result = $this->server->getProperties(
'/coll', [
'{DAV:}sync-token']);
60 $this->assertFalse(isset(
$result[
'{DAV:}sync-token']));
63 $this->collection->addChange([
'file1.txt'], [], []);
65 $result = $this->server->getProperties(
'/coll', [
'{DAV:}sync-token']);
66 $this->assertTrue(isset(
$result[
'{DAV:}sync-token']));
69 $this->collection->addChange([
'file1.txt'], [], []);
71 $result = $this->server->getProperties(
'/normalcoll', [
'{DAV:}sync-token']);
72 $this->assertFalse(isset(
$result[
'{DAV:}sync-token']));
◆ 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().
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>)',
489 $this->assertEquals(403,
$response->status);
foreach($paths as $path) $request
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.
◆ 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().
512 $this->collection->addChange([
'file1.txt'], [], []);
514 'REQUEST_METHOD' =>
'DELETE',
515 'REQUEST_URI' =>
'/coll/file1.txt',
516 'HTTP_IF' =>
'</coll> (<opaquelocktoken:foo>)',
520 $this->assertEquals(412,
$response->status);
foreach($paths as $path) $request
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.
◆ 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().
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>)',
506 $this->assertEquals(403,
$response->status);
foreach($paths as $path) $request
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.
◆ 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().
135 $this->collection->addChange([
'file1.txt'], [], []);
137 $this->collection->addChange([], [
'file2.txt'], [
'file3.txt']);
140 'REQUEST_METHOD' =>
'REPORT',
141 'REQUEST_URI' =>
'/coll/',
142 'CONTENT_TYPE' =>
'application/xml',
146 <?xml version=
"1.0" encoding=
"utf-8" ?>
147 <
D:sync-collection xmlns:
D=
"DAV:">
149 <
D:sync-level>infinite</
D:sync-level>
151 <
D:getcontentlength/>
162 $multiStatus = $this->server->xml->parse(
$response->getBodyAsString());
166 'http://sabre.io/ns/sync/2',
167 $multiStatus->getSyncToken()
170 $responses = $multiStatus->getResponses();
171 $this->assertEquals(2, count($responses),
'We expected exactly 2 {DAV:}response');
175 $this->assertNull(
$response->getHttpStatus());
176 $this->assertEquals(
'/coll/file2.txt',
$response->getHref());
177 $this->assertEquals([
179 '{DAV:}getcontentlength' => 3,
185 $this->assertEquals(
'404', $response->getHttpStatus());
186 $this->assertEquals(
'/coll/file3.txt', $response->getHref());
187 $this->assertEquals([], $response->getResponseProperties());
foreach($paths as $path) $request
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.
◆ 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().
246 $this->collection->addChange([
'file1.txt'], [], []);
248 $this->collection->addChange([], [
'file2.txt'], [
'file3.txt']);
251 'REQUEST_METHOD' =>
'REPORT',
252 'REQUEST_URI' =>
'/coll/',
253 'CONTENT_TYPE' =>
'application/xml',
258 <?xml version=
"1.0" encoding=
"utf-8" ?>
259 <
D:sync-collection xmlns:
D=
"DAV:">
262 <
D:getcontentlength/>
273 $multiStatus = $this->server->xml->parse(
279 'http://sabre.io/ns/sync/2',
280 $multiStatus->getSyncToken()
283 $responses = $multiStatus->getResponses();
284 $this->assertEquals(2, count($responses),
'We expected exactly 2 {DAV:}response');
288 $this->assertNull(
$response->getHttpStatus());
289 $this->assertEquals(
'/coll/file2.txt',
$response->getHref());
290 $this->assertEquals([
292 '{DAV:}getcontentlength' => 3,
298 $this->assertEquals(
'404', $response->getHttpStatus());
299 $this->assertEquals(
'/coll/file3.txt', $response->getHref());
300 $this->assertEquals([], $response->getResponseProperties());
foreach($paths as $path) $request
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.
◆ 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().
194 $this->collection->addChange([
'file1.txt'], [], []);
196 $this->collection->addChange([], [
'file2.txt'], [
'file3.txt']);
199 'REQUEST_METHOD' =>
'REPORT',
200 'REQUEST_URI' =>
'/coll/',
201 'CONTENT_TYPE' =>
'application/xml',
205 <?xml version=
"1.0" encoding=
"utf-8" ?>
206 <
D:sync-collection xmlns:
D=
"DAV:">
208 <
D:sync-level>infinite</
D:sync-level>
210 <
D:getcontentlength/>
212 <
D:limit><
D:nresults>1</
D:nresults></
D:limit>
222 $multiStatus = $this->server->xml->parse(
228 'http://sabre.io/ns/sync/2',
229 $multiStatus->getSyncToken()
232 $responses = $multiStatus->getResponses();
233 $this->assertEquals(1, count($responses),
'We expected exactly 1 {DAV:}response');
237 $this->assertEquals(
'404',
$response->getHttpStatus());
238 $this->assertEquals(
'/coll/file3.txt',
$response->getHref());
239 $this->assertEquals([],
$response->getResponseProperties());
foreach($paths as $path) $request
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.
◆ testSupportedReportSet()
Sabre\DAV\Sync\PluginTest::testSupportedReportSet |
( |
| ) |
|
Definition at line 44 of file PluginTest.php.
References $result.
46 $result = $this->server->getProperties(
'/coll', [
'{DAV:}supported-report-set']);
47 $this->assertFalse(
$result[
'{DAV:}supported-report-set']->has(
'{DAV:}sync-collection'));
50 $this->collection->addChange([
'file1.txt'], [], []);
52 $result = $this->server->getProperties(
'/coll', [
'{DAV:}supported-report-set']);
53 $this->assertTrue(
$result[
'{DAV:}supported-report-set']->has(
'{DAV:}sync-collection'));
◆ testSyncInitialSyncCollection()
Sabre\DAV\Sync\PluginTest::testSyncInitialSyncCollection |
( |
| ) |
|
Definition at line 75 of file PluginTest.php.
References $request, $response, and Sabre\DAVServerTest\request().
78 $this->collection->addChange([
'file1.txt'], [], []);
80 $request =
new HTTP\Request(
'REPORT',
'/coll/', [
'Content-Type' =>
'application/xml']);
83 <?xml version=
"1.0" encoding=
"utf-8" ?>
84 <
D:sync-collection xmlns:
D=
"DAV:">
86 <
D:sync-level>1</
D:sync-level>
99 $multiStatus = $this->server->xml->parse(
$response->getBodyAsString());
103 'http://sabre.io/ns/sync/1',
104 $multiStatus->getSyncToken()
107 $responses = $multiStatus->getResponses();
108 $this->assertEquals(2, count($responses),
'We expected exactly 2 {DAV:}response');
112 $this->assertNull(
$response->getHttpStatus());
113 $this->assertEquals(
'/coll/file1.txt',
$response->getHref());
114 $this->assertEquals([
116 '{DAV:}getcontentlength' => 3,
122 $this->assertNull($response->getHttpStatus());
123 $this->assertEquals(
'/coll/file2.txt', $response->getHref());
124 $this->assertEquals([
126 '{DAV:}getcontentlength' => 3,
128 ], $response->getResponseProperties());
foreach($paths as $path) $request
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
◆ 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().
364 $this->collection->addChange([
'file1.txt'], [], []);
366 'REQUEST_METHOD' =>
'REPORT',
367 'REQUEST_URI' =>
'/coll/',
368 'CONTENT_TYPE' =>
'application/xml',
372 <?xml version=
"1.0" encoding=
"utf-8" ?>
373 <
D:sync-collection xmlns:
D=
"DAV:">
375 <
D:sync-level>1</
D:sync-level>
377 <
D:getcontentlength/>
foreach($paths as $path) $request
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.
◆ 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().
393 $this->collection->addChange([
'file1.txt'], [], []);
395 'REQUEST_METHOD' =>
'REPORT',
396 'REQUEST_URI' =>
'/coll/',
397 'CONTENT_TYPE' =>
'application/xml',
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>
406 <
D:getcontentlength/>
foreach($paths as $path) $request
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.
◆ 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().
451 $this->collection->addChange([
'file1.txt'], [], []);
453 'REQUEST_METHOD' =>
'REPORT',
454 'REQUEST_URI' =>
'/coll/',
455 'CONTENT_TYPE' =>
'application/xml',
459 <?xml version=
"1.0" encoding=
"utf-8" ?>
460 <
D:sync-collection xmlns:
D=
"DAV:">
462 <
D:sync-level>1</
D:sync-level>
foreach($paths as $path) $request
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.
◆ 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().
336 'REQUEST_METHOD' =>
'REPORT',
337 'REQUEST_URI' =>
'/normalcoll/',
338 'CONTENT_TYPE' =>
'application/xml',
342 <?xml version=
"1.0" encoding=
"utf-8" ?>
343 <
D:sync-collection xmlns:
D=
"DAV:">
345 <
D:sync-level>1</
D:sync-level>
347 <
D:getcontentlength/>
foreach($paths as $path) $request
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.
◆ 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().
307 'REQUEST_METHOD' =>
'REPORT',
308 'REQUEST_URI' =>
'/coll/',
309 'CONTENT_TYPE' =>
'application/xml',
313 <?xml version=
"1.0" encoding=
"utf-8" ?>
314 <
D:sync-collection xmlns:
D=
"DAV:">
316 <
D:sync-level>1</
D:sync-level>
318 <
D:getcontentlength/>
foreach($paths as $path) $request
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.
◆ 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().
424 'REQUEST_METHOD' =>
'REPORT',
425 'REQUEST_URI' =>
'/coll/',
426 'CONTENT_TYPE' =>
'application/xml',
430 <?xml version=
"1.0" encoding=
"utf-8" ?>
431 <
D:sync-collection xmlns:
D=
"DAV:">
432 <
D:sync-level>1</
D:sync-level>
434 <
D:getcontentlength/>
foreach($paths as $path) $request
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.
◆ $collection
Sabre\DAV\Sync\PluginTest::$collection |
|
protected |
The documentation for this class was generated from the following file: