[Pkg-owncloud-commits] [php-sabre-vobject] 114/341: Add the Example 1 of the RFC6321 as a test.

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:35:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabre-vobject.

commit 59e9505302fb511c53b4b6b2a87081b31a4e09b0
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Tue Jan 13 16:20:31 2015 +0100

    Add the Example 1 of the RFC6321 as a test.
---
 tests/VObject/Parser/XmlTest.php | 66 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/tests/VObject/Parser/XmlTest.php b/tests/VObject/Parser/XmlTest.php
new file mode 100644
index 0000000..3ab7621
--- /dev/null
+++ b/tests/VObject/Parser/XmlTest.php
@@ -0,0 +1,66 @@
+<?php
+
+namespace Sabre\VObject\Parser;
+
+use
+    Sabre\VObject;
+
+class XmlTest extends \PHPUnit_Framework_TestCase {
+
+    function testRFC6321Example1() {
+
+        $xml = <<<XML
+<?xml version="1.0" encoding="utf-8"?>
+<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+  <properties>
+   <calscale>
+     <text>GREGORIAN</text>
+   </calscale>
+   <prodid>
+    <text>-//Example Inc.//Example Calendar//EN</text>
+   </prodid>
+   <version>
+     <text>2.0</text>
+   </version>
+  </properties>
+  <components>
+   <vevent>
+    <properties>
+     <dtstamp>
+       <date-time>2008-02-05T19:12:24Z</date-time>
+     </dtstamp>
+     <dtstart>
+       <date>2008-10-06</date>
+     </dtstart>
+     <summary>
+      <text>Planning meeting</text>
+     </summary>
+     <uid>
+      <text>4088E990AD89CB3DBB484909</text>
+     </uid>
+    </properties>
+   </vevent>
+  </components>
+ </vcalendar>
+</icalendar>
+XML;
+
+        $component = VObject\Reader::readXML($xml);
+        $this->assertEquals(
+            'BEGIN:VCALENDAR' . "\r\n" .
+            'VERSION:2.0' . "\r\n" .
+            'CALSCALE:GREGORIAN' . "\r\n" .
+            'PRODID:-//Example Inc.//Example Calendar//EN' . "\r\n" .
+            'BEGIN:VEVENT' . "\r\n" .
+            'DTSTAMP:20080205T191224Z' . "\r\n" .
+            'DTSTART:20081006' . "\r\n" .
+            'SUMMARY:Planning meeting' . "\r\n" .
+            'UID:4088E990AD89CB3DBB484909' . "\r\n" .
+            'END:VEVENT' . "\r\n" .
+            'END:VCALENDAR' . "\r\n",
+            Vobject\Writer::write($component)
+        );
+
+    }
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git



More information about the Pkg-owncloud-commits mailing list