]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(tests): Fix sharebymail tests fix/fix-email-share-transfer-accross-storages 48597/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 8 Oct 2024 14:53:51 +0000 (16:53 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 8 Oct 2024 14:53:51 +0000 (16:53 +0200)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/sharebymail/lib/ShareByMailProvider.php
apps/sharebymail/tests/ShareByMailProviderTest.php

index 7b8066e6f77c5ea85021781f39588ddc10d51ed7..19a463528c13be1b44c6d787341e7ed9b162576c 100644 (file)
@@ -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()))
index c01f5b476325d00685e78d2cbb112f6c22317ce6..78e026c830ce713afe3c07f20b01d866a07d629e 100644 (file)
@@ -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)