aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/l10n/pl.js4
-rw-r--r--apps/files_trashbin/l10n/pl.json4
-rw-r--r--apps/files_trashbin/l10n/zh_TW.js4
-rw-r--r--apps/files_trashbin/l10n/zh_TW.json4
-rw-r--r--apps/files_trashbin/tests/Command/CleanUpTest.php8
-rw-r--r--apps/files_trashbin/tests/ExpirationTest.php8
-rw-r--r--apps/files_trashbin/tests/Sabre/TrashbinPluginTest.php4
-rw-r--r--apps/files_trashbin/tests/StorageTest.php14
-rw-r--r--apps/files_trashbin/tests/TrashbinTest.php18
9 files changed, 33 insertions, 35 deletions
diff --git a/apps/files_trashbin/l10n/pl.js b/apps/files_trashbin/l10n/pl.js
index 4e555ba4e4d..381c6af8275 100644
--- a/apps/files_trashbin/l10n/pl.js
+++ b/apps/files_trashbin/l10n/pl.js
@@ -23,6 +23,8 @@ OC.L10N.register(
"You" : "Ty",
"List of files that have been deleted." : "Lista plików, które zostały usunięte.",
"No deleted files" : "Brak usuniętych plików",
- "Files and folders you have deleted will show up here" : "Tutaj pojawią się usunięte pliki i katalogi"
+ "Files and folders you have deleted will show up here" : "Tutaj pojawią się usunięte pliki i katalogi",
+ "All files have been permanently deleted" : "Wszystkie pliki zostały trwale usunięte",
+ "Failed to empty deleted files" : "Nie udało się opróżnić usuniętych plików"
},
"nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);");
diff --git a/apps/files_trashbin/l10n/pl.json b/apps/files_trashbin/l10n/pl.json
index 24fd5b2f473..dab222a3c16 100644
--- a/apps/files_trashbin/l10n/pl.json
+++ b/apps/files_trashbin/l10n/pl.json
@@ -21,6 +21,8 @@
"You" : "Ty",
"List of files that have been deleted." : "Lista plików, które zostały usunięte.",
"No deleted files" : "Brak usuniętych plików",
- "Files and folders you have deleted will show up here" : "Tutaj pojawią się usunięte pliki i katalogi"
+ "Files and folders you have deleted will show up here" : "Tutaj pojawią się usunięte pliki i katalogi",
+ "All files have been permanently deleted" : "Wszystkie pliki zostały trwale usunięte",
+ "Failed to empty deleted files" : "Nie udało się opróżnić usuniętych plików"
},"pluralForm" :"nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);"
} \ No newline at end of file
diff --git a/apps/files_trashbin/l10n/zh_TW.js b/apps/files_trashbin/l10n/zh_TW.js
index 26b9abd0e0f..4df774e705a 100644
--- a/apps/files_trashbin/l10n/zh_TW.js
+++ b/apps/files_trashbin/l10n/zh_TW.js
@@ -23,6 +23,8 @@ OC.L10N.register(
"You" : "您",
"List of files that have been deleted." : "刪除的檔案清單。",
"No deleted files" : "沒有刪除的檔案",
- "Files and folders you have deleted will show up here" : "您刪除的檔案與資料夾將會在此處顯示"
+ "Files and folders you have deleted will show up here" : "您刪除的檔案與資料夾將會在此處顯示",
+ "All files have been permanently deleted" : "所有檔案都已被永久刪除",
+ "Failed to empty deleted files" : "清空已刪除的檔案失敗"
},
"nplurals=1; plural=0;");
diff --git a/apps/files_trashbin/l10n/zh_TW.json b/apps/files_trashbin/l10n/zh_TW.json
index e9c0e9de42d..2d1d11079fd 100644
--- a/apps/files_trashbin/l10n/zh_TW.json
+++ b/apps/files_trashbin/l10n/zh_TW.json
@@ -21,6 +21,8 @@
"You" : "您",
"List of files that have been deleted." : "刪除的檔案清單。",
"No deleted files" : "沒有刪除的檔案",
- "Files and folders you have deleted will show up here" : "您刪除的檔案與資料夾將會在此處顯示"
+ "Files and folders you have deleted will show up here" : "您刪除的檔案與資料夾將會在此處顯示",
+ "All files have been permanently deleted" : "所有檔案都已被永久刪除",
+ "Failed to empty deleted files" : "清空已刪除的檔案失敗"
},"pluralForm" :"nplurals=1; plural=0;"
} \ No newline at end of file
diff --git a/apps/files_trashbin/tests/Command/CleanUpTest.php b/apps/files_trashbin/tests/Command/CleanUpTest.php
index 3dce8f0c92e..41ed0e1e960 100644
--- a/apps/files_trashbin/tests/Command/CleanUpTest.php
+++ b/apps/files_trashbin/tests/Command/CleanUpTest.php
@@ -69,9 +69,7 @@ class CleanUpTest extends TestCase {
$this->assertCount(10, $result);
}
- /**
- * @dataProvider dataTestRemoveDeletedFiles
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestRemoveDeletedFiles')]
public function testRemoveDeletedFiles(bool $nodeExists): void {
$this->initTable();
$this->rootFolder
@@ -129,7 +127,7 @@ class CleanUpTest extends TestCase {
*/
public function testExecuteDeleteListOfUsers(): void {
$userIds = ['user1', 'user2', 'user3'];
- $instance = $this->getMockBuilder(\OCA\Files_Trashbin\Command\CleanUp::class)
+ $instance = $this->getMockBuilder(CleanUp::class)
->onlyMethods(['removeDeletedFiles'])
->setConstructorArgs([$this->rootFolder, $this->userManager, $this->dbConnection])
->getMock();
@@ -159,7 +157,7 @@ class CleanUpTest extends TestCase {
public function testExecuteAllUsers(): void {
$userIds = [];
$backendUsers = ['user1', 'user2'];
- $instance = $this->getMockBuilder(\OCA\Files_Trashbin\Command\CleanUp::class)
+ $instance = $this->getMockBuilder(CleanUp::class)
->onlyMethods(['removeDeletedFiles'])
->setConstructorArgs([$this->rootFolder, $this->userManager, $this->dbConnection])
->getMock();
diff --git a/apps/files_trashbin/tests/ExpirationTest.php b/apps/files_trashbin/tests/ExpirationTest.php
index aab07de8162..3348edc4016 100644
--- a/apps/files_trashbin/tests/ExpirationTest.php
+++ b/apps/files_trashbin/tests/ExpirationTest.php
@@ -82,9 +82,7 @@ class ExpirationTest extends \Test\TestCase {
];
}
- /**
- * @dataProvider expirationData
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('expirationData')]
public function testExpiration(string $retentionObligation, int $timeNow, int $timestamp, bool $quotaExceeded, bool $expectedResult): void {
$mockedConfig = $this->getMockedConfig($retentionObligation);
$mockedTimeFactory = $this->getMockedTimeFactory($timeNow);
@@ -110,9 +108,7 @@ class ExpirationTest extends \Test\TestCase {
}
- /**
- * @dataProvider timestampTestData
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('timestampTestData')]
public function testGetMaxAgeAsTimestamp(string $configValue, bool|int $expectedMaxAgeTimestamp): void {
$mockedConfig = $this->getMockedConfig($configValue);
$mockedTimeFactory = $this->getMockedTimeFactory(
diff --git a/apps/files_trashbin/tests/Sabre/TrashbinPluginTest.php b/apps/files_trashbin/tests/Sabre/TrashbinPluginTest.php
index 6c566afc738..87aca2753ef 100644
--- a/apps/files_trashbin/tests/Sabre/TrashbinPluginTest.php
+++ b/apps/files_trashbin/tests/Sabre/TrashbinPluginTest.php
@@ -29,9 +29,7 @@ class TrashbinPluginTest extends TestCase {
$this->server = new Server($tree);
}
- /**
- * @dataProvider quotaProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('quotaProvider')]
public function testQuota(int $quota, int $fileSize, bool $expectedResult): void {
$fileInfo = $this->createMock(ITrashItem::class);
$fileInfo->method('getSize')
diff --git a/apps/files_trashbin/tests/StorageTest.php b/apps/files_trashbin/tests/StorageTest.php
index 2b2508a358b..c58ddec97dd 100644
--- a/apps/files_trashbin/tests/StorageTest.php
+++ b/apps/files_trashbin/tests/StorageTest.php
@@ -311,7 +311,7 @@ class StorageTest extends \Test\TestCase {
$recipientUser = $this->getUniqueId('recipient_');
Server::get(IUserManager::class)->createUser($recipientUser, $recipientUser);
- $node = \OCP\Server::get(IRootFolder::class)->getUserFolder($this->user)->get('share');
+ $node = Server::get(IRootFolder::class)->getUserFolder($this->user)->get('share');
$share = Server::get(\OCP\Share\IManager::class)->newShare();
$share->setNode($node)
->setShareType(IShare::TYPE_USER)
@@ -362,7 +362,7 @@ class StorageTest extends \Test\TestCase {
$recipientUser = $this->getUniqueId('recipient_');
Server::get(IUserManager::class)->createUser($recipientUser, $recipientUser);
- $node = \OCP\Server::get(IRootFolder::class)->getUserFolder($this->user)->get('share');
+ $node = Server::get(IRootFolder::class)->getUserFolder($this->user)->get('share');
$share = Server::get(\OCP\Share\IManager::class)->newShare();
$share->setNode($node)
->setShareType(IShare::TYPE_USER)
@@ -496,7 +496,7 @@ class StorageTest extends \Test\TestCase {
/**
* @var Temporary&MockObject $storage
*/
- $storage = $this->getMockBuilder(\OC\Files\Storage\Temporary::class)
+ $storage = $this->getMockBuilder(Temporary::class)
->setConstructorArgs([[]])
->onlyMethods(['rename', 'unlink', 'moveFromStorage'])
->getMock();
@@ -533,7 +533,7 @@ class StorageTest extends \Test\TestCase {
/**
* @var Temporary&MockObject $storage
*/
- $storage = $this->getMockBuilder(\OC\Files\Storage\Temporary::class)
+ $storage = $this->getMockBuilder(Temporary::class)
->setConstructorArgs([[]])
->onlyMethods(['rename', 'unlink', 'rmdir'])
->getMock();
@@ -560,14 +560,12 @@ class StorageTest extends \Test\TestCase {
$this->assertCount(0, $results);
}
- /**
- * @dataProvider dataTestShouldMoveToTrash
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestShouldMoveToTrash')]
public function testShouldMoveToTrash(string $mountPoint, string $path, bool $userExists, bool $appDisablesTrash, bool $expected): void {
$fileID = 1;
$cache = $this->createMock(ICache::class);
$cache->expects($this->any())->method('getId')->willReturn($fileID);
- $tmpStorage = $this->createMock(\OC\Files\Storage\Temporary::class);
+ $tmpStorage = $this->createMock(Temporary::class);
$tmpStorage->expects($this->any())->method('getCache')->willReturn($cache);
$userManager = $this->getMockBuilder(IUserManager::class)
->disableOriginalConstructor()->getMock();
diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php
index d8486ccbdc2..6104a242104 100644
--- a/apps/files_trashbin/tests/TrashbinTest.php
+++ b/apps/files_trashbin/tests/TrashbinTest.php
@@ -354,7 +354,7 @@ class TrashbinTest extends \Test\TestCase {
* Test restoring a file
*/
public function testRestoreFileInRoot(): void {
- $userFolder = \OCP\Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
+ $userFolder = Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
$file = $userFolder->newFile('file1.txt');
$file->putContent('foo');
@@ -386,7 +386,7 @@ class TrashbinTest extends \Test\TestCase {
* Test restoring a file in subfolder
*/
public function testRestoreFileInSubfolder(): void {
- $userFolder = \OCP\Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
+ $userFolder = Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
$folder = $userFolder->newFolder('folder');
$file = $folder->newFile('file1.txt');
$file->putContent('foo');
@@ -419,7 +419,7 @@ class TrashbinTest extends \Test\TestCase {
* Test restoring a folder
*/
public function testRestoreFolder(): void {
- $userFolder = \OCP\Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
+ $userFolder = Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
$folder = $userFolder->newFolder('folder');
$file = $folder->newFile('file1.txt');
$file->putContent('foo');
@@ -452,7 +452,7 @@ class TrashbinTest extends \Test\TestCase {
* Test restoring a file from inside a trashed folder
*/
public function testRestoreFileFromTrashedSubfolder(): void {
- $userFolder = \OCP\Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
+ $userFolder = Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
$folder = $userFolder->newFolder('folder');
$file = $folder->newFile('file1.txt');
$file->putContent('foo');
@@ -486,7 +486,7 @@ class TrashbinTest extends \Test\TestCase {
* The file should then land in the root.
*/
public function testRestoreFileWithMissingSourceFolder(): void {
- $userFolder = \OCP\Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
+ $userFolder = Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
$folder = $userFolder->newFolder('folder');
$file = $folder->newFile('file1.txt');
$file->putContent('foo');
@@ -523,7 +523,7 @@ class TrashbinTest extends \Test\TestCase {
* with the same name in the root folder
*/
public function testRestoreFileDoesNotOverwriteExistingInRoot(): void {
- $userFolder = \OCP\Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
+ $userFolder = Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
$file = $userFolder->newFile('file1.txt');
$file->putContent('foo');
@@ -563,7 +563,7 @@ class TrashbinTest extends \Test\TestCase {
* with the same name in the source folder
*/
public function testRestoreFileDoesNotOverwriteExistingInSubfolder(): void {
- $userFolder = \OCP\Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
+ $userFolder = Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
$folder = $userFolder->newFolder('folder');
$file = $folder->newFile('file1.txt');
$file->putContent('foo');
@@ -617,7 +617,7 @@ class TrashbinTest extends \Test\TestCase {
* the file to root instead
*/
public function testRestoreFileIntoReadOnlySourceFolder(): void {
- $userFolder = \OCP\Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
+ $userFolder = Server::get(IRootFolder::class)->getUserFolder(self::TEST_TRASHBIN_USER1);
$folder = $userFolder->newFolder('folder');
$file = $folder->newFile('file1.txt');
$file->putContent('foo');
@@ -673,7 +673,7 @@ class TrashbinTest extends \Test\TestCase {
Filesystem::tearDown();
\OC_User::setUserId($user);
\OC_Util::setupFS($user);
- \OCP\Server::get(IRootFolder::class)->getUserFolder($user);
+ Server::get(IRootFolder::class)->getUserFolder($user);
}
}