Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1820035
PrincipalCollectionTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
PrincipalCollectionTest.php
View Options
<?php
namespace
Sabre\DAVACL
;
use
Sabre\DAV
;
use
Sabre\HTTP
;
class
PrincipalCollectionTest
extends
\PHPUnit_Framework_TestCase
{
public
function
testBasic
()
{
$backend
=
new
PrincipalBackend\Mock
();
$pc
=
new
PrincipalCollection
(
$backend
);
$this
->
assertTrue
(
$pc
instanceof
PrincipalCollection
);
$this
->
assertEquals
(
'principals'
,
$pc
->
getName
());
}
/**
* @depends testBasic
*/
public
function
testGetChildren
()
{
$backend
=
new
PrincipalBackend\Mock
();
$pc
=
new
PrincipalCollection
(
$backend
);
$children
=
$pc
->
getChildren
();
$this
->
assertTrue
(
is_array
(
$children
));
foreach
(
$children
as
$child
)
{
$this
->
assertTrue
(
$child
instanceof
IPrincipal
);
}
}
/**
* @depends testBasic
* @expectedException Sabre\DAV\Exception\MethodNotAllowed
*/
public
function
testGetChildrenDisable
()
{
$backend
=
new
PrincipalBackend\Mock
();
$pc
=
new
PrincipalCollection
(
$backend
);
$pc
->
disableListing
=
true
;
$children
=
$pc
->
getChildren
();
}
public
function
testFindByUri
()
{
$backend
=
new
PrincipalBackend\Mock
();
$pc
=
new
PrincipalCollection
(
$backend
);
$this
->
assertEquals
(
'principals/user1'
,
$pc
->
findByUri
(
'mailto:user1.sabredav@sabredav.org'
));
$this
->
assertNull
(
$pc
->
findByUri
(
'mailto:fake.user.sabredav@sabredav.org'
));
$this
->
assertNull
(
$pc
->
findByUri
(
''
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Dec 21, 5:47 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914630
Default Alt Text
PrincipalCollectionTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment