Skip to content

Commit

Permalink
fix(tests): Fix sharebymail tests
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc authored and backportbot[bot] committed Oct 8, 2024
1 parent 7f7e2a6 commit ebafd49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/sharebymail/lib/ShareByMailProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ public function update(IShare $share, ?string $plainTextPassword = null): IShare
$qb = $this->dbConnection->getQueryBuilder();
$qb->update('share')
->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId())))
->set('item_source', $qb->createNamedParameter($share->getNode()->getId()))
->set('file_source', $qb->createNamedParameter($share->getNode()->getId()))
->set('item_source', $qb->createNamedParameter($share->getNodeId()))
->set('file_source', $qb->createNamedParameter($share->getNodeId()))
->set('share_with', $qb->createNamedParameter($share->getSharedWith()))
->set('permissions', $qb->createNamedParameter($share->getPermissions()))
->set('uid_owner', $qb->createNamedParameter($share->getShareOwner()))
Expand Down
2 changes: 2 additions & 0 deletions apps/sharebymail/tests/ShareByMailProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@ public function testUpdate() {
$this->share->expects($this->once())->method('getSharedBy')->willReturn($sharedBy);
$this->share->expects($this->any())->method('getNote')->willReturn($note);
$this->share->expects($this->atLeastOnce())->method('getId')->willReturn($id);
$this->share->expects($this->atLeastOnce())->method('getNodeId')->willReturn($itemSource);
$this->share->expects($this->once())->method('getSharedWith')->willReturn($shareWith);

$this->assertSame($this->share,
$instance->update($this->share)
Expand Down

0 comments on commit ebafd49

Please sign in to comment.