diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 19cf131d4ceec..3bd5ffa0d1eb3 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -293,9 +293,8 @@ public static function move2trash($file_path, $ownerOnly = false) { try { $moveSuccessful = true; - $inCache = $sourceStorage->getCache()->inCache($sourceInternalPath); $trashStorage->moveFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath); - if ($inCache) { + if ($sourceStorage->getCache()->inCache($sourceInternalPath)) { $trashStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath); } } catch (CopyRecursiveException $e) { diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php index 92956112a58d1..ea9abedd14489 100644 --- a/apps/files_trashbin/tests/TrashbinTest.php +++ b/apps/files_trashbin/tests/TrashbinTest.php @@ -19,9 +19,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Constants; use OCP\Files\FileInfo; -use OCP\Files\IRootFolder; use OCP\IConfig; -use OCP\Server; use OCP\Share\IShare; /** @@ -666,28 +664,6 @@ public function testRestoreFileIntoReadOnlySourceFolder(): void { } } - public function testTrashSizePropagation(): void { - $view = new View('/' . self::TEST_TRASHBIN_USER1 . '/files_trashbin/files'); - - $userFolder = Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1); - $file1 = $userFolder->newFile('foo.txt'); - $file1->putContent('1'); - - $this->assertTrue($userFolder->nodeExists('foo.txt')); - $file1->delete(); - $this->assertFalse($userFolder->nodeExists('foo.txt')); - $this->assertEquals(1, $view->getFileInfo('')->getSize()); - - $folder = $userFolder->newFolder('bar'); - $file2 = $folder->newFile('baz.txt'); - $file2->putContent('22'); - - $this->assertTrue($userFolder->nodeExists('bar')); - $folder->delete(); - $this->assertFalse($userFolder->nodeExists('bar')); - $this->assertEquals(3, $view->getFileInfo('')->getSize()); - } - /** * @param string $user * @param bool $create