[Pkg-owncloud-commits] [php-sabre-vobject] 03/19: Fix tabs and add unittest for -5TH fix
David Prévot
taffit at moszumanska.debian.org
Tue May 19 20:10:12 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 38e6643657fffae52cc1f9454c704e4ad94b6fa2
Author: Tomas Lindquist Olsen <tomas.l.olsen at gmail.com>
Date: Wed Mar 11 11:01:44 2015 +0100
Fix tabs and add unittest for -5TH fix
---
lib/Recur/RRuleIterator.php | 8 ++++----
tests/VObject/Recur/RRuleIteratorTest.php | 15 +++++++++++++++
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/lib/Recur/RRuleIterator.php b/lib/Recur/RRuleIterator.php
index 23533dd..0cd1c03 100644
--- a/lib/Recur/RRuleIterator.php
+++ b/lib/Recur/RRuleIterator.php
@@ -787,10 +787,10 @@ class RRuleIterator implements Iterator {
} else {
// if it was negative we count from the end of the array
- // might not exist, fx. -5th tuesday
- if (isset($dayHits[count($dayHits) + $offset])) {
- $byDayResults[] = $dayHits[count($dayHits) + $offset];
- }
+ // might not exist, fx. -5th tuesday
+ if (isset($dayHits[count($dayHits) + $offset])) {
+ $byDayResults[] = $dayHits[count($dayHits) + $offset];
+ }
}
} else {
// There was no counter (first, second, last wednesdays), so we
diff --git a/tests/VObject/Recur/RRuleIteratorTest.php b/tests/VObject/Recur/RRuleIteratorTest.php
index 8299002..9122934 100644
--- a/tests/VObject/Recur/RRuleIteratorTest.php
+++ b/tests/VObject/Recur/RRuleIteratorTest.php
@@ -627,6 +627,21 @@ class RRuleIteratorTest extends \PHPUnit_Framework_TestCase {
}
+ function testMinusFifthThursday() {
+
+ $this->parse(
+ 'FREQ=MONTHLY;BYDAY=-4TH,-5TH;COUNT=4',
+ '2015-01-01 00:15:00',
+ array(
+ '2015-01-01 00:15:00',
+ '2015-01-08 00:15:00',
+ '2015-02-05 00:15:00',
+ '2015-03-05 00:15:00'
+ )
+ );
+
+ }
+
/**
* @expectedException InvalidArgumentException
*/
--
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