[Pkg-owncloud-commits] [php-sabredav] 119/220: Test to validate issue #751

David Prévot taffit at moszumanska.debian.org
Thu May 12 01:21:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 951c9e2dbaa0f78f2d60a8d86c6d6d52e515d22b
Author: Evert Pot <me at evertpot.com>
Date:   Thu Mar 31 20:08:11 2016 -0400

    Test to validate issue #751
---
 tests/Sabre/DAV/ServerMKCOLTest.php | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/tests/Sabre/DAV/ServerMKCOLTest.php b/tests/Sabre/DAV/ServerMKCOLTest.php
index 1f38aab..557eddb 100644
--- a/tests/Sabre/DAV/ServerMKCOLTest.php
+++ b/tests/Sabre/DAV/ServerMKCOLTest.php
@@ -315,13 +315,11 @@ class ServerMKCOLTest extends AbstractServer {
      */
     function testMKCOLAndProps() {
 
-        $serverVars = [
-            'REQUEST_URI'       => '/testcol',
-            'REQUEST_METHOD'    => 'MKCOL',
-            'HTTP_CONTENT_TYPE' => 'application/xml',
-        ];
-
-        $request = HTTP\Sapi::createFromServerArray($serverVars);
+        $request = new HTTP\Request(
+            'MKCOL',
+            '/testcol',
+            ['Content-Type' => 'application/xml']
+        );
         $request->setBody('<?xml version="1.0"?>
 <mkcol xmlns="DAV:">
   <set>
@@ -341,6 +339,28 @@ class ServerMKCOLTest extends AbstractServer {
             'Content-Type'    => ['application/xml; charset=utf-8'],
         ], $this->response->getHeaders());
 
+        $responseBody = $this->response->getBodyAsString();
+
+        $expected = <<<XML
+<?xml version="1.0"?>
+<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
+ <d:response>
+  <d:href>/testcol</d:href>
+  <d:propstat>
+   <d:prop>
+    <d:displayname />
+   </d:prop>
+   <d:status>HTTP/1.1 403 Forbidden</d:status>
+  </d:propstat>
+ </d:response>
+</d:multistatus>
+XML;
+
+        $this->assertXmlStringEqualsXmlString(
+            $expected,
+            $responseBody
+        );
+
     }
 
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-php/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list