ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\VObject\Parser\QuotedPrintableTest Class Reference
+ Inheritance diagram for Sabre\VObject\Parser\QuotedPrintableTest:
+ Collaboration diagram for Sabre\VObject\Parser\QuotedPrintableTest:

Public Member Functions

 testReadQuotedPrintableSimple ()
 
 testReadQuotedPrintableNewlineSoft ()
 
 testReadQuotedPrintableNewlineHard ()
 
 testReadQuotedPrintableCompatibilityMS ()
 
 testReadQuotesPrintableCompoundValues ()
 

Private Member Functions

 getPropertyValue (\Sabre\VObject\Property $property)
 

Detailed Description

Definition at line 8 of file QuotedPrintableTest.php.

Member Function Documentation

◆ getPropertyValue()

Sabre\VObject\Parser\QuotedPrintableTest::getPropertyValue ( \Sabre\VObject\Property  $property)
private

Definition at line 80 of file QuotedPrintableTest.php.

Referenced by Sabre\VObject\Parser\QuotedPrintableTest\testReadQuotedPrintableCompatibilityMS(), Sabre\VObject\Parser\QuotedPrintableTest\testReadQuotedPrintableNewlineHard(), Sabre\VObject\Parser\QuotedPrintableTest\testReadQuotedPrintableNewlineSoft(), and Sabre\VObject\Parser\QuotedPrintableTest\testReadQuotedPrintableSimple().

80  {
81 
82  return (string)$property;
83 
84  /*
85  $param = $property['encoding'];
86  if ($param !== null) {
87  $encoding = strtoupper((string)$param);
88  if ($encoding === 'QUOTED-PRINTABLE') {
89  $value = quoted_printable_decode($value);
90  } else {
91  throw new Exception();
92  }
93  }
94 
95  $param = $property['charset'];
96  if ($param !== null) {
97  $charset = strtoupper((string)$param);
98  if ($charset !== 'UTF-8') {
99  $value = mb_convert_encoding($value, 'UTF-8', $charset);
100  }
101  } else {
102  $value = StringUtil::convertToUTF8($value);
103  }
104 
105  return $value;
106  */
107  }
+ Here is the caller graph for this function:

◆ testReadQuotedPrintableCompatibilityMS()

Sabre\VObject\Parser\QuotedPrintableTest::testReadQuotedPrintableCompatibilityMS ( )

Definition at line 48 of file QuotedPrintableTest.php.

References $data, $result, Sabre\VObject\Parser\QuotedPrintableTest\getPropertyValue(), Sabre\VObject\Reader\OPTION_FORGIVING, and Sabre\VObject\Reader\read().

48  {
49 
50  $data = "BEGIN:VCARD\r\nLABEL;ENCODING=QUOTED-PRINTABLE:Aachen=0D=0A=\r\nDeutschland:okay\r\nEND:VCARD";
52 
53  $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
54  $this->assertEquals('VCARD', $result->name);
55  $this->assertEquals(1, count($result->children()));
56  $this->assertEquals("Aachen\r\nDeutschland:okay", $this->getPropertyValue($result->LABEL));
57 
58  }
$result
getPropertyValue(\Sabre\VObject\Property $property)
const OPTION_FORGIVING
If this option is passed to the reader, it will be less strict about the validity of the lines...
Definition: Reader.php:21
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ testReadQuotedPrintableNewlineHard()

Sabre\VObject\Parser\QuotedPrintableTest::testReadQuotedPrintableNewlineHard ( )

Definition at line 35 of file QuotedPrintableTest.php.

References $data, $result, Sabre\VObject\Parser\QuotedPrintableTest\getPropertyValue(), and Sabre\VObject\Reader\read().

35  {
36 
37  $data = "BEGIN:VCARD\r\nLABEL;ENCODING=QUOTED-PRINTABLE:Aachen=0D=0A=\r\n Germany\r\nEND:VCARD";
39 
40  $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
41  $this->assertEquals('VCARD', $result->name);
42  $this->assertEquals(1, count($result->children()));
43  $this->assertEquals("Aachen\r\nGermany", $this->getPropertyValue($result->LABEL));
44 
45 
46  }
$result
getPropertyValue(\Sabre\VObject\Property $property)
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ testReadQuotedPrintableNewlineSoft()

Sabre\VObject\Parser\QuotedPrintableTest::testReadQuotedPrintableNewlineSoft ( )

Definition at line 23 of file QuotedPrintableTest.php.

References $data, $result, Sabre\VObject\Parser\QuotedPrintableTest\getPropertyValue(), and Sabre\VObject\Reader\read().

23  {
24 
25  $data = "BEGIN:VCARD\r\nLABEL;ENCODING=QUOTED-PRINTABLE:Aa=\r\n ch=\r\n en\r\nEND:VCARD";
27 
28  $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
29  $this->assertEquals('VCARD', $result->name);
30  $this->assertEquals(1, count($result->children()));
31  $this->assertEquals("Aachen", $this->getPropertyValue($result->LABEL));
32 
33  }
$result
getPropertyValue(\Sabre\VObject\Property $property)
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ testReadQuotedPrintableSimple()

Sabre\VObject\Parser\QuotedPrintableTest::testReadQuotedPrintableSimple ( )

Definition at line 10 of file QuotedPrintableTest.php.

References $data, $result, Sabre\VObject\Parser\QuotedPrintableTest\getPropertyValue(), and Sabre\VObject\Reader\read().

10  {
11 
12  $data = "BEGIN:VCARD\r\nLABEL;ENCODING=QUOTED-PRINTABLE:Aach=65n\r\nEND:VCARD";
13 
15 
16  $this->assertInstanceOf('Sabre\\VObject\\Component', $result);
17  $this->assertEquals('VCARD', $result->name);
18  $this->assertEquals(1, count($result->children()));
19  $this->assertEquals("Aachen", $this->getPropertyValue($result->LABEL));
20 
21  }
$result
getPropertyValue(\Sabre\VObject\Property $property)
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ testReadQuotesPrintableCompoundValues()

Sabre\VObject\Parser\QuotedPrintableTest::testReadQuotesPrintableCompoundValues ( )

Definition at line 60 of file QuotedPrintableTest.php.

References $data, $result, Sabre\VObject\Reader\OPTION_FORGIVING, and Sabre\VObject\Reader\read().

60  {
61 
62  $data = <<<VCF
63 BEGIN:VCARD
64 VERSION:2.1
65 N:Doe;John;;;
66 FN:John Doe
67 ADR;WORK;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:;;M=C3=BCnster =
68 Str. 1;M=C3=BCnster;;48143;Deutschland
69 END:VCARD
70 VCF;
71 
73  $this->assertEquals([
74  '', '', 'Münster Str. 1', 'Münster', '', '48143', 'Deutschland'
75  ], $result->ADR->getParts());
76 
77 
78  }
$result
const OPTION_FORGIVING
If this option is passed to the reader, it will be less strict about the validity of the lines...
Definition: Reader.php:21
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
$data
Definition: bench.php:6
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: