Exemplo n.º 1
0
 public function testHeadCollectionETagHeader()
 {
     $testPath = '/collection/';
     $backend = new ezcWebdavFileBackend($this->tempDir . 'backend/');
     $etag = $backend->getProperty($testPath, 'getetag')->etag;
     $req = new ezcWebdavHeadRequest($testPath);
     $req->validateHeaders();
     $res = $backend->head($req);
     $expectedRes = new ezcWebdavHeadResponse(new ezcWebdavCollection($testPath, $backend->getAllProperties($testPath)));
     $expectedRes->setHeader('ETag', $etag);
     $this->assertEquals($expectedRes, $res, 'Expected response does not match real response.', 0, 20);
 }
Exemplo n.º 2
0
 public function testResourceHeadError()
 {
     $backend = new ezcWebdavFileBackend($this->tempDir . 'backend/');
     $request = new ezcWebdavHeadRequest('/unknown');
     $request->validateHeaders();
     $response = $backend->head($request);
     $this->assertEquals($response, new ezcWebdavErrorResponse(ezcWebdavResponse::STATUS_404, '/unknown'), 'Expected response does not match real response.', 0, 20);
 }