Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test for vcard converter issue #173

Merged
merged 3 commits into from
Jan 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions tests/VObject/VCardConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,4 +487,45 @@ function testMultipleAnniversaries() {
);

}

function testNoLabel() {

$input = <<<VCF
BEGIN:VCARD
VERSION:3.0
UID:foo
N:Doe;John;;;
FN:John Doe
item1.X-ABDATE;type=pref:2008-12-11
END:VCARD

VCF;

$vcard = Reader::read($input);

$this->assertInstanceOf('Sabre\\VObject\\Component\\VCard', $vcard);
$vcard = $vcard->convert(\Sabre\VObject\Document::VCARD40);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply using VObject\Document::VCARD40 might be valid here (because of the namespace).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is preferred here. It's not omitted anywhere in the test class.
Should probably be omitted everywhere or nowhere. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't check around this test case. Yes, it should be omitted everywhere ;-).

$vcard = $vcard->serialize();

$converted = Reader::read($vcard);
$converted->validate();

$version = Version::VERSION;

$expected = <<<VCF
BEGIN:VCARD
VERSION:4.0
PRODID:-//Sabre//Sabre VObject $version//EN
UID:foo
N:Doe;John;;;
FN:John Doe
ITEM1.X-ABDATE;PREF=1:2008-12-11
END:VCARD

VCF;

$this->assertEquals($expected, str_replace("\r","", $vcard));

}

}