Skip to content

Commit

Permalink
fix(tests): Adapt tests to change of DefaultShareProvider constructor
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Aug 12, 2024
1 parent f217c6e commit 2744f31
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions tests/lib/Share20/DefaultShareProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
/** @var LoggerInterface|MockObject */
protected $logger;

protected IShareManager&MockObject $shareManager;

protected function setUp(): void {
$this->dbConn = \OC::$server->getDatabaseConnection();
$this->userManager = $this->createMock(IUserManager::class);
Expand All @@ -84,6 +86,7 @@ protected function setUp(): void {
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->shareManager = $this->createMock(IShareManager::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 @@ -101,7 +104,8 @@ protected function setUp(): void {
$this->l10nFactory,
$this->urlGenerator,
$this->timeFactory,
$this->logger
$this->logger,
$this->shareManager,
);
}

Expand Down Expand Up @@ -464,7 +468,8 @@ public function testDeleteSingleShare() {
$this->l10nFactory,
$this->urlGenerator,
$this->timeFactory,
$this->logger
$this->logger,
$this->shareManager,
])
->setMethods(['getShareById'])
->getMock();
Expand Down Expand Up @@ -560,7 +565,8 @@ public function testDeleteGroupShareWithUserGroupShares() {
$this->l10nFactory,
$this->urlGenerator,
$this->timeFactory,
$this->logger
$this->logger,
$this->shareManager,
])
->setMethods(['getShareById'])
->getMock();
Expand Down Expand Up @@ -2529,7 +2535,8 @@ public function testGetSharesInFolder() {
$this->l10nFactory,
$this->urlGenerator,
$this->timeFactory,
$this->logger
$this->logger,
$this->shareManager,
);

$password = md5(time());
Expand Down Expand Up @@ -2628,7 +2635,8 @@ public function testGetAccessListNoCurrentAccessRequired() {
$this->l10nFactory,
$this->urlGenerator,
$this->timeFactory,
$this->logger
$this->logger,
$this->shareManager,
);

$u1 = $userManager->createUser('testShare1', 'test');
Expand Down Expand Up @@ -2725,7 +2733,8 @@ public function testGetAccessListCurrentAccessRequired() {
$this->l10nFactory,
$this->urlGenerator,
$this->timeFactory,
$this->logger
$this->logger,
$this->shareManager,
);

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

0 comments on commit 2744f31

Please sign in to comment.