Some initial regression tests and results for PROPPATCH.

This commit is contained in:
Andrew McMillan 2006-12-21 18:56:00 +13:00
parent d75bccb4bc
commit fc0d34eac7
6 changed files with 144 additions and 0 deletions

View File

@ -0,0 +1,13 @@
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
Content-Length: 239
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
<response>
<href>http://mycaldav/caldav.php/user1/home/</href>
<responsedescription>All requested changes were made.</responsedescription>
</response>
</multistatus>
User One's Calendar --- faf25336de0e470a54075c14cbcf5272 --- 0 --- 1

View File

@ -0,0 +1,38 @@
#
# Check for support of PROPPATCH method
#
# Adding the 'owner' property to a collection
#
TYPE=PROPPATCH
URL=http://mycaldav/caldav.php/user1/home/
HEADER=User-agent: SpecTest PROPPATCH
HEADER=Content-type: text/xml
HEAD
BEGINDATA
<?xml version="1.0" encoding="utf-8" ?>
<propertyupdate xmlns="DAV:" xmlns:X="urn:mcmillan:bogus:xml:ns:rscds">
<set>
<prop>
<owner>
<href>http://www.example.com/acl/users/jim</href>
</owner>
<X:arbitrary>A completely bogus property which should be saved.</X:arbitrary>
<displayname>User One's Calendar</displayname>
</prop>
</set>
<remove>
<prop>
<resourcetype>
<calendar xmlns="urn:ietf:params:xml:ns:caldav"/>
</resourcetype>
</prop>
</remove>
</propertyupdate>
ENDDATA
QUERY
SELECT dav_displayname, dav_etag, is_calendar,
modified > (current_timestamp - '5 seconds'::interval) AS changed_last_5secs
FROM collection WHERE dav_name = '/user1/home/';
ENDQUERY

View File

@ -0,0 +1,13 @@
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
Content-Length: 239
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
<response>
<href>http://mycaldav/caldav.php/user1/home/</href>
<responsedescription>All requested changes were made.</responsedescription>
</response>
</multistatus>
User One's Calendar --- faf25336de0e470a54075c14cbcf5272 --- 1 --- 1

View File

@ -0,0 +1,38 @@
#
# Check for support of PROPPATCH method
#
# Convert the collection back to a calendar, change the displayname
# again, and remove the owner property.
#
TYPE=PROPPATCH
URL=http://mycaldav/caldav.php/user1/home/
HEADER=User-agent: SpecTest PROPPATCH
HEADER=Content-type: text/xml
HEAD
BEGINDATA
<?xml version="1.0" encoding="utf-8" ?>
<propertyupdate xmlns="DAV:">
<set>
<prop>
<owner/>
<resourcetype>
<collection/>
<calendar xmlns="urn:ietf:params:xml:ns:caldav"/>
</resourcetype>
<displayname>User One's Calendar</displayname>
</prop>
</set>
<remove>
<prop>
<owner/>
</prop>
</remove>
</propertyupdate>
ENDDATA
QUERY
SELECT dav_displayname, dav_etag, is_calendar,
modified > (current_timestamp - '5 seconds'::interval) AS changed_last_5secs
FROM collection WHERE dav_name = '/user1/home/';
ENDQUERY

View File

@ -0,0 +1,13 @@
HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
Content-Length: 251
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
<response>
<href>http://mycaldav/caldav.php/user1/home/</href>
<responsedescription>Some properties were not able to be changed.</responsedescription>
</response>
</multistatus>
User One's Calendar --- faf25336de0e470a54075c14cbcf5272 --- 1 --- 0

View File

@ -0,0 +1,29 @@
#
# Check for support of PROPPATCH method
#
# An attempt to remove the collection resourcetype should fail.
#
TYPE=PROPPATCH
URL=http://mycaldav/caldav.php/user1/home/
HEADER=User-agent: SpecTest PROPPATCH
HEADER=Content-type: text/xml
HEAD
BEGINDATA
<?xml version="1.0" encoding="utf-8" ?>
<propertyupdate xmlns="DAV:">
<remove>
<prop>
<resourcetype>
<collection/>
</resourcetype>
</prop>
</remove>
</propertyupdate>
ENDDATA
QUERY
SELECT dav_displayname, dav_etag, is_calendar,
modified > (current_timestamp - '5 seconds'::interval) AS changed_last_5secs
FROM collection WHERE dav_name = '/user1/home/';
ENDQUERY