Add tests for: Fix Fatal PHP Error if Depth is more than 1.

I'm not 100% this is working as intended, but it does kind
of make sense.
This commit is contained in:
Andrew Ruthven 2018-11-12 19:32:34 +13:00
parent 48efbb272b
commit deb743fdcf
4 changed files with 451 additions and 0 deletions

View File

@ -0,0 +1,406 @@
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
<response>
<href>/caldav.php/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/home/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/addresses/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/created/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/.in/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/.out/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/6E20BB7C-EFD9-4F0F-9BDC-5335E04D47E0/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/VTODO-EFD9-4F0F-9BDC-5335E04D47E0/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/SOHO%20collection/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/collection/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/anotherone/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/user2/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/user1/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/home/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/addresses/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/nz_holidays/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/us_holidays/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/.out/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/base/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/calendar-proxy-read/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/user4/calendar-proxy-write/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/resource1/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/resource1/home/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/resource1/addresses/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/resource1/mozilla/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/resource2/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/resource2/home/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/resource2/addresses/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
<response>
<href>/caldav.php/resource2/mulberry/</href>
<propstat>
<prop/>
<status>HTTP/1.1 200 OK</status>
</propstat>
<propstat>
<prop>
<getetag/>
</prop>
<status>HTTP/1.1 404 Not Found</status>
</propstat>
</response>
</multistatus>

View File

@ -0,0 +1,23 @@
#
# PROPFIND to find the collections user4 has access to
# - no etag returned
# - 404 for resources user4 doesn't have access to
#
TYPE=PROPFIND
URL=http://regression.host/caldav.php
AUTH=user4:user4
HEADER=User-Agent: BIND Spec Tests
HEADER=Content-Type: text/xml; charset="UTF-8"
HEADER=Depth: 2
BEGINDATA
<?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:getetag/>
</D:prop>
</D:propfind>
ENDDATA

View File

@ -0,0 +1,22 @@
#
# PROPFIND to find the collections user4 has access to, anchored to user4
# - etag returned
#
TYPE=PROPFIND
URL=http://regression.host/caldav.php/user4
AUTH=user4:user4
HEADER=User-Agent: BIND Spec Tests
HEADER=Content-Type: text/xml; charset="UTF-8"
HEADER=Depth: 2
BEGINDATA
<?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:getetag/>
</D:prop>
</D:propfind>
ENDDATA