16 $this->plugin =
new Plugin(
20 $this->server->addPlugin($this->plugin);
26 $this->assertArrayHasKey(
28 $this->plugin->getPluginInfo()
35 $this->server->updateProperties(
'', [
'{DAV:}displayname' =>
'hi']);
38 '{DAV:}displayname' =>
'hi',
40 ], $this->backend->data);
50 $result = $this->server->getProperties(
'', [
'{DAV:}displayname']);
53 '{DAV:}displayname' =>
'hi',
64 $this->server->emit(
'afterUnbind', [
'']);
65 $this->assertEquals([], $this->backend->data);
71 $this->server->tree->getNodeForPath(
'files')->createFile(
'source');
72 $this->server->updateProperties(
'files/source', [
'{DAV:}displayname' =>
'hi']);
74 $request = new \Sabre\HTTP\Request(
'MOVE',
'/files/source', [
'Destination' =>
'/files/dest']);
75 $this->assertHTTPStatus(201,
$request);
77 $result = $this->server->getProperties(
'/files/dest', [
'{DAV:}displayname']);
80 '{DAV:}displayname' =>
'hi',
83 $this->server->tree->getNodeForPath(
'files')->createFile(
'source');
84 $result = $this->server->getProperties(
'/files/source', [
'{DAV:}displayname']);
86 $this->assertEquals([],
$result);
95 $this->plugin->pathFilter =
function(
$path) {
101 $this->server->updateProperties(
'', [
'{DAV:}displayname' =>
'hi']);
102 $this->assertEquals([], $this->backend->data);
112 $result = $this->server->getProperties(
'', [
'{DAV:}displayname']);
114 $this->assertEquals([],
$result);
testGetPropertyInFilteredPath()
testSetPropertyInFilteredPath
foreach($paths as $path) $request
testSetPropertyInFilteredPath()
testDeleteProperty
testDeleteProperty()
testSetProperty
This class may be used as a basis for other webdav-related unittests.
testGetProperty()
testSetProperty