summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/CardDAV/SyncServiceTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit/CardDAV/SyncServiceTest.php')
-rw-r--r--apps/dav/tests/unit/CardDAV/SyncServiceTest.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php
index 32f8a2424b1..debc9238067 100644
--- a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php
+++ b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php
@@ -28,6 +28,7 @@ namespace OCA\DAV\Tests\unit\CardDAV;
use OC\Accounts\AccountManager;
use OCA\DAV\CardDAV\CardDavBackend;
use OCA\DAV\CardDAV\SyncService;
+use OCP\ILogger;
use OCP\IUser;
use OCP\IUserManager;
use Test\TestCase;
@@ -75,9 +76,9 @@ class SyncServiceTest extends TestCase {
$backend->expects($this->at(1))->method('getAddressBooksByUri')->willReturn([]);
/** @var IUserManager $userManager */
- $userManager = $this->getMockBuilder('OCP\IUserManager')->disableOriginalConstructor()->getMock();
- $logger = $this->getMockBuilder('OCP\ILogger')->disableOriginalConstructor()->getMock();
- $accountManager = $this->getMockBuilder('OC\Accounts\AccountManager')->disableOriginalConstructor()->getMock();
+ $userManager = $this->getMockBuilder(IUserManager::class)->disableOriginalConstructor()->getMock();
+ $logger = $this->getMockBuilder(ILogger::class)->disableOriginalConstructor()->getMock();
+ $accountManager = $this->getMockBuilder(AccountManager::class)->disableOriginalConstructor()->getMock();
$ss = new SyncService($backend, $userManager, $logger, $accountManager);
$book = $ss->ensureSystemAddressBookExists('principals/users/adam', 'contacts', []);
}
@@ -85,7 +86,7 @@ class SyncServiceTest extends TestCase {
public function testUpdateAndDeleteUser() {
/** @var CardDavBackend | \PHPUnit_Framework_MockObject_MockObject $backend */
$backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock();
- $logger = $this->getMockBuilder('OCP\ILogger')->disableOriginalConstructor()->getMock();
+ $logger = $this->getMockBuilder(ILogger::class)->disableOriginalConstructor()->getMock();
$backend->expects($this->once())->method('createCard');
$backend->expects($this->once())->method('updateCard');
@@ -96,15 +97,15 @@ class SyncServiceTest extends TestCase {
]);
/** @var IUserManager | \PHPUnit_Framework_MockObject_MockObject $userManager */
- $userManager = $this->getMockBuilder('OCP\IUserManager')->disableOriginalConstructor()->getMock();
+ $userManager = $this->getMockBuilder(IUserManager::class)->disableOriginalConstructor()->getMock();
/** @var IUser | \PHPUnit_Framework_MockObject_MockObject $user */
- $user = $this->getMockBuilder('OCP\IUser')->disableOriginalConstructor()->getMock();
+ $user = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
$user->method('getBackendClassName')->willReturn('unittest');
$user->method('getUID')->willReturn('test-user');
$user->method('getCloudId')->willReturn('cloudId');
$user->method('getDisplayName')->willReturn('test-user');
- $accountManager = $this->getMockBuilder('OC\Accounts\AccountManager')->disableOriginalConstructor()->getMock();
+ $accountManager = $this->getMockBuilder(AccountManager::class)->disableOriginalConstructor()->getMock();
$accountManager->expects($this->any())->method('getUser')
->willReturn([
AccountManager::PROPERTY_DISPLAYNAME =>
@@ -174,9 +175,9 @@ class SyncServiceTest extends TestCase {
* @return SyncService|\PHPUnit_Framework_MockObject_MockObject
*/
private function getSyncServiceMock($backend, $response) {
- $userManager = $this->getMockBuilder('OCP\IUserManager')->disableOriginalConstructor()->getMock();
- $logger = $this->getMockBuilder('OCP\ILogger')->disableOriginalConstructor()->getMock();
- $accountManager = $this->getMockBuilder('OC\Accounts\AccountManager')->disableOriginalConstructor()->getMock();
+ $userManager = $this->getMockBuilder(IUserManager::class)->disableOriginalConstructor()->getMock();
+ $logger = $this->getMockBuilder(ILogger::class)->disableOriginalConstructor()->getMock();
+ $accountManager = $this->getMockBuilder(AccountManager::class)->disableOriginalConstructor()->getMock();
/** @var SyncService | \PHPUnit_Framework_MockObject_MockObject $ss */
$ss = $this->getMockBuilder(SyncService::class)
->setMethods(['ensureSystemAddressBookExists', 'requestSyncReport', 'download', 'getCertPath'])