test: Update tests

Signed-off-by: Christopher Ng <chrng8@gmail.com>
pull/49317/head
Christopher Ng 2025-01-09 14:52:33 +07:00
parent 3c62d68534
commit 42d997bcd7
2 changed files with 9 additions and 0 deletions

@ -13,6 +13,7 @@ use OCA\Files_Sharing\Capabilities;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\IRootFolder;
use OCP\Files\Mount\IMountManager;
use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IDateTimeZone;
use OCP\IGroupManager;
@ -75,6 +76,7 @@ class CapabilitiesTest extends \Test\TestCase {
$this->createMock(KnownUserService::class),
$this->createMock(ShareDisableChecker::class),
$this->createMock(IDateTimeZone::class),
$this->createMock(IAppConfig::class),
);
$cap = new Capabilities($config, $shareManager);
$result = $this->getFilesSharingPart($cap->getCapabilities());

@ -28,6 +28,7 @@ use OCP\Files\Node;
use OCP\Files\NotFoundException;
use OCP\Files\Storage\IStorage;
use OCP\HintException;
use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IDateTimeZone;
use OCP\IGroup;
@ -109,6 +110,8 @@ class ManagerTest extends \Test\TestCase {
private DateTimeZone $timezone;
/** @var IDateTimeZone|MockObject */
protected $dateTimeZone;
/** @var IAppConfig|MockObject */
protected $appConfig;
protected function setUp(): void {
$this->logger = $this->createMock(LoggerInterface::class);
@ -131,6 +134,8 @@ class ManagerTest extends \Test\TestCase {
$this->timezone = new \DateTimeZone('Pacific/Auckland');
$this->dateTimeZone->method('getTimeZone')->willReturnCallback(fn () => $this->timezone);
$this->appConfig = $this->createMock(IAppConfig::class);
$this->l10nFactory = $this->createMock(IFactory::class);
$this->l = $this->createMock(IL10N::class);
$this->l->method('t')
@ -172,6 +177,7 @@ class ManagerTest extends \Test\TestCase {
$this->knownUserService,
$this->shareDisabledChecker,
$this->dateTimeZone,
$this->appConfig,
);
}
@ -199,6 +205,7 @@ class ManagerTest extends \Test\TestCase {
$this->knownUserService,
$this->shareDisabledChecker,
$this->dateTimeZone,
$this->appConfig,
]);
}