]> source.dussan.org Git - nextcloud-server.git/commitdiff
Address comments
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 16 Dec 2015 20:04:54 +0000 (21:04 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 12 Jan 2016 13:24:47 +0000 (14:24 +0100)
apps/dav/appinfo/app.php
apps/dav/lib/carddav/syncservice.php
apps/dav/tests/unit/carddav/syncservicetest.php

index d09003e19c0ea4f848dd047fd1454ca0b67e6aa1..9d092d84eb4ca222cf4af42a526ee764527c2b15 100644 (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);
 });
index dbe10bbcc81d45b319f74ce708314a9588c11d81..494db61d9892d0a0fd221cf61c3d94b6936678a6 100644 (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');
index f1ef934b8c6549992cca44f1bf47544562e6af0c..a6a773babc2641f165b6b5203812f95fa4a8636f 100644 (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', []);