ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\VObject\Parser\MimeDirTest Class Reference

Note that most MimeDir related tests can actually be found in the ReaderTest class one level up. More...

+ Inheritance diagram for Sabre\VObject\Parser\MimeDirTest:
+ Collaboration diagram for Sabre\VObject\Parser\MimeDirTest:

Public Member Functions

 testParseError ()
 
 testDecodeLatin1 ()
 
 testDecodeInlineLatin1 ()
 
 testIgnoreCharsetVCard30 ()
 
 testDontDecodeLatin1 ()
 
 testDecodeUnsupportedCharset ()
 
 testDecodeUnsupportedInlineCharset ()
 
 testDecodeWindows1252 ()
 
 testDecodeWindows1252Inline ()
 
 testCaseInsensitiveInlineCharset ()
 

Detailed Description

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.

Member Function Documentation

◆ testCaseInsensitiveInlineCharset()

Sabre\VObject\Parser\MimeDirTest::testCaseInsensitiveInlineCharset ( )

Definition at line 146 of file MimeDirTest.php.

References n.

146  {
147 
148  $vcard = <<<VCF
149 BEGIN:VCARD
150 VERSION:2.1
151 FN;CHARSET=iSo-8859-1:Euro
152 N;CHARSET=utf-8:Test2
153 END:VCARD\n
154 VCF;
155 
156  $mimeDir = new MimeDir();
157  $vcard = $mimeDir->parse($vcard);
158  // we can do a simple assertion here. As long as we don't get an exception, everything is thing
159  $this->assertEquals("Euro", $vcard->FN->getValue());
160  $this->assertEquals("Test2", $vcard->N->getValue());
161 
162  }
if(! $in) print Initializing normalization quick check tables n

◆ testDecodeInlineLatin1()

Sabre\VObject\Parser\MimeDirTest::testDecodeInlineLatin1 ( )

Definition at line 39 of file MimeDirTest.php.

References n.

39  {
40 
41  $vcard = <<<VCF
42 BEGIN:VCARD
43 VERSION:2.1
44 FN;CHARSET=ISO-8859-1:umlaut u - \xFC
45 END:VCARD\n
46 VCF;
47 
48  $mimeDir = new MimeDir();
49  $vcard = $mimeDir->parse($vcard);
50  $this->assertEquals("umlaut u - \xC3\xBC", $vcard->FN->getValue());
51 
52  }
if(! $in) print Initializing normalization quick check tables n

◆ testDecodeLatin1()

Sabre\VObject\Parser\MimeDirTest::testDecodeLatin1 ( )

Definition at line 23 of file MimeDirTest.php.

References n.

23  {
24 
25  $vcard = <<<VCF
26 BEGIN:VCARD
27 VERSION:3.0
28 FN:umlaut u - \xFC
29 END:VCARD\n
30 VCF;
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  }
if(! $in) print Initializing normalization quick check tables n

◆ testDecodeUnsupportedCharset()

Sabre\VObject\Parser\MimeDirTest::testDecodeUnsupportedCharset ( )

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 ( )

Definition at line 101 of file MimeDirTest.php.

References n.

101  {
102 
103  $vcard = <<<VCF
104 BEGIN:VCARD
105 VERSION:2.1
106 FN;CHARSET=foobar:nothing
107 END:VCARD\n
108 VCF;
109 
110  $mimeDir = new MimeDir();
111  $mimeDir->parse($vcard);
112 
113  }
if(! $in) print Initializing normalization quick check tables n

◆ testDecodeWindows1252()

Sabre\VObject\Parser\MimeDirTest::testDecodeWindows1252 ( )

Definition at line 115 of file MimeDirTest.php.

References n.

115  {
116 
117  $vcard = <<<VCF
118 BEGIN:VCARD
119 VERSION:3.0
120 FN:Euro \x80
121 END:VCARD\n
122 VCF;
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  }
if(! $in) print Initializing normalization quick check tables n

◆ testDecodeWindows1252Inline()

Sabre\VObject\Parser\MimeDirTest::testDecodeWindows1252Inline ( )

Definition at line 131 of file MimeDirTest.php.

References n.

131  {
132 
133  $vcard = <<<VCF
134 BEGIN:VCARD
135 VERSION:2.1
136 FN;CHARSET=Windows-1252:Euro \x80
137 END:VCARD\n
138 VCF;
139 
140  $mimeDir = new MimeDir();
141  $vcard = $mimeDir->parse($vcard);
142  $this->assertEquals("Euro \xE2\x82\xAC", $vcard->FN->getValue());
143 
144  }
if(! $in) print Initializing normalization quick check tables n

◆ testDontDecodeLatin1()

Sabre\VObject\Parser\MimeDirTest::testDontDecodeLatin1 ( )

Definition at line 69 of file MimeDirTest.php.

References n.

69  {
70 
71  $vcard = <<<VCF
72 BEGIN:VCARD
73 VERSION:4.0
74 FN:umlaut u - \xFC
75 END:VCARD\n
76 VCF;
77 
78  $mimeDir = new MimeDir();
79  $vcard = $mimeDir->parse($vcard);
80  // This basically tests that we don't touch the input string if
81  // the encoding was set to UTF-8. The result is actually invalid
82  // and the validator should report this, but it tests effectively
83  // that we pass through the string byte-by-byte.
84  $this->assertEquals("umlaut u - \xFC", $vcard->FN->getValue());
85 
86  }
if(! $in) print Initializing normalization quick check tables n

◆ testIgnoreCharsetVCard30()

Sabre\VObject\Parser\MimeDirTest::testIgnoreCharsetVCard30 ( )

Definition at line 54 of file MimeDirTest.php.

References n.

54  {
55 
56  $vcard = <<<VCF
57 BEGIN:VCARD
58 VERSION:3.0
59 FN;CHARSET=unknown:foo-bar - \xFC
60 END:VCARD\n
61 VCF;
62 
63  $mimeDir = new MimeDir();
64  $vcard = $mimeDir->parse($vcard);
65  $this->assertEquals("foo-bar - \xFC", $vcard->FN->getValue());
66 
67  }
if(! $in) print Initializing normalization quick check tables n

◆ testParseError()

Sabre\VObject\Parser\MimeDirTest::testParseError ( )

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: