diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-01-14 15:51:26 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-01-14 20:09:12 +0100 |
commit | da7dd24378d871bbe181e7509dc6af52d4bfb0fe (patch) | |
tree | d6dac4da0e1071d3a7842ecfa596af81a86af1ff | |
parent | 49a4f2fd61b0e9fe0b153b9543f7185fa808da74 (diff) | |
download | nextcloud-server-da7dd24378d871bbe181e7509dc6af52d4bfb0fe.tar.gz nextcloud-server-da7dd24378d871bbe181e7509dc6af52d4bfb0fe.zip |
Switch to OCP background jobs
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
3 files changed, 8 insertions, 6 deletions
diff --git a/apps/twofactor_backupcodes/lib/BackgroundJob/CheckBackupCodes.php b/apps/twofactor_backupcodes/lib/BackgroundJob/CheckBackupCodes.php index 752e745b936..9a39ffdb79f 100644 --- a/apps/twofactor_backupcodes/lib/BackgroundJob/CheckBackupCodes.php +++ b/apps/twofactor_backupcodes/lib/BackgroundJob/CheckBackupCodes.php @@ -25,9 +25,10 @@ declare(strict_types=1); namespace OCA\TwoFactorBackupCodes\BackgroundJob; use OC\Authentication\TwoFactorAuth\Manager; -use OC\BackgroundJob\QueuedJob; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\Authentication\TwoFactorAuth\IRegistry; use OCP\BackgroundJob\IJobList; +use OCP\BackgroundJob\QueuedJob; use OCP\IUser; use OCP\IUserManager; @@ -45,7 +46,8 @@ class CheckBackupCodes extends QueuedJob { /** @var Manager */ private $twofactorManager; - public function __construct(IUserManager $userManager, IJobList $jobList, Manager $twofactorManager, IRegistry $registry) { + public function __construct(ITimeFactory $timeFactory, IUserManager $userManager, IJobList $jobList, Manager $twofactorManager, IRegistry $registry) { + parent::__construct($timeFactory); $this->userManager = $userManager; $this->jobList = $jobList; $this->twofactorManager = $twofactorManager; diff --git a/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php b/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php index 1f227061feb..b04a8c3a29f 100644 --- a/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php +++ b/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php @@ -24,10 +24,10 @@ declare(strict_types=1); namespace OCA\TwoFactorBackupCodes\BackgroundJob; -use OC\BackgroundJob\TimedJob; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Authentication\TwoFactorAuth\IRegistry; use OCP\BackgroundJob\IJobList; +use OCP\BackgroundJob\TimedJob; use OCP\IUserManager; use OCP\Notification\IManager; @@ -39,9 +39,6 @@ class RememberBackupCodesJob extends TimedJob { /** @var IUserManager */ private $userManager; - /** @var ITimeFactory */ - private $time; - /** @var IManager */ private $notificationManager; @@ -53,6 +50,7 @@ class RememberBackupCodesJob extends TimedJob { ITimeFactory $timeFactory, IManager $notificationManager, IJobList $jobList) { + parent::__construct($timeFactory); $this->registry = $registry; $this->userManager = $userManager; $this->time = $timeFactory; diff --git a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php index ad1ce71545d..235414ffe75 100644 --- a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php +++ b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php @@ -27,6 +27,7 @@ namespace OCA\TwoFactorBackupCodes\Tests\Unit\BackgroundJob; use OC\Authentication\TwoFactorAuth\Manager; use OCA\TwoFactorBackupCodes\BackgroundJob\CheckBackupCodes; use OCA\TwoFactorBackupCodes\BackgroundJob\RememberBackupCodesJob; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\Authentication\TwoFactorAuth\IRegistry; use OCP\BackgroundJob\IJobList; use OCP\IUser; @@ -70,6 +71,7 @@ class CheckBackupCodeTest extends TestCase { })); $this->checkBackupCodes = new CheckBackupCodes( + $this->createMock(ITimeFactory::class), $this->userManager, $this->jobList, $this->manager, |