use OCA\DAV\Connector\Sabre\Principal;
\OC::$server->registerService('CardDAVSyncService', function() {
+
+ $config = \OC::$server->getConfig();
+ $userManager = \OC::$server->getUserManager();
+ $dbConnection = \OC::$server->getDatabaseConnection();
+
$principalBackend = new Principal(
- $this->config,
- $this->userManager
+ $config,
+ $userManager
);
- $backend = new CardDavBackend($this->dbConnection, $principalBackend);
+ $backend = new CardDavBackend($dbConnection, $principalBackend);
return new SyncService($backend);
});
}
/**
- * @param string|null $synToken
+ * @param string|null $syncToken
* @return string
*/
- private function buildSyncCollectionRequestBody($synToken) {
+ private function buildSyncCollectionRequestBody($syncToken) {
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->formatOutput = true;
$root = $dom->createElementNS('DAV:', 'd:sync-collection');
- $sync = $dom->createElement('d:sync-token', $synToken);
+ $sync = $dom->createElement('d:sync-token', $syncToken);
$prop = $dom->createElement('d:prop');
$cont = $dom->createElement('d:getcontenttype');
$etag = $dom->createElement('d:getetag');
public function testSyncWithDeletedElement() {
$backend = $this->getBackendMock(0, 0, 1);
-// $backend->method('getCard')->willReturn(true);
$ss = $this->getSyncServiceMock($backend, ['0' => [404 => '']]);
$return = $ss->syncRemoteAddressBook('', 'system', '1234567890', null, '1', 'principals/system/system', []);