diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2020-12-08 17:05:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 17:05:38 +0100 |
commit | 86a3b7e7bf419e2bf1acc687625d0ff8596d39dc (patch) | |
tree | e467d21a31f7e78320ee9739ba66dccd4025eb65 /apps/dav/tests | |
parent | fda6ffc866cf8c5d3579fe95d1731ab747894002 (diff) | |
parent | 13a438b3224f3f42a0f552230f680a243e1af705 (diff) | |
download | nextcloud-server-86a3b7e7bf419e2bf1acc687625d0ff8596d39dc.tar.gz nextcloud-server-86a3b7e7bf419e2bf1acc687625d0ff8596d39dc.zip |
Merge pull request #24486 from nextcloud/feature/noid/phone-number-validation
Phone number validation and search
Diffstat (limited to 'apps/dav/tests')
-rw-r--r-- | apps/dav/tests/unit/CardDAV/ConverterTest.php | 17 | ||||
-rw-r--r-- | apps/dav/tests/unit/CardDAV/SyncServiceTest.php | 15 |
2 files changed, 17 insertions, 15 deletions
diff --git a/apps/dav/tests/unit/CardDAV/ConverterTest.php b/apps/dav/tests/unit/CardDAV/ConverterTest.php index 8b4125c6c68..aef5cf8ef1c 100644 --- a/apps/dav/tests/unit/CardDAV/ConverterTest.php +++ b/apps/dav/tests/unit/CardDAV/ConverterTest.php @@ -29,13 +29,14 @@ namespace OCA\DAV\Tests\unit\CardDAV; use OC\Accounts\AccountManager; use OCA\DAV\CardDAV\Converter; +use OCP\Accounts\IAccountManager; use OCP\IImage; use OCP\IUser; use Test\TestCase; class ConverterTest extends TestCase { - /** @var AccountManager | \PHPUnit\Framework\MockObject\MockObject */ + /** @var AccountManager|\PHPUnit\Framework\MockObject\MockObject */ private $accountManager; protected function setUp(): void { @@ -49,36 +50,36 @@ class ConverterTest extends TestCase { ->disableOriginalConstructor()->getMock(); $accountManager->expects($this->any())->method('getUser')->willReturn( [ - AccountManager::PROPERTY_DISPLAYNAME => + IAccountManager::PROPERTY_DISPLAYNAME => [ 'value' => $user->getDisplayName(), 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY, ], - AccountManager::PROPERTY_ADDRESS => + IAccountManager::PROPERTY_ADDRESS => [ 'value' => '', 'scope' => AccountManager::VISIBILITY_PRIVATE, ], - AccountManager::PROPERTY_WEBSITE => + IAccountManager::PROPERTY_WEBSITE => [ 'value' => '', 'scope' => AccountManager::VISIBILITY_PRIVATE, ], - AccountManager::PROPERTY_EMAIL => + IAccountManager::PROPERTY_EMAIL => [ 'value' => $user->getEMailAddress(), 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY, ], - AccountManager::PROPERTY_AVATAR => + IAccountManager::PROPERTY_AVATAR => [ 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY ], - AccountManager::PROPERTY_PHONE => + IAccountManager::PROPERTY_PHONE => [ 'value' => '', 'scope' => AccountManager::VISIBILITY_PRIVATE, ], - AccountManager::PROPERTY_TWITTER => + IAccountManager::PROPERTY_TWITTER => [ 'value' => '', 'scope' => AccountManager::VISIBILITY_PRIVATE, diff --git a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php index 0a474d649bc..eb8186807c6 100644 --- a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php @@ -31,6 +31,7 @@ namespace OCA\DAV\Tests\unit\CardDAV; use OC\Accounts\AccountManager; use OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\CardDAV\SyncService; +use OCP\Accounts\IAccountManager; use OCP\ILogger; use OCP\IUser; use OCP\IUserManager; @@ -132,36 +133,36 @@ class SyncServiceTest extends TestCase { $accountManager = $this->getMockBuilder(AccountManager::class)->disableOriginalConstructor()->getMock(); $accountManager->expects($this->any())->method('getUser') ->willReturn([ - AccountManager::PROPERTY_DISPLAYNAME => + IAccountManager::PROPERTY_DISPLAYNAME => [ 'value' => $user->getDisplayName(), 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY, ], - AccountManager::PROPERTY_ADDRESS => + IAccountManager::PROPERTY_ADDRESS => [ 'value' => '', 'scope' => AccountManager::VISIBILITY_PRIVATE, ], - AccountManager::PROPERTY_WEBSITE => + IAccountManager::PROPERTY_WEBSITE => [ 'value' => '', 'scope' => AccountManager::VISIBILITY_PRIVATE, ], - AccountManager::PROPERTY_EMAIL => + IAccountManager::PROPERTY_EMAIL => [ 'value' => $user->getEMailAddress(), 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY, ], - AccountManager::PROPERTY_AVATAR => + IAccountManager::PROPERTY_AVATAR => [ 'scope' => AccountManager::VISIBILITY_CONTACTS_ONLY ], - AccountManager::PROPERTY_PHONE => + IAccountManager::PROPERTY_PHONE => [ 'value' => '', 'scope' => AccountManager::VISIBILITY_PRIVATE, ], - AccountManager::PROPERTY_TWITTER => + IAccountManager::PROPERTY_TWITTER => [ 'value' => '', 'scope' => AccountManager::VISIBILITY_PRIVATE, |