From eb50dc2fdb3d2373cbf6433307f6831f75f9f2ca Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 24 Nov 2023 16:30:30 +0545 Subject: [PATCH] test: adjust testPropFindUnfiltered to show multi-propstat behavior --- tests/Sabre/DAV/ClientTest.php | 37 +++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/tests/Sabre/DAV/ClientTest.php b/tests/Sabre/DAV/ClientTest.php index 06fcd2ca4f..a63184fe65 100644 --- a/tests/Sabre/DAV/ClientTest.php +++ b/tests/Sabre/DAV/ClientTest.php @@ -346,6 +346,12 @@ public function testPropFindUnfiltered() HTTP/1.1 200 OK + + + + + HTTP/1.1 404 Not Found + /folder1/file1.txt @@ -353,6 +359,7 @@ public function testPropFindUnfiltered() File1 + 12 HTTP/1.1 200 OK @@ -363,6 +370,7 @@ public function testPropFindUnfiltered() File2 + 27 HTTP/1.1 403 Forbidden @@ -373,15 +381,32 @@ public function testPropFindUnfiltered() File3 + 42 HTTP/1.1 425 Too Early + + /folder1/subfolder + + + + SubFolder + + HTTP/1.1 200 OK + + + + + + HTTP/1.1 404 Not Found + + XML; $client->response = new Response(207, [], $responseBody); - $result = $client->propFindUnfiltered('folder1', ['{DAV:}resourcetype', '{DAV:}displayname', '{urn:zim}gir'], 1); + $result = $client->propFindUnfiltered('folder1', ['{DAV:}resourcetype', '{DAV:}displayname', '{DAV:}contentlength', '{urn:zim}gir'], 1); self::assertEquals([ '/folder1' => [ @@ -395,6 +420,7 @@ public function testPropFindUnfiltered() 'properties' => [ '{DAV:}resourcetype' => null, '{DAV:}displayname' => 'File1', + '{DAV:}contentlength' => 12, ], 'status' => 200, ], @@ -402,6 +428,7 @@ public function testPropFindUnfiltered() 'properties' => [ '{DAV:}resourcetype' => null, '{DAV:}displayname' => 'File2', + '{DAV:}contentlength' => 27, ], 'status' => 403, ], @@ -409,9 +436,17 @@ public function testPropFindUnfiltered() 'properties' => [ '{DAV:}resourcetype' => null, '{DAV:}displayname' => 'File3', + '{DAV:}contentlength' => 42, ], 'status' => 425, ], + '/folder1/subfolder' => [ + 'properties' => [ + '{DAV:}resourcetype' => new Xml\Property\ResourceType('{DAV:}collection'), + '{DAV:}displayname' => 'SubFolder', + ], + 'status' => 200, + ], ], $result); $request = $client->request;