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

Public Member Functions

 testRead ()
 
 testVCard21Parameter ()
 

Detailed Description

Definition at line 7 of file EmptyParameterTest.php.

Member Function Documentation

◆ testRead()

Sabre\VObject\EmptyParameterTest::testRead ( )

Definition at line 9 of file EmptyParameterTest.php.

References Sabre\VObject\$input, $version, Sabre\VObject\Reader\read(), Sabre\VObject\Document\VCARD30, and Sabre\VObject\Version\VERSION.

9  {
10 
11  $input = <<<VCF
12 BEGIN:VCARD
13 VERSION:2.1
14 N:Doe;Jon;;;
15 FN:Jon Doe
16 EMAIL;X-INTERN:foo@example.org
17 UID:foo
18 END:VCARD
19 VCF;
20 
21  $vcard = Reader::read($input);
22 
23  $this->assertInstanceOf('Sabre\\VObject\\Component\\VCard', $vcard);
24  $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD30);
25  $vcard = $vcard->serialize();
26 
27  $converted = Reader::read($vcard);
28  $converted->validate();
29 
30  $this->assertTrue(isset($converted->EMAIL['X-INTERN']));
31 
33 
34  $expected = <<<VCF
35 BEGIN:VCARD
36 VERSION:3.0
37 PRODID:-//Sabre//Sabre VObject $version//EN
38 N:Doe;Jon;;;
39 FN:Jon Doe
40 EMAIL;X-INTERN=:foo@example.org
41 UID:foo
42 END:VCARD
43 
44 VCF;
45 
46  $this->assertEquals($expected, str_replace("\r", "", $vcard));
47 
48  }
if($argc< 3) $input
const VERSION
Full version number.
Definition: Version.php:17
$version
Definition: build.php:27
const VCARD30
vCard 3.0.
Definition: Document.php:44
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:

◆ testVCard21Parameter()

Sabre\VObject\EmptyParameterTest::testVCard21Parameter ( )

Definition at line 50 of file EmptyParameterTest.php.

References $result.

50  {
51 
52  $vcard = new Component\VCard([], false);
53  $vcard->VERSION = '2.1';
54  $vcard->PHOTO = 'random_stuff';
55  $vcard->PHOTO->add(null, 'BASE64');
56  $vcard->UID = 'foo-bar';
57 
58  $result = $vcard->serialize();
59  $expected = [
60  "BEGIN:VCARD",
61  "VERSION:2.1",
62  "PHOTO;BASE64:" . base64_encode('random_stuff'),
63  "UID:foo-bar",
64  "END:VCARD",
65  "",
66  ];
67 
68  $this->assertEquals(implode("\r\n", $expected), $result);
69 
70  }
$result

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