Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore(tests): Adapt DefaultShareProviderTest to new constructor param…
…eter

Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Jul 8, 2025
commit 7070ba4365c7a986f482df390c88d400cef5b8bd
10 changes: 10 additions & 0 deletions tests/lib/Share20/DefaultShareProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IGroup;
use OCP\IGroupManager;
Expand Down Expand Up @@ -79,6 +80,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
/** @var LoggerInterface|MockObject */
protected $logger;

protected IConfig&MockObject $config;

protected IShareManager&MockObject $shareManager;

protected function setUp(): void {
Expand All @@ -94,6 +97,7 @@ protected function setUp(): void {
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->shareManager = $this->createMock(IShareManager::class);
$this->config = $this->createMock(IConfig::class);

$this->userManager->expects($this->any())->method('userExists')->willReturn(true);
$this->timeFactory->expects($this->any())->method('now')->willReturn(new \DateTimeImmutable('2023-05-04 00:00 Europe/Berlin'));
Expand All @@ -113,6 +117,7 @@ protected function setUp(): void {
$this->timeFactory,
$this->logger,
$this->shareManager,
$this->config,
);
}

Expand Down Expand Up @@ -477,6 +482,7 @@ public function testDeleteSingleShare(): void {
$this->timeFactory,
$this->logger,
$this->shareManager,
$this->config,
])
->onlyMethods(['getShareById'])
->getMock();
Expand Down Expand Up @@ -574,6 +580,7 @@ public function testDeleteGroupShareWithUserGroupShares(): void {
$this->timeFactory,
$this->logger,
$this->shareManager,
$this->config,
])
->onlyMethods(['getShareById'])
->getMock();
Expand Down Expand Up @@ -2566,6 +2573,7 @@ public function testGetSharesInFolder(): void {
$this->timeFactory,
$this->logger,
$this->shareManager,
$this->config,
);

$password = md5(time());
Expand Down Expand Up @@ -2666,6 +2674,7 @@ public function testGetAccessListNoCurrentAccessRequired(): void {
$this->timeFactory,
$this->logger,
$this->shareManager,
$this->config,
);

$u1 = $userManager->createUser('testShare1', 'test');
Expand Down Expand Up @@ -2769,6 +2778,7 @@ public function testGetAccessListCurrentAccessRequired(): void {
$this->timeFactory,
$this->logger,
$this->shareManager,
$this->config,
);

$u1 = $userManager->createUser('testShare1', 'test');
Expand Down
Loading