[Pkg-owncloud-commits] [php-sabre-vobject] 329/341: More tests, CS fixes.

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 13:36:01 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 7543b9a1f63848ddc9f0804dfc81f078edc6d87b
Author: Evert Pot <me at evertpot.com>
Date:   Fri Jul 17 15:56:55 2015 -0400

    More tests, CS fixes.
---
 lib/FreeBusyGenerator.php               | 10 ++++----
 tests/VObject/FreeBusyGeneratorTest.php | 41 +++++++++++++++++++++++++++++++++
 tests/phpunit.xml                       |  4 +++-
 3 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/lib/FreeBusyGenerator.php b/lib/FreeBusyGenerator.php
index 751d4a9..e3dc2ca 100644
--- a/lib/FreeBusyGenerator.php
+++ b/lib/FreeBusyGenerator.php
@@ -266,7 +266,7 @@ class FreeBusyGenerator {
         $old = $vavailComps;
         $new = [];
 
-        foreach($old as $vavail) {
+        foreach ($old as $vavail) {
 
             list($compStart, $compEnd) = $vavail->getEffectiveStartEnd();
 
@@ -287,7 +287,7 @@ class FreeBusyGenerator {
 
             // Going through our existing list of components to see if there's
             // a higher priority component that already fully covers this one.
-            foreach($new as $higherVavail) {
+            foreach ($new as $higherVavail) {
 
                 list($higherStart, $higherEnd) = $higherVavail->getEffectiveStartEnd();
                 if (
@@ -313,7 +313,7 @@ class FreeBusyGenerator {
         //
         // We traverse the components in reverse, because we want the higher
         // priority components to override the lower ones.
-        foreach(array_reverse($new) as $vavail) {
+        foreach (array_reverse($new) as $vavail) {
 
             $busyType = isset($vavail->busyType) ? strtoupper($vavail->busyType) : 'BUSY-UNAVAILABLE';
             list($vavailStart, $vavailEnd) = $vavail->getEffectiveStartEnd();
@@ -336,7 +336,7 @@ class FreeBusyGenerator {
             );
 
             // Looping over the AVAILABLE components.
-            foreach($vavail->AVAILABLE as $available) {
+            foreach ($vavail->AVAILABLE as $available) {
 
                 list($availStart, $availEnd) = $available->getEffectiveStartEnd();
                 $fbData->add(
@@ -356,7 +356,7 @@ class FreeBusyGenerator {
 
                     $startEndDiff = $availStart->diff($availEnd);
 
-                    while($rruleIterator->valid()) {
+                    while ($rruleIterator->valid()) {
 
                         $recurStart = $rruleIterator->current();
                         $recurEnd = $recurStart->add($startEndDiff);
diff --git a/tests/VObject/FreeBusyGeneratorTest.php b/tests/VObject/FreeBusyGeneratorTest.php
index 51c9b94..ad43854 100644
--- a/tests/VObject/FreeBusyGeneratorTest.php
+++ b/tests/VObject/FreeBusyGeneratorTest.php
@@ -544,6 +544,47 @@ ICS;
             $vavail
         );
 
+    }
+
+    /**
+     * This VAVAILABILITY object has a 9am-5pm AVAILABLE object for office
+     * hours.
+     */
+    function testVAvailabilityOfficeHours() {
+
+        $blob = <<<ICS
+BEGIN:VCALENDAR
+BEGIN:VEVENT
+UID:lalala
+DTSTART:20110101T120000Z
+DTEND:20110101T130000Z
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+        $vavail = <<<ICS
+BEGIN:VCALENDAR
+BEGIN:VAVAILABILITY
+DTSTART:20110101T000000Z
+DTEND:20120101T000000Z
+BUSYTYPE:BUSY-TENTATIVE
+BEGIN:AVAILABLE
+DTSTART:20101213T090000Z
+DTEND:20101213T170000Z
+RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
+END:AVAILABLE
+END:VAVAILABILITY
+END:VCALENDAR
+ICS;
+
+        $this->assertFreeBusyReport(
+            "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T110000Z/20110101T120000Z\n" .
+            "FREEBUSY:20110101T120000Z/20110101T130000Z\n" .
+            "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T130000Z/20110103T090000Z\n",
+            $blob,
+            null,
+            $vavail
+        );
 
     }
 
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
index 2288151..46dad6a 100644
--- a/tests/phpunit.xml
+++ b/tests/phpunit.xml
@@ -4,7 +4,9 @@
   convertErrorsToExceptions="true"
   convertNoticesToExceptions="true"
   convertWarningsToExceptions="true"
-  strict="true"
+  beStrictAboutTestsThatDoNotTestAnything="true"
+  beStrictAboutOutputDuringTests="true"
+  beStrictAboutTestSize="true"
   >
   <testsuite name="Sabre\VObject">
     <directory>VObject/</directory>

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