Definition at line 7 of file EmptyParameterTest.php.
◆ testRead()
Sabre\VObject\EmptyParameterTest::testRead |
( |
| ) |
|
Definition at line 9 of file EmptyParameterTest.php.
9 {
10
12BEGIN:VCARD
13VERSION:2.1
14N:Doe;Jon;;;
15FN:Jon Doe
16EMAIL;X-INTERN:foo@example.org
17UID:foo
18END:VCARD
19VCF;
20
22
23 $this->assertInstanceOf('Sabre\\VObject\\Component\\VCard', $vcard);
25 $vcard = $vcard->serialize();
26
28 $converted->validate();
29
30 $this->assertTrue(isset($converted->EMAIL['X-INTERN']));
31
33
34 $expected = <<<VCF
35BEGIN:VCARD
36VERSION:3.0
37PRODID:-
38N:Doe;Jon;;;
39FN:Jon Doe
40EMAIL;X-INTERN=:foo@example.org
41UID:foo
42END:VCARD
43
44VCF;
45
46 $this->assertEquals($expected, str_replace("\r", "", $vcard));
47
48 }
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
const VERSION
Full version number.
foreach($paths as $path) if($argc< 3) $input
References Sabre\VObject\$input, $version, Sabre\VObject\Reader\read(), Sabre\VObject\Document\VCARD30, and Sabre\VObject\Version\VERSION.
◆ testVCard21Parameter()
Sabre\VObject\EmptyParameterTest::testVCard21Parameter |
( |
| ) |
|
Definition at line 50 of file EmptyParameterTest.php.
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
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 }
References $result.
The documentation for this class was generated from the following file: