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

Public Member Functions

 assertVCard21Serialization ($propValue, $expected)
 
 testSerializeVCard21 ()
 
 testSerializeVCard21Array ()
 
 testSerializeVCard21Fold ()
 
 testSerializeQuotedPrintable ()
 
 testSerializeQuotedPrintableFold ()
 
 testValidateMinimumPropValue ()
 

Detailed Description

Definition at line 8 of file TextTest.php.

Member Function Documentation

◆ assertVCard21Serialization()

Sabre\VObject\Property\TextTest::assertVCard21Serialization (   $propValue,
  $expected 
)

Definition at line 10 of file TextTest.php.

10 {
11
12 $doc = new VCard([
13 'VERSION' => '2.1',
14 'PROP' => $propValue
15 ], false);
16
17 // Adding quoted-printable, because we're testing if it gets removed
18 // automatically.
19 $doc->PROP['ENCODING'] = 'QUOTED-PRINTABLE';
20 $doc->PROP['P1'] = 'V1';
21
22
23 $output = $doc->serialize();
24
25
26 $this->assertEquals("BEGIN:VCARD\r\nVERSION:2.1\r\n$expected\r\nEND:VCARD\r\n", $output);
27
28 }

References Sabre\VObject\$output.

Referenced by Sabre\VObject\Property\TextTest\testSerializeQuotedPrintable(), Sabre\VObject\Property\TextTest\testSerializeQuotedPrintableFold(), Sabre\VObject\Property\TextTest\testSerializeVCard21(), Sabre\VObject\Property\TextTest\testSerializeVCard21Array(), and Sabre\VObject\Property\TextTest\testSerializeVCard21Fold().

+ Here is the caller graph for this function:

◆ testSerializeQuotedPrintable()

Sabre\VObject\Property\TextTest::testSerializeQuotedPrintable ( )

Definition at line 58 of file TextTest.php.

58 {
59
61 "foo\r\nbar",
62 'PROP;P1=V1;ENCODING=QUOTED-PRINTABLE:foo=0D=0Abar'
63 );
64 }
assertVCard21Serialization($propValue, $expected)
Definition: TextTest.php:10

References Sabre\VObject\Property\TextTest\assertVCard21Serialization().

+ Here is the call graph for this function:

◆ testSerializeQuotedPrintableFold()

Sabre\VObject\Property\TextTest::testSerializeQuotedPrintableFold ( )

Definition at line 66 of file TextTest.php.

66 {
67
69 "foo\r\nbarxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
70 "PROP;P1=V1;ENCODING=QUOTED-PRINTABLE:foo=0D=0Abarxxxxxxxxxxxxxxxxxxxxxxxxxx=\r\n xxx"
71 );
72
73 }

References Sabre\VObject\Property\TextTest\assertVCard21Serialization().

+ Here is the call graph for this function:

◆ testSerializeVCard21()

Sabre\VObject\Property\TextTest::testSerializeVCard21 ( )

Definition at line 30 of file TextTest.php.

30 {
31
33 'f;oo',
34 'PROP;P1=V1:f;oo'
35 );
36
37 }

References Sabre\VObject\Property\TextTest\assertVCard21Serialization().

+ Here is the call graph for this function:

◆ testSerializeVCard21Array()

Sabre\VObject\Property\TextTest::testSerializeVCard21Array ( )

Definition at line 39 of file TextTest.php.

39 {
40
42 ['f;oo', 'bar'],
43 'PROP;P1=V1:f\;oo;bar'
44 );
45
46 }

References Sabre\VObject\Property\TextTest\assertVCard21Serialization().

+ Here is the call graph for this function:

◆ testSerializeVCard21Fold()

Sabre\VObject\Property\TextTest::testSerializeVCard21Fold ( )

Definition at line 47 of file TextTest.php.

47 {
48
50 str_repeat('x', 80),
51 'PROP;P1=V1:' . str_repeat('x', 64) . "\r\n " . str_repeat('x', 16)
52 );
53
54 }

References Sabre\VObject\Property\TextTest\assertVCard21Serialization().

+ Here is the call graph for this function:

◆ testValidateMinimumPropValue()

Sabre\VObject\Property\TextTest::testValidateMinimumPropValue ( )

Definition at line 75 of file TextTest.php.

75 {
76
77 $vcard = <<<IN
78BEGIN:VCARD
79VERSION:4.0
80UID:foo
81FN:Hi!
82N:A
83END:VCARD
84IN;
85
86 $vcard = \Sabre\VObject\Reader::read($vcard);
87 $this->assertEquals(1, count($vcard->validate()));
88
89 $this->assertEquals(1, count($vcard->N->getParts()));
90
91 $vcard->validate(\Sabre\VObject\Node::REPAIR);
92
93 $this->assertEquals(5, count($vcard->N->getParts()));
94
95 }
count()
Returns the number of elements.
Definition: Node.php:177
const REPAIR
The following constants are used by the validate() method.
Definition: Node.php:27
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42

References Sabre\VObject\Node\count(), Sabre\VObject\Reader\read(), and Sabre\VObject\Node\REPAIR.

+ Here is the call graph for this function:

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