Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1817527
InviteReplyTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
InviteReplyTest.php
View Options
<?php
namespace
Sabre\CalDAV\Xml\Request
;
use
Sabre\DAV\Xml\XmlTest
;
use
Sabre\CalDAV\SharingPlugin
;
class
InviteReplyTest
extends
XmlTest
{
protected
$elementMap
=
[
'{http://calendarserver.org/ns/}invite-reply'
=>
'Sabre
\\
CalDAV
\\
Xml
\\
Request
\\
InviteReply'
,
];
function
testDeserialize
()
{
$xml
=
<<<XML
<?xml version="1.0"?>
<cs:invite-reply xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:">
<d:href>/principal/1</d:href>
<cs:hosturl><d:href>/calendar/1</d:href></cs:hosturl>
<cs:invite-accepted />
<cs:in-reply-to>blabla</cs:in-reply-to>
<cs:summary>Summary</cs:summary>
</cs:invite-reply>
XML;
$result
=
$this
->
parse
(
$xml
);
$inviteReply
=
new
InviteReply
(
'/principal/1'
,
'/calendar/1'
,
'blabla'
,
'Summary'
,
SharingPlugin
::
STATUS_ACCEPTED
);
$this
->
assertEquals
(
$inviteReply
,
$result
[
'value'
]
);
}
function
testDeserializeDeclined
()
{
$xml
=
<<<XML
<?xml version="1.0"?>
<cs:invite-reply xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:">
<d:href>/principal/1</d:href>
<cs:hosturl><d:href>/calendar/1</d:href></cs:hosturl>
<cs:invite-declined />
<cs:in-reply-to>blabla</cs:in-reply-to>
<cs:summary>Summary</cs:summary>
</cs:invite-reply>
XML;
$result
=
$this
->
parse
(
$xml
);
$inviteReply
=
new
InviteReply
(
'/principal/1'
,
'/calendar/1'
,
'blabla'
,
'Summary'
,
SharingPlugin
::
STATUS_DECLINED
);
$this
->
assertEquals
(
$inviteReply
,
$result
[
'value'
]
);
}
/**
* @expectedException \Sabre\DAV\Exception\BadRequest
*/
function
testDeserializeNoHostUrl
()
{
$xml
=
<<<XML
<?xml version="1.0"?>
<cs:invite-reply xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:">
<d:href>/principal/1</d:href>
<cs:invite-declined />
<cs:in-reply-to>blabla</cs:in-reply-to>
<cs:summary>Summary</cs:summary>
</cs:invite-reply>
XML;
$this
->
parse
(
$xml
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Dec 21, 3:27 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914257
Default Alt Text
InviteReplyTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment