8 require_once
'Sabre/DAV/AbstractServer.php';
15 $this->server->addPlugin(
new Plugin());
23 'REQUEST_METHOD' =>
'GET',
27 $this->server->httpRequest = (
$request);
28 $this->server->exec();
30 $this->assertEquals(501, $this->response->status,
'We expected GET to not be implemented for Directories. Response body: ' . $this->response->body);
37 'REQUEST_URI' =>
'/?mount',
38 'REQUEST_METHOD' =>
'GET',
39 'QUERY_STRING' =>
'mount',
40 'HTTP_HOST' =>
'example.org',
44 $this->server->httpRequest = (
$request);
45 $this->server->exec();
47 $this->assertEquals(200, $this->response->status);
49 $xml = simplexml_load_string($this->response->body);
50 $this->assertInstanceOf(
'SimpleXMLElement',
$xml,
'Response was not a valid xml document. The list of errors:' . print_r(libxml_get_errors(),
true) .
'. xml body: ' . $this->response->body .
'. What type we got: ' . gettype(
$xml) .
' class, if object: ' . get_class(
$xml));
52 $xml->registerXPathNamespace(
'dm',
'http://purl.org/NET/webdav/mount');
54 $this->assertEquals(
'http://example.org/', (
string)
$url[0]);
This plugin provides support for RFC4709: Mounting WebDAV servers.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.