aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-20 02:25:56 +0200
committerFlorin Peter <github@florin-peter.de>2013-05-20 02:25:56 +0200
commit31037241e11122203f2ea73b6c1b126a14bfdae2 (patch)
treec783857d7a61c48d913a252fb05e99e6389fb937 /tests
parent58a8d67a9b3c48567bcc40cc02444311c6773275 (diff)
parent71668cf08a57742c0a585c9e2fe7e4bb0ea08165 (diff)
downloadnextcloud-server-31037241e11122203f2ea73b6c1b126a14bfdae2.tar.gz
nextcloud-server-31037241e11122203f2ea73b6c1b126a14bfdae2.zip
Merge branch 'master' into files_encryption
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/vobject.php19
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