Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1820504
CompoundTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
CompoundTest.php
View Options
<?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
()));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Dec 22, 4:23 AM (5 d, 6 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
916502
Default Alt Text
CompoundTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment