]> git.mxchange.org Git - friendica-addons.git/blobdiff - dav/SabreDAV/tests/Sabre/CalDAV/Property/SupportedCalendarDataTest.php
Initial Release of the calendar plugin
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / CalDAV / Property / SupportedCalendarDataTest.php
diff --git a/dav/SabreDAV/tests/Sabre/CalDAV/Property/SupportedCalendarDataTest.php b/dav/SabreDAV/tests/Sabre/CalDAV/Property/SupportedCalendarDataTest.php
new file mode 100644 (file)
index 0000000..3b3c84c
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+class Sabre_CalDAV_Property_SupportedCalendarDataTest extends PHPUnit_Framework_TestCase {
+
+    function testSimple() {
+
+        $sccs = new Sabre_CalDAV_Property_SupportedCalendarData();
+
+    }
+
+    /**
+     * @depends testSimple
+     */
+    function testSerialize() {
+
+        $property = new Sabre_CalDAV_Property_SupportedCalendarData();
+
+        $doc = new DOMDocument();
+        $root = $doc->createElement('d:root');
+        $root->setAttribute('xmlns:d','DAV:');
+        $root->setAttribute('xmlns:cal',Sabre_CalDAV_Plugin::NS_CALDAV);
+
+        $doc->appendChild($root);
+        $objectTree = new Sabre_DAV_ObjectTree(new Sabre_DAV_SimpleCollection('rootdir'));
+        $server = new Sabre_DAV_Server($objectTree);
+
+        $property->serialize($server, $root);
+
+        $xml = $doc->saveXML();
+
+        $this->assertEquals(
+'<?xml version="1.0"?>
+<d:root xmlns:d="DAV:" xmlns:cal="' . Sabre_CalDAV_Plugin::NS_CALDAV . '">' .
+'<cal:calendar-data content-type="text/calendar" version="2.0"/>' .
+'</d:root>
+', $xml);
+
+    }
+
+}