From 0956b493b6394a6ea3c748fa5dd0910bc697ba8a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 25 Sep 2023 15:33:40 +0200 Subject: fix(phonenumber): Use the newly introduced API to limit 3rdparty lib usage Signed-off-by: Joas Schilling --- tests/lib/Accounts/AccountManagerTest.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/lib/Accounts/AccountManagerTest.php b/tests/lib/Accounts/AccountManagerTest.php index d12dfbfacea..3d0bee5902f 100644 --- a/tests/lib/Accounts/AccountManagerTest.php +++ b/tests/lib/Accounts/AccountManagerTest.php @@ -26,6 +26,7 @@ namespace Test\Accounts; use OC\Accounts\Account; use OC\Accounts\AccountManager; +use OC\PhoneNumberUtil; use OCA\Settings\BackgroundJobs\VerifyUserData; use OCP\Accounts\IAccountManager; use OCP\Accounts\UserUpdatedEvent; @@ -34,6 +35,7 @@ use OCP\Defaults; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IDBConnection; +use OCP\IPhoneNumberUtil; use OCP\IURLGenerator; use OCP\IUser; use OCP\L10N\IFactory; @@ -75,6 +77,8 @@ class AccountManagerTest extends TestCase { /** @var IJobList|MockObject */ private $jobList; + /** @var IPhoneNumberUtil */ + private $phoneNumberUtil; /** accounts table name */ private string $table = 'accounts'; @@ -97,6 +101,7 @@ class AccountManagerTest extends TestCase { $this->l10nFactory = $this->createMock(IFactory::class); $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->crypto = $this->createMock(ICrypto::class); + $this->phoneNumberUtil = new PhoneNumberUtil(); $this->accountManager = new AccountManager( $this->connection, @@ -109,7 +114,8 @@ class AccountManagerTest extends TestCase { $this->defaults, $this->l10nFactory, $this->urlGenerator, - $this->crypto + $this->crypto, + $this->phoneNumberUtil, ); } @@ -473,7 +479,8 @@ class AccountManagerTest extends TestCase { $this->defaults, $this->l10nFactory, $this->urlGenerator, - $this->crypto + $this->crypto, + $this->phoneNumberUtil, ]) ->onlyMethods($mockedMethods) ->getMock(); -- cgit v1.2.3