aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-10-21 15:46:31 -0700
committerfriendica <info@friendica.com>2013-10-21 15:46:31 -0700
commitb35122f7a6ad42756c35bb60ba1f06c3dcd45c77 (patch)
treeccdf373ce6475d264778523259cc32899b732fe7 /vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php
parente3504df514d306cfe6b83e44a11f550664564af4 (diff)
downloadvolse-hubzilla-b35122f7a6ad42756c35bb60ba1f06c3dcd45c77.tar.gz
volse-hubzilla-b35122f7a6ad42756c35bb60ba1f06c3dcd45c77.tar.bz2
volse-hubzilla-b35122f7a6ad42756c35bb60ba1f06c3dcd45c77.zip
add sabre (1.8.x) via composer in the !@#$ place it wants to be
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php101
1 files changed, 101 insertions, 0 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php
new file mode 100644
index 000000000..28e43ce08
--- /dev/null
+++ b/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/NodeTest.php
@@ -0,0 +1,101 @@
+<?php
+
+namespace Sabre\CalDAV\Notifications;
+
+use Sabre\CalDAV;
+
+class NodeTest extends \PHPUnit_Framework_TestCase {
+
+ protected $systemStatus;
+ protected $caldavBackend;
+
+ function getInstance() {
+
+ $principalUri = 'principals/user1';
+
+ $this->systemStatus = new Notification\SystemStatus(1,'"1"');
+
+ $this->caldavBackend = new CalDAV\Backend\Mock(array(),array(), array(
+ 'principals/user1' => array(
+ $this->systemStatus
+ )
+ ));
+
+ $node = new Node($this->caldavBackend, 'principals/user1', $this->systemStatus);
+ return $node;
+
+ }
+
+ function testGetId() {
+
+ $node = $this->getInstance();
+ $this->assertEquals($this->systemStatus->getId() . '.xml', $node->getName());
+
+ }
+
+ function testGetEtag() {
+
+ $node = $this->getInstance();
+ $this->assertEquals('"1"', $node->getETag());
+
+ }
+
+ function testGetNotificationType() {
+
+ $node = $this->getInstance();
+ $this->assertEquals($this->systemStatus, $node->getNotificationType());
+
+ }
+
+ function testDelete() {
+
+ $node = $this->getInstance();
+ $node->delete();
+ $this->assertEquals(array(), $this->caldavBackend->getNotificationsForPrincipal('principals/user1'));
+
+ }
+
+ function testGetGroup() {
+
+ $node = $this->getInstance();
+ $this->assertNull($node->getGroup());
+
+ }
+
+ function testGetACL() {
+
+ $node = $this->getInstance();
+ $expected = array(
+ array(
+ 'privilege' => '{DAV:}read',
+ 'principal' => 'principals/user1',
+ 'protected' => true,
+ ),
+ array(
+ 'privilege' => '{DAV:}write',
+ 'principal' => 'principals/user1',
+ 'protected' => true,
+ ),
+ );
+
+ $this->assertEquals($expected, $node->getACL());
+
+ }
+
+ /**
+ * @expectedException Sabre\DAV\Exception\NotImplemented
+ */
+ function testSetACL() {
+
+ $node = $this->getInstance();
+ $node->setACL(array());
+
+ }
+
+ function testGetSupportedPrivilegeSet() {
+
+ $node = $this->getInstance();
+ $this->assertNull($node->getSupportedPrivilegeSet());
+
+ }
+}