mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-31 18:46:02 +00:00
Add test for anyof
This commit is contained in:
parent
f476675b10
commit
31fbfe5d88
131
testing/tests/carddav/2044-REPORT-addressbook-query.result
Normal file
131
testing/tests/carddav/2044-REPORT-addressbook-query.result
Normal file
@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<multistatus xmlns="DAV:" xmlns:VC="urn:ietf:params:xml:ns:carddav">
|
||||
<response>
|
||||
<href>/caldav.php/user1/addressbook/andrew_mcmillan.vcf</href>
|
||||
<propstat>
|
||||
<prop>
|
||||
<getetag>some valid etag</getetag>
|
||||
<VC:address-data>BEGIN:VCARD
|
||||
VERSION:3.0
|
||||
TEL;X-EVOLUTION-UI-SLOT=3;TYPE=CELL:+64 22 123 4567
|
||||
TEL;X-EVOLUTION-UI-SLOT=2;TYPE=HOME,VOICE:+64 4 123 4567
|
||||
TEL;X-EVOLUTION-UI-SLOT=1;TYPE=WORK,VOICE:+64 22 123 4567
|
||||
EMAIL;X-EVOLUTION-UI-SLOT=2;TYPE=HOME:andrew@mcmillan.net.nz
|
||||
EMAIL;X-EVOLUTION-UI-SLOT=1;TYPE=WORK:andrew@morphoss.com
|
||||
FN:Andrew Watson McMillan
|
||||
END:VCARD
|
||||
</VC:address-data>
|
||||
</prop>
|
||||
<status>HTTP/1.1 200 OK</status>
|
||||
</propstat>
|
||||
</response>
|
||||
<response>
|
||||
<href>/caldav.php/user1/addressbook/donald_kelly.vcf</href>
|
||||
<propstat>
|
||||
<prop>
|
||||
<getetag>some valid etag</getetag>
|
||||
<VC:address-data>BEGIN:VCARD
|
||||
FN:Donald Kelly
|
||||
EMAIL;TYPE=internet:donald@example.co.nz
|
||||
TEL;TYPE=work:+64 4 347 4747
|
||||
TEL;TYPE=cell:+64 2 1234-4321
|
||||
VERSION:2.1
|
||||
END:VCARD
|
||||
</VC:address-data>
|
||||
</prop>
|
||||
<status>HTTP/1.1 200 OK</status>
|
||||
</propstat>
|
||||
</response>
|
||||
<response>
|
||||
<href>/caldav.php/user1/addressbook/F06EC844-EACD-4ADF-8823-588603991E04-ABSPlugin.vcf</href>
|
||||
<propstat>
|
||||
<prop>
|
||||
<getetag>some valid etag</getetag>
|
||||
<VC:address-data>BEGIN:VCARD
|
||||
VERSION:3.0
|
||||
FN:Morphoss Ltd
|
||||
EMAIL;TYPE=INTERNET;TYPE=WORK;TYPE=pref:andrew+davical@morphoss.com
|
||||
TEL;TYPE=WORK;TYPE=pref:+64272332426
|
||||
END:VCARD
|
||||
</VC:address-data>
|
||||
</prop>
|
||||
<status>HTTP/1.1 200 OK</status>
|
||||
</propstat>
|
||||
</response>
|
||||
<response>
|
||||
<href>/caldav.php/user1/addressbook/van_houtte.vcf</href>
|
||||
<propstat>
|
||||
<prop>
|
||||
<getetag>some valid etag</getetag>
|
||||
<VC:address-data>BEGIN:VCARD
|
||||
VERSION:3.0
|
||||
FN:Vincent VAN HOUTTE
|
||||
TEL;TYPE=CELL,VOICE:0486 11 22 33
|
||||
TEL;TYPE=HOME,VOICE:052 11 22 33
|
||||
TEL;TYPE=HOME,FAX:052 44 55 66
|
||||
EMAIL;TYPE=HOME:vvh@gmail.no
|
||||
TEL;TYPE=WORK,VOICE:052 11 22 33
|
||||
TEL;TYPE=WORK,FAX:052 44 55 66
|
||||
EMAIL;TYPE=WORK:vvh@gmail.no
|
||||
END:VCARD
|
||||
</VC:address-data>
|
||||
</prop>
|
||||
<status>HTTP/1.1 200 OK</status>
|
||||
</propstat>
|
||||
</response>
|
||||
<response>
|
||||
<href>/caldav.php/user1/addressbook/mustrmahn.vcf</href>
|
||||
<propstat>
|
||||
<prop>
|
||||
<getetag>some valid etag</getetag>
|
||||
<VC:address-data>BEGIN:VCARD
|
||||
VERSION:3.0
|
||||
FN:Überwerbung GmbH
|
||||
EMAIL;TYPE=INTERNET;TYPE=WORK;TYPE=pref:karl@mustermann.de
|
||||
TEL;TYPE=WORK;TYPE=pref:+49 30 1234567
|
||||
TEL;TYPE=CELL:+49 172 1234567
|
||||
END:VCARD
|
||||
</VC:address-data>
|
||||
</prop>
|
||||
<status>HTTP/1.1 200 OK</status>
|
||||
</propstat>
|
||||
</response>
|
||||
<response>
|
||||
<href>/caldav.php/user1/addressbook/J%C3%B6rg_Test-Ro%C3%9Fdeutscher_3_0.vcf</href>
|
||||
<propstat>
|
||||
<prop>
|
||||
<getetag>some valid etag</getetag>
|
||||
<VC:address-data>BEGIN:VCARD
|
||||
VERSION:3.0
|
||||
FN:Jörg Test-Roßdeutscher
|
||||
EMAIL;TYPE=INTERNET;TYPE=WORK;TYPE=pref:
|
||||
joerg.rossdeutscher@factordesign.foo
|
||||
EMAIL;TYPE=INTERNET;TYPE=WORK:joerg@factordesign.foo
|
||||
EMAIL;TYPE=INTERNET;TYPE=HOME:joerg.rossdeutscher@gesindel.foo
|
||||
EMAIL;TYPE=INTERNET;TYPE=HOME:raettchen@gmail.bar
|
||||
TEL;TYPE=WORK;TYPE=pref:040 999999432571-43
|
||||
TEL;TYPE=CELL:017799999978200
|
||||
TEL;TYPE=HOME:040999999793017
|
||||
END:VCARD
|
||||
</VC:address-data>
|
||||
</prop>
|
||||
<status>HTTP/1.1 200 OK</status>
|
||||
</propstat>
|
||||
</response>
|
||||
<response>
|
||||
<href>/caldav.php/user1/addressbook/test_multiple_email.vcf</href>
|
||||
<propstat>
|
||||
<prop>
|
||||
<getetag>some valid etag</getetag>
|
||||
<VC:address-data>BEGIN:VCARD
|
||||
VERSION:4.0
|
||||
FN:CardDavClient Test212420682
|
||||
EMAIL;TYPE=HOME:john6doe@example.com
|
||||
EMAIL;TYPE=WORK:doe6@example.com
|
||||
END:VCARD
|
||||
</VC:address-data>
|
||||
</prop>
|
||||
<status>HTTP/1.1 200 OK</status>
|
||||
</propstat>
|
||||
</response>
|
||||
</multistatus>
|
||||
45
testing/tests/carddav/2044-REPORT-addressbook-query.test
Normal file
45
testing/tests/carddav/2044-REPORT-addressbook-query.test
Normal file
@ -0,0 +1,45 @@
|
||||
#
|
||||
# Request a REPORT
|
||||
#
|
||||
# param-filter should filter on parameter value, anyof says any
|
||||
# filter can match.
|
||||
#
|
||||
TYPE=REPORT
|
||||
URL=http://regression.host/caldav.php/user1/addressbook/
|
||||
|
||||
HEADER=Accept: text/xml,application/xml
|
||||
HEADER=Content-Type: text/xml
|
||||
HEADER=Depth: 1
|
||||
|
||||
# HEAD
|
||||
|
||||
BEGINDATA
|
||||
<?xml version="1.0"?>
|
||||
<C:addressbook-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav" xmlns:CS="http://calendarserver.org/ns/">
|
||||
<D:prop>
|
||||
<D:getetag/>
|
||||
<C:address-data>
|
||||
<C:prop name="VERSION"/>
|
||||
<C:prop name="FN"/>
|
||||
<C:prop name="TEL"/>
|
||||
<C:prop name="EMAIL"/>
|
||||
</C:address-data>
|
||||
</D:prop>
|
||||
<C:filter test="anyof">
|
||||
<C:prop-filter name="TEL">
|
||||
<C:param-filter name="TYPE">
|
||||
<C:text-match name="TYPE" match-type="equals">WORK</C:text-match>
|
||||
</C:param-filter>
|
||||
</C:prop-filter>
|
||||
<C:prop-filter name="EMAIL">
|
||||
<C:param-filter name="TYPE">
|
||||
<C:text-match name="TYPE" match-type="equals">WORK</C:text-match>
|
||||
</C:param-filter>
|
||||
</C:prop-filter>
|
||||
</C:filter>
|
||||
</C:addressbook-query>
|
||||
ENDDATA
|
||||
|
||||
REPLACE=_<getetag>"[0-9a-f]+"</getetag>_<getetag>some valid etag</getetag>_
|
||||
REPLACE=/^REV:.*$/REV:date/
|
||||
REPLACE=/^UID:.*$/UID:a nice UID/
|
||||
Loading…
x
Reference in New Issue
Block a user