Definition at line 9 of file ServerPreconditionTest.php.
◆ testIfMatchCorrectEtag()
Sabre\DAV\ServerPreconditionsTest::testIfMatchCorrectEtag |
( |
| ) |
|
Definition at line 51 of file ServerPreconditionTest.php.
References $root, and $server.
53 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
55 $httpRequest =
new HTTP\Request(
'GET',
'/foo', [
'If-Match' =>
'"abc123"']);
56 $httpResponse =
new HTTP\Response();
57 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
◆ testIfMatchEvolutionEtag()
Sabre\DAV\ServerPreconditionsTest::testIfMatchEvolutionEtag |
( |
| ) |
|
Evolution sometimes uses " instead of " for If-Match headers.
testIfMatchCorrectEtag
Definition at line 66 of file ServerPreconditionTest.php.
References $root, and $server.
68 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
70 $httpRequest =
new HTTP\Request(
'GET',
'/foo', [
'If-Match' =>
'\\"abc123\\"']);
71 $httpResponse =
new HTTP\Response();
72 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
◆ testIfMatchHasNode()
Sabre\DAV\ServerPreconditionsTest::testIfMatchHasNode |
( |
| ) |
|
Definition at line 26 of file ServerPreconditionTest.php.
References $root, and $server.
28 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
30 $httpRequest =
new HTTP\Request(
'GET',
'/foo', [
'If-Match' =>
'*']);
31 $httpResponse =
new HTTP\Response();
32 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
◆ testIfMatchMultiple()
Sabre\DAV\ServerPreconditionsTest::testIfMatchMultiple |
( |
| ) |
|
Definition at line 78 of file ServerPreconditionTest.php.
References $root, and $server.
80 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
82 $httpRequest =
new HTTP\Request(
'GET',
'/foo', [
'If-Match' =>
'"hellothere", "abc123"']);
83 $httpResponse =
new HTTP\Response();
84 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
◆ testIfMatchNoNode()
Sabre\DAV\ServerPreconditionsTest::testIfMatchNoNode |
( |
| ) |
|
Sabre
Definition at line 14 of file ServerPreconditionTest.php.
References $root, and $server.
16 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
18 $httpRequest =
new HTTP\Request(
'GET',
'/bar', [
'If-Match' =>
'*']);
19 $httpResponse =
new HTTP\Response();
20 $server->checkPreconditions($httpRequest, $httpResponse);
◆ testIfMatchWrongEtag()
Sabre\DAV\ServerPreconditionsTest::testIfMatchWrongEtag |
( |
| ) |
|
Sabre
Definition at line 39 of file ServerPreconditionTest.php.
References $root, and $server.
41 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
43 $httpRequest =
new HTTP\Request(
'GET',
'/foo', [
'If-Match' =>
'1234']);
44 $httpResponse =
new HTTP\Response();
45 $server->checkPreconditions($httpRequest, $httpResponse);
◆ testIfModifiedSinceInvalidDate()
Sabre\DAV\ServerPreconditionsTest::testIfModifiedSinceInvalidDate |
( |
| ) |
|
Definition at line 242 of file ServerPreconditionTest.php.
References $root, $server, and Sabre\HTTP\Sapi\createFromServerArray().
244 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
247 'HTTP_IF_MODIFIED_SINCE' =>
'Your mother',
248 'REQUEST_URI' =>
'/foo' 250 $httpResponse =
new HTTP\ResponseMock();
253 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testIfModifiedSinceInvalidDate2()
Sabre\DAV\ServerPreconditionsTest::testIfModifiedSinceInvalidDate2 |
( |
| ) |
|
Definition at line 259 of file ServerPreconditionTest.php.
References $root, $server, and Sabre\HTTP\Sapi\createFromServerArray().
261 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
264 'HTTP_IF_MODIFIED_SINCE' =>
'Sun, 06 Nov 1994 08:49:37 EST',
265 'REQUEST_URI' =>
'/foo' 267 $httpResponse =
new HTTP\ResponseMock();
268 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testIfModifiedSinceModified()
Sabre\DAV\ServerPreconditionsTest::testIfModifiedSinceModified |
( |
| ) |
|
Definition at line 226 of file ServerPreconditionTest.php.
References $root, $server, and Sabre\HTTP\Sapi\createFromServerArray().
228 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
231 'HTTP_IF_MODIFIED_SINCE' =>
'Tue, 06 Nov 1984 08:49:37 GMT',
232 'REQUEST_URI' =>
'/foo' 235 $httpResponse =
new HTTP\ResponseMock();
236 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testIfModifiedSinceUnModified()
Sabre\DAV\ServerPreconditionsTest::testIfModifiedSinceUnModified |
( |
| ) |
|
Definition at line 205 of file ServerPreconditionTest.php.
References $root, $server, and Sabre\HTTP\Sapi\createFromServerArray().
207 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
210 'HTTP_IF_MODIFIED_SINCE' =>
'Sun, 06 Nov 1994 08:49:37 GMT',
211 'REQUEST_URI' =>
'/foo' 213 $server->httpResponse =
new HTTP\ResponseMock();
214 $this->assertFalse(
$server->checkPreconditions($httpRequest,
$server->httpResponse));
216 $this->assertEquals(304,
$server->httpResponse->status);
217 $this->assertEquals([
218 'Last-Modified' => [
'Sat, 06 Apr 1985 23:30:00 GMT'],
219 ],
$server->httpResponse->getHeaders());
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testIfNoneMatchCorrectEtag()
Sabre\DAV\ServerPreconditionsTest::testIfNoneMatchCorrectEtag |
( |
| ) |
|
Sabre
Definition at line 140 of file ServerPreconditionTest.php.
References $root, and $server.
142 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
144 $httpRequest =
new HTTP\Request(
'POST',
'/foo', [
'If-None-Match' =>
'"abc123"']);
145 $httpResponse =
new HTTP\Response();
146 $server->checkPreconditions($httpRequest, $httpResponse);
◆ testIfNoneMatchCorrectEtagAsGet()
Sabre\DAV\ServerPreconditionsTest::testIfNoneMatchCorrectEtagAsGet |
( |
| ) |
|
Definition at line 165 of file ServerPreconditionTest.php.
References $root, and $server.
167 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
169 $httpRequest =
new HTTP\Request(
'GET',
'/foo', [
'If-None-Match' =>
'"abc123"']);
170 $server->httpResponse =
new HTTP\ResponseMock();
172 $this->assertFalse(
$server->checkPreconditions($httpRequest,
$server->httpResponse));
173 $this->assertEquals(304,
$server->httpResponse->getStatus());
174 $this->assertEquals([
'ETag' => [
'"abc123"']],
$server->httpResponse->getHeaders());
◆ testIfNoneMatchCorrectEtagMultiple()
Sabre\DAV\ServerPreconditionsTest::testIfNoneMatchCorrectEtagMultiple |
( |
| ) |
|
Sabre
Definition at line 153 of file ServerPreconditionTest.php.
References $root, and $server.
155 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
157 $httpRequest =
new HTTP\Request(
'POST',
'/foo', [
'If-None-Match' =>
'"1234, "abc123"']);
158 $httpResponse =
new HTTP\Response();
159 $server->checkPreconditions($httpRequest, $httpResponse);
◆ testIfNoneMatchHasNode()
Sabre\DAV\ServerPreconditionsTest::testIfNoneMatchHasNode |
( |
| ) |
|
Sabre
Definition at line 103 of file ServerPreconditionTest.php.
References $root, and $server.
105 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
107 $httpRequest =
new HTTP\Request(
'POST',
'/foo', [
'If-None-Match' =>
'*']);
108 $httpResponse =
new HTTP\Response();
109 $server->checkPreconditions($httpRequest, $httpResponse);
◆ testIfNoneMatchNoNode()
Sabre\DAV\ServerPreconditionsTest::testIfNoneMatchNoNode |
( |
| ) |
|
Definition at line 90 of file ServerPreconditionTest.php.
References $root, and $server.
92 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
94 $httpRequest =
new HTTP\Request(
'GET',
'/bar', [
'If-None-Match' =>
'*']);
95 $httpResponse =
new HTTP\Response();
96 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
◆ testIfNoneMatchWrongEtag()
Sabre\DAV\ServerPreconditionsTest::testIfNoneMatchWrongEtag |
( |
| ) |
|
Definition at line 115 of file ServerPreconditionTest.php.
References $root, and $server.
117 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
119 $httpRequest =
new HTTP\Request(
'POST',
'/foo', [
'If-None-Match' =>
'"1234"']);
120 $httpResponse =
new HTTP\Response();
121 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
◆ testIfNoneMatchWrongEtagMultiple()
Sabre\DAV\ServerPreconditionsTest::testIfNoneMatchWrongEtagMultiple |
( |
| ) |
|
Definition at line 127 of file ServerPreconditionTest.php.
References $root, and $server.
129 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
131 $httpRequest =
new HTTP\Request(
'POST',
'/foo', [
'If-None-Match' =>
'"1234", "5678"']);
132 $httpResponse =
new HTTP\Response();
133 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
◆ testIfUnmodifiedSinceInvalidDate()
Sabre\DAV\ServerPreconditionsTest::testIfUnmodifiedSinceInvalidDate |
( |
| ) |
|
Definition at line 307 of file ServerPreconditionTest.php.
References $root, $server, and Sabre\HTTP\Sapi\createFromServerArray().
309 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
312 'HTTP_IF_UNMODIFIED_SINCE' =>
'Sun, 06 Nov 1984 08:49:37 CET',
313 'REQUEST_URI' =>
'/foo' 315 $httpResponse =
new HTTP\ResponseMock();
316 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testIfUnmodifiedSinceModified()
Sabre\DAV\ServerPreconditionsTest::testIfUnmodifiedSinceModified |
( |
| ) |
|
Sabre
Definition at line 292 of file ServerPreconditionTest.php.
References $root, $server, and Sabre\HTTP\Sapi\createFromServerArray().
294 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
297 'HTTP_IF_UNMODIFIED_SINCE' =>
'Tue, 06 Nov 1984 08:49:37 GMT',
298 'REQUEST_URI' =>
'/foo' 300 $httpResponse =
new HTTP\ResponseMock();
301 $server->checkPreconditions($httpRequest, $httpResponse);
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testIfUnmodifiedSinceUnModified()
Sabre\DAV\ServerPreconditionsTest::testIfUnmodifiedSinceUnModified |
( |
| ) |
|
Definition at line 275 of file ServerPreconditionTest.php.
References $root, $server, and Sabre\HTTP\Sapi\createFromServerArray().
277 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
280 'HTTP_IF_UNMODIFIED_SINCE' =>
'Sun, 06 Nov 1994 08:49:37 GMT',
281 'REQUEST_URI' =>
'/foo' 283 $httpResponse =
new HTTP\Response();
284 $this->assertTrue(
$server->checkPreconditions($httpRequest, $httpResponse));
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testNoneMatchCorrectEtagEnsureSapiSent()
Sabre\DAV\ServerPreconditionsTest::testNoneMatchCorrectEtagEnsureSapiSent |
( |
| ) |
|
This was a test written for issue #515.
Definition at line 181 of file ServerPreconditionTest.php.
References $root, Sabre\HTTP\SapiMock\$sent, $server, and Sabre\DAV\Version\VERSION.
183 $root =
new SimpleCollection(
'root', [
new ServerPreconditionsNode()]);
185 $server->sapi =
new HTTP\SapiMock();
187 $httpRequest =
new HTTP\Request(
'GET',
'/foo', [
'If-None-Match' =>
'"abc123"']);
188 $server->httpRequest = $httpRequest;
189 $server->httpResponse =
new HTTP\ResponseMock();
193 $this->assertFalse(
$server->checkPreconditions($httpRequest,
$server->httpResponse));
194 $this->assertEquals(304,
$server->httpResponse->getStatus());
195 $this->assertEquals([
196 'ETag' => [
'"abc123"'],
198 ],
$server->httpResponse->getHeaders());
const VERSION
Full version number.
The documentation for this class was generated from the following file: