[Pkg-owncloud-commits] [php-sabre-vobject] 22/65: Create and declare the AVAILABILITY component.

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

    Create and declare the AVAILABILITY component.
---
 lib/Component/VAvailability.php               | 19 +++++++++++++++++++
 lib/Component/VCalendar.php                   | 13 +++++++------
 tests/VObject/Component/VAvailabilityTest.php | 25 +++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 6 deletions(-)

diff --git a/lib/Component/VAvailability.php b/lib/Component/VAvailability.php
new file mode 100644
index 0000000..f7afec5
--- /dev/null
+++ b/lib/Component/VAvailability.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace Sabre\VObject\Component;
+
+use Sabre\VObject;
+
+/**
+ * The VAvailability component
+ *
+ * This component adds functionality to a component, specific for VAVAILABILITY
+ * components.
+ *
+ * @copyright Copyright (C) 2011-2015 fruux GmbH (https://fruux.com/).
+ * @author Ivan Enderlin
+ * @license http://sabre.io/license/ Modified BSD License
+ */
+class VAvailability extends VObject\Component {
+
+}
diff --git a/lib/Component/VCalendar.php b/lib/Component/VCalendar.php
index bcfc41c..028191b 100644
--- a/lib/Component/VCalendar.php
+++ b/lib/Component/VCalendar.php
@@ -35,12 +35,13 @@ class VCalendar extends VObject\Document {
      * @var array
      */
     static $componentMap = array(
-        'VALARM'    => 'Sabre\\VObject\\Component\\VAlarm',
-        'VEVENT'    => 'Sabre\\VObject\\Component\\VEvent',
-        'VFREEBUSY' => 'Sabre\\VObject\\Component\\VFreeBusy',
-        'VJOURNAL'  => 'Sabre\\VObject\\Component\\VJournal',
-        'VTIMEZONE' => 'Sabre\\VObject\\Component\\VTimeZone',
-        'VTODO'     => 'Sabre\\VObject\\Component\\VTodo',
+        'VALARM'        => 'Sabre\\VObject\\Component\\VAlarm',
+        'VEVENT'        => 'Sabre\\VObject\\Component\\VEvent',
+        'VFREEBUSY'     => 'Sabre\\VObject\\Component\\VFreeBusy',
+        'VAVAILABILITY' => 'Sabre\\VObject\\Component\\VAvailability',
+        'VJOURNAL'      => 'Sabre\\VObject\\Component\\VJournal',
+        'VTIMEZONE'     => 'Sabre\\VObject\\Component\\VTimeZone',
+        'VTODO'         => 'Sabre\\VObject\\Component\\VTodo',
     );
 
     /**
diff --git a/tests/VObject/Component/VAvailabilityTest.php b/tests/VObject/Component/VAvailabilityTest.php
new file mode 100644
index 0000000..ec5bd03
--- /dev/null
+++ b/tests/VObject/Component/VAvailabilityTest.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace Sabre\VObject\Component;
+
+use Sabre\VObject;
+use Sabre\VObject\Reader;
+use Sabre\VObject\Component\VAvailability;
+
+class VAvailabilityTest extends \PHPUnit_Framework_TestCase {
+
+    function testVAvailabilityComponent() {
+
+        $vcal = <<<VCAL
+BEGIN:VCALENDAR
+BEGIN:VAVAILABILITY
+END:VAVAILABILITY
+END:VCALENDAR
+VCAL;
+        $document = Reader::read($vcal);
+
+        $this->assertInstanceOf(VAvailability::class, $document->VAVAILABILITY);
+
+    }
+
+}

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