Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1820948
SyncCollectionTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
2 KB
Subscribers
None
SyncCollectionTest.php
View Options
<?php
namespace
Sabre\DAV\Xml\Request
;
use
Sabre\DAV\Xml\XmlTest
;
class
SyncCollectionTest
extends
XmlTest
{
function
testDeserializeProp
()
{
$xml
=
'<?xml version="1.0"?>
<d:sync-collection xmlns:d="DAV:">
<d:sync-token />
<d:sync-level>1</d:sync-level>
<d:prop>
<d:foo />
</d:prop>
</d:sync-collection>
'
;
$result
=
$this
->
parse
(
$xml
,
[
'{DAV:}sync-collection'
=>
'Sabre
\\
DAV
\\
Xml
\\
Request
\S
yncCollectionReport'
]);
$elem
=
new
SyncCollectionReport
();
$elem
->
syncLevel
=
1
;
$elem
->
properties
=
[
'{DAV:}foo'
];
$this
->
assertEquals
(
$elem
,
$result
[
'value'
]);
}
function
testDeserializeLimit
()
{
$xml
=
'<?xml version="1.0"?>
<d:sync-collection xmlns:d="DAV:">
<d:sync-token />
<d:sync-level>1</d:sync-level>
<d:prop>
<d:foo />
</d:prop>
<d:limit><d:nresults>5</d:nresults></d:limit>
</d:sync-collection>
'
;
$result
=
$this
->
parse
(
$xml
,
[
'{DAV:}sync-collection'
=>
'Sabre
\\
DAV
\\
Xml
\\
Request
\S
yncCollectionReport'
]);
$elem
=
new
SyncCollectionReport
();
$elem
->
syncLevel
=
1
;
$elem
->
properties
=
[
'{DAV:}foo'
];
$elem
->
limit
=
5
;
$this
->
assertEquals
(
$elem
,
$result
[
'value'
]);
}
function
testDeserializeInfinity
()
{
$xml
=
'<?xml version="1.0"?>
<d:sync-collection xmlns:d="DAV:">
<d:sync-token />
<d:sync-level>infinity</d:sync-level>
<d:prop>
<d:foo />
</d:prop>
</d:sync-collection>
'
;
$result
=
$this
->
parse
(
$xml
,
[
'{DAV:}sync-collection'
=>
'Sabre
\\
DAV
\\
Xml
\\
Request
\S
yncCollectionReport'
]);
$elem
=
new
SyncCollectionReport
();
$elem
->
syncLevel
=
\Sabre\DAV\Server
::
DEPTH_INFINITY
;
$elem
->
properties
=
[
'{DAV:}foo'
];
$this
->
assertEquals
(
$elem
,
$result
[
'value'
]);
}
/**
* @expectedException \Sabre\DAV\Exception\BadRequest
*/
function
testDeserializeMissingElem
()
{
$xml
=
'<?xml version="1.0"?>
<d:sync-collection xmlns:d="DAV:">
<d:sync-token />
</d:sync-collection>
'
;
$result
=
$this
->
parse
(
$xml
,
[
'{DAV:}sync-collection'
=>
'Sabre
\\
DAV
\\
Xml
\\
Request
\S
yncCollectionReport'
]);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Dec 22, 10:55 PM (2 d, 20 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914668
Default Alt Text
SyncCollectionTest.php (2 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment