public function testValidateHeadersFailure() { $req = new ezcWebdavUnlockRequest('/foo', '/bar'); try { $req->validateHeaders(); $this->fail('Exception not thrown on missing Unlock-Token header.'); } catch (ezcWebdavMissingHeaderException $e) { } }
/** * Parses the UNLOCK request and returns a request object. * * This method is responsible for parsing the UNLOCK request. It retrieves * the current request URI in $path and the request body as $body. The * return value, if no exception is thrown, is a valid {@link * ezcWebdavUnlockRequest} object. * * This method may be overwritten to adjust it to special client behaviour. * * @param string $path * @param string $body * @return ezcWebdavUnlockRequest */ protected function parseUnlockRequest($path, $body) { $request = new ezcWebdavUnlockRequest($path); $request->setHeaders(ezcWebdavServer::getInstance()->headerHandler->parseHeaders()); $request->setHeader('Lock-Token', $this->headerHandler->parseLockTokenHeader()); return $request; }