Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1841861
TestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
TestCase.php
View Options
<?php
namespace
Sabre\VObject
;
class
TestCase
extends
\PHPUnit_Framework_TestCase
{
/**
* This method tests wether two vcards or icalendar objects are
* semantically identical.
*
* It supports objects being supplied as strings, streams or
* Sabre\VObject\Component instances.
*
* PRODID is removed from both objects as this is often variable.
*
* @param resource|string|Component $expected
* @param resource|string|Component $actual
* @param string $message
*/
function
assertVObjEquals
(
$expected
,
$actual
,
$message
=
''
)
{
$self
=
$this
;
$getObj
=
function
(
$input
)
use
(
$self
)
{
if
(
is_resource
(
$input
))
{
$input
=
stream_get_contents
(
$input
);
}
if
(
is_string
(
$input
))
{
$input
=
Reader
::
read
(
$input
);
}
if
(!
$input
instanceof
Component
)
{
$this
->
fail
(
'Input must be a string, stream or VObject component'
);
}
unset
(
$input
->
PRODID
);
return
$input
;
};
$expected
=
$getObj
(
$expected
);
$actual
=
$getObj
(
$actual
);
$this
->
assertEquals
(
$expected
->
serialize
(),
$actual
->
serialize
(),
$message
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jan 7, 7:41 PM (16 h, 46 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
915807
Default Alt Text
TestCase.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment