From 0e282ea21a9a99bfd9e49316f216767145e500ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Tue, 8 Oct 2024 16:53:51 +0200 Subject: [PATCH] fix(tests): Fix sharebymail tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/sharebymail/lib/ShareByMailProvider.php | 4 ++-- apps/sharebymail/tests/ShareByMailProviderTest.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 7b8066e6f77..19a463528c1 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -744,8 +744,8 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider $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())) diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php index c01f5b47632..78e026c830c 100644 --- a/apps/sharebymail/tests/ShareByMailProviderTest.php +++ b/apps/sharebymail/tests/ShareByMailProviderTest.php @@ -755,6 +755,8 @@ class ShareByMailProviderTest extends TestCase { $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) -- 2.39.5