aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookRootTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookRootTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookRootTest.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookRootTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookRootTest.php
new file mode 100644
index 000000000..6eaff5db0
--- /dev/null
+++ b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookRootTest.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace Sabre\CardDAV;
+
+use Sabre\DAVACL;
+
+class AddressBookRootTest extends \PHPUnit_Framework_TestCase {
+
+ function testGetName() {
+
+ $pBackend = new DAVACL\PrincipalBackend\Mock();
+ $cBackend = new Backend\Mock();
+ $root = new AddressBookRoot($pBackend, $cBackend);
+ $this->assertEquals('addressbooks', $root->getName());
+
+ }
+
+ function testGetChildForPrincipal() {
+
+ $pBackend = new DAVACL\PrincipalBackend\Mock();
+ $cBackend = new Backend\Mock();
+ $root = new AddressBookRoot($pBackend, $cBackend);
+
+ $children = $root->getChildren();
+ $this->assertEquals(3, count($children));
+
+ $this->assertInstanceOf('Sabre\\CardDAV\\UserAddressBooks', $children[0]);
+ $this->assertEquals('user1', $children[0]->getName());
+
+ }
+}