22 $this->plugin =
new Plugin();
23 $this->plugin->setDefaultAcl([]);
24 $this->server->addPlugin(
26 new DAV\Auth\Backend\Mock()
30 $this->server->getPlugin(
'auth')->beforeMethod(
34 $this->server->addPlugin($this->plugin);
43 $this->server->httpRequest->setMethod(
'GET');
44 $this->server->httpRequest->setUrl(
'/testdir');
46 $this->server->emit(
'beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
52 $this->server->httpRequest->setMethod(
'GET');
53 $this->server->httpRequest->setUrl(
'/foo');
55 $r = $this->server->emit(
'beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
56 $this->assertTrue(
$r);
65 $this->server->httpRequest->setMethod(
'HEAD');
66 $this->server->httpRequest->setUrl(
'/testdir');
68 $this->server->emit(
'beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
77 $this->server->httpRequest->setMethod(
'OPTIONS');
78 $this->server->httpRequest->setUrl(
'/testdir');
80 $this->server->emit(
'beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
89 $this->server->httpRequest->setMethod(
'PUT');
90 $this->server->httpRequest->setUrl(
'/testdir');
92 $this->server->emit(
'beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
101 $this->server->httpRequest->setMethod(
'PROPPATCH');
102 $this->server->httpRequest->setUrl(
'/testdir');
104 $this->server->emit(
'beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
113 $this->server->httpRequest->setMethod(
'COPY');
114 $this->server->httpRequest->setUrl(
'/testdir');
116 $this->server->emit(
'beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
125 $this->server->httpRequest->setMethod(
'MOVE');
126 $this->server->httpRequest->setUrl(
'/testdir');
128 $this->server->emit(
'beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
137 $this->server->httpRequest->setMethod(
'ACL');
138 $this->server->httpRequest->setUrl(
'/testdir');
140 $this->server->emit(
'beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
149 $this->server->httpRequest->setMethod(
'LOCK');
150 $this->server->httpRequest->setUrl(
'/testdir');
152 $this->server->emit(
'beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
161 $this->server->emit(
'beforeBind', [
'testdir/file']);
170 $this->server->emit(
'beforeUnbind', [
'testdir']);
178 '{DAV:}getcontentlength',
183 $r = $this->server->emit(
'propFind', [$propFind,
new DAV\
SimpleCollection(
'testdir')]);
184 $this->assertTrue(
$r);
190 '{DAV:}displayname' => null,
191 '{DAV:}getcontentlength' => null,
193 '{DAV:}owner' => null,
197 $this->assertEquals($expected, $propFind->getResultForMultiStatus());
203 $this->plugin->hideNodesFromListings =
true;
206 '{DAV:}getcontentlength',
211 $r = $this->server->emit(
'propFind', [$propFind,
new DAV\
SimpleCollection(
'testdir')]);
212 $this->assertFalse(
$r);
testBeforeGetPropertiesNoListing()
The Request class represents a single HTTP request.
This class holds all the information about a PROPFIND request.
This class represents a single HTTP response.