"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/sabre/vobject/tests/VObject/BirthdayCalendarGeneratorTest.php" between
sabredav-3.1.2.zip and sabredav-3.1.3.zip

About: SabreDAV allows you to easily add WebDAV support to a PHP application.

BirthdayCalendarGeneratorTest.php  (sabredav-3.1.2):BirthdayCalendarGeneratorTest.php  (sabredav-3.1.3)
<?php <?php
namespace Sabre\VObject; namespace Sabre\VObject;
class BirthdayCalendarGeneratorTest extends TestCase { class BirthdayCalendarGeneratorTest extends \PHPUnit_Framework_TestCase {
use PHPUnitAssertions;
function testVcardStringWithValidBirthday() { function testVcardStringWithValidBirthday() {
$generator = new BirthdayCalendarGenerator(); $generator = new BirthdayCalendarGenerator();
$input = <<<VCF $input = <<<VCF
BEGIN:VCARD BEGIN:VCARD
VERSION:3.0 VERSION:3.0
N:Gump;Forrest;;Mr. N:Gump;Forrest;;Mr.
FN:Forrest Gump FN:Forrest Gump
BDAY:19850407 BDAY:19850407
skipping to change at line 38 skipping to change at line 40
RRULE:FREQ=YEARLY RRULE:FREQ=YEARLY
TRANSP:TRANSPARENT TRANSP:TRANSPARENT
X-SABRE-BDAY;X-SABRE-VCARD-UID=foo;X-SABRE-VCARD-FN=Forrest Gump:BDAY X-SABRE-BDAY;X-SABRE-VCARD-UID=foo;X-SABRE-VCARD-FN=Forrest Gump:BDAY
END:VEVENT END:VEVENT
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
function testArrayOfVcardStringsWithValidBirthdays() { function testArrayOfVcardStringsWithValidBirthdays() {
$generator = new BirthdayCalendarGenerator(); $generator = new BirthdayCalendarGenerator();
$input = []; $input = [];
skipping to change at line 97 skipping to change at line 99
RRULE:FREQ=YEARLY RRULE:FREQ=YEARLY
TRANSP:TRANSPARENT TRANSP:TRANSPARENT
X-SABRE-BDAY;X-SABRE-VCARD-UID=bar;X-SABRE-VCARD-FN=John Doe:BDAY X-SABRE-BDAY;X-SABRE-VCARD-UID=bar;X-SABRE-VCARD-FN=John Doe:BDAY
END:VEVENT END:VEVENT
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
function testArrayOfVcardStringsWithValidBirthdaysViaConstructor() { function testArrayOfVcardStringsWithValidBirthdaysViaConstructor() {
$input = []; $input = [];
skipping to change at line 157 skipping to change at line 159
RRULE:FREQ=YEARLY RRULE:FREQ=YEARLY
TRANSP:TRANSPARENT TRANSP:TRANSPARENT
X-SABRE-BDAY;X-SABRE-VCARD-UID=bar;X-SABRE-VCARD-FN=John Doe:BDAY X-SABRE-BDAY;X-SABRE-VCARD-UID=bar;X-SABRE-VCARD-FN=John Doe:BDAY
END:VEVENT END:VEVENT
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
function testVcardObjectWithValidBirthday() { function testVcardObjectWithValidBirthday() {
$generator = new BirthdayCalendarGenerator(); $generator = new BirthdayCalendarGenerator();
$input = <<<VCF $input = <<<VCF
skipping to change at line 197 skipping to change at line 199
RRULE:FREQ=YEARLY RRULE:FREQ=YEARLY
TRANSP:TRANSPARENT TRANSP:TRANSPARENT
X-SABRE-BDAY;X-SABRE-VCARD-UID=foo;X-SABRE-VCARD-FN=Forrest Gump:BDAY X-SABRE-BDAY;X-SABRE-VCARD-UID=foo;X-SABRE-VCARD-FN=Forrest Gump:BDAY
END:VEVENT END:VEVENT
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
function testArrayOfVcardObjectsWithValidBirthdays() { function testArrayOfVcardObjectsWithValidBirthdays() {
$generator = new BirthdayCalendarGenerator(); $generator = new BirthdayCalendarGenerator();
$input = []; $input = [];
skipping to change at line 260 skipping to change at line 262
RRULE:FREQ=YEARLY RRULE:FREQ=YEARLY
TRANSP:TRANSPARENT TRANSP:TRANSPARENT
X-SABRE-BDAY;X-SABRE-VCARD-UID=bar;X-SABRE-VCARD-FN=John Doe:BDAY X-SABRE-BDAY;X-SABRE-VCARD-UID=bar;X-SABRE-VCARD-FN=John Doe:BDAY
END:VEVENT END:VEVENT
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
function testVcardStringWithValidBirthdayWithXAppleOmitYear() { function testVcardStringWithValidBirthdayWithXAppleOmitYear() {
$generator = new BirthdayCalendarGenerator(); $generator = new BirthdayCalendarGenerator();
$input = <<<VCF $input = <<<VCF
skipping to change at line 298 skipping to change at line 300
RRULE:FREQ=YEARLY RRULE:FREQ=YEARLY
TRANSP:TRANSPARENT TRANSP:TRANSPARENT
X-SABRE-BDAY;X-SABRE-VCARD-UID=foo;X-SABRE-VCARD-FN=Forrest Gump;X-SABRE-OMIT-YE AR=2000:BDAY X-SABRE-BDAY;X-SABRE-VCARD-UID=foo;X-SABRE-VCARD-FN=Forrest Gump;X-SABRE-OMIT-YE AR=2000:BDAY
END:VEVENT END:VEVENT
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
function testVcardStringWithValidBirthdayWithoutYear() { function testVcardStringWithValidBirthdayWithoutYear() {
$generator = new BirthdayCalendarGenerator(); $generator = new BirthdayCalendarGenerator();
$input = <<<VCF $input = <<<VCF
skipping to change at line 336 skipping to change at line 338
RRULE:FREQ=YEARLY RRULE:FREQ=YEARLY
TRANSP:TRANSPARENT TRANSP:TRANSPARENT
X-SABRE-BDAY;X-SABRE-VCARD-UID=foo;X-SABRE-VCARD-FN=Forrest Gump;X-SABRE-OMIT-YE AR=2000:BDAY X-SABRE-BDAY;X-SABRE-VCARD-UID=foo;X-SABRE-VCARD-FN=Forrest Gump;X-SABRE-OMIT-YE AR=2000:BDAY
END:VEVENT END:VEVENT
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
function testVcardStringWithInvalidBirthday() { function testVcardStringWithInvalidBirthday() {
$generator = new BirthdayCalendarGenerator(); $generator = new BirthdayCalendarGenerator();
$input = <<<VCF $input = <<<VCF
skipping to change at line 365 skipping to change at line 367
$expected = <<<ICS $expected = <<<ICS
BEGIN:VCALENDAR BEGIN:VCALENDAR
VERSION:2.0 VERSION:2.0
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
function testVcardStringWithNoBirthday() { function testVcardStringWithNoBirthday() {
$generator = new BirthdayCalendarGenerator(); $generator = new BirthdayCalendarGenerator();
$input = <<<VCF $input = <<<VCF
skipping to change at line 393 skipping to change at line 395
$expected = <<<ICS $expected = <<<ICS
BEGIN:VCALENDAR BEGIN:VCALENDAR
VERSION:2.0 VERSION:2.0
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
function testVcardStringWithValidBirthdayLocalized() { function testVcardStringWithValidBirthdayLocalized() {
$generator = new BirthdayCalendarGenerator(); $generator = new BirthdayCalendarGenerator();
$input = <<<VCF $input = <<<VCF
skipping to change at line 432 skipping to change at line 434
TRANSP:TRANSPARENT TRANSP:TRANSPARENT
X-SABRE-BDAY;X-SABRE-VCARD-UID=foo;X-SABRE-VCARD-FN=Forrest Gump:BDAY X-SABRE-BDAY;X-SABRE-VCARD-UID=foo;X-SABRE-VCARD-FN=Forrest Gump:BDAY
END:VEVENT END:VEVENT
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$generator->setFormat('%1$s\'s Geburtstag'); $generator->setFormat('%1$s\'s Geburtstag');
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
function testVcardStringWithEmptyBirthdayProperty() { function testVcardStringWithEmptyBirthdayProperty() {
$generator = new BirthdayCalendarGenerator(); $generator = new BirthdayCalendarGenerator();
$input = <<<VCF $input = <<<VCF
skipping to change at line 461 skipping to change at line 463
$expected = <<<ICS $expected = <<<ICS
BEGIN:VCALENDAR BEGIN:VCALENDAR
VERSION:2.0 VERSION:2.0
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
/** /**
* @expectedException \Sabre\VObject\ParseException * @expectedException \Sabre\VObject\ParseException
*/ */
function testParseException() { function testParseException() {
skipping to change at line 553 skipping to change at line 555
$expected = <<<ICS $expected = <<<ICS
BEGIN:VCALENDAR BEGIN:VCALENDAR
VERSION:2.0 VERSION:2.0
END:VCALENDAR END:VCALENDAR
ICS; ICS;
$generator->setObjects($input); $generator->setObjects($input);
$output = $generator->getResult(); $output = $generator->getResult();
$this->assertVObjEquals( $this->assertVObjectEqualsVObject(
$expected, $expected,
$output $output
); );
} }
} }
 End of changes. 13 change blocks. 
13 lines changed or deleted 15 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS