]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(tests): Fix sharebymail tests backport/48597/stable29 48617/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 8 Oct 2024 14:53:51 +0000 (16:53 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 8 Oct 2024 15:34:22 +0000 (15:34 +0000)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/sharebymail/lib/ShareByMailProvider.php
apps/sharebymail/tests/ShareByMailProviderTest.php

index 9b7dfe48dcb3d7e6c3bf6a4cb7e88897d00e3759..f05dae9752a8524ac6786f30b4203a63ca2ef4a3 100644 (file)
@@ -678,8 +678,8 @@ class ShareByMailProvider 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 1f9034950b730dedf3808dbe1dfa79a76002876b..988d6d8630f2f252f69f69e3264a58290ccdc68a 100644 (file)
@@ -643,6 +643,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)