Skip to content
Prev Previous commit
Next Next commit
chore(tests): Adapt updatenotification tests to constructor change
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Mar 25, 2025
commit 1ae3e8e77dfe6b70c76d430ad06bb49bd8d0e069
31 changes: 18 additions & 13 deletions apps/updatenotification/tests/Notification/NotifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace OCA\UpdateNotification\Tests\Notification;

use OCA\UpdateNotification\Notification\Notifier;
use OCP\App\IAppManager;
use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IURLGenerator;
Expand All @@ -17,22 +18,20 @@
use OCP\Notification\AlreadyProcessedException;
use OCP\Notification\IManager;
use OCP\Notification\INotification;
use OCP\ServerVersion;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;

class NotifierTest extends TestCase {

/** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
protected $urlGenerator;
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
protected $config;
/** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
protected $notificationManager;
/** @var IFactory|\PHPUnit\Framework\MockObject\MockObject */
protected $l10nFactory;
/** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */
protected $userSession;
/** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */
protected $groupManager;
protected IURLGenerator&MockObject $urlGenerator;
protected IConfig&MockObject $config;
protected IManager&MockObject $notificationManager;
protected IFactory&MockObject $l10nFactory;
protected IUserSession&MockObject $userSession;
protected IGroupManager&MockObject $groupManager;
protected IAppManager&MockObject $appManager;
protected ServerVersion&MockObject $serverVersion;

protected function setUp(): void {
parent::setUp();
Expand All @@ -43,6 +42,8 @@ protected function setUp(): void {
$this->l10nFactory = $this->createMock(IFactory::class);
$this->userSession = $this->createMock(IUserSession::class);
$this->groupManager = $this->createMock(IGroupManager::class);
$this->appManager = $this->createMock(IAppManager::class);
$this->serverVersion = $this->createMock(ServerVersion::class);
}

/**
Expand All @@ -57,7 +58,9 @@ protected function getNotifier(array $methods = []) {
$this->notificationManager,
$this->l10nFactory,
$this->userSession,
$this->groupManager
$this->groupManager,
$this->appManager,
$this->serverVersion,
);
}
{
Expand All @@ -69,6 +72,8 @@ protected function getNotifier(array $methods = []) {
$this->l10nFactory,
$this->userSession,
$this->groupManager,
$this->appManager,
$this->serverVersion,
])
->onlyMethods($methods)
->getMock();
Expand Down
Loading