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.

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

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  }
+ Here is the caller graph for this function:

◆ testSerializeQuotedPrintable()

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

Definition at line 58 of file TextTest.php.

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

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
+ Here is the call graph for this function:

◆ testSerializeQuotedPrintableFold()

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

Definition at line 66 of file TextTest.php.

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

66  {
67 
69  "foo\r\nbarxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
70  "PROP;P1=V1;ENCODING=QUOTED-PRINTABLE:foo=0D=0Abarxxxxxxxxxxxxxxxxxxxxxxxxxx=\r\n xxx"
71  );
72 
73  }
assertVCard21Serialization($propValue, $expected)
Definition: TextTest.php:10
+ Here is the call graph for this function:

◆ testSerializeVCard21()

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

Definition at line 30 of file TextTest.php.

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

30  {
31 
33  'f;oo',
34  'PROP;P1=V1:f;oo'
35  );
36 
37  }
assertVCard21Serialization($propValue, $expected)
Definition: TextTest.php:10
+ Here is the call graph for this function:

◆ testSerializeVCard21Array()

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

Definition at line 39 of file TextTest.php.

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

39  {
40 
42  ['f;oo', 'bar'],
43  'PROP;P1=V1:f\;oo;bar'
44  );
45 
46  }
assertVCard21Serialization($propValue, $expected)
Definition: TextTest.php:10
+ Here is the call graph for this function:

◆ testSerializeVCard21Fold()

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

Definition at line 47 of file TextTest.php.

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

47  {
48 
50  str_repeat('x', 80),
51  'PROP;P1=V1:' . str_repeat('x', 64) . "\r\n " . str_repeat('x', 16)
52  );
53 
54  }
assertVCard21Serialization($propValue, $expected)
Definition: TextTest.php:10
+ Here is the call graph for this function:

◆ testValidateMinimumPropValue()

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

Definition at line 75 of file TextTest.php.

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

75  {
76 
77  $vcard = <<<IN
78 BEGIN:VCARD
79 VERSION:4.0
80 UID:foo
81 FN:Hi!
82 N:A
83 END:VCARD
84 IN;
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  }
const REPAIR
The following constants are used by the validate() method.
Definition: Node.php:27
count()
Returns the number of elements.
Definition: Node.php:177
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
+ Here is the call graph for this function:

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