public function testSyncSupport()
 {
     // create a new address book
     $this->backend->createAddressBook(self::UNIT_TEST_USER, 'Example', []);
     $books = $this->backend->getAddressBooksForUser(self::UNIT_TEST_USER);
     $this->assertEquals(1, count($books));
     $bookId = $books[0]['id'];
     // fist call without synctoken
     $changes = $this->backend->getChangesForAddressBook($bookId, '', 1);
     $syncToken = $changes['syncToken'];
     // add a change
     $uri0 = $this->getUniqueID('card');
     $this->backend->createCard($bookId, $uri0, '');
     // look for changes
     $changes = $this->backend->getChangesForAddressBook($bookId, $syncToken, 1);
     $this->assertEquals($uri0, $changes['added'][0]);
 }
 public function testSyncSupport()
 {
     $this->backend = $this->getMockBuilder('OCA\\DAV\\CardDAV\\CardDavBackend')->setConstructorArgs([$this->db, $this->principal, null])->setMethods(['updateProperties'])->getMock();
     // create a new address book
     $this->backend->createAddressBook(self::UNIT_TEST_USER, 'Example', []);
     $books = $this->backend->getAddressBooksForUser(self::UNIT_TEST_USER);
     $this->assertEquals(1, count($books));
     $bookId = $books[0]['id'];
     // fist call without synctoken
     $changes = $this->backend->getChangesForAddressBook($bookId, '', 1);
     $syncToken = $changes['syncToken'];
     // add a change
     $uri0 = $this->getUniqueID('card');
     $this->backend->createCard($bookId, $uri0, '');
     // look for changes
     $changes = $this->backend->getChangesForAddressBook($bookId, $syncToken, 1);
     $this->assertEquals($uri0, $changes['added'][0]);
 }