diff options
author | redmatrix <git@macgirvin.com> | 2016-05-10 17:26:44 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-10 17:26:44 -0700 |
commit | 0b02a6d123b2014705998c94ddf3d460948d3eac (patch) | |
tree | 78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /vendor/sabre/vobject/tests/Sabre/VObject/Splitter | |
parent | 40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff) | |
download | volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.gz volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.bz2 volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.zip |
initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)
Diffstat (limited to 'vendor/sabre/vobject/tests/Sabre/VObject/Splitter')
-rw-r--r-- | vendor/sabre/vobject/tests/Sabre/VObject/Splitter/ICalendarTest.php | 283 | ||||
-rw-r--r-- | vendor/sabre/vobject/tests/Sabre/VObject/Splitter/VCardTest.php | 138 |
2 files changed, 0 insertions, 421 deletions
diff --git a/vendor/sabre/vobject/tests/Sabre/VObject/Splitter/ICalendarTest.php b/vendor/sabre/vobject/tests/Sabre/VObject/Splitter/ICalendarTest.php deleted file mode 100644 index 43613350f..000000000 --- a/vendor/sabre/vobject/tests/Sabre/VObject/Splitter/ICalendarTest.php +++ /dev/null @@ -1,283 +0,0 @@ -<?php - -namespace Sabre\VObject\Splitter; - -use Sabre\VObject; - -class ICalendarSplitterTest extends \PHPUnit_Framework_TestCase { - - protected $version; - - function setup() { - $this->version = VObject\Version::VERSION; - } - - function createStream($data) { - - $stream = fopen('php://memory','r+'); - fwrite($stream, $data); - rewind($stream); - return $stream; - - } - - function testICalendarImportValidEvent() { - - $data = <<<EOT -BEGIN:VCALENDAR -BEGIN:VEVENT -UID:foo -END:VEVENT -END:VCALENDAR -EOT; - $tempFile = $this->createStream($data); - - $objects = new ICalendar($tempFile); - - $return = ""; - while($object=$objects->getNext()) { - $return .= $object->serialize(); - } - $this->assertEquals(array(), VObject\Reader::read($return)->validate()); - } - - function testICalendarImportEndOfData() { - $data = <<<EOT -BEGIN:VCALENDAR -BEGIN:VEVENT -UID:foo -END:VEVENT -END:VCALENDAR -EOT; - $tempFile = $this->createStream($data); - - $objects = new ICalendar($tempFile); - - $return = ""; - while($object=$objects->getNext()) { - $return .= $object->serialize(); - } - $this->assertNull($object=$objects->getNext()); - } - - /** - * @expectedException Sabre\VObject\ParseException - */ - function testICalendarImportInvalidEvent() { - $data = <<<EOT -EOT; - $tempFile = $this->createStream($data); - - $objects = new ICalendar($tempFile); - } - - function testICalendarImportMultipleValidEvents() { - - $event[] = <<<EOT -BEGIN:VEVENT -UID:foo1 -END:VEVENT -EOT; - -$event[] = <<<EOT -BEGIN:VEVENT -UID:foo2 -END:VEVENT -EOT; - - $data = <<<EOT -BEGIN:VCALENDAR -$event[0] -$event[1] -END:VCALENDAR - -EOT; - $tempFile = $this->createStream($data); - - $objects = new ICalendar($tempFile); - - $return = ""; - $i = 0; - while($object=$objects->getNext()) { - - $expected = <<<EOT -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Sabre//Sabre VObject $this->version//EN -CALSCALE:GREGORIAN -$event[$i] -END:VCALENDAR - -EOT; - - $return .= $object->serialize(); - $expected = str_replace("\n", "\r\n", $expected); - $this->assertEquals($expected, $object->serialize()); - $i++; - } - $this->assertEquals(array(), VObject\Reader::read($return)->validate()); - } - - function testICalendarImportEventWithoutUID() { - - $data = <<<EOT -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Sabre//Sabre VObject $this->version//EN -CALSCALE:GREGORIAN -BEGIN:VEVENT -END:VEVENT -END:VCALENDAR - -EOT; - $tempFile = $this->createStream($data); - - $objects = new ICalendar($tempFile); - - $return = ""; - while($object=$objects->getNext()) { - $expected = str_replace("\n", "\r\n", $data); - $this->assertEquals($expected, $object->serialize()); - $return .= $object->serialize(); - } - - $this->assertEquals(array(), VObject\Reader::read($return)->validate()); - } - - function testICalendarImportMultipleVTIMEZONESAndMultipleValidEvents() { - - $timezones = <<<EOT -BEGIN:VTIMEZONE -TZID:Europe/Berlin -BEGIN:DAYLIGHT -TZOFFSETFROM:+0100 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU -DTSTART:19810329T020000 -TZNAME:MESZ -TZOFFSETTO:+0200 -END:DAYLIGHT -BEGIN:STANDARD -TZOFFSETFROM:+0200 -RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU -DTSTART:19961027T030000 -TZNAME:MEZ -TZOFFSETTO:+0100 -END:STANDARD -END:VTIMEZONE -BEGIN:VTIMEZONE -TZID:Europe/London -BEGIN:DAYLIGHT -TZOFFSETFROM:+0000 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU -DTSTART:19810329T010000 -TZNAME:GMT+01:00 -TZOFFSETTO:+0100 -END:DAYLIGHT -BEGIN:STANDARD -TZOFFSETFROM:+0100 -RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU -DTSTART:19961027T020000 -TZNAME:GMT -TZOFFSETTO:+0000 -END:STANDARD -END:VTIMEZONE -EOT; - - $event[] = <<<EOT -BEGIN:VEVENT -UID:foo1 -END:VEVENT -EOT; - - $event[] = <<<EOT -BEGIN:VEVENT -UID:foo2 -END:VEVENT -EOT; - - $event[] = <<<EOT -BEGIN:VEVENT -UID:foo3 -END:VEVENT -EOT; - - $data = <<<EOT -BEGIN:VCALENDAR -$timezones -$event[0] -$event[1] -$event[2] -END:VCALENDAR - -EOT; - $tempFile = $this->createStream($data); - - $objects = new ICalendar($tempFile); - - $return = ""; - $i = 0; - while($object=$objects->getNext()) { - - $expected = <<<EOT -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Sabre//Sabre VObject $this->version//EN -CALSCALE:GREGORIAN -$timezones -$event[$i] -END:VCALENDAR - -EOT; - $expected = str_replace("\n", "\r\n", $expected); - - $this->assertEquals($expected, $object->serialize()); - $return .= $object->serialize(); - $i++; - - } - - $this->assertEquals(array(), VObject\Reader::read($return)->validate()); - $this->assertEquals(array(), VObject\Reader::read($return)->validate()); - } - - function testICalendarImportWithOutVTIMEZONES() { - - $data = <<<EOT -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Apple Inc.//Mac OS X 10.8//EN -CALSCALE:GREGORIAN -BEGIN:VEVENT -CREATED:20120605T072109Z -UID:D6716295-C10F-4B20-82F9-E1A3026C7DCF -DTEND;VALUE=DATE:20120717 -TRANSP:TRANSPARENT -SUMMARY:Start Vorbereitung -DTSTART;VALUE=DATE:20120716 -DTSTAMP:20120605T072115Z -SEQUENCE:2 -BEGIN:VALARM -X-WR-ALARMUID:A99EDA6A-35EB-4446-B8BC-CDA3C60C627D -UID:A99EDA6A-35EB-4446-B8BC-CDA3C60C627D -TRIGGER:-PT15H -X-APPLE-DEFAULT-ALARM:TRUE -ATTACH;VALUE=URI:Basso -ACTION:AUDIO -END:VALARM -END:VEVENT -END:VCALENDAR - -EOT; - $tempFile = $this->createStream($data); - - $objects = new ICalendar($tempFile); - - $return = ""; - while($object=$objects->getNext()) { - $return .= $object->serialize(); - } - - $this->assertEquals(array(), VObject\Reader::read($return)->validate()); - } - -} diff --git a/vendor/sabre/vobject/tests/Sabre/VObject/Splitter/VCardTest.php b/vendor/sabre/vobject/tests/Sabre/VObject/Splitter/VCardTest.php deleted file mode 100644 index b6b41925f..000000000 --- a/vendor/sabre/vobject/tests/Sabre/VObject/Splitter/VCardTest.php +++ /dev/null @@ -1,138 +0,0 @@ -<?php - -namespace Sabre\VObject\Splitter; - -use Sabre\VObject; - -class VCardSplitterTest extends \PHPUnit_Framework_TestCase { - - function createStream($data) { - - $stream = fopen('php://memory','r+'); - fwrite($stream, $data); - rewind($stream); - return $stream; - - } - - function testVCardImportValidVCard() { - $data = <<<EOT -BEGIN:VCARD -UID:foo -END:VCARD -EOT; - $tempFile = $this->createStream($data); - - $objects = new VCard($tempFile); - - $return = ""; - while($object=$objects->getNext()) { - $return .= $object->serialize(); - } - - VObject\Reader::read($return); - } - - function testVCardImportValidVCardsWithCategories() { - $data = <<<EOT -BEGIN:VCARD -UID:card-in-foo1-and-foo2 -CATEGORIES:foo1\,foo2 -END:VCARD -BEGIN:VCARD -UID:card-in-foo1 -CATEGORIES:foo1 -END:VCARD -BEGIN:VCARD -UID:card-in-foo3 -CATEGORIES:foo3 -END:VCARD -BEGIN:VCARD -UID:card-in-foo1-and-foo3 -CATEGORIES:foo1\,foo3 -END:VCARD -EOT; - $tempFile = $this->createStream($data); - - $objects = new VCard($tempFile); - - $return = ""; - while($object=$objects->getNext()) { - $return .= $object->serialize(); - } - - VObject\Reader::read($return); - } - - function testVCardImportEndOfData() { - $data = <<<EOT -BEGIN:VCARD -UID:foo -END:VCARD -EOT; - $tempFile = $this->createStream($data); - - $objects = new VCard($tempFile); - $object=$objects->getNext(); - - $this->assertFalse($object=$objects->getNext()); - - - } - - /** - * @expectedException InvalidArgumentException - */ - function testVCardImportCheckInvalidArgumentException() { - $data = <<<EOT -BEGIN:FOO -END:FOO -EOT; - $tempFile = $this->createStream($data); - - $objects = new VCard($tempFile); - while($object=$objects->getNext()) { - $return .= $object->serialize(); - } - - } - - function testVCardImportMultipleValidVCards() { - $data = <<<EOT -BEGIN:VCARD -UID:foo -END:VCARD -BEGIN:VCARD -UID:foo -END:VCARD -EOT; - $tempFile = $this->createStream($data); - - $objects = new VCard($tempFile); - - $return = ""; - while($object=$objects->getNext()) { - $return .= $object->serialize(); - } - - VObject\Reader::read($return); - } - - function testVCardImportVCardWithoutUID() { - $data = <<<EOT -BEGIN:VCARD -END:VCARD -EOT; - $tempFile = $this->createStream($data); - - $objects = new VCard($tempFile); - - $return = ""; - while($object=$objects->getNext()) { - $return .= $object->serialize(); - } - - VObject\Reader::read($return); - } - -} |