[Pkg-owncloud-commits] [php-sabre-vobject] 112/341: Test the new Sabre\VObject\Writer class.

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 bd125290db7d3e48d08333f96da446e62bdde90d
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Tue Jan 13 16:09:41 2015 +0100

    Test the new Sabre\VObject\Writer class.
---
 tests/VObject/WriterTest.php | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/tests/VObject/WriterTest.php b/tests/VObject/WriterTest.php
new file mode 100644
index 0000000..800e13d
--- /dev/null
+++ b/tests/VObject/WriterTest.php
@@ -0,0 +1,41 @@
+<?php
+
+namespace Sabre\VObject;
+
+class WriterTest extends \PHPUnit_Framework_TestCase {
+
+    function getComponent() {
+
+        $data = "BEGIN:VCALENDAR\r\nEND:VCALENDAR";
+        return Reader::read($data);
+
+    }
+
+    function testWriteToMimeDir() {
+
+        $result = Writer::write($this->getComponent());
+        $this->assertEquals("BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n", $result);
+
+    }
+
+    function testWriteToJson() {
+
+        $result = Writer::writeJson($this->getComponent());
+        $this->assertEquals('["vcalendar",[],[]]', $result);
+
+    }
+
+    function testWriteToXml() {
+
+        $result = Writer::writeXml($this->getComponent());
+        $this->assertEquals(
+            '<?xml version="1.0" encoding="UTF-8"?>' . "\n" .
+            '<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">' . "\n" .
+            ' <vcalendar/>' . "\n" .
+            '</icalendar>' . "\n",
+            $result
+        );
+
+    }
+
+}

-- 
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