diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-08-20 19:59:08 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-09-09 14:03:35 +0200 |
commit | aacaad2a3f56893c6be463ec7a21c868322654ee (patch) | |
tree | 0e995c930501cae44ba49ff707ddc896c6048093 /tests/lib | |
parent | 19cc757531959a14df40a79d550c82b39e4bc5a2 (diff) | |
download | nextcloud-server-aacaad2a3f56893c6be463ec7a21c868322654ee.tar.gz nextcloud-server-aacaad2a3f56893c6be463ec7a21c868322654ee.zip |
implement verification for additional mails
- mails added by (sub)admins are automatically verified
- provisioning_api controller as verification endpoint
- IAccountProperty gets a locallyVerified property
- IPropertyCollection gets a method to fetch an IAccountProperty by value
- an remove equivalent was already present
- AccountManager always initiates mail verification on update if necessary
- add core success template for arbitrary title and message
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Accounts/AccountManagerTest.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/lib/Accounts/AccountManagerTest.php b/tests/lib/Accounts/AccountManagerTest.php index 8ed0e29d7ce..bf79d233131 100644 --- a/tests/lib/Accounts/AccountManagerTest.php +++ b/tests/lib/Accounts/AccountManagerTest.php @@ -25,9 +25,15 @@ use OC\Accounts\Account; use OC\Accounts\AccountManager; use OCP\Accounts\IAccountManager; use OCP\BackgroundJob\IJobList; +use OCP\Defaults; use OCP\IConfig; use OCP\IDBConnection; +use OCP\IURLGenerator; use OCP\IUser; +use OCP\L10N\IFactory; +use OCP\Mail\IMailer; +use OCP\Security\ICrypto; +use OCP\Security\VerificationToken\IVerificationToken; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -41,6 +47,18 @@ use Test\TestCase; * @package Test\Accounts */ class AccountManagerTest extends TestCase { + /** @var IVerificationToken|MockObject */ + protected $verificationToken; + /** @var IMailer|MockObject */ + protected $mailer; + /** @var ICrypto|MockObject */ + protected $crypto; + /** @var IURLGenerator|MockObject */ + protected $urlGenerator; + /** @var Defaults|MockObject */ + protected $defaults; + /** @var IFactory|MockObject */ + protected $l10nFactory; /** @var \OCP\IDBConnection */ private $connection; @@ -70,6 +88,12 @@ class AccountManagerTest extends TestCase { $this->config = $this->createMock(IConfig::class); $this->jobList = $this->createMock(IJobList::class); $this->logger = $this->createMock(LoggerInterface::class); + $this->verificationToken = $this->createMock(IVerificationToken::class); + $this->mailer = $this->createMock(IMailer::class); + $this->defaults = $this->createMock(Defaults::class); + $this->l10nFactory = $this->createMock(IFactory::class); + $this->urlGenerator = $this->createMock(IURLGenerator::class); + $this->crypto = $this->createMock(ICrypto::class); $this->accountManager = new AccountManager( $this->connection, @@ -77,6 +101,12 @@ class AccountManagerTest extends TestCase { $this->eventDispatcher, $this->jobList, $this->logger, + $this->verificationToken, + $this->mailer, + $this->defaults, + $this->l10nFactory, + $this->urlGenerator, + $this->crypto ); } @@ -310,6 +340,12 @@ class AccountManagerTest extends TestCase { $this->eventDispatcher, $this->jobList, $this->logger, + $this->verificationToken, + $this->mailer, + $this->defaults, + $this->l10nFactory, + $this->urlGenerator, + $this->crypto ]) ->setMethods($mockedMethods) ->getMock(); |