5use PHPUnit\Framework\TestCase;
19 $mimeDir->parse(fopen(__FILE__,
'a'));
33 $mimeDir->setCharset(
'ISO-8859-1');
34 $vcard = $mimeDir->parse($vcard);
35 $this->assertEquals(
"umlaut u - \xC3\xBC", $vcard->FN->getValue());
44FN;CHARSET=ISO-8859-1:umlaut u - \xFC
49 $vcard = $mimeDir->parse($vcard);
50 $this->assertEquals(
"umlaut u - \xC3\xBC", $vcard->FN->getValue());
59FN;CHARSET=unknown:foo-bar - \xFC
64 $vcard = $mimeDir->parse($vcard);
65 $this->assertEquals(
"foo-bar - \xFC", $vcard->FN->getValue());
79 $vcard = $mimeDir->parse($vcard);
84 $this->assertEquals(
"umlaut u - \xFC", $vcard->FN->getValue());
94 $mimeDir->setCharset(
'foobar');
106FN;CHARSET=foobar:nothing
111 $mimeDir->parse($vcard);
125 $mimeDir->setCharset(
'Windows-1252');
126 $vcard = $mimeDir->parse($vcard);
127 $this->assertEquals(
"Euro \xE2\x82\xAC", $vcard->FN->getValue());
136FN;CHARSET=Windows-1252:Euro \x80
141 $vcard = $mimeDir->parse($vcard);
142 $this->assertEquals(
"Euro \xE2\x82\xAC", $vcard->FN->getValue());
151FN;CHARSET=iSo-8859-1:Euro
157 $vcard = $mimeDir->parse($vcard);
159 $this->assertEquals(
"Euro", $vcard->FN->getValue());
160 $this->assertEquals(
"Test2", $vcard->N->getValue());
An exception for terminatinating execution or to throw for unit testing.
Note that most MimeDir related tests can actually be found in the ReaderTest class one level up.
testDecodeWindows1252Inline()
testCaseInsensitiveInlineCharset()
testDecodeUnsupportedCharset()
@expectedException \InvalidArgumentException
testParseError()
@expectedException \Sabre\VObject\ParseException
testDecodeUnsupportedInlineCharset()
@expectedException \Sabre\VObject\ParseException
testIgnoreCharsetVCard30()