Skip to content

Commit

Permalink
More tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
evert committed May 24, 2013
1 parent 9515477 commit c16b7d4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Sabre/VObject/RecurrenceIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public function __construct(Component $vcal, $uid=null) {
$this->count = 1;
} else foreach($rrule->getParts() as $key=>$value) {

switch(strtoupper($key)) {
switch($key) {

case 'FREQ' :
if (!in_array(
Expand Down
21 changes: 21 additions & 0 deletions tests/Sabre/VObject/DocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,27 @@ function testCreateComponent() {
$this->assertEquals("BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nX-PROP;X-PARAM=3:1234256\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", $out);

}

function testCreate() {

$vcal = new Component\VCalendar(array(), false);

$event = $vcal->create('VEVENT');
$this->assertInstanceOf('Sabre\VObject\Component\VEvent', $event);

$event = $vcal->create('CALSCALE');
$this->assertInstanceOf('Sabre\VObject\Property\Text', $event);

}

function testGetClassNameForPropertyValue() {

$vcal = new Component\VCalendar(array(), false);
$this->assertEquals('Sabre\\VObject\\Property\\Text', $vcal->getClassNameForPropertyValue('TEXT'));
$this->assertNull($vcal->getClassNameForPropertyValue('FOO'));

}

}


Expand Down
2 changes: 2 additions & 0 deletions tests/Sabre/VObject/RecurrenceIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ function testInvalidFreq() {
$vcal = new VCalendar();
$ev = $vcal->createComponent('VEVENT');
$ev->RRULE = 'FREQ=SMONTHLY;INTERVAL=3;UNTIL=20111025T000000Z';
$ev->UID = 'foo';
$dtStart = $vcal->createProperty('DTSTART');
$dtStart->setDateTime(new DateTime('2011-10-07', new DateTimeZone('UTC')));

$ev->add($dtStart);
$vcal->add($ev);

$it = new RecurrenceIterator($vcal,(string)$ev->uid);

Expand Down

0 comments on commit c16b7d4

Please sign in to comment.