Note that most MimeDir related tests can actually be found in the ReaderTest class one level up.
More...
Note that most MimeDir related tests can actually be found in the ReaderTest class one level up.
Definition at line 11 of file MimeDirTest.php.
◆ testCaseInsensitiveInlineCharset()
Sabre\VObject\Parser\MimeDirTest::testCaseInsensitiveInlineCharset |
( |
| ) |
|
Definition at line 146 of file MimeDirTest.php.
146 {
147
148 $vcard = <<<VCF
149BEGIN:VCARD
150VERSION:2.1
151FN;CHARSET=iSo-8859-1:Euro
152N;CHARSET=utf-8:Test2
153END:VCARD\n
154VCF;
155
156 $mimeDir = new MimeDir();
157 $vcard = $mimeDir->parse($vcard);
158
159 $this->assertEquals("Euro", $vcard->FN->getValue());
160 $this->assertEquals("Test2", $vcard->N->getValue());
161
162 }
◆ testDecodeInlineLatin1()
Sabre\VObject\Parser\MimeDirTest::testDecodeInlineLatin1 |
( |
| ) |
|
Definition at line 39 of file MimeDirTest.php.
39 {
40
41 $vcard = <<<VCF
42BEGIN:VCARD
43VERSION:2.1
44FN;CHARSET=ISO-8859-1:umlaut u - \xFC
45END:VCARD\n
46VCF;
47
48 $mimeDir = new MimeDir();
49 $vcard = $mimeDir->parse($vcard);
50 $this->assertEquals("umlaut u - \xC3\xBC", $vcard->FN->getValue());
51
52 }
◆ testDecodeLatin1()
Sabre\VObject\Parser\MimeDirTest::testDecodeLatin1 |
( |
| ) |
|
Definition at line 23 of file MimeDirTest.php.
23 {
24
25 $vcard = <<<VCF
26BEGIN:VCARD
27VERSION:3.0
28FN:umlaut u - \xFC
29END:VCARD\n
30VCF;
31
32 $mimeDir = new MimeDir();
33 $mimeDir->setCharset('ISO-8859-1');
34 $vcard = $mimeDir->parse($vcard);
35 $this->assertEquals("umlaut u - \xC3\xBC", $vcard->FN->getValue());
36
37 }
◆ testDecodeUnsupportedCharset()
Sabre\VObject\Parser\MimeDirTest::testDecodeUnsupportedCharset |
( |
| ) |
|
@expectedException \InvalidArgumentException
Definition at line 91 of file MimeDirTest.php.
91 {
92
93 $mimeDir = new MimeDir();
94 $mimeDir->setCharset('foobar');
95
96 }
◆ testDecodeUnsupportedInlineCharset()
Sabre\VObject\Parser\MimeDirTest::testDecodeUnsupportedInlineCharset |
( |
| ) |
|
@expectedException \Sabre\VObject\ParseException
Definition at line 101 of file MimeDirTest.php.
101 {
102
103 $vcard = <<<VCF
104BEGIN:VCARD
105VERSION:2.1
106FN;CHARSET=foobar:nothing
107END:VCARD\n
108VCF;
109
110 $mimeDir = new MimeDir();
111 $mimeDir->parse($vcard);
112
113 }
◆ testDecodeWindows1252()
Sabre\VObject\Parser\MimeDirTest::testDecodeWindows1252 |
( |
| ) |
|
Definition at line 115 of file MimeDirTest.php.
115 {
116
117 $vcard = <<<VCF
118BEGIN:VCARD
119VERSION:3.0
120FN:Euro \x80
121END:VCARD\n
122VCF;
123
124 $mimeDir = new MimeDir();
125 $mimeDir->setCharset('Windows-1252');
126 $vcard = $mimeDir->parse($vcard);
127 $this->assertEquals("Euro \xE2\x82\xAC", $vcard->FN->getValue());
128
129 }
◆ testDecodeWindows1252Inline()
Sabre\VObject\Parser\MimeDirTest::testDecodeWindows1252Inline |
( |
| ) |
|
Definition at line 131 of file MimeDirTest.php.
131 {
132
133 $vcard = <<<VCF
134BEGIN:VCARD
135VERSION:2.1
136FN;CHARSET=Windows-1252:Euro \x80
137END:VCARD\n
138VCF;
139
140 $mimeDir = new MimeDir();
141 $vcard = $mimeDir->parse($vcard);
142 $this->assertEquals("Euro \xE2\x82\xAC", $vcard->FN->getValue());
143
144 }
◆ testDontDecodeLatin1()
Sabre\VObject\Parser\MimeDirTest::testDontDecodeLatin1 |
( |
| ) |
|
Definition at line 69 of file MimeDirTest.php.
69 {
70
71 $vcard = <<<VCF
72BEGIN:VCARD
73VERSION:4.0
74FN:umlaut u - \xFC
75END:VCARD\n
76VCF;
77
78 $mimeDir = new MimeDir();
79 $vcard = $mimeDir->parse($vcard);
80
81
82
83
84 $this->assertEquals("umlaut u - \xFC", $vcard->FN->getValue());
85
86 }
◆ testIgnoreCharsetVCard30()
Sabre\VObject\Parser\MimeDirTest::testIgnoreCharsetVCard30 |
( |
| ) |
|
Definition at line 54 of file MimeDirTest.php.
54 {
55
56 $vcard = <<<VCF
57BEGIN:VCARD
58VERSION:3.0
59FN;CHARSET=unknown:foo-bar - \xFC
60END:VCARD\n
61VCF;
62
63 $mimeDir = new MimeDir();
64 $vcard = $mimeDir->parse($vcard);
65 $this->assertEquals("foo-bar - \xFC", $vcard->FN->getValue());
66
67 }
◆ testParseError()
Sabre\VObject\Parser\MimeDirTest::testParseError |
( |
| ) |
|
@expectedException \Sabre\VObject\ParseException
Definition at line 16 of file MimeDirTest.php.
16 {
17
18 $mimeDir = new MimeDir();
19 $mimeDir->parse(fopen(__FILE__, 'a'));
20
21 }
The documentation for this class was generated from the following file: