aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
committerredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
commit0b02a6d123b2014705998c94ddf3d460948d3eac (patch)
tree78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php
parent40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff)
downloadvolse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.gz
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.bz2
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.zip
initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php56
1 files changed, 53 insertions, 3 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php
index aac749b37..fe8ba9025 100644
--- a/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php
+++ b/vendor/sabre/dav/tests/Sabre/CardDAV/AddressBookTest.php
@@ -2,6 +2,7 @@
namespace Sabre\CardDAV;
+use Sabre\DAV\PropPatch;
require_once 'Sabre/CardDAV/Backend/Mock.php';
@@ -105,9 +106,11 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase {
function testUpdateProperties() {
- $this->assertTrue(
- $this->ab->updateProperties(array('{DAV:}displayname' => 'barrr'))
- );
+ $propPatch = new PropPatch([
+ '{DAV:}displayname' => 'barrr',
+ ]);
+ $this->ab->propPatch($propPatch);
+ $this->assertTrue($propPatch->commit());
$this->assertEquals('barrr', $this->backend->addressBooks[0]['{DAV:}displayname']);
@@ -158,5 +161,52 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase {
}
+ function testGetSyncTokenNoSyncSupport() {
+
+ $this->assertNull($this->ab->getSyncToken());
+
+ }
+ function testGetChangesNoSyncSupport() {
+
+ $this->assertNull($this->ab->getChanges(1,null));
+
+ }
+
+ function testGetSyncToken() {
+
+ if (!SABRE_HASSQLITE) {
+ $this->markTestSkipped('Sqlite is required for this test to run');
+ }
+ $ab = new AddressBook(TestUtil::getBackend(), [ 'id' => 1, '{DAV:}sync-token' => 2]);
+ $this->assertEquals(2, $ab->getSyncToken());
+ TestUtil::deleteSQLiteDB();
+ }
+
+ function testGetSyncToken2() {
+
+ if (!SABRE_HASSQLITE) {
+ $this->markTestSkipped('Sqlite is required for this test to run');
+ }
+ $ab = new AddressBook(TestUtil::getBackend(), [ 'id' => 1, '{http://sabredav.org/ns}sync-token' => 2]);
+ $this->assertEquals(2, $ab->getSyncToken());
+ TestUtil::deleteSQLiteDB();
+ }
+
+ function testGetChanges() {
+
+ if (!SABRE_HASSQLITE) {
+ $this->markTestSkipped('Sqlite is required for this test to run');
+ }
+ $ab = new AddressBook(TestUtil::getBackend(), [ 'id' => 1, '{DAV:}sync-token' => 2]);
+ $this->assertEquals([
+ 'syncToken' => 2,
+ 'modified' => [],
+ 'deleted' => [],
+ 'added' => ['UUID-2345'],
+ ], $ab->getChanges(1, 1));
+ TestUtil::deleteSQLiteDB();
+
+ }
+
}