[Pkg-owncloud-commits] [php-sabre-vobject] 31/65: Add tests for Section 3.1, availableprop.
David Prévot
taffit at moszumanska.debian.org
Tue Feb 24 23:57:16 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 698986d494d77be1113f4389d34f24b20c87bd2d
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date: Mon Feb 2 17:40:15 2015 +0100
Add tests for Section 3.1, availableprop.
---
tests/VObject/Component/VAvailabilityTest.php | 93 +++++++++++++++++++++++++++
1 file changed, 93 insertions(+)
diff --git a/tests/VObject/Component/VAvailabilityTest.php b/tests/VObject/Component/VAvailabilityTest.php
index 4102d6c..7076c54 100644
--- a/tests/VObject/Component/VAvailabilityTest.php
+++ b/tests/VObject/Component/VAvailabilityTest.php
@@ -149,6 +149,99 @@ VCAL;
}
+ function testRFCxxxSection3_1_availableprop_required() {
+
+ // UID, DTSTAMP and DTSTART are present.
+ $this->assertIsValid(Reader::read(
+<<<VCAL
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//id
+BEGIN:VAVAILABILITY
+UID:foo at test
+DTSTAMP:20111005T133225Z
+BEGIN:AVAILABLE
+UID:foo at test
+DTSTAMP:20111005T133225Z
+DTSTART:20111005T133225Z
+END:AVAILABLE
+END:VAVAILABILITY
+END:VCALENDAR
+VCAL
+ ));
+
+ // UID, DTSTAMP and DTSTART are missing.
+ $this->assertIsNotValid(Reader::read(
+<<<VCAL
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//id
+BEGIN:VAVAILABILITY
+UID:foo at test
+DTSTAMP:20111005T133225Z
+BEGIN:AVAILABLE
+END:AVAILABLE
+END:VAVAILABILITY
+END:VCALENDAR
+VCAL
+ ));
+
+ // UID is missing.
+ $this->assertIsNotValid(Reader::read(
+<<<VCAL
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//id
+BEGIN:VAVAILABILITY
+UID:foo at test
+DTSTAMP:20111005T133225Z
+BEGIN:AVAILABLE
+DTSTAMP:20111005T133225Z
+DTSTART:20111005T133225Z
+END:AVAILABLE
+END:VAVAILABILITY
+END:VCALENDAR
+VCAL
+ ));
+
+ // DTSTAMP is missing.
+ $this->assertIsNotValid(Reader::read(
+<<<VCAL
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//id
+BEGIN:VAVAILABILITY
+UID:foo at test
+DTSTAMP:20111005T133225Z
+BEGIN:AVAILABLE
+UID:foo at test
+DTSTART:20111005T133225Z
+END:AVAILABLE
+END:VAVAILABILITY
+END:VCALENDAR
+VCAL
+ ));
+
+ // DTSTART is missing.
+ $this->assertIsNotValid(Reader::read(
+<<<VCAL
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//id
+BEGIN:VAVAILABILITY
+UID:foo at test
+DTSTAMP:20111005T133225Z
+BEGIN:AVAILABLE
+UID:foo at test
+DTSTAMP:20111005T133225Z
+END:AVAILABLE
+END:VAVAILABILITY
+END:VCALENDAR
+VCAL
+ ));
+
+ }
+
protected function assertIsValid(VObject\Document $document) {
$this->assertEmpty($document->validate());
--
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