Definition at line 10 of file ClientTest.php.
◆ setUp()
Sabre\DAV\ClientTest::setUp |
( |
| ) |
|
Definition at line 12 of file ClientTest.php.
12 {
13
14 if (!function_exists('curl_init')) {
15 $this->markTestSkipped('CURL must be installed to test the client');
16 }
17
18 }
◆ testAuth()
Sabre\DAV\ClientTest::testAuth |
( |
| ) |
|
Definition at line 38 of file ClientTest.php.
38 {
39
41 'baseUri' => '/',
42 'userName' => 'foo',
43 'password' => 'bar',
44 ]);
45
46 $this->assertEquals(
"foo:bar",
$client->curlSettings[CURLOPT_USERPWD]);
47 $this->assertEquals(CURLAUTH_BASIC | CURLAUTH_DIGEST,
$client->curlSettings[CURLOPT_HTTPAUTH]);
48
49 }
if($_SERVER['argc']< 4) $client
References $client.
◆ testBasicAuth()
Sabre\DAV\ClientTest::testBasicAuth |
( |
| ) |
|
Definition at line 51 of file ClientTest.php.
51 {
52
54 'baseUri' => '/',
55 'userName' => 'foo',
56 'password' => 'bar',
58 ]);
59
60 $this->assertEquals(
"foo:bar",
$client->curlSettings[CURLOPT_USERPWD]);
61 $this->assertEquals(CURLAUTH_BASIC,
$client->curlSettings[CURLOPT_HTTPAUTH]);
62
63 }
const AUTH_BASIC
Basic authentication.
References $client, and Sabre\DAV\Client\AUTH_BASIC.
◆ testConstruct()
Sabre\DAV\ClientTest::testConstruct |
( |
| ) |
|
Definition at line 20 of file ClientTest.php.
20 {
21
23 'baseUri' => '/',
24 ]);
25 $this->assertInstanceOf(
'Sabre\DAV\ClientMock',
$client);
26
27 }
References $client.
◆ testConstructNoBaseUri()
Sabre\DAV\ClientTest::testConstructNoBaseUri |
( |
| ) |
|
◆ testDigestAuth()
Sabre\DAV\ClientTest::testDigestAuth |
( |
| ) |
|
Definition at line 65 of file ClientTest.php.
65 {
66
68 'baseUri' => '/',
69 'userName' => 'foo',
70 'password' => 'bar',
72 ]);
73
74 $this->assertEquals(
"foo:bar",
$client->curlSettings[CURLOPT_USERPWD]);
75 $this->assertEquals(CURLAUTH_DIGEST,
$client->curlSettings[CURLOPT_HTTPAUTH]);
76
77 }
const AUTH_DIGEST
Digest authentication.
References $client, and Sabre\DAV\Client\AUTH_DIGEST.
◆ testEncoding()
Sabre\DAV\ClientTest::testEncoding |
( |
| ) |
|
◆ testNTLMAuth()
Sabre\DAV\ClientTest::testNTLMAuth |
( |
| ) |
|
Definition at line 79 of file ClientTest.php.
79 {
80
82 'baseUri' => '/',
83 'userName' => 'foo',
84 'password' => 'bar',
86 ]);
87
88 $this->assertEquals(
"foo:bar",
$client->curlSettings[CURLOPT_USERPWD]);
89 $this->assertEquals(CURLAUTH_NTLM,
$client->curlSettings[CURLOPT_HTTPAUTH]);
90
91 }
const AUTH_NTLM
NTLM authentication.
References $client, and Sabre\DAV\Client\AUTH_NTLM.
◆ testOPTIONS()
Sabre\DAV\ClientTest::testOPTIONS |
( |
| ) |
|
Definition at line 283 of file ClientTest.php.
283 {
284
286 'baseUri' => '/',
287 ]);
288
289 $client->response =
new Response(207, [
290 'DAV' => 'calendar-access, extended-mkcol',
291 ]);
293
294 $this->assertEquals(
295 ['calendar-access', 'extended-mkcol'],
297 );
298
300 $this->assertEquals(
'OPTIONS',
$request->getMethod());
301 $this->assertEquals(
'/',
$request->getUrl());
302 $this->assertEquals([
304
305 }
foreach($paths as $path) $request
References $client, $request, and $result.
◆ testPropFind()
Sabre\DAV\ClientTest::testPropFind |
( |
| ) |
|
Definition at line 115 of file ClientTest.php.
115 {
116
118 'baseUri' => '/',
119 ]);
120
121 $responseBody = <<<XML
122<?xml version="1.0"?>
123<multistatus xmlns="DAV:">
124 <response>
125 <href>/foo</href>
126 <propstat>
127 <prop>
128 <displayname>bar</displayname>
129 </prop>
130 <status>HTTP/1.1 200 OK</status>
131 </propstat>
132 </response>
133</multistatus>
134XML;
135
136 $client->response =
new Response(207, [], $responseBody);
137 $result =
$client->propFind(
'foo', [
'{DAV:}displayname',
'{urn:zim}gir']);
138
139 $this->assertEquals([
'{DAV:}displayname' =>
'bar'],
$result);
140
142 $this->assertEquals(
'PROPFIND',
$request->getMethod());
143 $this->assertEquals(
'/foo',
$request->getUrl());
144 $this->assertEquals([
145 'Depth' => ['0'],
146 'Content-Type' => ['application/xml'],
148
149 }
References $client, $request, and $result.
◆ testPropFindDepth1()
Sabre\DAV\ClientTest::testPropFindDepth1 |
( |
| ) |
|
Definition at line 165 of file ClientTest.php.
165 {
166
168 'baseUri' => '/',
169 ]);
170
171 $responseBody = <<<XML
172<?xml version="1.0"?>
173<multistatus xmlns="DAV:">
174 <response>
175 <href>/foo</href>
176 <propstat>
177 <prop>
178 <displayname>bar</displayname>
179 </prop>
180 <status>HTTP/1.1 200 OK</status>
181 </propstat>
182 </response>
183</multistatus>
184XML;
185
186 $client->response =
new Response(207, [], $responseBody);
187 $result =
$client->propFind(
'foo', [
'{DAV:}displayname',
'{urn:zim}gir'], 1);
188
189 $this->assertEquals([
190 '/foo' => [
191 '{DAV:}displayname' => 'bar'
192 ],
194
196 $this->assertEquals(
'PROPFIND',
$request->getMethod());
197 $this->assertEquals(
'/foo',
$request->getUrl());
198 $this->assertEquals([
199 'Depth' => ['1'],
200 'Content-Type' => ['application/xml'],
202
203 }
References $client, $request, and $result.
◆ testPropFindError()
Sabre\DAV\ClientTest::testPropFindError |
( |
| ) |
|
@expectedException \Sabre\HTTP\ClientHttpException
Definition at line 154 of file ClientTest.php.
154 {
155
157 'baseUri' => '/',
158 ]);
159
160 $client->response =
new Response(405, []);
161 $client->propFind(
'foo', [
'{DAV:}displayname',
'{urn:zim}gir']);
162
163 }
References $client.
◆ testPropPatch()
Sabre\DAV\ClientTest::testPropPatch |
( |
| ) |
|
Definition at line 205 of file ClientTest.php.
205 {
206
208 'baseUri' => '/',
209 ]);
210
211 $responseBody = <<<XML
212<?xml version="1.0"?>
213<multistatus xmlns="DAV:">
214 <response>
215 <href>/foo</href>
216 <propstat>
217 <prop>
218 <displayname>bar</displayname>
219 </prop>
220 <status>HTTP/1.1 200 OK</status>
221 </propstat>
222 </response>
223</multistatus>
224XML;
225
226 $client->response =
new Response(207, [], $responseBody);
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'],
235
236 }
References $client, $request, and $result.
◆ testPropPatchHTTPError()
Sabre\DAV\ClientTest::testPropPatchHTTPError |
( |
| ) |
|
@depends testPropPatch @expectedException \Sabre\HTTP\ClientHttpException
Definition at line 242 of file ClientTest.php.
242 {
243
245 'baseUri' => '/',
246 ]);
247
248 $client->response =
new Response(403, [],
'');
249 $client->propPatch(
'foo', [
'{DAV:}displayname' =>
'hi',
'{urn:zim}gir' =>
null]);
250
251 }
References $client.
◆ testPropPatchMultiStatusError()
Sabre\DAV\ClientTest::testPropPatchMultiStatusError |
( |
| ) |
|
@depends testPropPatch @expectedException Sabre\HTTP\ClientException
Definition at line 257 of file ClientTest.php.
257 {
258
260 'baseUri' => '/',
261 ]);
262
263 $responseBody = <<<XML
264<?xml version="1.0"?>
265<multistatus xmlns="DAV:">
266<response>
267 <href>/foo</href>
268 <propstat>
269 <prop>
270 <displayname />
271 </prop>
272 <status>HTTP/1.1 403 Forbidden</status>
273 </propstat>
274</response>
275</multistatus>
276XML;
277
278 $client->response =
new Response(207, [], $responseBody);
279 $client->propPatch(
'foo', [
'{DAV:}displayname' =>
'hi',
'{urn:zim}gir' =>
null]);
280
281 }
References $client.
◆ testProxy()
Sabre\DAV\ClientTest::testProxy |
( |
| ) |
|
Definition at line 93 of file ClientTest.php.
93 {
94
96 'baseUri' => '/',
97 'proxy' => 'localhost:8888',
98 ]);
99
100 $this->assertEquals(
"localhost:8888",
$client->curlSettings[CURLOPT_PROXY]);
101
102 }
References $client.
The documentation for this class was generated from the following file: