[Pkg-owncloud-commits] [php-sabre-vobject] 64/106: Moving recurrence-related code to Recur/ directory.
David Prévot
taffit at moszumanska.debian.org
Fri Aug 22 15:11:04 UTC 2014
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 b61c3661bbb47cab7154ba14291b13c29aa3a3ad
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Wed Aug 6 18:42:32 2014 -0400
Moving recurrence-related code to Recur/ directory.
Moved unittests to unit/ directory.
---
lib/Sabre/VObject/Component/VCalendar.php | 5 +-
lib/Sabre/VObject/Component/VEvent.php | 4 +-
lib/Sabre/VObject/FreeBusyGenerator.php | 6 +-
lib/Sabre/VObject/ITip/Broker.php | 4 +-
.../EventIterator.php} | 25 ++++----
.../{RRuleParser.php => Recur/RRuleIterator.php} | 6 +-
tests/phpunit.xml | 4 +-
tests/{Sabre/VObject => unit}/AttachIssueTest.php | 0
tests/{Sabre/VObject => unit}/CliTest.php | 0
.../VObject => unit}/Component/VAlarmTest.php | 0
.../VObject => unit}/Component/VCalendarTest.php | 0
.../VObject => unit}/Component/VCardTest.php | 0
.../VObject => unit}/Component/VEventTest.php | 0
.../VObject => unit}/Component/VFreeBusyTest.php | 0
.../VObject => unit}/Component/VJournalTest.php | 0
.../VObject => unit}/Component/VTimeZoneTest.php | 0
.../VObject => unit}/Component/VTodoTest.php | 0
tests/{Sabre/VObject => unit}/ComponentTest.php | 0
.../{Sabre/VObject => unit}/DateTimeParserTest.php | 0
tests/{Sabre/VObject => unit}/DocumentTest.php | 0
tests/{Sabre/VObject => unit}/ElementListTest.php | 0
tests/{Sabre/VObject => unit}/EmClientTest.php | 0
.../VObject => unit}/EmptyValueIssueTest.php | 0
.../VObject => unit}/FreeBusyGeneratorTest.php | 0
.../VObject => unit}/GoogleColonEscapingTest.php | 0
.../ITip/BrokerAttendeeReplyTest.php | 0
.../ITip/BrokerDeleteEventTest.php | 0
.../VObject => unit}/ITip/BrokerNewEventTest.php | 0
.../ITip/BrokerProcessMessageTest.php | 0
.../ITip/BrokerUpdateEventTest.php | 0
tests/{Sabre/VObject => unit}/Issue153Test.php | 0
tests/{Sabre/VObject => unit}/Issue154Test.php | 0
tests/{Sabre/VObject => unit}/Issue26Test.php | 2 +-
.../VObject => unit}/Issue36WorkAroundTest.php | 4 +-
tests/{Sabre/VObject => unit}/Issue40Test.php | 0
tests/{Sabre/VObject => unit}/Issue64Test.php | 0
tests/{Sabre/VObject => unit}/Issue96Test.php | 0
tests/{Sabre/VObject => unit}/JCalTest.php | 0
tests/{Sabre/VObject => unit}/JCardTest.php | 0
.../VObject => unit}/LineFoldingIssueTest.php | 0
tests/{Sabre/VObject => unit}/ParameterTest.php | 0
tests/{Sabre/VObject => unit}/Parser/JsonTest.php | 0
.../Parser/QuotedPrintableTest.php | 0
.../VObject => unit}/Property/BinaryTest.php | 0
.../VObject => unit}/Property/BooleanTest.php | 0
.../VObject => unit}/Property/CompoundTest.php | 0
.../{Sabre/VObject => unit}/Property/FloatTest.php | 0
.../Property/ICalendar/DateTimeTest.php | 0
.../Property/ICalendar/DurationTest.php | 0
.../Property/ICalendar/RecurTest.php | 0
.../{Sabre/VObject => unit}/Property/TextTest.php | 0
.../Property/VCard/DateAndOrTimeTest.php | 0
.../Property/VCard/LanguageTagTest.php | 0
tests/{Sabre/VObject => unit}/PropertyTest.php | 0
tests/{Sabre/VObject => unit}/ReaderTest.php | 0
.../Recur/EventIterator}/ByMonthInDailyTest.php | 0
.../EventIterator}/FifthTuesdayProblemTest.php | 9 ++-
.../Recur/EventIterator}/IncorrectExpandTest.php | 0
.../EventIterator}/InfiniteLoopProblemTest.php | 11 ++--
.../Recur/EventIterator}/Issue48Test.php | 2 +-
.../Recur/EventIterator}/Issue50Test.php | 2 +-
.../Recur/EventIterator}/MainTest.php | 69 +++++++++++-----------
.../Recur/EventIterator}/MissingOverriddenTest.php | 0
.../EventIterator}/OverrideFirstEventTest.php | 0
.../Recur/RRuleIterator.php} | 4 +-
.../UntilRespectsTimezoneTest.ics | 0
tests/{Sabre/VObject => unit}/SlashRTest.php | 0
.../VObject => unit}/Splitter/ICalendarTest.php | 0
.../{Sabre/VObject => unit}/Splitter/VCardTest.php | 0
tests/{Sabre/VObject => unit}/StringUtilTest.php | 0
tests/{Sabre/VObject => unit}/TimeZoneUtilTest.php | 0
tests/{Sabre/VObject => unit}/UUIDUtilTest.php | 0
tests/{Sabre/VObject => unit}/VCard21Test.php | 0
.../{Sabre/VObject => unit}/VCardConverterTest.php | 0
tests/{Sabre/VObject => unit}/VersionTest.php | 0
tests/{Sabre/VObject => unit}/issue153.vcf | 0
tests/{Sabre/VObject => unit}/issue64.vcf | 0
77 files changed, 83 insertions(+), 74 deletions(-)
diff --git a/lib/Sabre/VObject/Component/VCalendar.php b/lib/Sabre/VObject/Component/VCalendar.php
index 86802a2..8e609f2 100644
--- a/lib/Sabre/VObject/Component/VCalendar.php
+++ b/lib/Sabre/VObject/Component/VCalendar.php
@@ -4,7 +4,8 @@ namespace Sabre\VObject\Component;
use
Sabre\VObject,
- Sabre\VObject\Component;
+ Sabre\VObject\Component,
+ Sabre\VObject\Recur\EventIterator;
/**
* The VCalendar component
@@ -265,7 +266,7 @@ class VCalendar extends VObject\Document {
throw new \LogicException('Event did not have a UID!');
}
- $it = new VObject\RecurrenceIterator($this, $vevent->uid);
+ $it = new EventIterator($this, $vevent->uid);
$it->fastForward($start);
while($it->valid() && $it->getDTStart() < $end) {
diff --git a/lib/Sabre/VObject/Component/VEvent.php b/lib/Sabre/VObject/Component/VEvent.php
index 250e943..9931922 100644
--- a/lib/Sabre/VObject/Component/VEvent.php
+++ b/lib/Sabre/VObject/Component/VEvent.php
@@ -1,7 +1,9 @@
<?php
namespace Sabre\VObject\Component;
+
use Sabre\VObject;
+use Sabre\VObject\Recur\EventIterator;
/**
* VEvent component
@@ -28,7 +30,7 @@ class VEvent extends VObject\Component {
public function isInTimeRange(\DateTime $start, \DateTime $end) {
if ($this->RRULE) {
- $it = new VObject\RecurrenceIterator($this);
+ $it = new EventIterator($this);
$it->fastForward($start);
// We fast-forwarded to a spot where the end-time of the
diff --git a/lib/Sabre/VObject/FreeBusyGenerator.php b/lib/Sabre/VObject/FreeBusyGenerator.php
index c1fc21e..f71d2db 100644
--- a/lib/Sabre/VObject/FreeBusyGenerator.php
+++ b/lib/Sabre/VObject/FreeBusyGenerator.php
@@ -2,8 +2,8 @@
namespace Sabre\VObject;
-use
- Sabre\VObject\Component\VCalendar;
+use Sabre\VObject\Component\VCalendar;
+use Sabre\VObject\Recur\EventIterator;
/**
* This class helps with generating FREEBUSY reports based on existing sets of
@@ -172,7 +172,7 @@ class FreeBusyGenerator {
if ($component->RRULE) {
- $iterator = new RecurrenceIterator($object, (string)$component->uid);
+ $iterator = new EventIterator($object, (string)$component->uid);
if ($this->start) {
$iterator->fastForward($this->start);
}
diff --git a/lib/Sabre/VObject/ITip/Broker.php b/lib/Sabre/VObject/ITip/Broker.php
index 10b013b..eef1094 100644
--- a/lib/Sabre/VObject/ITip/Broker.php
+++ b/lib/Sabre/VObject/ITip/Broker.php
@@ -4,7 +4,7 @@ namespace Sabre\VObject\ITip;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Reader;
-use Sabre\VObject\RecurrenceIterator;
+use Sabre\VObject\Recur\EventIterator;
/**
* The ITip\Broker class is a utility class that helps with processing
@@ -344,7 +344,7 @@ class Broker {
// original list, it means that new exceptions must be created.
foreach($instances as $recurId=>$partstat) {
- $recurrenceIterator = new RecurrenceIterator($existingObject, $itipMessage->uid);
+ $recurrenceIterator = new EventIterator($existingObject, $itipMessage->uid);
$found = false;
$iterations = 1000;
do {
diff --git a/lib/Sabre/VObject/RecurrenceIterator.php b/lib/Sabre/VObject/Recur/EventIterator.php
similarity index 95%
rename from lib/Sabre/VObject/RecurrenceIterator.php
rename to lib/Sabre/VObject/Recur/EventIterator.php
index dc1f470..7221cdd 100644
--- a/lib/Sabre/VObject/RecurrenceIterator.php
+++ b/lib/Sabre/VObject/Recur/EventIterator.php
@@ -1,10 +1,11 @@
<?php
-namespace Sabre\VObject;
+namespace Sabre\VObject\Recur;
use InvalidArgumentException;
use DateTime;
-use Sabre\VObject\Component\VEVENT;
+use Sabre\VObject\Component;
+use Sabre\VObject\Component\VEvent;
/**
* This class is used to determine new for a recurring event, when the next
@@ -52,7 +53,7 @@ use Sabre\VObject\Component\VEVENT;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class RecurrenceIterator implements \Iterator {
+class EventIterator implements \Iterator {
/**
* Creates the iterator
@@ -154,7 +155,7 @@ class RecurrenceIterator implements \Iterator {
$this->eventDuration = 0;
}
- $this->rruleParser = new RRuleParser($rrule, $this->startDate);
+ $this->rruleIterator = new RRuleIterator($rrule, $this->startDate);
$this->rewind();
}
@@ -229,7 +230,7 @@ class RecurrenceIterator implements \Iterator {
if (isset($event->DTEND)) {
$event->DTEND->setDateTime($this->getDtEnd());
}
- if ($this->rruleParser->key() > 0) {
+ if ($this->rruleIterator->key() > 0) {
$event->{'RECURRENCE-ID'} = (string)$event->DTSTART;
}
return $event;
@@ -267,7 +268,7 @@ class RecurrenceIterator implements \Iterator {
*/
public function rewind() {
- $this->rruleParser->rewind();
+ $this->rruleIterator->rewind();
// re-creating overridden event index.
$index = array();
foreach($this->overriddenEvents as $key=>$event) {
@@ -304,15 +305,15 @@ class RecurrenceIterator implements \Iterator {
// We need to do this until we find a date that's not in the
// exception list.
do {
- if (!$this->rruleParser->valid()) {
+ if (!$this->rruleIterator->valid()) {
$nextDate = null;
break;
}
- $nextDate = $this->rruleParser->current();
+ $nextDate = $this->rruleIterator->current();
if (!$nextDate) {
break;
}
- $this->rruleParser->next();
+ $this->rruleIterator->next();
} while(isset($this->exceptions[$nextDate->getTimeStamp()]));
}
@@ -366,16 +367,16 @@ class RecurrenceIterator implements \Iterator {
*/
public function isInfinite() {
- return $this->rruleParser->isInfinite();
+ return $this->rruleIterator->isInfinite();
}
/**
* RRULE parser
*
- * @var RRuleParser
+ * @var RRuleIterator
*/
- protected $rruleParser;
+ protected $rruleIterator;
/**
* The duration, in seconds, of the master event.
diff --git a/lib/Sabre/VObject/RRuleParser.php b/lib/Sabre/VObject/Recur/RRuleIterator.php
similarity index 99%
rename from lib/Sabre/VObject/RRuleParser.php
rename to lib/Sabre/VObject/Recur/RRuleIterator.php
index 1ec7c83..9df4b48 100644
--- a/lib/Sabre/VObject/RRuleParser.php
+++ b/lib/Sabre/VObject/Recur/RRuleIterator.php
@@ -1,10 +1,12 @@
<?php
-namespace Sabre\VObject;
+namespace Sabre\VObject\Recur;
use DateTime;
use InvalidArgumentException;
use Iterator;
+use Sabre\VObject\DateTimeParser;
+
/**
* RRuleParser
@@ -19,7 +21,7 @@ use Iterator;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class RRuleParser implements Iterator {
+class RRuleIterator implements Iterator {
/**
* Creates the Iterator
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
index faf1325..6c1febd 100644
--- a/tests/phpunit.xml
+++ b/tests/phpunit.xml
@@ -6,8 +6,8 @@
convertWarningsToExceptions="true"
strict="true"
>
- <testsuite name="Sabre_VObject">
- <directory>Sabre/</directory>
+ <testsuite name="Sabre\VObject">
+ <directory>unit/</directory>
</testsuite>
<filter>
diff --git a/tests/Sabre/VObject/AttachIssueTest.php b/tests/unit/AttachIssueTest.php
similarity index 100%
rename from tests/Sabre/VObject/AttachIssueTest.php
rename to tests/unit/AttachIssueTest.php
diff --git a/tests/Sabre/VObject/CliTest.php b/tests/unit/CliTest.php
similarity index 100%
rename from tests/Sabre/VObject/CliTest.php
rename to tests/unit/CliTest.php
diff --git a/tests/Sabre/VObject/Component/VAlarmTest.php b/tests/unit/Component/VAlarmTest.php
similarity index 100%
rename from tests/Sabre/VObject/Component/VAlarmTest.php
rename to tests/unit/Component/VAlarmTest.php
diff --git a/tests/Sabre/VObject/Component/VCalendarTest.php b/tests/unit/Component/VCalendarTest.php
similarity index 100%
rename from tests/Sabre/VObject/Component/VCalendarTest.php
rename to tests/unit/Component/VCalendarTest.php
diff --git a/tests/Sabre/VObject/Component/VCardTest.php b/tests/unit/Component/VCardTest.php
similarity index 100%
rename from tests/Sabre/VObject/Component/VCardTest.php
rename to tests/unit/Component/VCardTest.php
diff --git a/tests/Sabre/VObject/Component/VEventTest.php b/tests/unit/Component/VEventTest.php
similarity index 100%
rename from tests/Sabre/VObject/Component/VEventTest.php
rename to tests/unit/Component/VEventTest.php
diff --git a/tests/Sabre/VObject/Component/VFreeBusyTest.php b/tests/unit/Component/VFreeBusyTest.php
similarity index 100%
rename from tests/Sabre/VObject/Component/VFreeBusyTest.php
rename to tests/unit/Component/VFreeBusyTest.php
diff --git a/tests/Sabre/VObject/Component/VJournalTest.php b/tests/unit/Component/VJournalTest.php
similarity index 100%
rename from tests/Sabre/VObject/Component/VJournalTest.php
rename to tests/unit/Component/VJournalTest.php
diff --git a/tests/Sabre/VObject/Component/VTimeZoneTest.php b/tests/unit/Component/VTimeZoneTest.php
similarity index 100%
rename from tests/Sabre/VObject/Component/VTimeZoneTest.php
rename to tests/unit/Component/VTimeZoneTest.php
diff --git a/tests/Sabre/VObject/Component/VTodoTest.php b/tests/unit/Component/VTodoTest.php
similarity index 100%
rename from tests/Sabre/VObject/Component/VTodoTest.php
rename to tests/unit/Component/VTodoTest.php
diff --git a/tests/Sabre/VObject/ComponentTest.php b/tests/unit/ComponentTest.php
similarity index 100%
rename from tests/Sabre/VObject/ComponentTest.php
rename to tests/unit/ComponentTest.php
diff --git a/tests/Sabre/VObject/DateTimeParserTest.php b/tests/unit/DateTimeParserTest.php
similarity index 100%
rename from tests/Sabre/VObject/DateTimeParserTest.php
rename to tests/unit/DateTimeParserTest.php
diff --git a/tests/Sabre/VObject/DocumentTest.php b/tests/unit/DocumentTest.php
similarity index 100%
rename from tests/Sabre/VObject/DocumentTest.php
rename to tests/unit/DocumentTest.php
diff --git a/tests/Sabre/VObject/ElementListTest.php b/tests/unit/ElementListTest.php
similarity index 100%
rename from tests/Sabre/VObject/ElementListTest.php
rename to tests/unit/ElementListTest.php
diff --git a/tests/Sabre/VObject/EmClientTest.php b/tests/unit/EmClientTest.php
similarity index 100%
rename from tests/Sabre/VObject/EmClientTest.php
rename to tests/unit/EmClientTest.php
diff --git a/tests/Sabre/VObject/EmptyValueIssueTest.php b/tests/unit/EmptyValueIssueTest.php
similarity index 100%
rename from tests/Sabre/VObject/EmptyValueIssueTest.php
rename to tests/unit/EmptyValueIssueTest.php
diff --git a/tests/Sabre/VObject/FreeBusyGeneratorTest.php b/tests/unit/FreeBusyGeneratorTest.php
similarity index 100%
rename from tests/Sabre/VObject/FreeBusyGeneratorTest.php
rename to tests/unit/FreeBusyGeneratorTest.php
diff --git a/tests/Sabre/VObject/GoogleColonEscapingTest.php b/tests/unit/GoogleColonEscapingTest.php
similarity index 100%
rename from tests/Sabre/VObject/GoogleColonEscapingTest.php
rename to tests/unit/GoogleColonEscapingTest.php
diff --git a/tests/Sabre/VObject/ITip/BrokerAttendeeReplyTest.php b/tests/unit/ITip/BrokerAttendeeReplyTest.php
similarity index 100%
rename from tests/Sabre/VObject/ITip/BrokerAttendeeReplyTest.php
rename to tests/unit/ITip/BrokerAttendeeReplyTest.php
diff --git a/tests/Sabre/VObject/ITip/BrokerDeleteEventTest.php b/tests/unit/ITip/BrokerDeleteEventTest.php
similarity index 100%
rename from tests/Sabre/VObject/ITip/BrokerDeleteEventTest.php
rename to tests/unit/ITip/BrokerDeleteEventTest.php
diff --git a/tests/Sabre/VObject/ITip/BrokerNewEventTest.php b/tests/unit/ITip/BrokerNewEventTest.php
similarity index 100%
rename from tests/Sabre/VObject/ITip/BrokerNewEventTest.php
rename to tests/unit/ITip/BrokerNewEventTest.php
diff --git a/tests/Sabre/VObject/ITip/BrokerProcessMessageTest.php b/tests/unit/ITip/BrokerProcessMessageTest.php
similarity index 100%
rename from tests/Sabre/VObject/ITip/BrokerProcessMessageTest.php
rename to tests/unit/ITip/BrokerProcessMessageTest.php
diff --git a/tests/Sabre/VObject/ITip/BrokerUpdateEventTest.php b/tests/unit/ITip/BrokerUpdateEventTest.php
similarity index 100%
rename from tests/Sabre/VObject/ITip/BrokerUpdateEventTest.php
rename to tests/unit/ITip/BrokerUpdateEventTest.php
diff --git a/tests/Sabre/VObject/Issue153Test.php b/tests/unit/Issue153Test.php
similarity index 100%
rename from tests/Sabre/VObject/Issue153Test.php
rename to tests/unit/Issue153Test.php
diff --git a/tests/Sabre/VObject/Issue154Test.php b/tests/unit/Issue154Test.php
similarity index 100%
rename from tests/Sabre/VObject/Issue154Test.php
rename to tests/unit/Issue154Test.php
diff --git a/tests/Sabre/VObject/Issue26Test.php b/tests/unit/Issue26Test.php
similarity index 90%
rename from tests/Sabre/VObject/Issue26Test.php
rename to tests/unit/Issue26Test.php
index 3fe4a13..f080f39 100644
--- a/tests/Sabre/VObject/Issue26Test.php
+++ b/tests/unit/Issue26Test.php
@@ -28,7 +28,7 @@ ICS;
$vcal = Reader::read($input);
$this->assertInstanceOf('Sabre\\VObject\\Component\\VCalendar', $vcal);
- $it = new RecurrenceIterator($vcal, 'bae5d57a98');
+ $it = new Recur\EventIterator($vcal, 'bae5d57a98');
iterator_to_array($it);
}
diff --git a/tests/Sabre/VObject/Issue36WorkAroundTest.php b/tests/unit/Issue36WorkAroundTest.php
similarity index 81%
rename from tests/Sabre/VObject/Issue36WorkAroundTest.php
rename to tests/unit/Issue36WorkAroundTest.php
index 00e67ba..cc98716 100644
--- a/tests/Sabre/VObject/Issue36WorkAroundTest.php
+++ b/tests/unit/Issue36WorkAroundTest.php
@@ -31,8 +31,8 @@ ICS;
$obj = Reader::read($event);
// If this does not throw an exception, it's all good.
- $it = new RecurrenceIterator($obj,'1833bd44-188b-405c-9f85-1a12105318aa');
- $this->assertInstanceOf('Sabre\\VObject\\RecurrenceIterator', $it);
+ $it = new Recur\EventIterator($obj,'1833bd44-188b-405c-9f85-1a12105318aa');
+ $this->assertInstanceOf('Sabre\\VObject\\Recur\EventIterator', $it);
}
diff --git a/tests/Sabre/VObject/Issue40Test.php b/tests/unit/Issue40Test.php
similarity index 100%
rename from tests/Sabre/VObject/Issue40Test.php
rename to tests/unit/Issue40Test.php
diff --git a/tests/Sabre/VObject/Issue64Test.php b/tests/unit/Issue64Test.php
similarity index 100%
rename from tests/Sabre/VObject/Issue64Test.php
rename to tests/unit/Issue64Test.php
diff --git a/tests/Sabre/VObject/Issue96Test.php b/tests/unit/Issue96Test.php
similarity index 100%
rename from tests/Sabre/VObject/Issue96Test.php
rename to tests/unit/Issue96Test.php
diff --git a/tests/Sabre/VObject/JCalTest.php b/tests/unit/JCalTest.php
similarity index 100%
rename from tests/Sabre/VObject/JCalTest.php
rename to tests/unit/JCalTest.php
diff --git a/tests/Sabre/VObject/JCardTest.php b/tests/unit/JCardTest.php
similarity index 100%
rename from tests/Sabre/VObject/JCardTest.php
rename to tests/unit/JCardTest.php
diff --git a/tests/Sabre/VObject/LineFoldingIssueTest.php b/tests/unit/LineFoldingIssueTest.php
similarity index 100%
rename from tests/Sabre/VObject/LineFoldingIssueTest.php
rename to tests/unit/LineFoldingIssueTest.php
diff --git a/tests/Sabre/VObject/ParameterTest.php b/tests/unit/ParameterTest.php
similarity index 100%
rename from tests/Sabre/VObject/ParameterTest.php
rename to tests/unit/ParameterTest.php
diff --git a/tests/Sabre/VObject/Parser/JsonTest.php b/tests/unit/Parser/JsonTest.php
similarity index 100%
rename from tests/Sabre/VObject/Parser/JsonTest.php
rename to tests/unit/Parser/JsonTest.php
diff --git a/tests/Sabre/VObject/Parser/QuotedPrintableTest.php b/tests/unit/Parser/QuotedPrintableTest.php
similarity index 100%
rename from tests/Sabre/VObject/Parser/QuotedPrintableTest.php
rename to tests/unit/Parser/QuotedPrintableTest.php
diff --git a/tests/Sabre/VObject/Property/BinaryTest.php b/tests/unit/Property/BinaryTest.php
similarity index 100%
rename from tests/Sabre/VObject/Property/BinaryTest.php
rename to tests/unit/Property/BinaryTest.php
diff --git a/tests/Sabre/VObject/Property/BooleanTest.php b/tests/unit/Property/BooleanTest.php
similarity index 100%
rename from tests/Sabre/VObject/Property/BooleanTest.php
rename to tests/unit/Property/BooleanTest.php
diff --git a/tests/Sabre/VObject/Property/CompoundTest.php b/tests/unit/Property/CompoundTest.php
similarity index 100%
rename from tests/Sabre/VObject/Property/CompoundTest.php
rename to tests/unit/Property/CompoundTest.php
diff --git a/tests/Sabre/VObject/Property/FloatTest.php b/tests/unit/Property/FloatTest.php
similarity index 100%
rename from tests/Sabre/VObject/Property/FloatTest.php
rename to tests/unit/Property/FloatTest.php
diff --git a/tests/Sabre/VObject/Property/ICalendar/DateTimeTest.php b/tests/unit/Property/ICalendar/DateTimeTest.php
similarity index 100%
rename from tests/Sabre/VObject/Property/ICalendar/DateTimeTest.php
rename to tests/unit/Property/ICalendar/DateTimeTest.php
diff --git a/tests/Sabre/VObject/Property/ICalendar/DurationTest.php b/tests/unit/Property/ICalendar/DurationTest.php
similarity index 100%
rename from tests/Sabre/VObject/Property/ICalendar/DurationTest.php
rename to tests/unit/Property/ICalendar/DurationTest.php
diff --git a/tests/Sabre/VObject/Property/ICalendar/RecurTest.php b/tests/unit/Property/ICalendar/RecurTest.php
similarity index 100%
rename from tests/Sabre/VObject/Property/ICalendar/RecurTest.php
rename to tests/unit/Property/ICalendar/RecurTest.php
diff --git a/tests/Sabre/VObject/Property/TextTest.php b/tests/unit/Property/TextTest.php
similarity index 100%
rename from tests/Sabre/VObject/Property/TextTest.php
rename to tests/unit/Property/TextTest.php
diff --git a/tests/Sabre/VObject/Property/VCard/DateAndOrTimeTest.php b/tests/unit/Property/VCard/DateAndOrTimeTest.php
similarity index 100%
rename from tests/Sabre/VObject/Property/VCard/DateAndOrTimeTest.php
rename to tests/unit/Property/VCard/DateAndOrTimeTest.php
diff --git a/tests/Sabre/VObject/Property/VCard/LanguageTagTest.php b/tests/unit/Property/VCard/LanguageTagTest.php
similarity index 100%
rename from tests/Sabre/VObject/Property/VCard/LanguageTagTest.php
rename to tests/unit/Property/VCard/LanguageTagTest.php
diff --git a/tests/Sabre/VObject/PropertyTest.php b/tests/unit/PropertyTest.php
similarity index 100%
rename from tests/Sabre/VObject/PropertyTest.php
rename to tests/unit/PropertyTest.php
diff --git a/tests/Sabre/VObject/ReaderTest.php b/tests/unit/ReaderTest.php
similarity index 100%
rename from tests/Sabre/VObject/ReaderTest.php
rename to tests/unit/ReaderTest.php
diff --git a/tests/Sabre/VObject/RecurrenceIterator/ByMonthInDailyTest.php b/tests/unit/Recur/EventIterator/ByMonthInDailyTest.php
similarity index 100%
rename from tests/Sabre/VObject/RecurrenceIterator/ByMonthInDailyTest.php
rename to tests/unit/Recur/EventIterator/ByMonthInDailyTest.php
diff --git a/tests/Sabre/VObject/RecurrenceIterator/FifthTuesdayProblemTest.php b/tests/unit/Recur/EventIterator/FifthTuesdayProblemTest.php
similarity index 80%
rename from tests/Sabre/VObject/RecurrenceIterator/FifthTuesdayProblemTest.php
rename to tests/unit/Recur/EventIterator/FifthTuesdayProblemTest.php
index f55814e..c1546a0 100644
--- a/tests/Sabre/VObject/RecurrenceIterator/FifthTuesdayProblemTest.php
+++ b/tests/unit/Recur/EventIterator/FifthTuesdayProblemTest.php
@@ -1,8 +1,11 @@
<?php
-namespace Sabre\VObject;
+namespace Sabre\VObject\Recur\EventIterator;
-class RecurrenceIteratorFifthTuesdayProblemTest extends \PHPUnit_Framework_TestCase {
+use Sabre\VObject\Recur;
+use Sabre\VObject\Reader;
+
+class FifthTuesdayProblemTest extends \PHPUnit_Framework_TestCase {
/**
* A pretty slow test. Had to be marked as 'medium' for phpunit to not die
@@ -35,7 +38,7 @@ END:VCALENDAR
ICS;
$vObject = Reader::read($ics);
- $it = new RecurrenceIterator($vObject, (string)$vObject->VEVENT->UID);
+ $it = new Recur\EventIterator($vObject, (string)$vObject->VEVENT->UID);
while($it->valid()) {
$it->next();
diff --git a/tests/Sabre/VObject/RecurrenceIterator/IncorrectExpandTest.php b/tests/unit/Recur/EventIterator/IncorrectExpandTest.php
similarity index 100%
rename from tests/Sabre/VObject/RecurrenceIterator/IncorrectExpandTest.php
rename to tests/unit/Recur/EventIterator/IncorrectExpandTest.php
diff --git a/tests/Sabre/VObject/RecurrenceIterator/InfiniteLoopProblemTest.php b/tests/unit/Recur/EventIterator/InfiniteLoopProblemTest.php
similarity index 89%
rename from tests/Sabre/VObject/RecurrenceIterator/InfiniteLoopProblemTest.php
rename to tests/unit/Recur/EventIterator/InfiniteLoopProblemTest.php
index 941ac9f..c4f115b 100644
--- a/tests/Sabre/VObject/RecurrenceIterator/InfiniteLoopProblemTest.php
+++ b/tests/unit/Recur/EventIterator/InfiniteLoopProblemTest.php
@@ -1,13 +1,14 @@
<?php
-namespace Sabre\VObject;
+namespace Sabre\VObject\Recur\EventIterator;
use
DateTime,
DateTimeZone,
- Sabre\VObject\Component\VCalendar;
+ Sabre\VObject\Component\VCalendar,
+ Sabre\VObject\Recur;
-class RecurrenceIteratorInfiniteLoopProblemTest extends \PHPUnit_Framework_TestCase {
+class EventIteratorInfiniteLoopProblemTest extends \PHPUnit_Framework_TestCase {
public function setUp() {
@@ -51,7 +52,7 @@ class RecurrenceIteratorInfiniteLoopProblemTest extends \PHPUnit_Framework_TestC
// way to specify this, and could have certainly been a lot easier.
$this->vcal->add($ev);
- $it = new RecurrenceIterator($this->vcal,'uuid');
+ $it = new Recur\EventIterator($this->vcal,'uuid');
$it->fastForward(new DateTime('2012-01-29 23:00:00', new DateTimeZone('UTC')));
$collect = array();
@@ -88,7 +89,7 @@ class RecurrenceIteratorInfiniteLoopProblemTest extends \PHPUnit_Framework_TestC
$ev->RRULE = 'FREQ=YEARLY;INTERVAL=0';
$this->vcal->add($ev);
- $it = new RecurrenceIterator($this->vcal,'uuid');
+ $it = new Recur\EventIterator($this->vcal,'uuid');
$it->fastForward(new DateTime('2013-01-01 23:00:00', new DateTimeZone('UTC')));
// if we got this far.. it means we are no longer infinitely looping
diff --git a/tests/Sabre/VObject/Issue48Test.php b/tests/unit/Recur/EventIterator/Issue48Test.php
similarity index 95%
rename from tests/Sabre/VObject/Issue48Test.php
rename to tests/unit/Recur/EventIterator/Issue48Test.php
index 8dff53f..435a10c 100644
--- a/tests/Sabre/VObject/Issue48Test.php
+++ b/tests/unit/Recur/EventIterator/Issue48Test.php
@@ -30,7 +30,7 @@ ICS;
$vcal = Reader::read($input);
$this->assertInstanceOf('Sabre\\VObject\\Component\\VCalendar', $vcal);
- $it = new RecurrenceIterator($vcal, 'foo');
+ $it = new Recur\EventIterator($vcal, 'foo');
$result = iterator_to_array($it);
diff --git a/tests/Sabre/VObject/Issue50Test.php b/tests/unit/Recur/EventIterator/Issue50Test.php
similarity index 97%
rename from tests/Sabre/VObject/Issue50Test.php
rename to tests/unit/Recur/EventIterator/Issue50Test.php
index fdb012b..7a81295 100644
--- a/tests/Sabre/VObject/Issue50Test.php
+++ b/tests/unit/Recur/EventIterator/Issue50Test.php
@@ -104,7 +104,7 @@ ICS;
$vcal = Reader::read($input);
$this->assertInstanceOf('Sabre\\VObject\\Component\\VCalendar', $vcal);
- $it = new RecurrenceIterator($vcal, '1aef0b27-3d92-4581-829a-11999dd36724');
+ $it = new Recur\EventIterator($vcal, '1aef0b27-3d92-4581-829a-11999dd36724');
$result = array();
foreach($it as $instance) {
diff --git a/tests/Sabre/VObject/RecurrenceIterator/MainTest.php b/tests/unit/Recur/EventIterator/MainTest.php
similarity index 94%
rename from tests/Sabre/VObject/RecurrenceIterator/MainTest.php
rename to tests/unit/Recur/EventIterator/MainTest.php
index ecea965..b92261c 100644
--- a/tests/Sabre/VObject/RecurrenceIterator/MainTest.php
+++ b/tests/unit/Recur/EventIterator/MainTest.php
@@ -1,12 +1,11 @@
<?php
-namespace Sabre\VObject\RecurrenceIterator;
+namespace Sabre\VObject\EventIterator;
-use
- DateTime,
- DateTimeZone,
- Sabre\VObject\RecurrenceIterator,
- Sabre\VObject\Component\VCalendar;
+use DateTime;
+use DateTimeZone;
+use Sabre\VObject\Recur\EventIterator;
+use Sabre\VObject\Component\VCalendar;
class MainTest extends \PHPUnit_Framework_TestCase {
@@ -23,7 +22,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$this->assertTrue($it->isInfinite());
@@ -45,7 +44,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$ev->add($dtStart);
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
}
@@ -55,7 +54,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
function testVCalendarNoUID() {
$vcal = new VCalendar();
- $it = new RecurrenceIterator($vcal);
+ $it = new EventIterator($vcal);
}
@@ -65,7 +64,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
function testVCalendarInvalidUID() {
$vcal = new VCalendar();
- $it = new RecurrenceIterator($vcal,'foo');
+ $it = new EventIterator($vcal,'foo');
}
@@ -85,7 +84,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$ev->add($dtStart);
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,$ev->uid);
+ $it = new EventIterator($vcal,$ev->uid);
// Max is to prevent overflow
$max = 12;
@@ -138,7 +137,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,$ev->uid);
+ $it = new EventIterator($vcal,$ev->uid);
// Max is to prevent overflow
$max = 12;
@@ -185,7 +184,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,$ev->uid);
+ $it = new EventIterator($vcal,$ev->uid);
// Max is to prevent overflow
$max = 12;
@@ -227,7 +226,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
// Grabbing the next 12 items
$max = 12;
@@ -280,7 +279,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
// Grabbing the next 12 items
$max = 12;
@@ -333,7 +332,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
// Grabbing the next 12 items
$max = 12;
@@ -386,7 +385,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
// Max is to prevent overflow
$max = 12;
@@ -437,7 +436,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
// Grabbing the next 12 items
$max = 15;
@@ -493,7 +492,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
// Grabbing the next 12 items
$max = 12;
@@ -546,7 +545,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
// Grabbing the next 12 items
$max = 12;
@@ -599,7 +598,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 14;
$result = array();
@@ -645,7 +644,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 14;
$result = array();
@@ -698,7 +697,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 14;
$result = array();
@@ -751,7 +750,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 20;
$result = array();
@@ -807,7 +806,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 20;
$result = array();
@@ -857,7 +856,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 20;
$result = array();
@@ -907,7 +906,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 20;
$result = array();
@@ -957,7 +956,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 20;
$result = array();
@@ -1000,7 +999,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 20;
$result = array();
@@ -1048,7 +1047,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 20;
$result = array();
@@ -1096,7 +1095,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($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.
@@ -1145,7 +1144,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev);
- $it = new RecurrenceIterator($vcal,(string)$ev->uid);
+ $it = new EventIterator($vcal,(string)$ev->uid);
$max = 20;
$result = array();
@@ -1206,7 +1205,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev3);
- $it = new RecurrenceIterator($vcal,'overridden');
+ $it = new EventIterator($vcal,'overridden');
$dates = array();
$summaries = array();
@@ -1271,7 +1270,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev2);
- $it = new RecurrenceIterator($vcal,'overridden');
+ $it = new EventIterator($vcal,'overridden');
$dates = array();
$summaries = array();
@@ -1323,7 +1322,7 @@ class MainTest extends \PHPUnit_Framework_TestCase {
$vcal->add($ev2);
- $it = new RecurrenceIterator($vcal,'overridden');
+ $it = new EventIterator($vcal,'overridden');
$dates = array();
$summaries = array();
diff --git a/tests/Sabre/VObject/RecurrenceIterator/MissingOverriddenTest.php b/tests/unit/Recur/EventIterator/MissingOverriddenTest.php
similarity index 100%
rename from tests/Sabre/VObject/RecurrenceIterator/MissingOverriddenTest.php
rename to tests/unit/Recur/EventIterator/MissingOverriddenTest.php
diff --git a/tests/Sabre/VObject/RecurrenceIterator/OverrideFirstEventTest.php b/tests/unit/Recur/EventIterator/OverrideFirstEventTest.php
similarity index 100%
rename from tests/Sabre/VObject/RecurrenceIterator/OverrideFirstEventTest.php
rename to tests/unit/Recur/EventIterator/OverrideFirstEventTest.php
diff --git a/tests/Sabre/VObject/RRuleParserTest.php b/tests/unit/Recur/RRuleIterator.php
similarity index 99%
rename from tests/Sabre/VObject/RRuleParserTest.php
rename to tests/unit/Recur/RRuleIterator.php
index 7d39998..0f1236b 100644
--- a/tests/Sabre/VObject/RRuleParserTest.php
+++ b/tests/unit/Recur/RRuleIterator.php
@@ -1,11 +1,11 @@
<?php
-namespace Sabre\VObject;
+namespace Sabre\VObject\Recur;
use DateTime;
use DateTimeZone;
-class RRuleParserTest extends \PHPUnit_Framework_TestCase {
+class RRuleIteratorTest extends \PHPUnit_Framework_TestCase {
function testHourly() {
diff --git a/tests/Sabre/VObject/RecurrenceIterator/UntilRespectsTimezoneTest.ics b/tests/unit/RecurrenceIterator/UntilRespectsTimezoneTest.ics
similarity index 100%
rename from tests/Sabre/VObject/RecurrenceIterator/UntilRespectsTimezoneTest.ics
rename to tests/unit/RecurrenceIterator/UntilRespectsTimezoneTest.ics
diff --git a/tests/Sabre/VObject/SlashRTest.php b/tests/unit/SlashRTest.php
similarity index 100%
rename from tests/Sabre/VObject/SlashRTest.php
rename to tests/unit/SlashRTest.php
diff --git a/tests/Sabre/VObject/Splitter/ICalendarTest.php b/tests/unit/Splitter/ICalendarTest.php
similarity index 100%
rename from tests/Sabre/VObject/Splitter/ICalendarTest.php
rename to tests/unit/Splitter/ICalendarTest.php
diff --git a/tests/Sabre/VObject/Splitter/VCardTest.php b/tests/unit/Splitter/VCardTest.php
similarity index 100%
rename from tests/Sabre/VObject/Splitter/VCardTest.php
rename to tests/unit/Splitter/VCardTest.php
diff --git a/tests/Sabre/VObject/StringUtilTest.php b/tests/unit/StringUtilTest.php
similarity index 100%
rename from tests/Sabre/VObject/StringUtilTest.php
rename to tests/unit/StringUtilTest.php
diff --git a/tests/Sabre/VObject/TimeZoneUtilTest.php b/tests/unit/TimeZoneUtilTest.php
similarity index 100%
rename from tests/Sabre/VObject/TimeZoneUtilTest.php
rename to tests/unit/TimeZoneUtilTest.php
diff --git a/tests/Sabre/VObject/UUIDUtilTest.php b/tests/unit/UUIDUtilTest.php
similarity index 100%
rename from tests/Sabre/VObject/UUIDUtilTest.php
rename to tests/unit/UUIDUtilTest.php
diff --git a/tests/Sabre/VObject/VCard21Test.php b/tests/unit/VCard21Test.php
similarity index 100%
rename from tests/Sabre/VObject/VCard21Test.php
rename to tests/unit/VCard21Test.php
diff --git a/tests/Sabre/VObject/VCardConverterTest.php b/tests/unit/VCardConverterTest.php
similarity index 100%
rename from tests/Sabre/VObject/VCardConverterTest.php
rename to tests/unit/VCardConverterTest.php
diff --git a/tests/Sabre/VObject/VersionTest.php b/tests/unit/VersionTest.php
similarity index 100%
rename from tests/Sabre/VObject/VersionTest.php
rename to tests/unit/VersionTest.php
diff --git a/tests/Sabre/VObject/issue153.vcf b/tests/unit/issue153.vcf
similarity index 100%
rename from tests/Sabre/VObject/issue153.vcf
rename to tests/unit/issue153.vcf
diff --git a/tests/Sabre/VObject/issue64.vcf b/tests/unit/issue64.vcf
similarity index 100%
rename from tests/Sabre/VObject/issue64.vcf
rename to tests/unit/issue64.vcf
--
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