Skip to content

Commit 3d5ec75

Browse files
come-ncShGKme
authored andcommitted
chore(tests): Adapt DefaultShareProviderTest to new constructor parameter
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 3c1c7b8 commit 3d5ec75

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/lib/Share20/DefaultShareProviderTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use OCP\Files\File;
3131
use OCP\Files\Folder;
3232
use OCP\Files\IRootFolder;
33+
use OCP\IConfig;
3334
use OCP\IDBConnection;
3435
use OCP\IGroup;
3536
use OCP\IGroupManager;
@@ -83,6 +84,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
8384
/** @var ITimeFactory|MockObject */
8485
protected $timeFactory;
8586

87+
protected IConfig&MockObject $config;
88+
8689
/** @var IShareManager&MockObject */
8790
protected $shareManager;
8891

@@ -98,6 +101,7 @@ protected function setUp(): void {
98101
$this->urlGenerator = $this->createMock(IURLGenerator::class);
99102
$this->timeFactory = $this->createMock(ITimeFactory::class);
100103
$this->shareManager = $this->createMock(IShareManager::class);
104+
$this->config = $this->createMock(IConfig::class);
101105

102106
$this->userManager->expects($this->any())->method('userExists')->willReturn(true);
103107
$this->timeFactory->expects($this->any())->method('now')->willReturn(new \DateTimeImmutable("2023-05-04 00:00 Europe/Berlin"));
@@ -116,6 +120,7 @@ protected function setUp(): void {
116120
$this->urlGenerator,
117121
$this->timeFactory,
118122
$this->shareManager,
123+
$this->config,
119124
);
120125
}
121126

@@ -478,6 +483,7 @@ public function testDeleteSingleShare() {
478483
$this->urlGenerator,
479484
$this->timeFactory,
480485
$this->shareManager,
486+
$this->config,
481487
])
482488
->setMethods(['getShareById'])
483489
->getMock();
@@ -574,6 +580,7 @@ public function testDeleteGroupShareWithUserGroupShares() {
574580
$this->urlGenerator,
575581
$this->timeFactory,
576582
$this->shareManager,
583+
$this->config,
577584
])
578585
->setMethods(['getShareById'])
579586
->getMock();
@@ -2569,6 +2576,7 @@ public function testGetSharesInFolder() {
25692576
$this->urlGenerator,
25702577
$this->timeFactory,
25712578
$this->shareManager,
2579+
$this->config,
25722580
);
25732581

25742582
$password = md5(time());
@@ -2668,6 +2676,7 @@ public function testGetAccessListNoCurrentAccessRequired() {
26682676
$this->urlGenerator,
26692677
$this->timeFactory,
26702678
$this->shareManager,
2679+
$this->config,
26712680
);
26722681

26732682
$u1 = $userManager->createUser('testShare1', 'test');
@@ -2765,6 +2774,7 @@ public function testGetAccessListCurrentAccessRequired() {
27652774
$this->urlGenerator,
27662775
$this->timeFactory,
27672776
$this->shareManager,
2777+
$this->config,
27682778
);
27692779

27702780
$u1 = $userManager->createUser('testShare1', 'test');

0 commit comments

Comments
 (0)