@@ 22-33 (lines=12) @@ | ||
19 | \Sabre\VObject\Component\VCard::$propertyMap['CATEGORIES'] = 'OCA\Contacts\VObject\GroupProperty'; |
|
20 | } |
|
21 | ||
22 | public function testCrappyVCard() { |
|
23 | $cardData = file_get_contents(__DIR__ . '/../data/test3.vcf'); |
|
24 | $obj = \Sabre\VObject\Reader::read( |
|
25 | $cardData, |
|
26 | \Sabre\VObject\Reader::OPTION_IGNORE_INVALID_LINES |
|
27 | ); |
|
28 | $obj->validate($obj::REPAIR); |
|
29 | ||
30 | $this->assertEquals('2.1', (string)$obj->VERSION); |
|
31 | $this->assertEquals('Adèle Fermée', (string)$obj->FN); |
|
32 | $this->assertEquals('Fermée;Adèle;;;', (string)$obj->N); |
|
33 | } |
|
34 | ||
35 | public function testEscapedParameters() { |
|
36 | $cardData = file_get_contents(__DIR__ . '/../data/test6.vcf'); |
|
@@ 35-46 (lines=12) @@ | ||
32 | $this->assertEquals('Fermée;Adèle;;;', (string)$obj->N); |
|
33 | } |
|
34 | ||
35 | public function testEscapedParameters() { |
|
36 | $cardData = file_get_contents(__DIR__ . '/../data/test6.vcf'); |
|
37 | $obj = \Sabre\VObject\Reader::read( |
|
38 | $cardData, |
|
39 | \Sabre\VObject\Reader::OPTION_IGNORE_INVALID_LINES |
|
40 | ); |
|
41 | $obj->validate($obj::REPAIR); |
|
42 | ||
43 | $this->assertEquals('3.0', (string)$obj->VERSION); |
|
44 | $this->assertEquals('Parameters;Escaped;;;', (string)$obj->N); |
|
45 | $this->assertEquals('TEL;TYPE=PREF\,WORK\,VOICE:123456789' . "\r\n", $obj->TEL->serialize()); |
|
46 | } |
|
47 | ||
48 | public function testGroupProperty() { |
|
49 | $arr = array( |