summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml8
-rw-r--r--apps/dav/tests/travis/caldav/install.sh20
-rw-r--r--apps/dav/tests/travis/caldav/script.sh18
-rw-r--r--apps/dav/tests/travis/caldavtest/tests/CalDAV/current-user-principal.xml151
-rw-r--r--apps/dav/tests/travis/caldavtest/tests/CalDAV/sync-report.xml3512
-rw-r--r--apps/dav/tests/travis/carddav/install.sh (renamed from apps/dav/tests/travis/carddavtester/install.sh)0
-rw-r--r--apps/dav/tests/travis/carddav/script.sh (renamed from apps/dav/tests/travis/carddavtester/script.sh)0
-rw-r--r--apps/federation/api/ocsauthapi.php22
-rw-r--r--apps/federation/appinfo/application.php3
-rw-r--r--apps/federation/backgroundjob/getsharedsecret.php3
-rw-r--r--apps/federation/backgroundjob/requestsharedsecret.php7
-rw-r--r--apps/federation/tests/api/ocsauthapitest.php12
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--tests/lib/testcase.php14
14 files changed, 3754 insertions, 18 deletions
diff --git a/.travis.yml b/.travis.yml
index 3f80fdb8458..4f79311c33c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,10 +39,8 @@ matrix:
- php: 5.4
env: DB=pgsql;TC=litmus-v1
- php: 5.4
- env: DB=sqlite;TC=carddavtester
-# - php: 5.4
-# env: DB=pgsql;TC=carddavtester
-# - php: 5.4
-# env: DB=mysql;TC=caldavtester
+ env: DB=sqlite;TC=carddav
+ - php: 5.4
+ env: DB=sqlite;TC=caldav
fast_finish: true
diff --git a/apps/dav/tests/travis/caldav/install.sh b/apps/dav/tests/travis/caldav/install.sh
new file mode 100644
index 00000000000..e836e37f86f
--- /dev/null
+++ b/apps/dav/tests/travis/caldav/install.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+SCRIPT=`realpath $0`
+SCRIPTPATH=`dirname $SCRIPT`
+
+
+if [ ! -f CalDAVTester/run.py ]; then
+ cd "$SCRIPTPATH"
+ git clone https://github.com/DeepDiver1975/CalDAVTester.git
+ cd "$SCRIPTPATH/CalDAVTester"
+ python run.py -s
+ cd "$SCRIPTPATH"
+fi
+
+# create test user
+cd "$SCRIPTPATH/../../../../../"
+OC_PASS=user01 php occ user:add --password-from-env user01
+php occ dav:create-calendar user01 calendar
+OC_PASS=user02 php occ user:add --password-from-env user02
+php occ dav:create-calendar user02 calendar
+cd "$SCRIPTPATH/../../../../../"
diff --git a/apps/dav/tests/travis/caldav/script.sh b/apps/dav/tests/travis/caldav/script.sh
new file mode 100644
index 00000000000..9a818b553f7
--- /dev/null
+++ b/apps/dav/tests/travis/caldav/script.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+SCRIPT=`realpath $0`
+SCRIPTPATH=`dirname $SCRIPT`
+
+# start the server
+php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../../.." &
+
+sleep 30
+
+# run the tests
+cd "$SCRIPTPATH/CalDAVTester"
+PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onfail -s "$SCRIPTPATH/../caldavtest/config/serverinfo.xml" -o cdt.txt \
+ "$SCRIPTPATH/../caldavtest/tests/CalDAV/current-user-principal.xml"
+RESULT=$?
+
+tail "$/../../../../../data-autotest/owncloud.log"
+
+exit $RESULT
diff --git a/apps/dav/tests/travis/caldavtest/tests/CalDAV/current-user-principal.xml b/apps/dav/tests/travis/caldavtest/tests/CalDAV/current-user-principal.xml
new file mode 100644
index 00000000000..d01058fee0a
--- /dev/null
+++ b/apps/dav/tests/travis/caldavtest/tests/CalDAV/current-user-principal.xml
@@ -0,0 +1,151 @@
+<?xml version="1.0" standalone="no"?>
+
+<!DOCTYPE caldavtest SYSTEM "caldavtest.dtd">
+
+<!--
+ Copyright (c) 2006-2015 Apple Inc. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<caldavtest>
+ <description>Test DAV:current-user-principal support</description>
+
+ <require-feature>
+ <feature>caldav</feature>
+ <feature>current-user-principal</feature>
+ </require-feature>
+
+ <start/>
+
+ <test-suite name='Check for the property on /'>
+ <require-feature>
+ <feature>own-root</feature>
+ </require-feature>
+ <test name='1'>
+ <description>Check for authenticated property on /</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$root:</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/current-user-principal/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value><![CDATA[{DAV:}current-user-principal$<href xmlns="DAV:">$principaluri1:</href>]]></value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='3'>
+ <description>Check for authenticated property on / (user02)</description>
+ <request user="$userid2:" pswd="$pswd2:">
+ <method>PROPFIND</method>
+ <ruri>$root:</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/current-user-principal/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value><![CDATA[{DAV:}current-user-principal$<href xmlns="DAV:">$principaluri2:</href>]]></value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='Check for the property on /principals/'>
+ <test name='1'>
+ <description>Check for authenticated property on /</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$principalcollection:</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/current-user-principal/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value><![CDATA[{DAV:}current-user-principal$<href xmlns="DAV:">$principaluri1:</href>]]></value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2'>
+ <description>Check for unauthenticated property on /</description>
+ <request auth="no">
+ <method>PROPFIND</method>
+ <ruri>$principals_users:</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/current-user-principal/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>401</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='3'>
+ <description>Check for authenticated property on / (user02)</description>
+ <request user="$userid2:" pswd="$pswd2:">
+ <method>PROPFIND</method>
+ <ruri>$principalcollection:</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/current-user-principal/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value><![CDATA[{DAV:}current-user-principal$<href xmlns="DAV:">$principaluri2:</href>]]></value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <end/>
+</caldavtest>
diff --git a/apps/dav/tests/travis/caldavtest/tests/CalDAV/sync-report.xml b/apps/dav/tests/travis/caldavtest/tests/CalDAV/sync-report.xml
new file mode 100644
index 00000000000..c675af82065
--- /dev/null
+++ b/apps/dav/tests/travis/caldavtest/tests/CalDAV/sync-report.xml
@@ -0,0 +1,3512 @@
+<?xml version="1.0" standalone="no"?>
+
+<!DOCTYPE caldavtest SYSTEM "caldavtest.dtd">
+
+<!--
+ Copyright (c) 2006-2015 Apple Inc. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<caldavtest>
+ <require-feature>
+ <feature>caldav</feature>
+ <feature>sync-report</feature>
+ </require-feature>
+
+ <start>
+ <request end-delete="yes">
+ <method>MKCALENDAR</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar1/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/1.txt</filepath>
+ </data>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar1/2.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/2.txt</filepath>
+ </data>
+ </request>
+ <request end-delete="yes">
+ <method>MKCALENDAR</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar2/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/4.txt</filepath>
+ </data>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar2/2.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/5.txt</filepath>
+ </data>
+ </request>
+ </start>
+
+ <test-suite name='support-report-set/sync-token property'>
+ <test name='1'>
+ <description>Not on calendars</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$calendars:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>notexists</name>
+ <value>$verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}supported-report-set</value>
+ </arg>
+ <arg>
+ <name>badprops</name>
+ <value>{DAV:}sync-token</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2'>
+ <description>On calendar-home</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/1.xml</filepath>
+ </data>
+ <verify>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>$verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection</value>
+ <value>$verify-property-prefix:/{DAV:}sync-token[+data:,]</value>
+ </arg>
+ </verify>
+ <verify>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}supported-report-set</value>
+ <value>{DAV:}sync-token</value>
+ </arg>
+ </verify>
+ <verify>
+ <exclude-feature>
+ <feature>sync-report-home</feature>
+ </exclude-feature>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>notexists</name>
+ <value>$verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection</value>
+ </arg>
+ </verify>
+ <verify>
+ <exclude-feature>
+ <feature>sync-report-home</feature>
+ </exclude-feature>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}supported-report-set</value>
+ </arg>
+ <arg>
+ <name>badprops</name>
+ <value>{DAV:}sync-token</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='3'>
+ <description>On calendar</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>$verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection</value>
+ <value>$verify-property-prefix:/{DAV:}sync-token[+data:,]</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}supported-report-set</value>
+ <value>{DAV:}sync-token</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>On inbox</description>
+ <request>
+ <method>PROPFIND</method>
+ <ruri>$inboxpath1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/1.xml</filepath>
+ </data>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>$verify-property-prefix:/{DAV:}supported-report-set/{DAV:}supported-report/{DAV:}report/{DAV:}sync-collection</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}supported-report-set</value>
+ <value>{DAV:}sync-token</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='5'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>Look for options header tag on principal</description>
+ <request>
+ <method>OPTIONS</method>
+ <ruri>$principal1:</ruri>
+ <verify>
+ <callback>header</callback>
+ <arg>
+ <name>header</name>
+ <value>*DAV$.*calendarserver-home-sync[^-]*</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - sync-level'>
+ <test name='1'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:1, depth:0</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/8.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar2/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:1, depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/8.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar2/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='3'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:1, depth:infinity</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/8.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar2/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:infinity, depth:0</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/9.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar1/1.ics</value>
+ <value>synccalendar1/2.ics</value>
+ <value>synccalendar2/</value>
+ <value>synccalendar2/1.ics</value>
+ <value>synccalendar2/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='5'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:infinity, depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/9.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar1/1.ics</value>
+ <value>synccalendar1/2.ics</value>
+ <value>synccalendar2/</value>
+ <value>synccalendar2/1.ics</value>
+ <value>synccalendar2/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='6'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:infinity, depth:infinity</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/9.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar1/1.ics</value>
+ <value>synccalendar1/2.ics</value>
+ <value>synccalendar2/</value>
+ <value>synccalendar2/1.ics</value>
+ <value>synccalendar2/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='7'>
+ <description>sync-level:1, depth:0</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/8.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='8'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:1, depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/8.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='9'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:1, depth:infinity</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/8.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='10'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:infinity, depth:0</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/9.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='11'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:infinity, depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/9.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='12'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>sync-level:infinity, depth:infinity</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/9.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='13'>
+ <description>Bad sync-level</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/10.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ <arg>
+ <name>status</name>
+ <value>400</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - empty token - no props'>
+ <test name='1'>
+ <description>initial query - calendar collection depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>initial query - home depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar2/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='3'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>initial query - home depth:infinity</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar1/1.ics</value>
+ <value>synccalendar1/2.ics</value>
+ <value>synccalendar2/</value>
+ <value>synccalendar2/1.ics</value>
+ <value>synccalendar2/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>add new resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar1/3.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/3.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+ <test name='5'>
+ <description>new resource - calendar collection depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ <value>3.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='6'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>new resource - home depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar2/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='7'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>new resource - home depth:infinity</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar1/1.ics</value>
+ <value>synccalendar1/2.ics</value>
+ <value>synccalendar1/3.ics</value>
+ <value>synccalendar2/</value>
+ <value>synccalendar2/1.ics</value>
+ <value>synccalendar2/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='8'>
+ <description>remove new resource</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar1/3.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+ <test name='9'>
+ <description>remove new resource - calendar collection depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='10'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>remove new resource - home depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar2/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='11'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>remove new resource - home depth:infinity</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar1/1.ics</value>
+ <value>synccalendar1/2.ics</value>
+ <value>synccalendar2/</value>
+ <value>synccalendar2/1.ics</value>
+ <value>synccalendar2/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='12'>
+ <description>changed resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar1/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/1.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ </test>
+ <test name='13'>
+ <description>changed resource - calendar collection depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='14'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>changed resource - home depth:1</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar2/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='15'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <description>changed resource - home depth:infinity</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar1/</value>
+ <value>synccalendar1/1.ics</value>
+ <value>synccalendar1/2.ics</value>
+ <value>synccalendar2/</value>
+ <value>synccalendar2/1.ics</value>
+ <value>synccalendar2/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - diff token - no props - calendar depth:1'>
+ <test name='1'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2'>
+ <description>new resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar1/3.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/3.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>3.ics</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>remove resource (treated as new)</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar1/3.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>badhrefs</name>
+ <value>3.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>remove resource (treated as old)</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/4.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>badhrefs</name>
+ <value>3.ics</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='5'>
+ <description>changed resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar1/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/1.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>1.ics</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='6'>
+ <description>no change</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - empty token - props'>
+ <test name='1'>
+ <description>initial query</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/5.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2'>
+ <description>new resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar2/3.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/6.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/5.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ <value>3.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='3'>
+ <description>remove resource new resource</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar2/3.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/5.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>changed resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar2/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/4.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/5.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - diff token - props'>
+ <test name='1'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/5.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ <value>1.ics</value>
+ <value>2.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2'>
+ <description>new resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar2/3.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/6.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>3.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>remove resource (treated as new)</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar2/3.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>badhrefs</name>
+ <value>3.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>remove resource (treated as old)</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/7.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>badhrefs</name>
+ <value>3.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='5'>
+ <description>changed resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar2/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/4.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>1.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='6'>
+ <description>no change</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - diff token - no props - home depth:infinity'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>Initialize</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ </request>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ </request>
+ <request end-delete="yes">
+ <method>MKCALENDAR</method>
+ <ruri>$calendarhome1:/synccalendar3/</ruri>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar3/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/7.txt</filepath>
+ </data>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar3/2.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/8.txt</filepath>
+ </data>
+ </request>
+ <request end-delete="yes">
+ <method>MKCALENDAR</method>
+ <ruri>$calendarhome1:/synccalendar4/</ruri>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar4/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/10.txt</filepath>
+ </data>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar4/2.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/11.txt</filepath>
+ </data>
+ </request>
+ </test>
+ <test name='2'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar3/</value>
+ <value>synccalendar3/1.ics</value>
+ <value>synccalendar3/2.ics</value>
+ <value>synccalendar4/</value>
+ <value>synccalendar4/1.ics</value>
+ <value>synccalendar4/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>new resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar3/3.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/9.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ <value>synccalendar3/3.ics</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='4'>
+ <description>remove resource (treated as new)</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar3/3.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>synccalendar3/3.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='5'>
+ <description>remove resource (treated as old)</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/4.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>synccalendar3/3.ics</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='6'>
+ <description>changed resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar3/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/7.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ <value>synccalendar3/1.ics</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='7'>
+ <description>no change</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - diff token - props - home depth:infinity'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/5.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar3/</value>
+ <value>synccalendar3/1.ics</value>
+ <value>synccalendar3/2.ics</value>
+ <value>synccalendar4/</value>
+ <value>synccalendar4/1.ics</value>
+ <value>synccalendar4/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>ignore</name>
+ <value>$calendarhome1:/$outbox:/</value>
+ <value>$calendarhome1:/$freebusy:</value>
+ <value>$calendarhome1:/$notification:/</value>
+ <value>$calendarhome1:/$dropbox:/</value>
+ </arg>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2'>
+ <description>new resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar4/3.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/12.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar4/</value>
+ <value>synccalendar4/3.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>remove resource (treated as new)</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar4/3.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar4/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>synccalendar4/3.ics</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>remove resource (treated as old)</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/7.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar4/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>synccalendar4/3.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>count</name>
+ <value>2</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='5'>
+ <description>changed resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar4/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/10.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar4/</value>
+ <value>synccalendar4/1.ics</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='6'>
+ <description>no change</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/6.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - diff token - delete/create calendar - home depth:infinity'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar3/</value>
+ <value>synccalendar3/1.ics</value>
+ <value>synccalendar3/2.ics</value>
+ <value>synccalendar4/</value>
+ <value>synccalendar4/1.ics</value>
+ <value>synccalendar4/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2'>
+ <description>remove resource then calendar</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar3/1.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar3/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>badhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>add calendar - test last sync</description>
+ <request>
+ <method>MKCALENDAR</method>
+ <ruri>$calendarhome1:/synccalendar3/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/4.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>add calendar - test previous sync</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - diff token - no props - home depth:1'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>Initialize</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar1/</ruri>
+ </request>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar2/</ruri>
+ </request>
+ <request end-delete="yes">
+ <method>MKCALENDAR</method>
+ <ruri>$calendarhome1:/synccalendar3/</ruri>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar3/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/7.txt</filepath>
+ </data>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar3/2.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/8.txt</filepath>
+ </data>
+ </request>
+ <request end-delete="yes">
+ <method>MKCALENDAR</method>
+ <ruri>$calendarhome1:/synccalendar4/</ruri>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar4/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/10.txt</filepath>
+ </data>
+ </request>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar4/2.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/11.txt</filepath>
+ </data>
+ </request>
+ </test>
+ <test name='2'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/8.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar3/</value>
+ <value>synccalendar4/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>new resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar3/3.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/9.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/12.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='4'>
+ <description>remove resource (treated as new)</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar3/3.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/12.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='5'>
+ <description>remove resource (treated as old)</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/13.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='6'>
+ <description>changed resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar3/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/7.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/12.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='7'>
+ <description>no change</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/12.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - diff token - props - home depth:1'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/14.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar3/</value>
+ <value>synccalendar4/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>ignore</name>
+ <value>$calendarhome1:/$outbox:/</value>
+ <value>$calendarhome1:/$freebusy:</value>
+ <value>$calendarhome1:/$notification:/</value>
+ <value>$calendarhome1:/$dropbox:/</value>
+ </arg>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2'>
+ <description>new resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar4/3.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/12.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/15.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar4/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>remove resource (treated as new)</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar4/3.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/15.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar4/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>remove resource (treated as old)</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/16.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar4/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>count</name>
+ <value>1</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='5'>
+ <description>changed resource</description>
+ <request>
+ <method>PUT</method>
+ <ruri>$calendarhome1:/synccalendar4/1.ics</ruri>
+ <data>
+ <content-type>text/calendar; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/put/10.txt</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/15.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar4/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='6'>
+ <description>no change</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/15.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ </verify>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{DAV:}getcontenttype</value>
+ <value>{DAV:}getetag</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - diff token - delete/create calendar - home depth:1'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/8.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar3/</value>
+ <value>synccalendar4/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2'>
+ <description>remove resource then calendar</description>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar3/1.ics</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>DELETE</method>
+ <ruri>$calendarhome1:/synccalendar3/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/12.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>badhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken2:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>add calendar - test last sync</description>
+ <request>
+ <method>MKCALENDAR</method>
+ <ruri>$calendarhome1:/synccalendar3/</ruri>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/13.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='4'>
+ <description>add calendar - test previous sync</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/12.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - empty inbox'>
+ <test name='1'>
+ <description>initial query</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$inboxpath1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_sync_extra_items:</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='simple reports - valid token'>
+ <test name='1'>
+ <description>initial query</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarpath1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>1</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/11.xml</filepath>
+ </data>
+ <verify>
+ <callback>prepostcondition</callback>
+ <arg>
+ <name>error</name>
+ <value>{DAV:}valid-sync-token</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='calendar webdav property change - home depth:infinity'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/2.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar3/</value>
+ <value>synccalendar4/</value>
+ <value>synccalendar4/1.ics</value>
+ <value>synccalendar4/2.ics</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2'>
+ <description>Change a property</description>
+ <request>
+ <method>PROPPATCH</method>
+ <ruri>$calendarhome1:/synccalendar3/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/17.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{DAV:}multistatus/{DAV:}sync-token[!$synctoken1:]</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>Remove a property</description>
+ <request>
+ <method>PROPPATCH</method>
+ <ruri>$calendarhome1:/synccalendar3/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/18.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/3.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{DAV:}multistatus/{DAV:}sync-token[!$synctoken1:]</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ </test-suite>
+
+ <test-suite name='calendar webdav property change - home depth:1'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/8.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar3/</value>
+ <value>synccalendar4/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2'>
+ <description>Change a property</description>
+ <request>
+ <method>PROPPATCH</method>
+ <ruri>$calendarhome1:/synccalendar3/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/17.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/12.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{DAV:}multistatus/{DAV:}sync-token[!$synctoken1:]</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>Remove a property</description>
+ <request>
+ <method>PROPPATCH</method>
+ <ruri>$calendarhome1:/synccalendar3/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/18.xml</filepath>
+ </data>
+ <verify>
+ <callback>statusCode</callback>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/12.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>synccalendar3/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{DAV:}multistatus/{DAV:}sync-token[!$synctoken1:]</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ </test-suite>
+
+
+ <test-suite name='default calendar property change - home depth:1'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/8.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar3/</value>
+ <value>synccalendar4/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2'>
+ <description>Change property on Inbox</description>
+ <request>
+ <method>PROPPATCH</method>
+ <ruri>$inboxpath1:/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/19.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL</value>
+ </arg>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/12.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$inbox:/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{DAV:}multistatus/{DAV:}sync-token[!$synctoken1:]</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>Reset the property</description>
+ <request>
+ <method>PROPPATCH</method>
+ <ruri>$inboxpath1:/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/20.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL</value>
+ </arg>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/12.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$inbox:/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{DAV:}multistatus/{DAV:}sync-token[!$synctoken1:]</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ </test-suite>
+
+
+ <test-suite name='schedule-calendar-transp in response - home depth:1'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>initial query - grab token</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/22.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar_home_items_initial_sync:</value>
+ <value>synccalendar3/</value>
+ <value>synccalendar4/</value>
+ </arg>
+ <arg>
+ <name>badhrefs</name>
+ <value>$dropbox:/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>dataString</callback>
+ <arg>
+ <name>contains</name>
+ <value>opaque</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='2'>
+ <description>Change property on calendar</description>
+ <request>
+ <method>PROPPATCH</method>
+ <ruri>$calendarpath1:/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/PROPPATCH/calendar-transp-transparent.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp</value>
+ </arg>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/23.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar:/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{DAV:}multistatus/{DAV:}sync-token[!$synctoken1:]</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>dataString</callback>
+ <arg>
+ <name>contains</name>
+ <value>transparent</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ <test name='3'>
+ <description>Reset the property</description>
+ <request>
+ <method>PROPPATCH</method>
+ <ruri>$calendarpath1:/</ruri>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/Common/PROPPATCH/calendar-transp-opaque.xml</filepath>
+ </data>
+ <verify>
+ <callback>propfindItems</callback>
+ <arg>
+ <name>okprops</name>
+ <value>{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp</value>
+ </arg>
+ </verify>
+ </request>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/23.xml</filepath>
+ </data>
+ <verify>
+ <callback>multistatusItems</callback>
+ <arg>
+ <name>okhrefs</name>
+ <value>$calendar:/</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>xmlElementMatch</callback>
+ <arg>
+ <name>exists</name>
+ <value>/{DAV:}multistatus/{DAV:}sync-token[!$synctoken1:]</value>
+ </arg>
+ </verify>
+ <verify>
+ <callback>dataString</callback>
+ <arg>
+ <name>contains</name>
+ <value>opaque</value>
+ </arg>
+ </verify>
+ <grabelement>
+ <name>/{DAV:}multistatus/{DAV:}sync-token</name>
+ <variable>$synctoken1:</variable>
+ </grabelement>
+ </request>
+ </test>
+ </test-suite>
+
+
+
+ <test-suite name='Prefer:return=minimal - home depth:1'>
+ <require-feature>
+ <feature>sync-report-home</feature>
+ </require-feature>
+ <test name='1'>
+ <description>initial query - no minimal</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/24.xml</filepath>
+ </data>
+ <verify>
+ <callback>dataString</callback>
+ <arg>
+ <name>contains</name>
+ <value>foobar</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ <test name='2'>
+ <description>initial query - with minimal</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>infinity</value>
+ </header>
+ <header>
+ <name>Prefer</name>
+ <value>return=minimal</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/24.xml</filepath>
+ </data>
+ <verify>
+ <callback>dataString</callback>
+ <arg>
+ <name>notcontains</name>
+ <value>foobar</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+
+ <test-suite name='limited reports'>
+ <test name='1'>
+ <exclude-feature>
+ <feature>sync-report-limit</feature>
+ </exclude-feature>
+ <description>Limit not allowed</description>
+ <request>
+ <method>REPORT</method>
+ <ruri>$calendarhome1:/</ruri>
+ <header>
+ <name>Depth</name>
+ <value>0</value>
+ </header>
+ <data>
+ <content-type>text/xml; charset=utf-8</content-type>
+ <filepath>Resource/CalDAV/reports/sync/21.xml</filepath>
+ </data>
+ <verify>
+ <callback>prepostcondition</callback>
+ <arg>
+ <name>error</name>
+ <value>{DAV:}number-of-matches-within-limits</value>
+ </arg>
+ </verify>
+ </request>
+ </test>
+ </test-suite>
+
+ <end/>
+
+</caldavtest>
diff --git a/apps/dav/tests/travis/carddavtester/install.sh b/apps/dav/tests/travis/carddav/install.sh
index fa5d141ce0d..fa5d141ce0d 100644
--- a/apps/dav/tests/travis/carddavtester/install.sh
+++ b/apps/dav/tests/travis/carddav/install.sh
diff --git a/apps/dav/tests/travis/carddavtester/script.sh b/apps/dav/tests/travis/carddav/script.sh
index 46a6a98e273..46a6a98e273 100644
--- a/apps/dav/tests/travis/carddavtester/script.sh
+++ b/apps/dav/tests/travis/carddav/script.sh
diff --git a/apps/federation/api/ocsauthapi.php b/apps/federation/api/ocsauthapi.php
index d165a0bd22f..b94550fd4f2 100644
--- a/apps/federation/api/ocsauthapi.php
+++ b/apps/federation/api/ocsauthapi.php
@@ -26,6 +26,7 @@ use OCA\Federation\DbHandler;
use OCA\Federation\TrustedServers;
use OCP\AppFramework\Http;
use OCP\BackgroundJob\IJobList;
+use OCP\ILogger;
use OCP\IRequest;
use OCP\Security\ISecureRandom;
use OCP\Security\StringUtils;
@@ -54,6 +55,9 @@ class OCSAuthAPI {
/** @var DbHandler */
private $dbHandler;
+ /** @var ILogger */
+ private $logger;
+
/**
* OCSAuthAPI constructor.
*
@@ -62,19 +66,22 @@ class OCSAuthAPI {
* @param IJobList $jobList
* @param TrustedServers $trustedServers
* @param DbHandler $dbHandler
+ * @param ILogger $logger
*/
public function __construct(
IRequest $request,
ISecureRandom $secureRandom,
IJobList $jobList,
TrustedServers $trustedServers,
- DbHandler $dbHandler
+ DbHandler $dbHandler,
+ ILogger $logger
) {
$this->request = $request;
$this->secureRandom = $secureRandom;
$this->jobList = $jobList;
$this->trustedServers = $trustedServers;
$this->dbHandler = $dbHandler;
+ $this->logger = $logger;
}
/**
@@ -88,6 +95,7 @@ class OCSAuthAPI {
$token = $this->request->getParam('token');
if ($this->trustedServers->isTrustedServer($url) === false) {
+ $this->logger->log(\OCP\Util::ERROR, 'remote server not trusted (' . $url . ') while requesting shared secret');
return new \OC_OCS_Result(null, HTTP::STATUS_FORBIDDEN);
}
@@ -95,6 +103,7 @@ class OCSAuthAPI {
// token wins
$localToken = $this->dbHandler->getToken($url);
if (strcmp($localToken, $token) > 0) {
+ $this->logger->log(\OCP\Util::ERROR, 'remote server (' . $url . ') presented lower token');
return new \OC_OCS_Result(null, HTTP::STATUS_FORBIDDEN);
}
@@ -120,10 +129,13 @@ class OCSAuthAPI {
$url = $this->request->getParam('url');
$token = $this->request->getParam('token');
- if (
- $this->trustedServers->isTrustedServer($url) === false
- || $this->isValidToken($url, $token) === false
- ) {
+ if ($this->trustedServers->isTrustedServer($url) === false) {
+ $this->logger->log(\OCP\Util::ERROR, 'remote server not trusted (' . $url . ') while getting shared secret');
+ return new \OC_OCS_Result(null, HTTP::STATUS_FORBIDDEN);
+ }
+
+ if ($this->isValidToken($url, $token) === false) {
+ $this->logger->log(\OCP\Util::ERROR, 'remote server (' . $url . ') didn\'t send a valid token (got ' . $token . ') while getting shared secret');
return new \OC_OCS_Result(null, HTTP::STATUS_FORBIDDEN);
}
diff --git a/apps/federation/appinfo/application.php b/apps/federation/appinfo/application.php
index 172283536b4..45d88548b70 100644
--- a/apps/federation/appinfo/application.php
+++ b/apps/federation/appinfo/application.php
@@ -108,7 +108,8 @@ class Application extends \OCP\AppFramework\App {
$server->getSecureRandom(),
$server->getJobList(),
$container->query('TrustedServers'),
- $container->query('DbHandler')
+ $container->query('DbHandler'),
+ $server->getLogger()
);
diff --git a/apps/federation/backgroundjob/getsharedsecret.php b/apps/federation/backgroundjob/getsharedsecret.php
index eb55fa2d6ab..8aa8a08e07b 100644
--- a/apps/federation/backgroundjob/getsharedsecret.php
+++ b/apps/federation/backgroundjob/getsharedsecret.php
@@ -91,7 +91,7 @@ class GetSharedSecret extends QueuedJob{
$this->trustedServers = new TrustedServers(
$this->dbHandler,
\OC::$server->getHTTPClientService(),
- \OC::$server->getLogger(),
+ $this->logger,
$this->jobList,
\OC::$server->getSecureRandom(),
\OC::$server->getConfig()
@@ -148,6 +148,7 @@ class GetSharedSecret extends QueuedJob{
} catch (ClientException $e) {
$status = $e->getCode();
+ $this->logger->logException($e);
}
// if we received a unexpected response we try again later
diff --git a/apps/federation/backgroundjob/requestsharedsecret.php b/apps/federation/backgroundjob/requestsharedsecret.php
index 24d8adada11..a1906d20823 100644
--- a/apps/federation/backgroundjob/requestsharedsecret.php
+++ b/apps/federation/backgroundjob/requestsharedsecret.php
@@ -60,6 +60,9 @@ class RequestSharedSecret extends QueuedJob {
private $endPoint = '/ocs/v2.php/apps/federation/api/v1/request-shared-secret?format=json';
+ /** @var ILogger */
+ private $logger;
+
/**
* RequestSharedSecret constructor.
*
@@ -80,13 +83,14 @@ class RequestSharedSecret extends QueuedJob {
$this->jobList = $jobList ? $jobList : \OC::$server->getJobList();
$this->urlGenerator = $urlGenerator ? $urlGenerator : \OC::$server->getURLGenerator();
$this->dbHandler = $dbHandler ? $dbHandler : new DbHandler(\OC::$server->getDatabaseConnection(), \OC::$server->getL10N('federation'));
+ $this->logger = \OC::$server->getLogger();
if ($trustedServers) {
$this->trustedServers = $trustedServers;
} else {
$this->trustedServers = new TrustedServers(
$this->dbHandler,
\OC::$server->getHTTPClientService(),
- \OC::$server->getLogger(),
+ $this->logger,
$this->jobList,
\OC::$server->getSecureRandom(),
\OC::$server->getConfig()
@@ -142,6 +146,7 @@ class RequestSharedSecret extends QueuedJob {
} catch (ClientException $e) {
$status = $e->getCode();
+ $this->logger->logException($e);
}
// if we received a unexpected response we try again later
diff --git a/apps/federation/tests/api/ocsauthapitest.php b/apps/federation/tests/api/ocsauthapitest.php
index a334686c24e..e6a95af8585 100644
--- a/apps/federation/tests/api/ocsauthapitest.php
+++ b/apps/federation/tests/api/ocsauthapitest.php
@@ -28,6 +28,7 @@ use OCA\Federation\API\OCSAuthAPI;
use OCA\Federation\DbHandler;
use OCA\Federation\TrustedServers;
use OCP\AppFramework\Http;
+use OCP\ILogger;
use OCP\IRequest;
use OCP\Security\ISecureRandom;
use Test\TestCase;
@@ -49,6 +50,9 @@ class OCSAuthAPITest extends TestCase {
/** @var \PHPUnit_Framework_MockObject_MockObject | DbHandler */
private $dbHandler;
+ /** @var \PHPUnit_Framework_MockObject_MockObject | ILogger */
+ private $logger;
+
/** @var OCSAuthApi */
private $ocsAuthApi;
@@ -63,13 +67,16 @@ class OCSAuthAPITest extends TestCase {
->disableOriginalConstructor()->getMock();
$this->jobList = $this->getMockBuilder('OC\BackgroundJob\JobList')
->disableOriginalConstructor()->getMock();
+ $this->logger = $this->getMockBuilder('OCP\ILogger')
+ ->disableOriginalConstructor()->getMock();
$this->ocsAuthApi = new OCSAuthAPI(
$this->request,
$this->secureRandom,
$this->jobList,
$this->trustedServers,
- $this->dbHandler
+ $this->dbHandler,
+ $this->logger
);
}
@@ -136,7 +143,8 @@ class OCSAuthAPITest extends TestCase {
$this->secureRandom,
$this->jobList,
$this->trustedServers,
- $this->dbHandler
+ $this->dbHandler,
+ $this->logger
]
)->setMethods(['isValidToken'])->getMock();
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 7e1329d1155..a3dff2850bd 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1383,7 +1383,7 @@
* Returns list of webdav properties to request
*/
_getWebdavProperties: function() {
- return this.filesClient.getPropfindProperties();
+ return [].concat(this.filesClient.getPropfindProperties());
},
/**
diff --git a/tests/lib/testcase.php b/tests/lib/testcase.php
index 1ee0c85b98a..93b354863a9 100644
--- a/tests/lib/testcase.php
+++ b/tests/lib/testcase.php
@@ -33,7 +33,8 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
private $commandBus;
/** @var IDBConnection */
- static private $realDatabase;
+ static protected $realDatabase = null;
+ static private $wasDatabaseAllowed = false;
protected function getTestTraits() {
$traits = [];
@@ -52,7 +53,9 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
protected function setUp() {
// detect database access
+ self::$wasDatabaseAllowed = true;
if (!$this->IsDatabaseAccessAllowed()) {
+ self::$wasDatabaseAllowed = false;
if (is_null(self::$realDatabase)) {
self::$realDatabase = \OC::$server->getDatabaseConnection();
}
@@ -155,8 +158,15 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
}
public static function tearDownAfterClass() {
+ if (!self::$wasDatabaseAllowed && self::$realDatabase !== null) {
+ // in case an error is thrown in a test, PHPUnit jumps straight to tearDownAfterClass,
+ // so we need the database again
+ \OC::$server->registerService('DatabaseConnection', function () {
+ return self::$realDatabase;
+ });
+ }
$dataDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data-autotest');
- if (\OC::$server->getDatabaseConnection()) {
+ if (self::$wasDatabaseAllowed && \OC::$server->getDatabaseConnection()) {
$queryBuilder = \OC::$server->getDatabaseConnection()->getQueryBuilder();
self::tearDownAfterClassCleanShares($queryBuilder);