[Pkg-owncloud-commits] [php-sabre-vobject] 188/341: Add a test for Writer + MIME Dir + iterator.

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:35:46 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 9974bd0784f87198e535f0dc68790e27d8b735f2
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Thu Jan 22 11:49:07 2015 +0100

    Add a test for Writer + MIME Dir + iterator.
---
 tests/VObject/WriterTest.php | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/VObject/WriterTest.php b/tests/VObject/WriterTest.php
index 800e13d..b2b0402 100644
--- a/tests/VObject/WriterTest.php
+++ b/tests/VObject/WriterTest.php
@@ -18,6 +18,24 @@ class WriterTest extends \PHPUnit_Framework_TestCase {
 
     }
 
+    function testWriteToMimeDirWithIterator() {
+
+        $iterator = function() {
+            for($i = 0; $i < 3; ++$i) {
+                yield $this->getComponent();
+            }
+        };
+
+        $result = Writer::write($iterator());
+        $this->assertEquals(
+            "BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n" .
+            "BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n" .
+            "BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n",
+            $result
+        );
+
+    }
+
     function testWriteToJson() {
 
         $result = Writer::writeJson($this->getComponent());

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