xref: /plugin/davcal/vendor/sabre/dav/tests/Sabre/DAV/ServerPreconditionTest.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\DAV;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehleruse Sabre\HTTP;
6*a1a3b679SAndreas Boehler
7*a1a3b679SAndreas Boehlerrequire_once 'Sabre/HTTP/ResponseMock.php';
8*a1a3b679SAndreas Boehler
9*a1a3b679SAndreas Boehlerclass ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
10*a1a3b679SAndreas Boehler
11*a1a3b679SAndreas Boehler    /**
12*a1a3b679SAndreas Boehler     * @expectedException Sabre\DAV\Exception\PreconditionFailed
13*a1a3b679SAndreas Boehler     */
14*a1a3b679SAndreas Boehler    function testIfMatchNoNode() {
15*a1a3b679SAndreas Boehler
16*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
17*a1a3b679SAndreas Boehler        $server = new Server($root);
18*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('GET', '/bar', ['If-Match' => '*']);
19*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
20*a1a3b679SAndreas Boehler        $server->checkPreconditions($httpRequest, $httpResponse);
21*a1a3b679SAndreas Boehler
22*a1a3b679SAndreas Boehler    }
23*a1a3b679SAndreas Boehler
24*a1a3b679SAndreas Boehler    /**
25*a1a3b679SAndreas Boehler     */
26*a1a3b679SAndreas Boehler    function testIfMatchHasNode() {
27*a1a3b679SAndreas Boehler
28*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
29*a1a3b679SAndreas Boehler        $server = new Server($root);
30*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '*']);
31*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
32*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
33*a1a3b679SAndreas Boehler
34*a1a3b679SAndreas Boehler    }
35*a1a3b679SAndreas Boehler
36*a1a3b679SAndreas Boehler    /**
37*a1a3b679SAndreas Boehler     * @expectedException Sabre\DAV\Exception\PreconditionFailed
38*a1a3b679SAndreas Boehler     */
39*a1a3b679SAndreas Boehler    function testIfMatchWrongEtag() {
40*a1a3b679SAndreas Boehler
41*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
42*a1a3b679SAndreas Boehler        $server = new Server($root);
43*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '1234']);
44*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
45*a1a3b679SAndreas Boehler        $server->checkPreconditions($httpRequest, $httpResponse);
46*a1a3b679SAndreas Boehler
47*a1a3b679SAndreas Boehler    }
48*a1a3b679SAndreas Boehler
49*a1a3b679SAndreas Boehler    /**
50*a1a3b679SAndreas Boehler     */
51*a1a3b679SAndreas Boehler    function testIfMatchCorrectEtag() {
52*a1a3b679SAndreas Boehler
53*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
54*a1a3b679SAndreas Boehler        $server = new Server($root);
55*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '"abc123"']);
56*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
57*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
58*a1a3b679SAndreas Boehler
59*a1a3b679SAndreas Boehler    }
60*a1a3b679SAndreas Boehler
61*a1a3b679SAndreas Boehler    /**
62*a1a3b679SAndreas Boehler     * Evolution sometimes uses \" instead of " for If-Match headers.
63*a1a3b679SAndreas Boehler     *
64*a1a3b679SAndreas Boehler     * @depends testIfMatchCorrectEtag
65*a1a3b679SAndreas Boehler     */
66*a1a3b679SAndreas Boehler    function testIfMatchEvolutionEtag() {
67*a1a3b679SAndreas Boehler
68*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
69*a1a3b679SAndreas Boehler        $server = new Server($root);
70*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '\\"abc123\\"']);
71*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
72*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
73*a1a3b679SAndreas Boehler
74*a1a3b679SAndreas Boehler    }
75*a1a3b679SAndreas Boehler
76*a1a3b679SAndreas Boehler    /**
77*a1a3b679SAndreas Boehler     */
78*a1a3b679SAndreas Boehler    function testIfMatchMultiple() {
79*a1a3b679SAndreas Boehler
80*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
81*a1a3b679SAndreas Boehler        $server = new Server($root);
82*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('GET', '/foo', ['If-Match' => '"hellothere", "abc123"']);
83*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
84*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
85*a1a3b679SAndreas Boehler
86*a1a3b679SAndreas Boehler    }
87*a1a3b679SAndreas Boehler
88*a1a3b679SAndreas Boehler    /**
89*a1a3b679SAndreas Boehler     */
90*a1a3b679SAndreas Boehler    function testIfNoneMatchNoNode() {
91*a1a3b679SAndreas Boehler
92*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
93*a1a3b679SAndreas Boehler        $server = new Server($root);
94*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('GET', '/bar', ['If-None-Match' => '*']);
95*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
96*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
97*a1a3b679SAndreas Boehler
98*a1a3b679SAndreas Boehler    }
99*a1a3b679SAndreas Boehler
100*a1a3b679SAndreas Boehler    /**
101*a1a3b679SAndreas Boehler     * @expectedException Sabre\DAV\Exception\PreconditionFailed
102*a1a3b679SAndreas Boehler     */
103*a1a3b679SAndreas Boehler    function testIfNoneMatchHasNode() {
104*a1a3b679SAndreas Boehler
105*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
106*a1a3b679SAndreas Boehler        $server = new Server($root);
107*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '*']);
108*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
109*a1a3b679SAndreas Boehler        $server->checkPreconditions($httpRequest, $httpResponse);
110*a1a3b679SAndreas Boehler
111*a1a3b679SAndreas Boehler    }
112*a1a3b679SAndreas Boehler
113*a1a3b679SAndreas Boehler    /**
114*a1a3b679SAndreas Boehler     */
115*a1a3b679SAndreas Boehler    function testIfNoneMatchWrongEtag() {
116*a1a3b679SAndreas Boehler
117*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
118*a1a3b679SAndreas Boehler        $server = new Server($root);
119*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '"1234"']);
120*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
121*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
122*a1a3b679SAndreas Boehler
123*a1a3b679SAndreas Boehler    }
124*a1a3b679SAndreas Boehler
125*a1a3b679SAndreas Boehler    /**
126*a1a3b679SAndreas Boehler     */
127*a1a3b679SAndreas Boehler    function testIfNoneMatchWrongEtagMultiple() {
128*a1a3b679SAndreas Boehler
129*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
130*a1a3b679SAndreas Boehler        $server = new Server($root);
131*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '"1234", "5678"']);
132*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
133*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
134*a1a3b679SAndreas Boehler
135*a1a3b679SAndreas Boehler    }
136*a1a3b679SAndreas Boehler
137*a1a3b679SAndreas Boehler    /**
138*a1a3b679SAndreas Boehler     * @expectedException Sabre\DAV\Exception\PreconditionFailed
139*a1a3b679SAndreas Boehler     */
140*a1a3b679SAndreas Boehler    public function testIfNoneMatchCorrectEtag() {
141*a1a3b679SAndreas Boehler
142*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
143*a1a3b679SAndreas Boehler        $server = new Server($root);
144*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '"abc123"']);
145*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
146*a1a3b679SAndreas Boehler        $server->checkPreconditions($httpRequest, $httpResponse);
147*a1a3b679SAndreas Boehler
148*a1a3b679SAndreas Boehler    }
149*a1a3b679SAndreas Boehler
150*a1a3b679SAndreas Boehler    /**
151*a1a3b679SAndreas Boehler     * @expectedException Sabre\DAV\Exception\PreconditionFailed
152*a1a3b679SAndreas Boehler     */
153*a1a3b679SAndreas Boehler    public function testIfNoneMatchCorrectEtagMultiple() {
154*a1a3b679SAndreas Boehler
155*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
156*a1a3b679SAndreas Boehler        $server = new Server($root);
157*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('POST', '/foo', ['If-None-Match' => '"1234, "abc123"']);
158*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
159*a1a3b679SAndreas Boehler        $server->checkPreconditions($httpRequest, $httpResponse);
160*a1a3b679SAndreas Boehler
161*a1a3b679SAndreas Boehler    }
162*a1a3b679SAndreas Boehler
163*a1a3b679SAndreas Boehler    /**
164*a1a3b679SAndreas Boehler     */
165*a1a3b679SAndreas Boehler    public function testIfNoneMatchCorrectEtagAsGet() {
166*a1a3b679SAndreas Boehler
167*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
168*a1a3b679SAndreas Boehler        $server = new Server($root);
169*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('GET', '/foo', ['If-None-Match' => '"abc123"']);
170*a1a3b679SAndreas Boehler        $server->httpResponse = new HTTP\ResponseMock();
171*a1a3b679SAndreas Boehler
172*a1a3b679SAndreas Boehler        $this->assertFalse($server->checkPreconditions($httpRequest, $server->httpResponse));
173*a1a3b679SAndreas Boehler        $this->assertEquals(304, $server->httpResponse->getStatus());
174*a1a3b679SAndreas Boehler        $this->assertEquals(['ETag' => ['"abc123"']], $server->httpResponse->getHeaders());
175*a1a3b679SAndreas Boehler
176*a1a3b679SAndreas Boehler    }
177*a1a3b679SAndreas Boehler
178*a1a3b679SAndreas Boehler    /**
179*a1a3b679SAndreas Boehler     * This was a test written for issue #515.
180*a1a3b679SAndreas Boehler     */
181*a1a3b679SAndreas Boehler    public function testNoneMatchCorrectEtagEnsureSapiSent() {
182*a1a3b679SAndreas Boehler
183*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
184*a1a3b679SAndreas Boehler        $server = new Server($root);
185*a1a3b679SAndreas Boehler        $server->sapi = new HTTP\SapiMock();
186*a1a3b679SAndreas Boehler        HTTP\SapiMock::$sent = 0;
187*a1a3b679SAndreas Boehler        $httpRequest = new HTTP\Request('GET', '/foo', ['If-None-Match' => '"abc123"']);
188*a1a3b679SAndreas Boehler        $server->httpRequest = $httpRequest;
189*a1a3b679SAndreas Boehler        $server->httpResponse = new HTTP\ResponseMock();
190*a1a3b679SAndreas Boehler
191*a1a3b679SAndreas Boehler        $server->exec();
192*a1a3b679SAndreas Boehler
193*a1a3b679SAndreas Boehler        $this->assertFalse($server->checkPreconditions($httpRequest, $server->httpResponse));
194*a1a3b679SAndreas Boehler        $this->assertEquals(304, $server->httpResponse->getStatus());
195*a1a3b679SAndreas Boehler        $this->assertEquals([
196*a1a3b679SAndreas Boehler            'ETag' => ['"abc123"'],
197*a1a3b679SAndreas Boehler            'X-Sabre-Version' => [Version::VERSION],
198*a1a3b679SAndreas Boehler        ], $server->httpResponse->getHeaders());
199*a1a3b679SAndreas Boehler        $this->assertEquals(1, HTTP\SapiMock::$sent);
200*a1a3b679SAndreas Boehler
201*a1a3b679SAndreas Boehler    }
202*a1a3b679SAndreas Boehler
203*a1a3b679SAndreas Boehler    /**
204*a1a3b679SAndreas Boehler     */
205*a1a3b679SAndreas Boehler    public function testIfModifiedSinceUnModified() {
206*a1a3b679SAndreas Boehler
207*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
208*a1a3b679SAndreas Boehler        $server = new Server($root);
209*a1a3b679SAndreas Boehler        $httpRequest = HTTP\Sapi::createFromServerArray(array(
210*a1a3b679SAndreas Boehler            'HTTP_IF_MODIFIED_SINCE' => 'Sun, 06 Nov 1994 08:49:37 GMT',
211*a1a3b679SAndreas Boehler            'REQUEST_URI'   => '/foo'
212*a1a3b679SAndreas Boehler        ));
213*a1a3b679SAndreas Boehler        $server->httpResponse = new HTTP\ResponseMock();
214*a1a3b679SAndreas Boehler        $this->assertFalse($server->checkPreconditions($httpRequest, $server->httpResponse));
215*a1a3b679SAndreas Boehler
216*a1a3b679SAndreas Boehler        $this->assertEquals(304, $server->httpResponse->status);
217*a1a3b679SAndreas Boehler        $this->assertEquals(array(
218*a1a3b679SAndreas Boehler            'Last-Modified' => ['Sat, 06 Apr 1985 23:30:00 GMT'],
219*a1a3b679SAndreas Boehler        ), $server->httpResponse->getHeaders());
220*a1a3b679SAndreas Boehler
221*a1a3b679SAndreas Boehler    }
222*a1a3b679SAndreas Boehler
223*a1a3b679SAndreas Boehler
224*a1a3b679SAndreas Boehler    /**
225*a1a3b679SAndreas Boehler     */
226*a1a3b679SAndreas Boehler    public function testIfModifiedSinceModified() {
227*a1a3b679SAndreas Boehler
228*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
229*a1a3b679SAndreas Boehler        $server = new Server($root);
230*a1a3b679SAndreas Boehler        $httpRequest = HTTP\Sapi::createFromServerArray(array(
231*a1a3b679SAndreas Boehler            'HTTP_IF_MODIFIED_SINCE' => 'Tue, 06 Nov 1984 08:49:37 GMT',
232*a1a3b679SAndreas Boehler            'REQUEST_URI'   => '/foo'
233*a1a3b679SAndreas Boehler        ));
234*a1a3b679SAndreas Boehler
235*a1a3b679SAndreas Boehler        $httpRequest = $httpRequest;
236*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\ResponseMock();
237*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
238*a1a3b679SAndreas Boehler
239*a1a3b679SAndreas Boehler    }
240*a1a3b679SAndreas Boehler
241*a1a3b679SAndreas Boehler    /**
242*a1a3b679SAndreas Boehler     */
243*a1a3b679SAndreas Boehler    public function testIfModifiedSinceInvalidDate() {
244*a1a3b679SAndreas Boehler
245*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
246*a1a3b679SAndreas Boehler        $server = new Server($root);
247*a1a3b679SAndreas Boehler        $httpRequest = HTTP\Sapi::createFromServerArray(array(
248*a1a3b679SAndreas Boehler            'HTTP_IF_MODIFIED_SINCE' => 'Your mother',
249*a1a3b679SAndreas Boehler            'REQUEST_URI'   => '/foo'
250*a1a3b679SAndreas Boehler        ));
251*a1a3b679SAndreas Boehler        $httpRequest = $httpRequest;
252*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\ResponseMock();
253*a1a3b679SAndreas Boehler
254*a1a3b679SAndreas Boehler        // Invalid dates must be ignored, so this should return true
255*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
256*a1a3b679SAndreas Boehler
257*a1a3b679SAndreas Boehler    }
258*a1a3b679SAndreas Boehler
259*a1a3b679SAndreas Boehler    /**
260*a1a3b679SAndreas Boehler     */
261*a1a3b679SAndreas Boehler    public function testIfModifiedSinceInvalidDate2() {
262*a1a3b679SAndreas Boehler
263*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
264*a1a3b679SAndreas Boehler        $server = new Server($root);
265*a1a3b679SAndreas Boehler        $httpRequest = HTTP\Sapi::createFromServerArray(array(
266*a1a3b679SAndreas Boehler            'HTTP_IF_MODIFIED_SINCE' => 'Sun, 06 Nov 1994 08:49:37 EST',
267*a1a3b679SAndreas Boehler            'REQUEST_URI'   => '/foo'
268*a1a3b679SAndreas Boehler        ));
269*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\ResponseMock();
270*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
271*a1a3b679SAndreas Boehler
272*a1a3b679SAndreas Boehler    }
273*a1a3b679SAndreas Boehler
274*a1a3b679SAndreas Boehler
275*a1a3b679SAndreas Boehler    /**
276*a1a3b679SAndreas Boehler     */
277*a1a3b679SAndreas Boehler    public function testIfUnmodifiedSinceUnModified() {
278*a1a3b679SAndreas Boehler
279*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
280*a1a3b679SAndreas Boehler        $server = new Server($root);
281*a1a3b679SAndreas Boehler        $httpRequest = HTTP\Sapi::createFromServerArray(array(
282*a1a3b679SAndreas Boehler            'HTTP_IF_UNMODIFIED_SINCE' => 'Sun, 06 Nov 1994 08:49:37 GMT',
283*a1a3b679SAndreas Boehler            'REQUEST_URI'   => '/foo'
284*a1a3b679SAndreas Boehler        ));
285*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\Response();
286*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
287*a1a3b679SAndreas Boehler
288*a1a3b679SAndreas Boehler    }
289*a1a3b679SAndreas Boehler
290*a1a3b679SAndreas Boehler
291*a1a3b679SAndreas Boehler    /**
292*a1a3b679SAndreas Boehler     * @expectedException Sabre\DAV\Exception\PreconditionFailed
293*a1a3b679SAndreas Boehler     */
294*a1a3b679SAndreas Boehler    public function testIfUnmodifiedSinceModified() {
295*a1a3b679SAndreas Boehler
296*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
297*a1a3b679SAndreas Boehler        $server = new Server($root);
298*a1a3b679SAndreas Boehler        $httpRequest = HTTP\Sapi::createFromServerArray(array(
299*a1a3b679SAndreas Boehler            'HTTP_IF_UNMODIFIED_SINCE' => 'Tue, 06 Nov 1984 08:49:37 GMT',
300*a1a3b679SAndreas Boehler            'REQUEST_URI'   => '/foo'
301*a1a3b679SAndreas Boehler        ));
302*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\ResponseMock();
303*a1a3b679SAndreas Boehler        $server->checkPreconditions($httpRequest, $httpResponse);
304*a1a3b679SAndreas Boehler
305*a1a3b679SAndreas Boehler    }
306*a1a3b679SAndreas Boehler
307*a1a3b679SAndreas Boehler    /**
308*a1a3b679SAndreas Boehler     */
309*a1a3b679SAndreas Boehler    public function testIfUnmodifiedSinceInvalidDate() {
310*a1a3b679SAndreas Boehler
311*a1a3b679SAndreas Boehler        $root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
312*a1a3b679SAndreas Boehler        $server = new Server($root);
313*a1a3b679SAndreas Boehler        $httpRequest = HTTP\Sapi::createFromServerArray(array(
314*a1a3b679SAndreas Boehler            'HTTP_IF_UNMODIFIED_SINCE' => 'Sun, 06 Nov 1984 08:49:37 CET',
315*a1a3b679SAndreas Boehler            'REQUEST_URI'   => '/foo'
316*a1a3b679SAndreas Boehler        ));
317*a1a3b679SAndreas Boehler        $httpResponse = new HTTP\ResponseMock();
318*a1a3b679SAndreas Boehler        $this->assertTrue($server->checkPreconditions($httpRequest, $httpResponse));
319*a1a3b679SAndreas Boehler
320*a1a3b679SAndreas Boehler    }
321*a1a3b679SAndreas Boehler
322*a1a3b679SAndreas Boehler
323*a1a3b679SAndreas Boehler}
324*a1a3b679SAndreas Boehler
325*a1a3b679SAndreas Boehlerclass ServerPreconditionsNode extends File {
326*a1a3b679SAndreas Boehler
327*a1a3b679SAndreas Boehler    function getETag() {
328*a1a3b679SAndreas Boehler
329*a1a3b679SAndreas Boehler        return '"abc123"';
330*a1a3b679SAndreas Boehler
331*a1a3b679SAndreas Boehler    }
332*a1a3b679SAndreas Boehler
333*a1a3b679SAndreas Boehler    function getLastModified() {
334*a1a3b679SAndreas Boehler
335*a1a3b679SAndreas Boehler        /* my birthday & time, I believe */
336*a1a3b679SAndreas Boehler        return strtotime('1985-04-07 01:30 +02:00');
337*a1a3b679SAndreas Boehler
338*a1a3b679SAndreas Boehler    }
339*a1a3b679SAndreas Boehler
340*a1a3b679SAndreas Boehler    function getName() {
341*a1a3b679SAndreas Boehler
342*a1a3b679SAndreas Boehler        return 'foo';
343*a1a3b679SAndreas Boehler
344*a1a3b679SAndreas Boehler    }
345*a1a3b679SAndreas Boehler
346*a1a3b679SAndreas Boehler}
347