Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1820827
PropFindTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
PropFindTest.php
View Options
<?php
namespace
Sabre\DAV
;
class
PropFindTest
extends
\PHPUnit_Framework_TestCase
{
function
testHandle
()
{
$propFind
=
new
PropFind
(
'foo'
,
[
'{DAV:}displayname'
]);
$propFind
->
handle
(
'{DAV:}displayname'
,
'foobar'
);
$this
->
assertEquals
([
200
=>
[
'{DAV:}displayname'
=>
'foobar'
],
404
=>
[],
],
$propFind
->
getResultForMultiStatus
());
}
function
testHandleCallBack
()
{
$propFind
=
new
PropFind
(
'foo'
,
[
'{DAV:}displayname'
]);
$propFind
->
handle
(
'{DAV:}displayname'
,
function
()
{
return
'foobar'
;
});
$this
->
assertEquals
([
200
=>
[
'{DAV:}displayname'
=>
'foobar'
],
404
=>
[],
],
$propFind
->
getResultForMultiStatus
());
}
function
testAllPropDefaults
()
{
$propFind
=
new
PropFind
(
'foo'
,
[
'{DAV:}displayname'
],
0
,
PropFind
::
ALLPROPS
);
$this
->
assertEquals
([
200
=>
[],
],
$propFind
->
getResultForMultiStatus
());
}
function
testSet
()
{
$propFind
=
new
PropFind
(
'foo'
,
[
'{DAV:}displayname'
]);
$propFind
->
set
(
'{DAV:}displayname'
,
'bar'
);
$this
->
assertEquals
([
200
=>
[
'{DAV:}displayname'
=>
'bar'
],
404
=>
[],
],
$propFind
->
getResultForMultiStatus
());
}
function
testSetAllpropCustom
()
{
$propFind
=
new
PropFind
(
'foo'
,
[
'{DAV:}displayname'
],
0
,
PropFind
::
ALLPROPS
);
$propFind
->
set
(
'{DAV:}customproperty'
,
'bar'
);
$this
->
assertEquals
([
200
=>
[
'{DAV:}customproperty'
=>
'bar'
],
],
$propFind
->
getResultForMultiStatus
());
}
function
testSetUnset
()
{
$propFind
=
new
PropFind
(
'foo'
,
[
'{DAV:}displayname'
]);
$propFind
->
set
(
'{DAV:}displayname'
,
'bar'
);
$propFind
->
set
(
'{DAV:}displayname'
,
null
);
$this
->
assertEquals
([
200
=>
[],
404
=>
[
'{DAV:}displayname'
=>
null
],
],
$propFind
->
getResultForMultiStatus
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Dec 22, 4:09 PM (3 d, 3 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914829
Default Alt Text
PropFindTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment