ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SyncTokenPropertyTest.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAV;
4
6
17 function testAlreadyThere1($name, $value) {
18
19 $propFind = new PropFind('foo', [
20 '{http://calendarserver.org/ns/}getctag',
21 $name,
22 ]);
23
24 $propFind->set($name, $value);
25 $corePlugin = new CorePlugin();
26 $corePlugin->propFindLate($propFind, new SimpleCollection('hi'));
27
28 $this->assertEquals("hello", $propFind->get('{http://calendarserver.org/ns/}getctag'));
29
30 }
31
41 function testRefetch($name, $value) {
42
43 $this->server->tree = new Tree(
44 new SimpleCollection('root', [
45 new Mock\PropertiesCollection(
46 'foo',
47 [],
48 [$name => $value]
49 )
50 ])
51 );
52 $propFind = new PropFind('foo', [
53 '{http://calendarserver.org/ns/}getctag',
54 $name,
55 ]);
56
57 $corePlugin = $this->server->getPlugin('core');
58 $corePlugin->propFindLate($propFind, new SimpleCollection('hi'));
59
60 $this->assertEquals("hello", $propFind->get('{http://calendarserver.org/ns/}getctag'));
61
62 }
63
64 function testNoData() {
65
66 $this->server->tree = new Tree(
67 new SimpleCollection('root', [
68 new Mock\PropertiesCollection(
69 'foo',
70 [],
71 []
72 )
73 ])
74 );
75
76 $propFind = new PropFind('foo', [
77 '{http://calendarserver.org/ns/}getctag',
78 ]);
79
80 $corePlugin = $this->server->getPlugin('core');
81 $corePlugin->propFindLate($propFind, new SimpleCollection('hi'));
82
83 $this->assertNull($propFind->get('{http://calendarserver.org/ns/}getctag'));
84
85 }
86
87 function data() {
88
89 return [
90 [
91 '{http://sabredav.org/ns}sync-token',
92 "hello"
93 ],
94 [
95 '{DAV:}sync-token',
96 "hello"
97 ],
98 [
99 '{DAV:}sync-token',
100 new Xml\Property\Href(Sync\Plugin::SYNCTOKEN_PREFIX . "hello", false)
101 ]
102 ];
103
104 }
105
106}
An exception for terminatinating execution or to throw for unit testing.
This class may be used as a basis for other webdav-related unittests.
The core plugin provides all the basic features for a WebDAV server.
Definition: CorePlugin.php:17
This class holds all the information about a PROPFIND request.
Definition: PropFind.php:11
testRefetch($name, $value)
In these test-cases, the plugin is forced to do a local propfind to fetch the items.
testAlreadyThere1($name, $value)
The assumption in these tests is that a PROPFIND is going on, and to fetch the sync-token,...
The tree object is responsible for basic tree operations.
Definition: Tree.php:17
Href property.
Definition: Href.php:26