Skip to content

Commit 0a373a5

Browse files
authored
Merge pull request #3040 from nextcloud/backport/3039/stable32
[stable32] fix: Add missing DI for IAppConfig to Push.php
2 parents eb09749 + 5f45158 commit 0a373a5

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

lib/Push.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use OC\Security\IdentityProof\Manager;
1717
use OCA\Notifications\AppInfo\Application;
1818
use OCP\AppFramework\Http;
19+
use OCP\AppFramework\Services\IAppConfig;
1920
use OCP\AppFramework\Utility\ITimeFactory;
2021
use OCP\Authentication\Exceptions\InvalidTokenException;
2122
use OCP\Authentication\Token\IToken;
@@ -78,6 +79,7 @@ public function __construct(
7879
protected IDBConnection $db,
7980
protected INotificationManager $notificationManager,
8081
protected IConfig $config,
82+
protected IAppConfig $appConfig,
8183
protected IProvider $tokenProvider,
8284
protected Manager $keyManager,
8385
protected IClientService $clientService,

tests/Unit/PushTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use OC\Security\IdentityProof\Manager;
1818
use OCA\Notifications\Push;
1919
use OCP\AppFramework\Http;
20+
use OCP\AppFramework\Services\IAppConfig;
2021
use OCP\AppFramework\Utility\ITimeFactory;
2122
use OCP\Authentication\Token\IToken as OCPIToken;
2223
use OCP\Http\Client\IClient;
@@ -48,6 +49,7 @@ class PushTest extends TestCase {
4849
protected IDBConnection $db;
4950
protected INotificationManager&MockObject $notificationManager;
5051
protected IConfig&MockObject $config;
52+
protected IAppConfig&MockObject $appConfig;
5153
protected IProvider&MockObject $tokenProvider;
5254
protected Manager&MockObject $keyManager;
5355
protected IClientService&MockObject $clientService;
@@ -65,6 +67,7 @@ protected function setUp(): void {
6567
$this->db = \OCP\Server::get(IDBConnection::class);
6668
$this->notificationManager = $this->createMock(INotificationManager::class);
6769
$this->config = $this->createMock(IConfig::class);
70+
$this->appConfig = $this->createMock(IAppConfig::class);
6871
$this->tokenProvider = $this->createMock(IProvider::class);
6972
$this->keyManager = $this->createMock(Manager::class);
7073
$this->clientService = $this->createMock(IClientService::class);
@@ -91,6 +94,7 @@ protected function getPush(array $methods = []): Push|MockObject {
9194
$this->db,
9295
$this->notificationManager,
9396
$this->config,
97+
$this->appConfig,
9498
$this->tokenProvider,
9599
$this->keyManager,
96100
$this->clientService,
@@ -109,6 +113,7 @@ protected function getPush(array $methods = []): Push|MockObject {
109113
$this->db,
110114
$this->notificationManager,
111115
$this->config,
116+
$this->appConfig,
112117
$this->tokenProvider,
113118
$this->keyManager,
114119
$this->clientService,

0 commit comments

Comments
 (0)