aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2025-01-24 09:37:31 +0100
committerprovokateurin <kate@provokateurin.de>2025-01-24 09:41:14 +0100
commitdcb370ab62ffde704e1dc9ddcee58039b53a85ff (patch)
tree19682bf4ae1b4ea50bf2d97e5e8e8c415ec4e7f8 /tests
parentd7ce5d4f94f9fe0c4915d0250dcee26ad72f95c6 (diff)
downloadnextcloud-server-dcb370ab62ffde704e1dc9ddcee58039b53a85ff.tar.gz
nextcloud-server-dcb370ab62ffde704e1dc9ddcee58039b53a85ff.zip
Revert "fix(Share20\Manager): Ensure node is still accessible when checking share"revert/share-node-accessible
This reverts commit c2ca99e2f641396b6823c1e675afd3ecb486e744. Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Share20/ManagerTest.php33
1 files changed, 4 insertions, 29 deletions
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php
index 1afe0473cea..6df97423989 100644
--- a/tests/lib/Share20/ManagerTest.php
+++ b/tests/lib/Share20/ManagerTest.php
@@ -25,7 +25,6 @@ use OCP\Files\Mount\IMountManager;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\Mount\IShareOwnerlessMount;
use OCP\Files\Node;
-use OCP\Files\NotFoundException;
use OCP\Files\Storage\IStorage;
use OCP\HintException;
use OCP\IAppConfig;
@@ -675,24 +674,6 @@ class ManagerTest extends \Test\TestCase {
}
- public function testGetShareByIdNodeAccessible(): void {
- $share = $this->createMock(IShare::class);
- $share
- ->expects($this->once())
- ->method('getNode')
- ->willThrowException(new NotFoundException());
-
- $this->defaultProvider
- ->expects($this->once())
- ->method('getShareById')
- ->with(42)
- ->willReturn($share);
-
- $this->expectException(ShareNotFound::class);
- $this->manager->getShareById('default:42');
- }
-
-
public function testGetExpiredShareById(): void {
$this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
@@ -2901,10 +2882,9 @@ class ManagerTest extends \Test\TestCase {
}
public function testGetSharesBy(): void {
- $node = $this->createMock(Folder::class);
-
$share = $this->manager->newShare();
- $share->setNode($node);
+
+ $node = $this->createMock(Folder::class);
$this->defaultProvider->expects($this->once())
->method('getSharesBy')
@@ -2957,8 +2937,6 @@ class ManagerTest extends \Test\TestCase {
* deleted (as they are evaluated). but share 8 should still be there.
*/
public function testGetSharesByExpiredLinkShares(): void {
- $node = $this->createMock(File::class);
-
$manager = $this->createManagerMock()
->setMethods(['deleteShare'])
->getMock();
@@ -2972,7 +2950,6 @@ class ManagerTest extends \Test\TestCase {
for ($i = 0; $i < 8; $i++) {
$share = $this->manager->newShare();
$share->setId($i);
- $share->setNode($node);
$shares[] = $share;
}
@@ -2993,6 +2970,8 @@ class ManagerTest extends \Test\TestCase {
$shares2[] = clone $shares[$i];
}
+ $node = $this->createMock(File::class);
+
/*
* Simulate the getSharesBy call.
*/
@@ -3154,10 +3133,8 @@ class ManagerTest extends \Test\TestCase {
$date = new \DateTime();
$date->setTime(0, 0, 0);
$date->add(new \DateInterval('P2D'));
- $node = $this->createMock(File::class);
$share = $this->manager->newShare();
$share->setExpirationDate($date);
- $share->setNode($node);
$share->setShareOwner('owner');
$share->setSharedBy('sharedBy');
@@ -3235,10 +3212,8 @@ class ManagerTest extends \Test\TestCase {
$date = new \DateTime();
$date->setTime(0, 0, 0);
$date->add(new \DateInterval('P2D'));
- $node = $this->createMock(Folder::class);
$share = $this->manager->newShare();
$share->setExpirationDate($date);
- $share->setNode($node);
$this->defaultProvider->expects($this->once())
->method('getShareByToken')