[Pkg-owncloud-commits] [php-sabre-vobject] 124/341: Add tests for 3.6.6, .7, .8 and .9 of RFC6321.
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 13:35:40 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 d6e8b54c3e2f88db99b6af6911c1bf69e3c6b499
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date: Wed Jan 14 16:10:10 2015 +0100
Add tests for 3.6.6, .7, .8 and .9 of RFC6321.
---
tests/VObject/Parser/XmlTest.php | 162 +++++++++++++++++++++++++++++++++++++++
1 file changed, 162 insertions(+)
diff --git a/tests/VObject/Parser/XmlTest.php b/tests/VObject/Parser/XmlTest.php
index b5cff97..6646c3f 100644
--- a/tests/VObject/Parser/XmlTest.php
+++ b/tests/VObject/Parser/XmlTest.php
@@ -604,6 +604,168 @@ XML
}
+ /**
+ * Values, Duration.
+ */
+ function testRFC6321Section3_6_6() {
+
+ $this->assertXCalEqualsToICal(
+<<<XML
+<?xml version="1.0" encoding="utf-8"?>
+ <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+ <properties>
+ <duration>
+ <duration>P1D</duration>
+ </duration>
+ </properties>
+ </vcalendar>
+ </icalendar>
+XML
+,
+ 'BEGIN:VCALENDAR' . CRLF .
+ 'DURATION:P1D' . CRLF .
+ 'END:VCALENDAR' . CRLF
+ );
+
+ }
+
+ /**
+ * Values, Float.
+ */
+ function testRFC6321Section3_6_7() {
+
+ $this->assertXCalEqualsToICal(
+<<<XML
+<?xml version="1.0" encoding="utf-8"?>
+ <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+ <properties>
+ <foo>
+ <float>4.2</float>
+ </foo>
+ </properties>
+ </vcalendar>
+ </icalendar>
+XML
+,
+ 'BEGIN:VCALENDAR' . CRLF .
+ 'FOO:4.2' . CRLF .
+ 'END:VCALENDAR' . CRLF
+ );
+
+ $this->assertXCalEqualsToICal(
+<<<XML
+<?xml version="1.0" encoding="utf-8"?>
+ <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+ <properties>
+ <foo>
+ <float>-4.2</float>
+ </foo>
+ </properties>
+ </vcalendar>
+ </icalendar>
+XML
+,
+ 'BEGIN:VCALENDAR' . CRLF .
+ 'FOO:-4.2' . CRLF .
+ 'END:VCALENDAR' . CRLF
+ );
+
+ }
+
+ /**
+ * Values, Integer.
+ */
+ function testRFC6321Section3_6_8() {
+
+ $this->assertXCalEqualsToICal(
+<<<XML
+<?xml version="1.0" encoding="utf-8"?>
+ <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+ <properties>
+ <foo>
+ <integer>42</integer>
+ </foo>
+ </properties>
+ </vcalendar>
+ </icalendar>
+XML
+,
+ 'BEGIN:VCALENDAR' . CRLF .
+ 'FOO:42' . CRLF .
+ 'END:VCALENDAR' . CRLF
+ );
+
+ $this->assertXCalEqualsToICal(
+<<<XML
+<?xml version="1.0" encoding="utf-8"?>
+ <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+ <properties>
+ <foo>
+ <integer>-42</integer>
+ </foo>
+ </properties>
+ </vcalendar>
+ </icalendar>
+XML
+,
+ 'BEGIN:VCALENDAR' . CRLF .
+ 'FOO:-42' . CRLF .
+ 'END:VCALENDAR' . CRLF
+ );
+
+ }
+
+ /**
+ * Values, Period of Time.
+ */
+ function testRFC6321Section3_6_9() {
+
+ $this->assertXCalEqualsToICal(
+<<<XML
+<?xml version="1.0" encoding="utf-8"?>
+ <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+ <properties>
+ <period>
+ <start>2011-05-17T12:00:00</start>
+ <duration>P1H</duration>
+ </period>
+ </properties>
+ </vcalendar>
+ </icalendar>
+XML
+,
+ 'BEGIN:VCALENDAR' . CRLF .
+ 'PERIOD:2011-05-17T12:00:00/P1H' . CRLF .
+ 'END:VCALENDAR' . CRLF
+ );
+
+ $this->assertXCalEqualsToICal(
+<<<XML
+<?xml version="1.0" encoding="utf-8"?>
+ <icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+ <properties>
+ <foo>
+ <integer>-42</integer>
+ </foo>
+ </properties>
+ </vcalendar>
+ </icalendar>
+XML
+,
+ 'BEGIN:VCALENDAR' . CRLF .
+ 'FOO:-42' . CRLF .
+ 'END:VCALENDAR' . CRLF
+ );
+
+ }
+
protected function assertXCalEqualsToICal($xcal, $ical) {
$component = VObject\Reader::readXML($xcal);
--
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