ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
AddressBookMultiGetTest.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
8 
9  protected $elementMap = [
10  '{urn:ietf:params:xml:ns:carddav}addressbook-multiget' => 'Sabre\\CardDAV\\Xml\\Request\AddressBookMultiGetReport',
11  ];
12 
13  function testDeserialize() {
14 
15  /* lines look a bit odd but this triggers an XML parsing bug */
16  $xml = <<<XML
17 <?xml version='1.0' encoding='UTF-8' ?>
18 <CARD:addressbook-multiget xmlns="DAV:" xmlns:CARD="urn:ietf:params:xml:ns:carddav">
19  <prop>
20  <getcontenttype />
21  <getetag />
22  <CARD:address-data content-type="text/vcard" version="4.0" /></prop><href>/foo.vcf</href>
23 </CARD:addressbook-multiget>
24 XML;
25 
26  $result = $this->parse($xml);
27  $addressBookMultiGetReport = new AddressBookMultiGetReport();
28  $addressBookMultiGetReport->properties = [
29  '{DAV:}getcontenttype',
30  '{DAV:}getetag',
31  '{urn:ietf:params:xml:ns:carddav}address-data',
32  ];
33  $addressBookMultiGetReport->hrefs = ['/foo.vcf'];
34  $addressBookMultiGetReport->contentType = 'text/vcard';
35  $addressBookMultiGetReport->version = '4.0';
36  $addressBookMultiGetReport->addressDataProperties = [];
37 
38 
39  $this->assertEquals(
40  $addressBookMultiGetReport,
41  $result['value']
42  );
43 
44  }
45 
46 
47 }
$result
parse($xml, array $elementMap=[])
Definition: XmlTest.php:26
$this data['403_header']