8 require_once
'Sabre/DAV/ClientMock.php';
14 if (!function_exists(
'curl_init')) {
15 $this->markTestSkipped(
'CURL must be installed to test the client');
25 $this->assertInstanceOf(
'Sabre\DAV\ClientMock',
$client);
46 $this->assertEquals(
"foo:bar",
$client->curlSettings[CURLOPT_USERPWD]);
47 $this->assertEquals(CURLAUTH_BASIC | CURLAUTH_DIGEST,
$client->curlSettings[CURLOPT_HTTPAUTH]);
60 $this->assertEquals(
"foo:bar",
$client->curlSettings[CURLOPT_USERPWD]);
61 $this->assertEquals(CURLAUTH_BASIC,
$client->curlSettings[CURLOPT_HTTPAUTH]);
74 $this->assertEquals(
"foo:bar",
$client->curlSettings[CURLOPT_USERPWD]);
75 $this->assertEquals(CURLAUTH_DIGEST,
$client->curlSettings[CURLOPT_HTTPAUTH]);
88 $this->assertEquals(
"foo:bar",
$client->curlSettings[CURLOPT_USERPWD]);
89 $this->assertEquals(CURLAUTH_NTLM,
$client->curlSettings[CURLOPT_HTTPAUTH]);
97 'proxy' =>
'localhost:8888',
100 $this->assertEquals(
"localhost:8888",
$client->curlSettings[CURLOPT_PROXY]);
111 $this->assertEquals(
"identity,deflate,gzip",
$client->curlSettings[CURLOPT_ENCODING]);
121 $responseBody = <<<XML
122 <?xml version=
"1.0"?>
123 <multistatus xmlns=
"DAV:">
128 <displayname>bar</displayname>
130 <status>
HTTP/1.1 200 OK</status>
137 $result =
$client->propFind(
'foo', [
'{DAV:}displayname',
'{urn:zim}gir']);
139 $this->assertEquals([
'{DAV:}displayname' =>
'bar'],
$result);
142 $this->assertEquals(
'PROPFIND',
$request->getMethod());
143 $this->assertEquals(
'/foo',
$request->getUrl());
144 $this->assertEquals([
146 'Content-Type' => [
'application/xml'],
161 $client->propFind(
'foo', [
'{DAV:}displayname',
'{urn:zim}gir']);
171 $responseBody = <<<XML
172 <?xml version=
"1.0"?>
173 <multistatus xmlns=
"DAV:">
178 <displayname>bar</displayname>
180 <status>
HTTP/1.1 200 OK</status>
187 $result =
$client->propFind(
'foo', [
'{DAV:}displayname',
'{urn:zim}gir'], 1);
189 $this->assertEquals([
191 '{DAV:}displayname' =>
'bar' 196 $this->assertEquals(
'PROPFIND',
$request->getMethod());
197 $this->assertEquals(
'/foo',
$request->getUrl());
198 $this->assertEquals([
200 'Content-Type' => [
'application/xml'],
211 $responseBody = <<<XML
212 <?xml version=
"1.0"?>
213 <multistatus xmlns=
"DAV:">
218 <displayname>bar</displayname>
220 <status>
HTTP/1.1 200 OK</status>
227 $result =
$client->propPatch(
'foo', [
'{DAV:}displayname' =>
'hi',
'{urn:zim}gir' => null]);
230 $this->assertEquals(
'PROPPATCH',
$request->getMethod());
231 $this->assertEquals(
'/foo',
$request->getUrl());
232 $this->assertEquals([
233 'Content-Type' => [
'application/xml'],
249 $client->propPatch(
'foo', [
'{DAV:}displayname' =>
'hi',
'{urn:zim}gir' => null]);
263 $responseBody = <<<XML
264 <?xml version=
"1.0"?>
265 <multistatus xmlns=
"DAV:">
272 <status>
HTTP/1.1 403 Forbidden</status>
279 $client->propPatch(
'foo', [
'{DAV:}displayname' =>
'hi',
'{urn:zim}gir' => null]);
290 'DAV' =>
'calendar-access, extended-mkcol',
295 [
'calendar-access',
'extended-mkcol'],
300 $this->assertEquals(
'OPTIONS',
$request->getMethod());
301 $this->assertEquals(
'/',
$request->getUrl());
302 $this->assertEquals([
const ENCODING_GZIP
Gzip encoding.
foreach($paths as $path) $request
if($_SERVER['argc']< 4) $client
const AUTH_NTLM
NTLM authentication.
testConstructNoBaseUri()
InvalidArgumentException
const AUTH_DIGEST
Digest authentication.
testPropPatchMultiStatusError()
testPropPatch Sabre
This class represents a single HTTP response.
testPropPatchHTTPError()
testPropPatch
const ENCODING_IDENTITY
Identity encoding, which basically does not nothing.
const ENCODING_DEFLATE
Deflate encoding.
const AUTH_BASIC
Basic authentication.