[Pkg-owncloud-commits] [php-sabre-vobject] 07/30: Revert "Some style fixes"

David Prévot taffit at moszumanska.debian.org
Sun Mar 13 00:53:01 UTC 2016


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 a02785dde658f96fc88a0be0e07aad4f794c552f
Author: Evert Pot <me at evertpot.com>
Date:   Mon Feb 8 17:05:25 2016 -0500

    Revert "Some style fixes"
---
 lib/Parser/MimeDir.php                             |  2 +-
 tests/VObject/Component/VCalendarTest.php          |  2 --
 tests/VObject/ITip/BrokerDeleteEventTest.php       | 14 ++++++++------
 tests/VObject/Parser/MimeDirTest.php               | 22 +++++++++++-----------
 .../Recur/EventIterator/HandleRDateExpandTest.php  |  4 ++--
 .../Recur/EventIterator/MaxInstancesTest.php       |  2 +-
 tests/VObject/Recur/RDateIteratorTest.php          |  2 ++
 7 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/lib/Parser/MimeDir.php b/lib/Parser/MimeDir.php
index cc49540..6a7f931 100644
--- a/lib/Parser/MimeDir.php
+++ b/lib/Parser/MimeDir.php
@@ -474,7 +474,7 @@ class MimeDir extends Parser {
                     $property['value'] = mb_convert_encoding($property['value'], 'UTF-8', $charset);
                     break;
                 default :
-                    throw new ParseException('Unsupported CHARSET: ' . $charset);
+                    throw new ParseException('Unsupported CHARSET: ' . $propObj['CHARSET']);
             }
             $propObj->setRawMimeDirValue($property['value']);
         }
diff --git a/tests/VObject/Component/VCalendarTest.php b/tests/VObject/Component/VCalendarTest.php
index bd89059..1f3455d 100644
--- a/tests/VObject/Component/VCalendarTest.php
+++ b/tests/VObject/Component/VCalendarTest.php
@@ -100,8 +100,6 @@ END:VEVENT
 END:VCALENDAR
 ';
 
-        $tests[] = [$input, $output];
-
         // Removing timezone info from sub-components. See Issue #278
         $input = 'BEGIN:VCALENDAR
 CALSCALE:GREGORIAN
diff --git a/tests/VObject/ITip/BrokerDeleteEventTest.php b/tests/VObject/ITip/BrokerDeleteEventTest.php
index 935c451..0b1d8ce 100644
--- a/tests/VObject/ITip/BrokerDeleteEventTest.php
+++ b/tests/VObject/ITip/BrokerDeleteEventTest.php
@@ -86,7 +86,7 @@ ICS
             ],
         ];
 
-        $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk at example.org');
+        $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk at example.org');
 
     }
 
@@ -172,7 +172,7 @@ ICS
             ],
         ];
 
-        $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk at example.org');
+        $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk at example.org');
 
     }
 
@@ -229,12 +229,12 @@ ICS
             ],
         ];
 
-        $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
+        $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
 
 
     }
 
-    function testAttendeeReplyWithDuration() {
+    function testAttendeeDeleteWithDuration() {
 
         $oldMessage = <<<ICS
 BEGIN:VCALENDAR
@@ -287,7 +287,7 @@ ICS
             ],
         ];
 
-        $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
+        $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
 
 
     }
@@ -313,9 +313,11 @@ ICS;
 
         $newMessage = null;
 
+        $version = \Sabre\VObject\Version::VERSION;
+
         $expected = [];
 
-        $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
+        $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
 
 
     }
diff --git a/tests/VObject/Parser/MimeDirTest.php b/tests/VObject/Parser/MimeDirTest.php
index 63219da..fcc4a46 100644
--- a/tests/VObject/Parser/MimeDirTest.php
+++ b/tests/VObject/Parser/MimeDirTest.php
@@ -27,8 +27,8 @@ FN:umlaut u - \xFC
 END:VCARD\n
 VCF;
 
-        $mimeDir = new MimeDir();
-        $mimeDir->setCharset('ISO-8859-1');
+        $mimeDir = new Mimedir();
+        $mimeDir->setCharSet('ISO-8859-1');
         $vcard = $mimeDir->parse($vcard);
         $this->assertEquals("umlaut u - \xC3\xBC", $vcard->FN->getValue());
 
@@ -43,7 +43,7 @@ FN;CHARSET=ISO-8859-1:umlaut u - \xFC
 END:VCARD\n
 VCF;
 
-        $mimeDir = new MimeDir();
+        $mimeDir = new Mimedir();
         $vcard = $mimeDir->parse($vcard);
         $this->assertEquals("umlaut u - \xC3\xBC", $vcard->FN->getValue());
 
@@ -58,7 +58,7 @@ FN;CHARSET=unknown:foo-bar - \xFC
 END:VCARD\n
 VCF;
 
-        $mimeDir = new MimeDir();
+        $mimeDir = new Mimedir();
         $vcard = $mimeDir->parse($vcard);
         $this->assertEquals("foo-bar - \xFC", $vcard->FN->getValue());
 
@@ -73,7 +73,7 @@ FN:umlaut u - \xFC
 END:VCARD\n
 VCF;
 
-        $mimeDir = new MimeDir();
+        $mimeDir = new Mimedir();
         $vcard = $mimeDir->parse($vcard);
         // This basically tests that we don't touch the input string if
         // the encoding was set to UTF-8. The result is actually invalid
@@ -88,8 +88,8 @@ VCF;
      */
     function testDecodeUnsupportedCharset() {
 
-        $mimeDir = new MimeDir();
-        $mimeDir->setCharset('foobar');
+        $mimeDir = new Mimedir();
+        $mimeDir->setCharSet('foobar');
 
     }
 
@@ -105,7 +105,7 @@ FN;CHARSET=foobar:nothing
 END:VCARD\n
 VCF;
 
-        $mimeDir = new MimeDir();
+        $mimeDir = new Mimedir();
         $mimeDir->parse($vcard);
 
     }
@@ -119,8 +119,8 @@ FN:Euro \x80
 END:VCARD\n
 VCF;
 
-        $mimeDir = new MimeDir();
-        $mimeDir->setCharset('Windows-1252');
+        $mimeDir = new Mimedir();
+        $mimeDir->setCharSet('Windows-1252');
         $vcard = $mimeDir->parse($vcard);
         $this->assertEquals("Euro \xE2\x82\xAC", $vcard->FN->getValue());
 
@@ -135,7 +135,7 @@ FN;CHARSET=Windows-1252:Euro \x80
 END:VCARD\n
 VCF;
 
-        $mimeDir = new MimeDir();
+        $mimeDir = new Mimedir();
         $vcard = $mimeDir->parse($vcard);
         $this->assertEquals("Euro \xE2\x82\xAC", $vcard->FN->getValue());
 
diff --git a/tests/VObject/Recur/EventIterator/HandleRDateExpandTest.php b/tests/VObject/Recur/EventIterator/HandleRDateExpandTest.php
index f85e2a7..69fc7d0 100644
--- a/tests/VObject/Recur/EventIterator/HandleRDateExpandTest.php
+++ b/tests/VObject/Recur/EventIterator/HandleRDateExpandTest.php
@@ -39,7 +39,7 @@ ICS;
 
         $vcal = $vcal->expand(new DateTime('2015-01-01'), new DateTime('2015-12-01'));
 
-        $result = iterator_to_array($vcal->EVENT);
+        $result = iterator_to_array($vcal->vevent);
 
         $this->assertEquals(5, count($result));
 
@@ -52,7 +52,7 @@ ICS;
             new DateTimeImmutable("2015-10-20", $utc),
         ];
 
-        $result = array_map(function($ev) {return $ev->DTSTART->getDateTime();}, $result);
+        $result = array_map(function($ev) {return $ev->dtstart->getDateTime();}, $result);
         $this->assertEquals($expected, $result);
     
     }
diff --git a/tests/VObject/Recur/EventIterator/MaxInstancesTest.php b/tests/VObject/Recur/EventIterator/MaxInstancesTest.php
index 5a09b53..21a3f40 100644
--- a/tests/VObject/Recur/EventIterator/MaxInstancesTest.php
+++ b/tests/VObject/Recur/EventIterator/MaxInstancesTest.php
@@ -12,7 +12,7 @@ class MaxInstancesTest extends TestCase {
     /**
      * @expectedException \Sabre\VObject\Recur\MaxInstancesExceededException
      */
-    function testExceedMaxRecurrences() {
+    function testOverrideFirstEvent() {
 
         $input =  <<<ICS
 BEGIN:VCALENDAR
diff --git a/tests/VObject/Recur/RDateIteratorTest.php b/tests/VObject/Recur/RDateIteratorTest.php
index e2852dc..7abf0e0 100644
--- a/tests/VObject/Recur/RDateIteratorTest.php
+++ b/tests/VObject/Recur/RDateIteratorTest.php
@@ -38,6 +38,8 @@ class RDateIteratorTest extends \PHPUnit_Framework_TestCase {
             new DateTimeImmutable('2014-10-01 00:00:00', $tz),
         ];
 
+        $result = iterator_to_array($it);
+
         $this->assertEquals(
             $expected,
             iterator_to_array($it)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-php/php-sabre-vobject.git



More information about the Pkg-owncloud-commits mailing list