Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #946 from fruux/carddav-addressdata-bug
Fix parsing bug for some CardDAV reports.
- Loading branch information
Showing
5 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,6 @@ class Version { | |
/** | ||
* Full version number | ||
*/ | ||
const VERSION = '3.2.1'; | ||
const VERSION = '3.2.2'; | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
tests/Sabre/CardDAV/Xml/Request/AddressBookMultiGetTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Sabre\CardDAV\Xml\Request; | ||
|
||
use Sabre\DAV\Xml\XmlTest; | ||
|
||
class AddressBookMultiGetTest extends XmlTest { | ||
|
||
protected $elementMap = [ | ||
'{urn:ietf:params:xml:ns:carddav}addressbook-multiget' => 'Sabre\\CardDAV\\Xml\\Request\AddressBookMultiGetReport', | ||
]; | ||
|
||
function testDeserialize() { | ||
|
||
/* lines look a bit odd but this triggers an XML parsing bug */ | ||
$xml = <<<XML | ||
<?xml version='1.0' encoding='UTF-8' ?> | ||
<CARD:addressbook-multiget xmlns="DAV:" xmlns:CARD="urn:ietf:params:xml:ns:carddav"> | ||
<prop> | ||
<getcontenttype /> | ||
<getetag /> | ||
<CARD:address-data content-type="text/vcard" version="4.0" /></prop><href>/foo.vcf</href> | ||
</CARD:addressbook-multiget> | ||
XML; | ||
|
||
$result = $this->parse($xml); | ||
$addressBookMultiGetReport = new AddressBookMultiGetReport(); | ||
$addressBookMultiGetReport->properties = [ | ||
'{DAV:}getcontenttype', | ||
'{DAV:}getetag', | ||
'{urn:ietf:params:xml:ns:carddav}address-data', | ||
]; | ||
$addressBookMultiGetReport->hrefs = ['/foo.vcf']; | ||
$addressBookMultiGetReport->contentType = 'text/vcard'; | ||
$addressBookMultiGetReport->version = '4.0'; | ||
$addressBookMultiGetReport->addressDataProperties = []; | ||
|
||
|
||
$this->assertEquals( | ||
$addressBookMultiGetReport, | ||
$result['value'] | ||
); | ||
|
||
} | ||
|
||
|
||
} |