[Pkg-owncloud-commits] [php-sabre-vobject] 28/65: Create the AVAILABLE component.

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:57:15 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 0b5497bfdc4dfb30ce13dee9d9b73f4341746ad2
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Mon Feb 2 11:11:14 2015 +0100

    Create the AVAILABLE component.
---
 lib/Component/Available.php                   | 19 +++++++++++++++++++
 lib/Component/VAvailability.php               |  2 ++
 tests/VObject/Component/VAvailabilityTest.php | 17 +++++++++++++++++
 3 files changed, 38 insertions(+)

diff --git a/lib/Component/Available.php b/lib/Component/Available.php
new file mode 100644
index 0000000..6b3a171
--- /dev/null
+++ b/lib/Component/Available.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace Sabre\VObject\Component;
+
+use Sabre\VObject;
+
+/**
+ * The Available sub-component
+ *
+ * This component adds functionality to a component, specific for AVAILABLE
+ * components.
+ *
+ * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/).
+ * @author Ivan Enderlin
+ * @license http://sabre.io/license/ Modified BSD License
+ */
+class Available extends VObject\Component {
+
+}
diff --git a/lib/Component/VAvailability.php b/lib/Component/VAvailability.php
index 8780d12..4603da7 100644
--- a/lib/Component/VAvailability.php
+++ b/lib/Component/VAvailability.php
@@ -54,6 +54,8 @@ class VAvailability extends VObject\Component {
             'CATEGORIES' => '*',
             'COMMENT' => '*',
             'CONTACT' => '*',
+
+            'AVAILABLE' => '*',
         ];
 
     }
diff --git a/tests/VObject/Component/VAvailabilityTest.php b/tests/VObject/Component/VAvailabilityTest.php
index 4f6101b..59e3e4c 100644
--- a/tests/VObject/Component/VAvailabilityTest.php
+++ b/tests/VObject/Component/VAvailabilityTest.php
@@ -4,6 +4,7 @@ namespace Sabre\VObject\Component;
 
 use Sabre\VObject;
 use Sabre\VObject\Reader;
+use Sabre\VObject\Component;
 use Sabre\VObject\Component\VAvailability;
 
 const CRLF = "\r\n";
@@ -132,6 +133,22 @@ VCAL
         ])));
     }
 
+    function testAvailableSubComponent() {
+
+        $vcal = <<<VCAL
+BEGIN:VCALENDAR
+BEGIN:VAVAILABILITY
+BEGIN:AVAILABLE
+END:AVAILABLE
+END:VAVAILABILITY
+END:VCALENDAR
+VCAL;
+        $document = Reader::read($vcal);
+
+        $this->assertInstanceOf(Component::class, $document->VAVAILABILITY->AVAILABLE);
+
+    }
+
     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