[Pkg-owncloud-commits] [php-sabre-vobject] 109/341: Add tests for the XML reader.

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 6447fde63467b3404dc84e5cd6cc785610f2e40f
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Tue Jan 13 16:00:38 2015 +0100

    Add tests for the XML reader.
---
 tests/VObject/ReaderTest.php | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/tests/VObject/ReaderTest.php b/tests/VObject/ReaderTest.php
index 287fa8d..28cdb43 100644
--- a/tests/VObject/ReaderTest.php
+++ b/tests/VObject/ReaderTest.php
@@ -447,4 +447,44 @@ ICS;
 
     }
 
+    function testReadXMLComponent() {
+
+        $data = <<<XML
+<?xml version="1.0" encoding="utf-8"?>
+<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+ </vcalendar>
+</icalendar>
+XML;
+
+        $result = Reader::readXML($data);
+
+        $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
+        $this->assertEquals('VCALENDAR', $result->name);
+        $this->assertEquals(0, count($result->children));
+
+    }
+
+    function testReadXMLStream() {
+
+        $data = <<<XML
+<?xml version="1.0" encoding="utf-8"?>
+<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+ </vcalendar>
+</icalendar>
+XML;
+
+        $stream = fopen('php://memory', 'r+');
+        fwrite($stream, $data);
+        rewind($stream);
+
+        $result = Reader::readXML($stream);
+
+        $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
+        $this->assertEquals('VCALENDAR', $result->name);
+        $this->assertEquals(0, count($result->children));
+
+    }
+
 }

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