Address comments

This commit is contained in:
Thomas Müller 2015-12-16 21:04:54 +01:00
parent 451ab84d11
commit 06dac9726e
3 changed files with 11 additions and 7 deletions

View File

@ -24,12 +24,17 @@ use OCA\DAV\CardDAV\SyncService;
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);
});

View File

@ -141,15 +141,15 @@ class SyncService {
}
/**
* @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');

View File

@ -51,7 +51,6 @@ class SyncServiceTest extends TestCase {
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', []);