[Pkg-owncloud-commits] [php-sabre-vobject] 05/30: Fix some coding issues in tests
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 64a2174d8b695f74a8a29343a59d4ae4686c421b
Author: Jakob Sack <mail at jakobsack.de>
Date: Mon Feb 8 21:06:44 2016 +0100
Fix some coding issues in tests
---
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 --
6 files changed, 22 insertions(+), 24 deletions(-)
diff --git a/tests/VObject/Component/VCalendarTest.php b/tests/VObject/Component/VCalendarTest.php
index 1f3455d..bd89059 100644
--- a/tests/VObject/Component/VCalendarTest.php
+++ b/tests/VObject/Component/VCalendarTest.php
@@ -100,6 +100,8 @@ 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 0b1d8ce..935c451 100644
--- a/tests/VObject/ITip/BrokerDeleteEventTest.php
+++ b/tests/VObject/ITip/BrokerDeleteEventTest.php
@@ -86,7 +86,7 @@ ICS
],
];
- $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk at example.org');
+ $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk at example.org');
}
@@ -172,7 +172,7 @@ ICS
],
];
- $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk at example.org');
+ $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk at example.org');
}
@@ -229,12 +229,12 @@ ICS
],
];
- $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
+ $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
}
- function testAttendeeDeleteWithDuration() {
+ function testAttendeeReplyWithDuration() {
$oldMessage = <<<ICS
BEGIN:VCALENDAR
@@ -287,7 +287,7 @@ ICS
],
];
- $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
+ $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
}
@@ -313,11 +313,9 @@ ICS;
$newMessage = null;
- $version = \Sabre\VObject\Version::VERSION;
-
$expected = [];
- $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:one at example.org');
+ $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 fcc4a46..63219da 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 69fc7d0..f85e2a7 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->vevent);
+ $result = iterator_to_array($vcal->EVENT);
$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 21a3f40..5a09b53 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 testOverrideFirstEvent() {
+ function testExceedMaxRecurrences() {
$input = <<<ICS
BEGIN:VCALENDAR
diff --git a/tests/VObject/Recur/RDateIteratorTest.php b/tests/VObject/Recur/RDateIteratorTest.php
index 7abf0e0..e2852dc 100644
--- a/tests/VObject/Recur/RDateIteratorTest.php
+++ b/tests/VObject/Recur/RDateIteratorTest.php
@@ -38,8 +38,6 @@ 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