3 require_once 'Sabre/DAV/AbstractServer.php';
5 class Sabre_DAV_Mount_PluginTest extends Sabre_DAV_AbstractServer {
10 $this->server->addPlugin(new Sabre_DAV_Mount_Plugin());
14 function testPassThrough() {
18 'REQUEST_METHOD' => 'GET',
21 $request = new Sabre_HTTP_Request($serverVars);
22 $this->server->httpRequest = ($request);
23 $this->server->exec();
25 $this->assertEquals('HTTP/1.1 501 Not Implemented',$this->response->status,'We expected GET to not be implemented for Directories. Response body: ' . $this->response->body);
29 function testMountResponse() {
32 'REQUEST_URI' => '/?mount',
33 'REQUEST_METHOD' => 'GET',
34 'QUERY_STRING' => 'mount',
35 'HTTP_HOST' => 'example.org',
38 $request = new Sabre_HTTP_Request($serverVars);
39 $this->server->httpRequest = ($request);
40 $this->server->exec();
42 $this->assertEquals('HTTP/1.1 200 OK',$this->response->status);
44 $xml = simplexml_load_string($this->response->body);
45 $this->assertTrue($xml==true,'Response was not a valid xml document');
47 $xml->registerXPathNamespace('dm','http://purl.org/NET/webdav/mount');
48 $url = $xml->xpath('//dm:url');
49 $this->assertEquals('http://example.org/',(string)$url[0]);