Mercurial > hg > rc1
view vendor/sabre/vobject/tests/VObject/Property/CompoundTest.php @ 43:771f6803cc4b default tip
somehow lost the correctly updated metadata so e.g. 'mail' package wasn't being imported
author | Charlie Root |
---|---|
date | Sun, 26 Jan 2025 13:13:49 -0500 |
parents | 430dbd5346f7 |
children |
line wrap: on
line source
<?php namespace Sabre\VObject\Property; use Sabre\VObject\Component\VCard; class CompoundTest extends \PHPUnit_Framework_TestCase { function testSetParts() { $arr = array( 'ABC, Inc.', 'North American Division', 'Marketing;Sales', ); $vcard = new VCard(); $elem = $vcard->createProperty('ORG'); $elem->setParts($arr); $this->assertEquals('ABC\, Inc.;North American Division;Marketing\;Sales', $elem->getValue()); $this->assertEquals(3, count($elem->getParts())); $parts = $elem->getParts(); $this->assertEquals('Marketing;Sales', $parts[2]); } function testGetParts() { $str = 'ABC\, Inc.;North American Division;Marketing\;Sales'; $vcard = new VCard(); $elem = $vcard->createProperty('ORG'); $elem->setRawMimeDirValue($str); $this->assertEquals(3, count($elem->getParts())); $parts = $elem->getParts(); $this->assertEquals('Marketing;Sales', $parts[2]); } function testGetPartsNull() { $vcard = new VCard(); $elem = $vcard->createProperty('ORG', null); $this->assertEquals(0, count($elem->getParts())); } }