[Pkg-owncloud-commits] [php-sabre-vobject] 19/29: A lot of small improvements

David Prévot taffit at moszumanska.debian.org
Sat Dec 12 19:26:59 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 ae0737d5b6713ab2cd6c8ca2278d3d5614589b2d
Author: Jakob Sack <mail at jakobsack.de>
Date:   Fri Dec 11 12:47:11 2015 +0100

    A lot of small improvements
    
    - UPCASE magic properties
    - remove unneeded parameters
    - stop tests right after the call that should throw an error
    - remove copy-paste-errors
---
 lib/FreeBusyGenerator.php                          |  4 +-
 lib/ITip/Broker.php                                |  2 +-
 lib/Parameter.php                                  |  2 +-
 lib/Recur/EventIterator.php                        |  7 +++
 lib/Recur/RDateIterator.php                        |  7 +++
 tests/VObject/CliTest.php                          | 12 +---
 tests/VObject/DateTimeParserTest.php               |  2 -
 tests/VObject/DocumentTest.php                     |  4 +-
 tests/VObject/FreeBusyGeneratorTest.php            |  4 +-
 tests/VObject/ITip/BrokerNewEventTest.php          | 28 +--------
 tests/VObject/ITip/BrokerTester.php                |  2 +-
 tests/VObject/Issue153Test.php                     |  2 +-
 tests/VObject/Issue36WorkAroundTest.php            |  2 +-
 tests/VObject/Issue96Test.php                      |  2 +-
 tests/VObject/IssueUndefinedIndexTest.php          |  1 -
 tests/VObject/Parser/QuotedPrintableTest.php       |  8 +--
 tests/VObject/Property/TextTest.php                |  2 +-
 .../EventIterator/InfiniteLoopProblemTest.php      |  4 +-
 tests/VObject/Recur/EventIterator/Issue26Test.php  |  1 -
 tests/VObject/Recur/EventIterator/MainTest.php     | 69 +++++++++++-----------
 tests/VObject/Recur/RRuleIteratorTest.php          | 16 ++---
 tests/VObject/VCard21Test.php                      |  4 +-
 22 files changed, 82 insertions(+), 103 deletions(-)

diff --git a/lib/FreeBusyGenerator.php b/lib/FreeBusyGenerator.php
index adc2b7a..7962da1 100644
--- a/lib/FreeBusyGenerator.php
+++ b/lib/FreeBusyGenerator.php
@@ -315,7 +315,7 @@ class FreeBusyGenerator {
         // priority components to override the lower ones.
         foreach (array_reverse($new) as $vavail) {
 
-            $busyType = isset($vavail->busyType) ? strtoupper($vavail->busyType) : 'BUSY-UNAVAILABLE';
+            $busyType = isset($vavail->BUSYTYPE) ? strtoupper($vavail->BUSYTYPE) : 'BUSY-UNAVAILABLE';
             list($vavailStart, $vavailEnd) = $vavail->getEffectiveStartEnd();
 
             // Making the component size no larger than the requested free-busy
@@ -424,7 +424,7 @@ class FreeBusyGenerator {
 
                         if ($component->RRULE) {
                             try {
-                                $iterator = new EventIterator($object, (string)$component->uid, $this->timeZone);
+                                $iterator = new EventIterator($object, (string)$component->UID, $this->timeZone);
                             } catch (NoInstancesException $e) {
                                 // This event is recurring, but it doesn't have a single
                                 // instance. We are skipping this event from the output
diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
index 77d4038..143b257 100644
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@ -376,7 +376,7 @@ class Broker {
                             $attendee['PARTSTAT'] = $instances[$recurId];
                             $attendee['SCHEDULE-STATUS'] = $requestStatus;
                             // Un-setting the RSVP status, because we now know
-                            // that the attende already replied.
+                            // that the attendee already replied.
                             unset($attendee['RSVP']);
                             break;
                         }
diff --git a/lib/Parameter.php b/lib/Parameter.php
index a5d43b4..2cf01a2 100644
--- a/lib/Parameter.php
+++ b/lib/Parameter.php
@@ -137,7 +137,7 @@ class Parameter extends Node {
             case 'DIB' :
             case 'PICT' :
             case 'TIFF' :
-            case 'PDF':
+            case 'PDF' :
             case 'PS' :
             case 'JPEG' :
             case 'MPEG' :
diff --git a/lib/Recur/EventIterator.php b/lib/Recur/EventIterator.php
index baf57d2..ce2c69d 100644
--- a/lib/Recur/EventIterator.php
+++ b/lib/Recur/EventIterator.php
@@ -504,4 +504,11 @@ class EventIterator implements \Iterator {
      */
     protected $nextDate;
 
+    /**
+     * The event that overwrites the current iteration
+     *
+     * @var VEVENT
+     */
+    protected $currentOverriddenEvent;
+
 }
diff --git a/lib/Recur/RDateIterator.php b/lib/Recur/RDateIterator.php
index 18bda5a..023f579 100644
--- a/lib/Recur/RDateIterator.php
+++ b/lib/Recur/RDateIterator.php
@@ -172,4 +172,11 @@ class RDateIterator implements Iterator {
 
     }
 
+    /**
+     * Array with the RRULE dates
+     *
+     * @var array
+     */
+    protected $dates = [];
+
 }
diff --git a/tests/VObject/CliTest.php b/tests/VObject/CliTest.php
index f0cfa2e..723b93b 100644
--- a/tests/VObject/CliTest.php
+++ b/tests/VObject/CliTest.php
@@ -403,7 +403,6 @@ VCARD
         rewind($inputStream);
         $this->cli->stdin = $inputStream;
 
-        // vCard 2.1 is not supported yet, so this returns a failure.
         $this->assertEquals(
             2,
             $this->cli->main(['vobject', 'convert', '--format=vcard21', '--pretty', '-'])
@@ -449,7 +448,7 @@ VCARD
     );
         rewind($inputStream);
         $this->cli->stdin = $inputStream;
-        // vCard 2.1 is not supported yet, so this returns a failure.
+        // vCard 2.0 is not supported yet, so this returns a failure.
         $this->assertEquals(
             2,
             $this->cli->main(['vobject', 'validate', '-'])
@@ -470,7 +469,7 @@ VCARD
     );
         rewind($inputStream);
         $this->cli->stdin = $inputStream;
-        // vCard 2.1 is not supported yet, so this returns a failure.
+
         $this->assertEquals(
             2,
             $this->cli->main(['vobject', 'validate', '-'])
@@ -491,7 +490,7 @@ VCARD
     );
         rewind($inputStream);
         $this->cli->stdin = $inputStream;
-        // vCard 2.1 is not supported yet, so this returns a failure.
+
         $this->assertEquals(
             2,
             $this->cli->main(['vobject', 'repair', '-'])
@@ -520,7 +519,6 @@ VCARD
     );
         rewind($inputStream);
         $this->cli->stdin = $inputStream;
-        // vCard 2.1 is not supported yet, so this returns a failure.
 
         $result = $this->cli->main(['vobject', 'repair', '-']);
 
@@ -568,7 +566,6 @@ VCARD
     );
         rewind($inputStream);
         $this->cli->stdin = $inputStream;
-        // vCard 2.1 is not supported yet, so this returns a failure.
 
         $result = $this->cli->main(['vobject', 'color', '-']);
 
@@ -611,7 +608,6 @@ VCARD
     );
         rewind($inputStream);
         $this->cli->stdin = $inputStream;
-        // vCard 2.1 is not supported yet, so this returns a failure.
 
         $result = $this->cli->main(['vobject', 'color', '-']);
 
@@ -629,8 +625,6 @@ VCARD
 
 class CliMock extends Cli {
 
-    public $log = [];
-
     public $quiet = false;
 
     public $format;
diff --git a/tests/VObject/DateTimeParserTest.php b/tests/VObject/DateTimeParserTest.php
index 3b9e9c3..9dc685c 100644
--- a/tests/VObject/DateTimeParserTest.php
+++ b/tests/VObject/DateTimeParserTest.php
@@ -165,7 +165,6 @@ class DateTimeParserTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @dataProvider vcardDates
      * @expectedException \Sabre\VObject\InvalidDataException
      */
     function testBadVCardDate() {
@@ -175,7 +174,6 @@ class DateTimeParserTest extends \PHPUnit_Framework_TestCase {
     }
 
     /**
-     * @dataProvider vcardDates
      * @expectedException \Sabre\VObject\InvalidDataException
      */
     function testBadVCardTime() {
diff --git a/tests/VObject/DocumentTest.php b/tests/VObject/DocumentTest.php
index 96250d8..f1730fd 100644
--- a/tests/VObject/DocumentTest.php
+++ b/tests/VObject/DocumentTest.php
@@ -49,8 +49,8 @@ class DocumentTest extends \PHPUnit_Framework_TestCase {
         $event = $vcal->create('VEVENT');
         $this->assertInstanceOf('Sabre\VObject\Component\VEvent', $event);
 
-        $event = $vcal->create('CALSCALE');
-        $this->assertInstanceOf('Sabre\VObject\Property\Text', $event);
+        $prop = $vcal->create('CALSCALE');
+        $this->assertInstanceOf('Sabre\VObject\Property\Text', $prop);
 
     }
 
diff --git a/tests/VObject/FreeBusyGeneratorTest.php b/tests/VObject/FreeBusyGeneratorTest.php
index ba0729e..a675ef5 100644
--- a/tests/VObject/FreeBusyGeneratorTest.php
+++ b/tests/VObject/FreeBusyGeneratorTest.php
@@ -355,8 +355,8 @@ END:VCALENDAR
 ICS;
 
         $this->assertFreeBusyReport(
-            'FREEBUSY:20110103T010000Z/20110103T020000Z' . "\n" .
-                'FREEBUSY:20110103T030000Z/20110103T060000Z',
+            "FREEBUSY:20110103T010000Z/20110103T020000Z\n" .
+            'FREEBUSY:20110103T030000Z/20110103T060000Z',
             $blob
         );
 
diff --git a/tests/VObject/ITip/BrokerNewEventTest.php b/tests/VObject/ITip/BrokerNewEventTest.php
index 49d8c09..5e116d1 100644
--- a/tests/VObject/ITip/BrokerNewEventTest.php
+++ b/tests/VObject/ITip/BrokerNewEventTest.php
@@ -2,7 +2,7 @@
 
 namespace Sabre\VObject\ITip;
 
-class BrokerNewEventTest extends \PHPUnit_Framework_TestCase {
+class BrokerNewEventTest extends BrokerTester {
 
     function testNoAttendee() {
 
@@ -101,7 +101,6 @@ END:VEVENT
 END:VCALENDAR
 ICS;
 
-        $expected = [];
         $this->parse($message, []);
 
     }
@@ -126,7 +125,6 @@ END:VEVENT
 END:VCALENDAR
 ICS;
 
-        $expected = [];
         $this->parse($message, []);
 
     }
@@ -477,29 +475,7 @@ ICS;
 
     function parse($message, $expected = []) {
 
-        $broker = new Broker();
-        $result = $broker->parseEvent($message, 'mailto:strunk at example.org');
-
-        $this->assertEquals(count($expected), count($result));
-
-        foreach ($expected as $index => $ex) {
-
-            $message = $result[$index];
-
-            foreach ($ex as $key => $val) {
-
-                if ($key === 'message') {
-                    $this->assertEquals(
-                        str_replace("\n", "\r\n", $val),
-                        rtrim($message->message->serialize(), "\r\n")
-                    );
-                } else {
-                    $this->assertEquals($val, $message->$key);
-                }
-
-            }
-
-        }
+        parent::parse(null, $message, $expected, 'mailto:strunk at example.org');
 
     }
 
diff --git a/tests/VObject/ITip/BrokerTester.php b/tests/VObject/ITip/BrokerTester.php
index 2cea0b9..a2dd583 100644
--- a/tests/VObject/ITip/BrokerTester.php
+++ b/tests/VObject/ITip/BrokerTester.php
@@ -55,7 +55,7 @@ abstract class BrokerTester extends \Sabre\VObject\TestCase {
         $message->message = $vcal;
         $message->method = isset($vcal->METHOD) ? $vcal->METHOD->getValue() : null;
         $message->component = $mainComponent->name;
-        $message->uid = $mainComponent->uid->getValue();
+        $message->uid = $mainComponent->UID->getValue();
         $message->sequence = isset($vcal->VEVENT[0]) ? (string)$vcal->VEVENT[0]->SEQUENCE : null;
 
         if ($message->method === 'REPLY') {
diff --git a/tests/VObject/Issue153Test.php b/tests/VObject/Issue153Test.php
index 1cc14c1..fca07fe 100644
--- a/tests/VObject/Issue153Test.php
+++ b/tests/VObject/Issue153Test.php
@@ -7,7 +7,7 @@ class Issue153Test extends \PHPUnit_Framework_TestCase {
     function testRead() {
 
         $obj = Reader::read(file_get_contents(dirname(__FILE__) . '/issue153.vcf'));
-        $this->assertEquals('Test Benutzer', (string)$obj->fn);
+        $this->assertEquals('Test Benutzer', (string)$obj->FN);
 
     }
 
diff --git a/tests/VObject/Issue36WorkAroundTest.php b/tests/VObject/Issue36WorkAroundTest.php
index 9a9ce86..e2b9caf 100644
--- a/tests/VObject/Issue36WorkAroundTest.php
+++ b/tests/VObject/Issue36WorkAroundTest.php
@@ -32,7 +32,7 @@ ICS;
 
         // If this does not throw an exception, it's all good.
         $it = new Recur\EventIterator($obj, '1833bd44-188b-405c-9f85-1a12105318aa');
-        $this->assertInstanceOf('Sabre\\VObject\\Recur\EventIterator', $it);
+        $this->assertInstanceOf('Sabre\\VObject\\Recur\\EventIterator', $it);
 
     }
 
diff --git a/tests/VObject/Issue96Test.php b/tests/VObject/Issue96Test.php
index 4300b86..f0ed548 100644
--- a/tests/VObject/Issue96Test.php
+++ b/tests/VObject/Issue96Test.php
@@ -17,7 +17,7 @@ VCF;
 
         $vcard = Reader::read($input, Reader::OPTION_FORGIVING);
         $this->assertInstanceOf('Sabre\\VObject\\Component\\VCard', $vcard);
-        $this->assertEquals("http://www.example.org", $vcard->url->getValue());
+        $this->assertEquals("http://www.example.org", $vcard->URL->getValue());
 
     }
 
diff --git a/tests/VObject/IssueUndefinedIndexTest.php b/tests/VObject/IssueUndefinedIndexTest.php
index 9b6292e..6f8afe6 100644
--- a/tests/VObject/IssueUndefinedIndexTest.php
+++ b/tests/VObject/IssueUndefinedIndexTest.php
@@ -23,7 +23,6 @@ END:VCARD
 VCF;
 
         $vcard = Reader::read($input, Reader::OPTION_FORGIVING);
-        $this->assertInstanceOf('Sabre\\VObject\\Component\\VCard', $vcard);
 
     }
 
diff --git a/tests/VObject/Parser/QuotedPrintableTest.php b/tests/VObject/Parser/QuotedPrintableTest.php
index 2ba926f..f40d6a6 100644
--- a/tests/VObject/Parser/QuotedPrintableTest.php
+++ b/tests/VObject/Parser/QuotedPrintableTest.php
@@ -16,7 +16,7 @@ class QuotedPrintableTest extends \PHPUnit_Framework_TestCase {
         $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
         $this->assertEquals('VCARD', $result->name);
         $this->assertEquals(1, count($result->children()));
-        $this->assertEquals("Aachen", $this->getPropertyValue($result->label));
+        $this->assertEquals("Aachen", $this->getPropertyValue($result->LABEL));
 
     }
 
@@ -28,7 +28,7 @@ class QuotedPrintableTest extends \PHPUnit_Framework_TestCase {
         $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
         $this->assertEquals('VCARD', $result->name);
         $this->assertEquals(1, count($result->children()));
-        $this->assertEquals("Aachen", $this->getPropertyValue($result->label));
+        $this->assertEquals("Aachen", $this->getPropertyValue($result->LABEL));
 
     }
 
@@ -40,7 +40,7 @@ class QuotedPrintableTest extends \PHPUnit_Framework_TestCase {
         $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
         $this->assertEquals('VCARD', $result->name);
         $this->assertEquals(1, count($result->children()));
-        $this->assertEquals("Aachen\r\nGermany", $this->getPropertyValue($result->label));
+        $this->assertEquals("Aachen\r\nGermany", $this->getPropertyValue($result->LABEL));
 
 
     }
@@ -53,7 +53,7 @@ class QuotedPrintableTest extends \PHPUnit_Framework_TestCase {
         $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
         $this->assertEquals('VCARD', $result->name);
         $this->assertEquals(1, count($result->children()));
-        $this->assertEquals("Aachen\r\nDeutschland:okay", $this->getPropertyValue($result->label));
+        $this->assertEquals("Aachen\r\nDeutschland:okay", $this->getPropertyValue($result->LABEL));
 
     }
 
diff --git a/tests/VObject/Property/TextTest.php b/tests/VObject/Property/TextTest.php
index a5c79ff..69ac8aa 100644
--- a/tests/VObject/Property/TextTest.php
+++ b/tests/VObject/Property/TextTest.php
@@ -6,7 +6,7 @@ use Sabre\VObject\Component\VCard;
 
 class TextTest extends \PHPUnit_Framework_TestCase {
 
-    function assertVCard21serialization($propValue, $expected) {
+    function assertVCard21Serialization($propValue, $expected) {
 
         $doc = new VCard([
             'VERSION' => '2.1',
diff --git a/tests/VObject/Recur/EventIterator/InfiniteLoopProblemTest.php b/tests/VObject/Recur/EventIterator/InfiniteLoopProblemTest.php
index 8b0e480..491b0e8 100644
--- a/tests/VObject/Recur/EventIterator/InfiniteLoopProblemTest.php
+++ b/tests/VObject/Recur/EventIterator/InfiniteLoopProblemTest.php
@@ -57,8 +57,8 @@ class InfiniteLoopProblemTest extends \PHPUnit_Framework_TestCase {
         $collect = [];
 
         while ($it->valid()) {
-            $collect[] = $it->getDTSTART();
-            if ($it->getDTSTART() > new DateTimeImmutable('2013-02-05 22:59:59', new DateTimeZone('UTC'))) {
+            $collect[] = $it->getDtStart();
+            if ($it->getDtStart() > new DateTimeImmutable('2013-02-05 22:59:59', new DateTimeZone('UTC'))) {
                 break;
             }
             $it->next();
diff --git a/tests/VObject/Recur/EventIterator/Issue26Test.php b/tests/VObject/Recur/EventIterator/Issue26Test.php
index 693a890..df8619d 100644
--- a/tests/VObject/Recur/EventIterator/Issue26Test.php
+++ b/tests/VObject/Recur/EventIterator/Issue26Test.php
@@ -28,7 +28,6 @@ ICS;
         $this->assertInstanceOf('Sabre\\VObject\\Component\\VCalendar', $vcal);
 
         $it = new EventIterator($vcal, 'bae5d57a98');
-        iterator_to_array($it);
 
     }
 
diff --git a/tests/VObject/Recur/EventIterator/MainTest.php b/tests/VObject/Recur/EventIterator/MainTest.php
index 28eec5d..4c78e8a 100644
--- a/tests/VObject/Recur/EventIterator/MainTest.php
+++ b/tests/VObject/Recur/EventIterator/MainTest.php
@@ -22,7 +22,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $this->assertTrue($it->isInfinite());
 
@@ -44,7 +44,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
         $ev->add($dtStart);
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
     }
 
@@ -84,7 +84,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
         $ev->add($dtStart);
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, $ev->uid);
+        $it = new EventIterator($vcal, $ev->UID);
 
         // Max is to prevent overflow
         $max = 12;
@@ -137,7 +137,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, $ev->uid);
+        $it = new EventIterator($vcal, $ev->UID);
 
         // Max is to prevent overflow
         $max = 12;
@@ -184,7 +184,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, $ev->uid);
+        $it = new EventIterator($vcal, $ev->UID);
 
         // Max is to prevent overflow
         $max = 12;
@@ -226,7 +226,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         // Grabbing the next 12 items
         $max = 12;
@@ -279,7 +279,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         // Grabbing the next 12 items
         $max = 12;
@@ -332,7 +332,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         // Grabbing the next 12 items
         $max = 12;
@@ -385,7 +385,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         // Max is to prevent overflow
         $max = 12;
@@ -436,7 +436,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         // Grabbing the next 12 items
         $max = 15;
@@ -492,7 +492,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         // Grabbing the next 12 items
         $max = 12;
@@ -545,7 +545,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         // Grabbing the next 12 items
         $max = 12;
@@ -598,7 +598,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 14;
         $result = [];
@@ -644,7 +644,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 14;
         $result = [];
@@ -697,7 +697,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 14;
         $result = [];
@@ -750,11 +750,11 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 20;
         $result = [];
-        foreach ($it as $k => $item) {
+        foreach ($it as $item) {
 
             $result[] = $item;
             $max--;
@@ -806,11 +806,11 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 20;
         $result = [];
-        foreach ($it as $k => $item) {
+        foreach ($it as $item) {
 
             $result[] = $item;
             $max--;
@@ -856,11 +856,11 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 20;
         $result = [];
-        foreach ($it as $k => $item) {
+        foreach ($it as $item) {
 
             $result[] = $item;
             $max--;
@@ -906,11 +906,11 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 20;
         $result = [];
-        foreach ($it as $k => $item) {
+        foreach ($it as $item) {
 
             $result[] = $item;
             $max--;
@@ -956,11 +956,11 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 20;
         $result = [];
-        foreach ($it as $k => $item) {
+        foreach ($it as $item) {
 
             $result[] = $item;
             $max--;
@@ -999,11 +999,11 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 20;
         $result = [];
-        foreach ($it as $k => $item) {
+        foreach ($it as $item) {
 
             $result[] = $item;
             $max--;
@@ -1047,11 +1047,11 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 20;
         $result = [];
-        foreach ($it as $k => $item) {
+        foreach ($it as $item) {
 
             $result[] = $item;
             $max--;
@@ -1095,7 +1095,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         // The idea is that we're fast-forwarding too far in the future, so
         // there will be no results left.
@@ -1113,7 +1113,6 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         }
 
-        $tz = new DateTimeZone('UTC');
         $this->assertEquals([], $result);
 
     }
@@ -1144,11 +1143,11 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, (string)$ev->uid);
+        $it = new EventIterator($vcal, (string)$ev->UID);
 
         $max = 20;
         $result = [];
-        foreach ($it as $k => $item) {
+        foreach ($it as $item) {
 
             $result[] = $item;
             $max--;
@@ -1335,7 +1334,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
         // We stop the loop when it hits the 6th of februari. Normally this
         // iterator would hit 24, 25 (overriden from 31) and 7 feb but because
         // we 'filter' from the 28th till the 6th, we should get 0 results.
-        while ($it->valid() && $it->getDTSTart() < new DateTimeImmutable('2012-02-06 23:00:00')) {
+        while ($it->valid() && $it->getDTStart() < new DateTimeImmutable('2012-02-06 23:00:00')) {
 
             $dates[] = $it->getDTStart();
             $summaries[] = (string)$it->getEventObject()->SUMMARY;
@@ -1368,7 +1367,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
 
         $vcal->add($ev);
 
-        $it = new EventIterator($vcal, $ev->uid);
+        $it = new EventIterator($vcal, $ev->UID);
 
         // Max is to prevent overflow
         $max = 12;
diff --git a/tests/VObject/Recur/RRuleIteratorTest.php b/tests/VObject/Recur/RRuleIteratorTest.php
index 463757b..24efef9 100644
--- a/tests/VObject/Recur/RRuleIteratorTest.php
+++ b/tests/VObject/Recur/RRuleIteratorTest.php
@@ -139,12 +139,12 @@ class RRuleIteratorTest extends \PHPUnit_Framework_TestCase {
             'FREQ=DAILY;BYMONTH=9,10;BYDAY=SU',
             '2007-10-04 16:00:00',
             [
-                "2013-09-29 16:00:00",
-                "2013-10-06 16:00:00",
-                "2013-10-13 16:00:00",
-                "2013-10-20 16:00:00",
-                "2013-10-27 16:00:00",
-                "2014-09-07 16:00:00"
+                '2013-09-29 16:00:00',
+                '2013-10-06 16:00:00',
+                '2013-10-13 16:00:00',
+                '2013-10-20 16:00:00',
+                '2013-10-27 16:00:00',
+                '2014-09-07 16:00:00'
             ],
             '2013-09-28'
         );
@@ -487,7 +487,7 @@ class RRuleIteratorTest extends \PHPUnit_Framework_TestCase {
             'FREQ=MONTHLY;INTERVAL=1;UNTIL=20071030T035959Z;BYDAY=5TU',
             '2007-10-04 14:46:42',
             [
-                "2007-10-04 14:46:42",
+                '2007-10-04 14:46:42',
             ]
         );
 
@@ -580,7 +580,7 @@ class RRuleIteratorTest extends \PHPUnit_Framework_TestCase {
 
     }
 
-    function testUntilBeginHAsTimezone() {
+    function testUntilBeginHasTimezone() {
 
         $this->parse(
             'FREQ=WEEKLY;UNTIL=20131118T183000',
diff --git a/tests/VObject/VCard21Test.php b/tests/VObject/VCard21Test.php
index 9c6994d..cede1ea 100644
--- a/tests/VObject/VCard21Test.php
+++ b/tests/VObject/VCard21Test.php
@@ -18,7 +18,7 @@ END:VCARD\r
 VCF;
 
         $vobj = Reader::read($input);
-        $output = $vobj->serialize($input);
+        $output = $vobj->serialize();
 
         $this->assertEquals($input, $output);
 
@@ -35,7 +35,7 @@ END:VCARD
 VCF;
 
         $vobj = Reader::read($input);
-        $output = $vobj->serialize($input);
+        $output = $vobj->serialize();
 
         $expected = <<<VCF
 BEGIN:VCARD\r

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