aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV/Mount
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-10-21 15:46:31 -0700
committerfriendica <info@friendica.com>2013-10-21 15:46:31 -0700
commitb35122f7a6ad42756c35bb60ba1f06c3dcd45c77 (patch)
treeccdf373ce6475d264778523259cc32899b732fe7 /vendor/sabre/dav/tests/Sabre/DAV/Mount
parente3504df514d306cfe6b83e44a11f550664564af4 (diff)
downloadvolse-hubzilla-b35122f7a6ad42756c35bb60ba1f06c3dcd45c77.tar.gz
volse-hubzilla-b35122f7a6ad42756c35bb60ba1f06c3dcd45c77.tar.bz2
volse-hubzilla-b35122f7a6ad42756c35bb60ba1f06c3dcd45c77.zip
add sabre (1.8.x) via composer in the !@#$ place it wants to be
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV/Mount')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php
new file mode 100644
index 000000000..e818fe043
--- /dev/null
+++ b/vendor/sabre/dav/tests/Sabre/DAV/Mount/PluginTest.php
@@ -0,0 +1,58 @@
+<?php
+
+namespace Sabre\DAV\Mount;
+
+use Sabre\DAV;
+use Sabre\HTTP;
+
+require_once 'Sabre/DAV/AbstractServer.php';
+
+class PluginTest extends DAV\AbstractServer {
+
+ function setUp() {
+
+ parent::setUp();
+ $this->server->addPlugin(new Plugin());
+
+ }
+
+ function testPassThrough() {
+
+ $serverVars = array(
+ 'REQUEST_URI' => '/',
+ 'REQUEST_METHOD' => 'GET',
+ );
+
+ $request = new HTTP\Request($serverVars);
+ $this->server->httpRequest = ($request);
+ $this->server->exec();
+
+ $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);
+
+ }
+
+ function testMountResponse() {
+
+ $serverVars = array(
+ 'REQUEST_URI' => '/?mount',
+ 'REQUEST_METHOD' => 'GET',
+ 'QUERY_STRING' => 'mount',
+ 'HTTP_HOST' => 'example.org',
+ );
+
+ $request = new HTTP\Request($serverVars);
+ $this->server->httpRequest = ($request);
+ $this->server->exec();
+
+ $this->assertEquals('HTTP/1.1 200 OK',$this->response->status);
+
+ $xml = simplexml_load_string($this->response->body);
+ $this->assertTrue($xml==true,'Response was not a valid xml document');
+
+ $xml->registerXPathNamespace('dm','http://purl.org/NET/webdav/mount');
+ $url = $xml->xpath('//dm:url');
+ $this->assertEquals('http://example.org/',(string)$url[0]);
+
+ }
+
+}