]> git.mxchange.org Git - friendica-addons.git/blobdiff - dav/SabreDAV/tests/Sabre/CardDAV/Property/SupportedAddressDataTest.php
Initial Release of the calendar plugin
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / CardDAV / Property / SupportedAddressDataTest.php
diff --git a/dav/SabreDAV/tests/Sabre/CardDAV/Property/SupportedAddressDataTest.php b/dav/SabreDAV/tests/Sabre/CardDAV/Property/SupportedAddressDataTest.php
new file mode 100644 (file)
index 0000000..e85c5d8
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+
+class Sabre_CardDAV_Property_SupportedAddressDataDataTest extends PHPUnit_Framework_TestCase {
+
+    function testSimple() {
+
+        $property = new Sabre_CardDAV_Property_SupportedAddressData();
+
+    }
+
+    /**
+     * @depends testSimple
+     */
+    function testSerialize() {
+
+        $property = new Sabre_CardDAV_Property_SupportedAddressData();
+
+        $doc = new DOMDocument();
+        $root = $doc->createElementNS(Sabre_CardDAV_Plugin::NS_CARDDAV, 'card:root');
+        $root->setAttribute('xmlns:d','DAV:');
+
+        $doc->appendChild($root);
+        $server = new Sabre_DAV_Server();
+
+        $property->serialize($server, $root);
+
+        $xml = $doc->saveXML();
+
+        $this->assertEquals(
+'<?xml version="1.0"?>
+<card:root xmlns:card="' . Sabre_CardDAV_Plugin::NS_CARDDAV . '" xmlns:d="DAV:">' .
+'<card:address-data-type content-type="text/vcard" version="3.0"/>' .
+'<card:address-data-type content-type="text/vcard" version="4.0"/>' .
+'</card:root>
+', $xml);
+
+    }
+
+}