3 require_once 'Sabre/DAVACL/MockPrincipalBackend.php';
5 class Sabre_DAVACL_PrincipalCollectionTest extends PHPUnit_Framework_TestCase {
7 public function testBasic() {
9 $backend = new Sabre_DAVACL_MockPrincipalBackend();
10 $pc = new Sabre_DAVACL_PrincipalCollection($backend);
11 $this->assertTrue($pc instanceof Sabre_DAVACL_PrincipalCollection);
13 $this->assertEquals('principals',$pc->getName());
20 public function testGetChildren() {
22 $backend = new Sabre_DAVACL_MockPrincipalBackend();
23 $pc = new Sabre_DAVACL_PrincipalCollection($backend);
25 $children = $pc->getChildren();
26 $this->assertTrue(is_array($children));
28 foreach($children as $child) {
29 $this->assertTrue($child instanceof Sabre_DAVACL_IPrincipal);
36 * @expectedException Sabre_DAV_Exception_MethodNotAllowed
38 public function testGetChildrenDisable() {
40 $backend = new Sabre_DAVACL_MockPrincipalBackend();
41 $pc = new Sabre_DAVACL_PrincipalCollection($backend);
42 $pc->disableListing = true;
44 $children = $pc->getChildren();