ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PrincipalCollectionTest.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAVACL;
4
6
7 function testBasic() {
8
9 $backend = new PrincipalBackend\Mock();
10 $pc = new PrincipalCollection($backend);
11 $this->assertTrue($pc instanceof PrincipalCollection);
12
13 $this->assertEquals('principals', $pc->getName());
14
15 }
16
20 function testGetChildren() {
21
22 $backend = new PrincipalBackend\Mock();
23 $pc = new PrincipalCollection($backend);
24
25 $children = $pc->getChildren();
26 $this->assertTrue(is_array($children));
27
28 foreach ($children as $child) {
29 $this->assertTrue($child instanceof IPrincipal);
30 }
31
32 }
33
39
40 $backend = new PrincipalBackend\Mock();
41 $pc = new PrincipalCollection($backend);
42 $pc->disableListing = true;
43
44 $children = $pc->getChildren();
45
46 }
47
48 function testFindByUri() {
49
50 $backend = new PrincipalBackend\Mock();
51 $pc = new PrincipalCollection($backend);
52 $this->assertEquals('principals/user1', $pc->findByUri('mailto:user1.sabredav@sabredav.org'));
53 $this->assertNull($pc->findByUri('mailto:fake.user.sabredav@sabredav.org'));
54 $this->assertNull($pc->findByUri(''));
55 }
56
57}
An exception for terminatinating execution or to throw for unit testing.
testGetChildrenDisable()
@depends testBasic @expectedException Sabre\DAV\Exception\MethodNotAllowed
IPrincipal interface.
Definition: IPrincipal.php:16