diff options
author | Florin Peter <github@florin-peter.de> | 2013-05-20 02:25:56 +0200 |
---|---|---|
committer | Florin Peter <github@florin-peter.de> | 2013-05-20 02:25:56 +0200 |
commit | 31037241e11122203f2ea73b6c1b126a14bfdae2 (patch) | |
tree | c783857d7a61c48d913a252fb05e99e6389fb937 /tests | |
parent | 58a8d67a9b3c48567bcc40cc02444311c6773275 (diff) | |
parent | 71668cf08a57742c0a585c9e2fe7e4bb0ea08165 (diff) | |
download | nextcloud-server-31037241e11122203f2ea73b6c1b126a14bfdae2.tar.gz nextcloud-server-31037241e11122203f2ea73b6c1b126a14bfdae2.zip |
Merge branch 'master' into files_encryption
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/vobject.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/vobject.php b/tests/lib/vobject.php index 1103a4b3297..f28d22a1fcd 100644 --- a/tests/lib/vobject.php +++ b/tests/lib/vobject.php @@ -10,10 +10,29 @@ class Test_VObject extends PHPUnit_Framework_TestCase { public function setUp() { Sabre\VObject\Property::$classMap['SUMMARY'] = 'OC\VObject\StringProperty'; + Sabre\VObject\Property::$classMap['ORG'] = 'OC\VObject\CompoundProperty'; } function testStringProperty() { $property = Sabre\VObject\Property::create('SUMMARY', 'Escape;this,please'); $this->assertEquals("SUMMARY:Escape\;this\,please\r\n", $property->serialize()); } + + function testCompoundProperty() { + + $arr = array( + 'ABC, Inc.', + 'North American Division', + 'Marketing;Sales', + ); + + $property = Sabre\VObject\Property::create('ORG'); + $property->setParts($arr); + + $this->assertEquals('ABC\, Inc.;North American Division;Marketing\;Sales', $property->value); + $this->assertEquals('ORG:ABC\, Inc.;North American Division;Marketing\;Sales' . "\r\n", $property->serialize()); + $this->assertEquals(3, count($property->getParts())); + $parts = $property->getParts(); + $this->assertEquals('Marketing;Sales', $parts[2]); + } }
\ No newline at end of file |