Skip to content

Commit 54a0827

Browse files
committed
Added unit tests for note parser
1 parent 95284ee commit 54a0827

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/VCardParserTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,20 @@ public function testUrl()
153153
$this->assertEquals($parser->getCardAtIndex(0)->url['PREF;WORK'][0], 'http://work1.example.com');
154154
$this->assertEquals($parser->getCardAtIndex(0)->url['PREF;WORK'][1], 'http://work2.example.com');
155155
}
156+
157+
public function testNote()
158+
{
159+
$vcard = new VCard();
160+
$vcard->addNote('This is a testnote');
161+
$parser = new VCardParser($vcard->buildVCard());
162+
163+
$vcardMultiline = new VCard();
164+
$vcardMultiline->addNote("This is a multiline note\nNew line content!");
165+
$parserMultiline = new VCardParser($vcardMultiline->buildVCard());
166+
167+
$this->assertEquals($parser->getCardAtIndex(0)->note, 'This is a testnote');
168+
$this->assertEquals($parserMultiline->getCardAtIndex(0)->note, "This is a multiline note\nNew line content!");
169+
}
156170

157171
public function testTitle()
158172
{

0 commit comments

Comments
 (0)