diff options
Diffstat (limited to 'apps')
453 files changed, 3974 insertions, 4517 deletions
diff --git a/apps/dav/l10n/de.js b/apps/dav/l10n/de.js index 964bf10370d..788e1bf2f75 100644 --- a/apps/dav/l10n/de.js +++ b/apps/dav/l10n/de.js @@ -161,7 +161,7 @@ OC.L10N.register( "When:" : "Wann:", "Location:" : "Ort:", "Link:" : "Link:", - "Occurring:" : "Vorkommend:", + "Occurring:" : "Findet statt:", "Accept" : "Akzeptieren", "Decline" : "Ablehnen", "More options …" : "Weitere Optionen …", diff --git a/apps/dav/l10n/de.json b/apps/dav/l10n/de.json index fa62791d7e8..32a5497bb4e 100644 --- a/apps/dav/l10n/de.json +++ b/apps/dav/l10n/de.json @@ -159,7 +159,7 @@ "When:" : "Wann:", "Location:" : "Ort:", "Link:" : "Link:", - "Occurring:" : "Vorkommend:", + "Occurring:" : "Findet statt:", "Accept" : "Akzeptieren", "Decline" : "Ablehnen", "More options …" : "Weitere Optionen …", diff --git a/apps/dav/l10n/de_DE.js b/apps/dav/l10n/de_DE.js index 0b1e2863f54..ce9c993e027 100644 --- a/apps/dav/l10n/de_DE.js +++ b/apps/dav/l10n/de_DE.js @@ -161,7 +161,7 @@ OC.L10N.register( "When:" : "Wann:", "Location:" : "Ort:", "Link:" : "Link:", - "Occurring:" : "Vorkommend:", + "Occurring:" : "Findet statt:", "Accept" : "Akzeptieren", "Decline" : "Ablehnen", "More options …" : "Weitere Optionen …", diff --git a/apps/dav/l10n/de_DE.json b/apps/dav/l10n/de_DE.json index 319c04131da..0e903fe8c06 100644 --- a/apps/dav/l10n/de_DE.json +++ b/apps/dav/l10n/de_DE.json @@ -159,7 +159,7 @@ "When:" : "Wann:", "Location:" : "Ort:", "Link:" : "Link:", - "Occurring:" : "Vorkommend:", + "Occurring:" : "Findet statt:", "Accept" : "Akzeptieren", "Decline" : "Ablehnen", "More options …" : "Weitere Optionen …", diff --git a/apps/dav/l10n/pt_BR.js b/apps/dav/l10n/pt_BR.js index c578d4f4c9d..7d9cc7d4524 100644 --- a/apps/dav/l10n/pt_BR.js +++ b/apps/dav/l10n/pt_BR.js @@ -104,22 +104,22 @@ OC.L10N.register( "Every %1$d Weeks on %2$s for the entire day until %3$s" : "A Cada %1$d Semanas, %2$s para o dia inteiro até %3$s", "Every %1$d Weeks on %2$s between %3$s - %4$s" : "A Cada %1$d Semanas, %2$s entre %3$s - %4$s", "Every %1$d Weeks on %2$s between %3$s - %4$s until %5$s" : "A Cada %1$d Semanas, %2$s entre %3$s - %4$s até %5$s", - "Every Month on the %1$s for the entire day" : "Todo Mês no dia %1$s para o dia inteiro", - "Every Month on the %1$s for the entire day until %2$s" : "Todo Mês no dia %1$s para o dia inteiro até %2$s", - "Every Month on the %1$s between %2$s - %3$s" : "Todo Mês no dia %1$s entre %2$s - %3$s", - "Every Month on the %1$s between %2$s - %3$s until %4$s" : "Todo Mês no dia %1$s entre %2$s - %3$s até %4$s", - "Every %1$d Months on the %2$s for the entire day" : "A Cada %1$d Meses no dia %2$s para o dia inteiro", - "Every %1$d Months on the %2$s for the entire day until %3$s" : "A Cada %1$d Meses no dia %2$s para o dia inteiro até %3$s", - "Every %1$d Months on the %2$s between %3$s - %4$s" : "A Cada %1$d Meses no dia %2$s entre %3$s - %4$s", - "Every %1$d Months on the %2$s between %3$s - %4$s until %5$s" : "A Cada %1$d Meses no dia %2$s entre %3$s - %4$s até %5$s", - "Every Year in %1$s on the %2$s for the entire day" : "Todo Ano em %1$s no dia %2$s para o dia inteiro", - "Every Year in %1$s on the %2$s for the entire day until %3$s" : "Todo Ano em %1$s no dia %2$s para o dia inteiro até %3$s", - "Every Year in %1$s on the %2$s between %3$s - %4$s" : "Todo Ano em %1$s no dia %2$s entre %3$s - %4$s", - "Every Year in %1$s on the %2$s between %3$s - %4$s until %5$s" : "Todo Ano em %1$s no dia %2$s entre %3$s - %4$s até %5$s", - "Every %1$d Years in %2$s on the %3$s for the entire day" : "A Cada %1$d Anos em %2$s no dia %3$s para o dia inteiro", - "Every %1$d Years in %2$s on the %3$s for the entire day until %4$s" : "A Cada %1$d Anos em %2$s no dia %3$s para o dia inteiro até %4$s", - "Every %1$d Years in %2$s on the %3$s between %4$s - %5$s" : "A Cada %1$d Anos em %2$s no dia %3$s entre %4$s - %5$s ", - "Every %1$d Years in %2$s on the %3$s between %4$s - %5$s until %6$s" : "A Cada %1$d Anos em %2$s no dia %3$s entre %4$s - %5$s até %6$s", + "Every Month on the %1$s for the entire day" : "Todo Mês, dia: %1$s, para o dia inteiro", + "Every Month on the %1$s for the entire day until %2$s" : "Todo Mês, dia: %1$s, para o dia inteiro até %2$s", + "Every Month on the %1$s between %2$s - %3$s" : "Todo Mês, dia: %1$s, entre %2$s - %3$s", + "Every Month on the %1$s between %2$s - %3$s until %4$s" : "Todo Mês, dia: %1$s, entre %2$s - %3$s até %4$s", + "Every %1$d Months on the %2$s for the entire day" : "A Cada %1$d Meses, dia: %2$s, para o dia inteiro", + "Every %1$d Months on the %2$s for the entire day until %3$s" : "A Cada %1$d Meses, dia: %2$s, para o dia inteiro até %3$s", + "Every %1$d Months on the %2$s between %3$s - %4$s" : "A Cada %1$d Meses, dia: %2$s, entre %3$s - %4$s", + "Every %1$d Months on the %2$s between %3$s - %4$s until %5$s" : "A Cada %1$d Meses, dia: %2$s, entre %3$s - %4$s até %5$s", + "Every Year in %1$s on the %2$s for the entire day" : "Todo Ano em %1$s, dia: %2$s, para o dia inteiro", + "Every Year in %1$s on the %2$s for the entire day until %3$s" : "Todo Ano em %1$s, dia: %2$s, para o dia inteiro até %3$s", + "Every Year in %1$s on the %2$s between %3$s - %4$s" : "Todo Ano em %1$s, dia: %2$s, entre %3$s - %4$s", + "Every Year in %1$s on the %2$s between %3$s - %4$s until %5$s" : "Todo Ano em %1$s, dia: %2$s, entre %3$s - %4$s até %5$s", + "Every %1$d Years in %2$s on the %3$s for the entire day" : "A Cada %1$d Anos em %2$s, dia: %3$s, para o dia inteiro", + "Every %1$d Years in %2$s on the %3$s for the entire day until %4$s" : "A Cada %1$d Anos em %2$s, dia: %3$s, para o dia inteiro até %4$s", + "Every %1$d Years in %2$s on the %3$s between %4$s - %5$s" : "A Cada %1$d Anos em %2$s, dia: %3$s, entre %4$s - %5$s ", + "Every %1$d Years in %2$s on the %3$s between %4$s - %5$s until %6$s" : "A Cada %1$d Anos em %2$s, dia: %3$s, entre %4$s - %5$s até %6$s", "On specific dates for the entire day until %1$s" : "Em datas específicas para o dia inteiro até %1$s", "On specific dates between %1$s - %2$s until %3$s" : "Em datas específicas entre %1$s - %2$s até %3$s", "In the past on %1$s" : "No passado em %1$s", @@ -185,16 +185,16 @@ OC.L10N.register( "October" : "Outubro", "November" : "Novembro", "December" : "Dezembro", - "First" : "Primeiro/a", - "Second" : "Segundo/a", - "Third" : "Terço/a", - "Fourth" : "Quarto/a", - "Fifth" : "Quinto/a", + "First" : "1.º/ª", + "Second" : "2.º/ª", + "Third" : "3.º/ª", + "Fourth" : "4.º/ª", + "Fifth" : "5.º/ª", "Last" : "Último/a", "Second Last" : "Penúltimo/a", - "Third Last" : "Terceiro/a Último/a", - "Fourth Last" : "Quarto/a Último/a", - "Fifth Last" : "Quinto/a Último/a", + "Third Last" : "3.º/ª Último/a", + "Fourth Last" : "4.º/ª Último/a", + "Fifth Last" : "5.º/ª Último/a", "Contacts" : "Contatos", "{actor} created address book {addressbook}" : "{actor} criou o catálogo de endereços {addressbook}", "You created address book {addressbook}" : "Você criou o catálogo de endereços {addressbook}", diff --git a/apps/dav/l10n/pt_BR.json b/apps/dav/l10n/pt_BR.json index d2f229a8046..c57088cb0ed 100644 --- a/apps/dav/l10n/pt_BR.json +++ b/apps/dav/l10n/pt_BR.json @@ -102,22 +102,22 @@ "Every %1$d Weeks on %2$s for the entire day until %3$s" : "A Cada %1$d Semanas, %2$s para o dia inteiro até %3$s", "Every %1$d Weeks on %2$s between %3$s - %4$s" : "A Cada %1$d Semanas, %2$s entre %3$s - %4$s", "Every %1$d Weeks on %2$s between %3$s - %4$s until %5$s" : "A Cada %1$d Semanas, %2$s entre %3$s - %4$s até %5$s", - "Every Month on the %1$s for the entire day" : "Todo Mês no dia %1$s para o dia inteiro", - "Every Month on the %1$s for the entire day until %2$s" : "Todo Mês no dia %1$s para o dia inteiro até %2$s", - "Every Month on the %1$s between %2$s - %3$s" : "Todo Mês no dia %1$s entre %2$s - %3$s", - "Every Month on the %1$s between %2$s - %3$s until %4$s" : "Todo Mês no dia %1$s entre %2$s - %3$s até %4$s", - "Every %1$d Months on the %2$s for the entire day" : "A Cada %1$d Meses no dia %2$s para o dia inteiro", - "Every %1$d Months on the %2$s for the entire day until %3$s" : "A Cada %1$d Meses no dia %2$s para o dia inteiro até %3$s", - "Every %1$d Months on the %2$s between %3$s - %4$s" : "A Cada %1$d Meses no dia %2$s entre %3$s - %4$s", - "Every %1$d Months on the %2$s between %3$s - %4$s until %5$s" : "A Cada %1$d Meses no dia %2$s entre %3$s - %4$s até %5$s", - "Every Year in %1$s on the %2$s for the entire day" : "Todo Ano em %1$s no dia %2$s para o dia inteiro", - "Every Year in %1$s on the %2$s for the entire day until %3$s" : "Todo Ano em %1$s no dia %2$s para o dia inteiro até %3$s", - "Every Year in %1$s on the %2$s between %3$s - %4$s" : "Todo Ano em %1$s no dia %2$s entre %3$s - %4$s", - "Every Year in %1$s on the %2$s between %3$s - %4$s until %5$s" : "Todo Ano em %1$s no dia %2$s entre %3$s - %4$s até %5$s", - "Every %1$d Years in %2$s on the %3$s for the entire day" : "A Cada %1$d Anos em %2$s no dia %3$s para o dia inteiro", - "Every %1$d Years in %2$s on the %3$s for the entire day until %4$s" : "A Cada %1$d Anos em %2$s no dia %3$s para o dia inteiro até %4$s", - "Every %1$d Years in %2$s on the %3$s between %4$s - %5$s" : "A Cada %1$d Anos em %2$s no dia %3$s entre %4$s - %5$s ", - "Every %1$d Years in %2$s on the %3$s between %4$s - %5$s until %6$s" : "A Cada %1$d Anos em %2$s no dia %3$s entre %4$s - %5$s até %6$s", + "Every Month on the %1$s for the entire day" : "Todo Mês, dia: %1$s, para o dia inteiro", + "Every Month on the %1$s for the entire day until %2$s" : "Todo Mês, dia: %1$s, para o dia inteiro até %2$s", + "Every Month on the %1$s between %2$s - %3$s" : "Todo Mês, dia: %1$s, entre %2$s - %3$s", + "Every Month on the %1$s between %2$s - %3$s until %4$s" : "Todo Mês, dia: %1$s, entre %2$s - %3$s até %4$s", + "Every %1$d Months on the %2$s for the entire day" : "A Cada %1$d Meses, dia: %2$s, para o dia inteiro", + "Every %1$d Months on the %2$s for the entire day until %3$s" : "A Cada %1$d Meses, dia: %2$s, para o dia inteiro até %3$s", + "Every %1$d Months on the %2$s between %3$s - %4$s" : "A Cada %1$d Meses, dia: %2$s, entre %3$s - %4$s", + "Every %1$d Months on the %2$s between %3$s - %4$s until %5$s" : "A Cada %1$d Meses, dia: %2$s, entre %3$s - %4$s até %5$s", + "Every Year in %1$s on the %2$s for the entire day" : "Todo Ano em %1$s, dia: %2$s, para o dia inteiro", + "Every Year in %1$s on the %2$s for the entire day until %3$s" : "Todo Ano em %1$s, dia: %2$s, para o dia inteiro até %3$s", + "Every Year in %1$s on the %2$s between %3$s - %4$s" : "Todo Ano em %1$s, dia: %2$s, entre %3$s - %4$s", + "Every Year in %1$s on the %2$s between %3$s - %4$s until %5$s" : "Todo Ano em %1$s, dia: %2$s, entre %3$s - %4$s até %5$s", + "Every %1$d Years in %2$s on the %3$s for the entire day" : "A Cada %1$d Anos em %2$s, dia: %3$s, para o dia inteiro", + "Every %1$d Years in %2$s on the %3$s for the entire day until %4$s" : "A Cada %1$d Anos em %2$s, dia: %3$s, para o dia inteiro até %4$s", + "Every %1$d Years in %2$s on the %3$s between %4$s - %5$s" : "A Cada %1$d Anos em %2$s, dia: %3$s, entre %4$s - %5$s ", + "Every %1$d Years in %2$s on the %3$s between %4$s - %5$s until %6$s" : "A Cada %1$d Anos em %2$s, dia: %3$s, entre %4$s - %5$s até %6$s", "On specific dates for the entire day until %1$s" : "Em datas específicas para o dia inteiro até %1$s", "On specific dates between %1$s - %2$s until %3$s" : "Em datas específicas entre %1$s - %2$s até %3$s", "In the past on %1$s" : "No passado em %1$s", @@ -183,16 +183,16 @@ "October" : "Outubro", "November" : "Novembro", "December" : "Dezembro", - "First" : "Primeiro/a", - "Second" : "Segundo/a", - "Third" : "Terço/a", - "Fourth" : "Quarto/a", - "Fifth" : "Quinto/a", + "First" : "1.º/ª", + "Second" : "2.º/ª", + "Third" : "3.º/ª", + "Fourth" : "4.º/ª", + "Fifth" : "5.º/ª", "Last" : "Último/a", "Second Last" : "Penúltimo/a", - "Third Last" : "Terceiro/a Último/a", - "Fourth Last" : "Quarto/a Último/a", - "Fifth Last" : "Quinto/a Último/a", + "Third Last" : "3.º/ª Último/a", + "Fourth Last" : "4.º/ª Último/a", + "Fifth Last" : "5.º/ª Último/a", "Contacts" : "Contatos", "{actor} created address book {addressbook}" : "{actor} criou o catálogo de endereços {addressbook}", "You created address book {addressbook}" : "Você criou o catálogo de endereços {addressbook}", diff --git a/apps/dav/lib/BulkUpload/MultipartRequestParser.php b/apps/dav/lib/BulkUpload/MultipartRequestParser.php index 96a90f82cde..f23aca580cc 100644 --- a/apps/dav/lib/BulkUpload/MultipartRequestParser.php +++ b/apps/dav/lib/BulkUpload/MultipartRequestParser.php @@ -57,7 +57,13 @@ class MultipartRequestParser { */ private function parseBoundaryFromHeaders(string $contentType): string { try { + if (!str_contains($contentType, ';')) { + throw new \InvalidArgumentException('No semicolon in header'); + } [$mimeType, $boundary] = explode(';', $contentType); + if (!str_contains($boundary, '=')) { + throw new \InvalidArgumentException('No equal in boundary header'); + } [$boundaryKey, $boundaryValue] = explode('=', $boundary); } catch (\Exception $e) { throw new BadRequest('Error while parsing boundary in Content-Type header.', Http::STATUS_BAD_REQUEST, $e); diff --git a/apps/dav/tests/unit/Avatars/AvatarHomeTest.php b/apps/dav/tests/unit/Avatars/AvatarHomeTest.php index c0c19192ba9..aaa930b6c19 100644 --- a/apps/dav/tests/unit/Avatars/AvatarHomeTest.php +++ b/apps/dav/tests/unit/Avatars/AvatarHomeTest.php @@ -6,7 +6,7 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2017 ownCloud GmbH * SPDX-License-Identifier: AGPL-3.0-only */ -namespace OCA\DAV\Tests\Unit\Avatars; +namespace OCA\DAV\Tests\unit\Avatars; use OCA\DAV\Avatars\AvatarHome; use OCA\DAV\Avatars\AvatarNode; diff --git a/apps/dav/tests/unit/Avatars/AvatarNodeTest.php b/apps/dav/tests/unit/Avatars/AvatarNodeTest.php index 01634e77ed6..0ca147a1f3b 100644 --- a/apps/dav/tests/unit/Avatars/AvatarNodeTest.php +++ b/apps/dav/tests/unit/Avatars/AvatarNodeTest.php @@ -6,7 +6,7 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2017 ownCloud GmbH * SPDX-License-Identifier: AGPL-3.0-only */ -namespace OCA\DAV\Tests\Unit\Avatars; +namespace OCA\DAV\Tests\unit\Avatars; use OCA\DAV\Avatars\AvatarNode; use OCP\IAvatar; diff --git a/apps/dav/tests/unit/CapabilitiesTest.php b/apps/dav/tests/unit/CapabilitiesTest.php index 21d00ef183f..ad70d576d48 100644 --- a/apps/dav/tests/unit/CapabilitiesTest.php +++ b/apps/dav/tests/unit/CapabilitiesTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/apps/dav/tests/unit/CardDAV/Activity/BackendTest.php b/apps/dav/tests/unit/CardDAV/Activity/BackendTest.php index 134a6ca5ca0..4de1cf25cc5 100644 --- a/apps/dav/tests/unit/CardDAV/Activity/BackendTest.php +++ b/apps/dav/tests/unit/CardDAV/Activity/BackendTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -20,20 +22,11 @@ use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class BackendTest extends TestCase { - /** @var IManager|MockObject */ - protected $activityManager; - - /** @var IGroupManager|MockObject */ - protected $groupManager; - - /** @var IUserSession|MockObject */ - protected $userSession; - - /** @var IAppManager|MockObject */ - protected $appManager; - - /** @var IUserManager|MockObject */ - protected $userManager; + protected IManager&MockObject $activityManager; + protected IGroupManager&MockObject $groupManager; + protected IUserSession&MockObject $userSession; + protected IAppManager&MockObject $appManager; + protected IUserManager&MockObject $userManager; protected function setUp(): void { parent::setUp(); @@ -45,10 +38,9 @@ class BackendTest extends TestCase { } /** - * @param array $methods * @return Backend|MockObject */ - protected function getBackend(array $methods = []) { + protected function getBackend(array $methods = []): Backend { if (empty($methods)) { return new Backend( $this->activityManager, @@ -71,7 +63,7 @@ class BackendTest extends TestCase { } } - public function dataCallTriggerAddressBookActivity(): array { + public static function dataCallTriggerAddressBookActivity(): array { return [ ['onAddressbookCreate', [['data']], Addressbook::SUBJECT_ADD, [['data'], [], []]], ['onAddressbookUpdate', [['data'], ['shares'], ['changed-properties']], Addressbook::SUBJECT_UPDATE, [['data'], ['shares'], ['changed-properties']]], @@ -95,7 +87,7 @@ class BackendTest extends TestCase { call_user_func_array([$backend, $method], $payload); } - public function dataTriggerAddressBookActivity(): array { + public static function dataTriggerAddressBookActivity(): array { return [ // Add addressbook [Addressbook::SUBJECT_ADD, [], [], [], '', '', null, []], @@ -160,12 +152,6 @@ class BackendTest extends TestCase { /** * @dataProvider dataTriggerAddressBookActivity - * @param string $action - * @param array $data - * @param array $shares - * @param array $changedProperties - * @param string $currentUser - * @param string $author * @param string[]|null $shareUsers * @param string[] $users */ @@ -219,13 +205,13 @@ class BackendTest extends TestCase { ->method('userExists') ->willReturn(true); - $event->expects($this->exactly(sizeof($users))) + $event->expects($this->exactly(count($users))) ->method('setAffectedUser') ->willReturnSelf(); - $event->expects($this->exactly(sizeof($users))) + $event->expects($this->exactly(count($users))) ->method('setSubject') ->willReturnSelf(); - $this->activityManager->expects($this->exactly(sizeof($users))) + $this->activityManager->expects($this->exactly(count($users))) ->method('publish') ->with($event); } else { @@ -261,7 +247,7 @@ class BackendTest extends TestCase { ], [], []]); } - public function dataTriggerCardActivity(): array { + public static function dataTriggerCardActivity(): array { $cardData = "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.4.8//EN\r\nUID:test-user\r\nFN:test-user\r\nN:test-user;;;;\r\nEND:VCARD\r\n\r\n"; return [ @@ -330,12 +316,6 @@ class BackendTest extends TestCase { /** * @dataProvider dataTriggerCardActivity - * @param string $action - * @param array $addressBookData - * @param array $shares - * @param array $cardData - * @param string $currentUser - * @param string $author * @param string[]|null $shareUsers * @param string[] $users */ @@ -385,13 +365,13 @@ class BackendTest extends TestCase { ->with($author) ->willReturnSelf(); - $event->expects($this->exactly(sizeof($users))) + $event->expects($this->exactly(count($users))) ->method('setAffectedUser') ->willReturnSelf(); - $event->expects($this->exactly(sizeof($users))) + $event->expects($this->exactly(count($users))) ->method('setSubject') ->willReturnSelf(); - $this->activityManager->expects($this->exactly(sizeof($users))) + $this->activityManager->expects($this->exactly(count($users))) ->method('publish') ->with($event); } else { @@ -409,7 +389,7 @@ class BackendTest extends TestCase { $this->assertEmpty($this->invokePrivate($backend, 'triggerCardActivity', [Card::SUBJECT_UPDATE, ['principaluri' => 'principals/system/system'], [], []])); } - public function dataGetUsersForShares(): array { + public static function dataGetUsersForShares(): array { return [ [ [], @@ -454,9 +434,6 @@ class BackendTest extends TestCase { /** * @dataProvider dataGetUsersForShares - * @param array $shares - * @param array $groups - * @param array $expected */ public function testGetUsersForShares(array $shares, array $groups, array $expected): void { $backend = $this->getBackend(); @@ -498,10 +475,9 @@ class BackendTest extends TestCase { } /** - * @param string $uid * @return IUser|MockObject */ - protected function getUserMock(string $uid) { + protected function getUserMock(string $uid): IUser { $user = $this->createMock(IUser::class); $user->expects($this->once()) ->method('getUID') diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php index a8bfc1b41fd..cfb14a5d567 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -12,32 +12,20 @@ use OCA\DAV\CardDAV\AddressBookImpl; use OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\Db\PropertyMapper; use OCP\IURLGenerator; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\VObject\Component\VCard; use Sabre\VObject\Property\Text; //use Sabre\VObject\Property\; use Test\TestCase; class AddressBookImplTest extends TestCase { - /** @var AddressBookImpl */ - private $addressBookImpl; - - /** @var array */ - private $addressBookInfo; - - /** @var AddressBook | \PHPUnit\Framework\MockObject\MockObject */ - private $addressBook; - - /** @var IURLGenerator | \PHPUnit\Framework\MockObject\MockObject */ - private $urlGenerator; - - /** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject */ - private $backend; - - /** @var PropertyMapper | \PHPUnit\Framework\MockObject\MockObject */ - private $propertyMapper; - - /** @var VCard | \PHPUnit\Framework\MockObject\MockObject */ - private $vCard; + private array $addressBookInfo; + private AddressBook&MockObject $addressBook; + private IURLGenerator&MockObject $urlGenerator; + private CardDavBackend&MockObject $backend; + private PropertyMapper&MockObject $propertyMapper; + private VCard&MockObject $vCard; + private AddressBookImpl $addressBookImpl; protected function setUp(): void { parent::setUp(); @@ -48,10 +36,8 @@ class AddressBookImplTest extends TestCase { 'principaluri' => 'principals/system/system', '{DAV:}displayname' => 'display name', ]; - $this->addressBook = $this->getMockBuilder(AddressBook::class) - ->disableOriginalConstructor()->getMock(); - $this->backend = $this->getMockBuilder(CardDavBackend::class) - ->disableOriginalConstructor()->getMock(); + $this->addressBook = $this->createMock(AddressBook::class); + $this->backend = $this->createMock(CardDavBackend::class); $this->vCard = $this->createMock(VCard::class); $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->propertyMapper = $this->createMock(PropertyMapper::class); @@ -77,7 +63,7 @@ class AddressBookImplTest extends TestCase { } public function testSearch(): void { - /** @var \PHPUnit\Framework\MockObject\MockObject | AddressBookImpl $addressBookImpl */ + /** @var MockObject&AddressBookImpl $addressBookImpl */ $addressBookImpl = $this->getMockBuilder(AddressBookImpl::class) ->setConstructorArgs( [ @@ -89,7 +75,7 @@ class AddressBookImplTest extends TestCase { null ] ) - ->setMethods(['vCard2Array', 'readCard']) + ->onlyMethods(['vCard2Array', 'readCard']) ->getMock(); $pattern = 'pattern'; @@ -107,10 +93,10 @@ class AddressBookImplTest extends TestCase { $addressBookImpl->expects($this->exactly(2))->method('readCard') ->willReturn($this->vCard); $addressBookImpl->expects($this->exactly(2))->method('vCard2Array') - ->withConsecutive( - ['foo.vcf', $this->vCard], - ['bar.vcf', $this->vCard] - )->willReturn('vCard'); + ->willReturnMap([ + ['foo.vcf', $this->vCard, 'vCard'], + ['bar.vcf', $this->vCard, 'vCard'], + ]); $result = $addressBookImpl->search($pattern, $searchProperties, []); $this->assertTrue((is_array($result))); @@ -119,13 +105,11 @@ class AddressBookImplTest extends TestCase { /** * @dataProvider dataTestCreate - * - * @param array $properties */ - public function testCreate($properties): void { + public function testCreate(array $properties): void { $uid = 'uid'; - /** @var \PHPUnit\Framework\MockObject\MockObject | AddressBookImpl $addressBookImpl */ + /** @var MockObject&AddressBookImpl $addressBookImpl */ $addressBookImpl = $this->getMockBuilder(AddressBookImpl::class) ->setConstructorArgs( [ @@ -137,7 +121,7 @@ class AddressBookImplTest extends TestCase { null ] ) - ->setMethods(['vCard2Array', 'createUid', 'createEmptyVCard']) + ->onlyMethods(['vCard2Array', 'createUid', 'createEmptyVCard']) ->getMock(); $expectedProperties = 0; @@ -164,7 +148,7 @@ class AddressBookImplTest extends TestCase { $this->assertTrue($addressBookImpl->createOrUpdate($properties)); } - public function dataTestCreate() { + public static function dataTestCreate(): array { return [ [[]], [['FN' => 'John Doe']], @@ -177,7 +161,7 @@ class AddressBookImplTest extends TestCase { $uri = 'bla.vcf'; $properties = ['URI' => $uri, 'UID' => $uid, 'FN' => 'John Doe']; - /** @var \PHPUnit\Framework\MockObject\MockObject | AddressBookImpl $addressBookImpl */ + /** @var MockObject&AddressBookImpl $addressBookImpl */ $addressBookImpl = $this->getMockBuilder(AddressBookImpl::class) ->setConstructorArgs( [ @@ -189,7 +173,7 @@ class AddressBookImplTest extends TestCase { null ] ) - ->setMethods(['vCard2Array', 'createUid', 'createEmptyVCard', 'readCard']) + ->onlyMethods(['vCard2Array', 'createUid', 'createEmptyVCard', 'readCard']) ->getMock(); $addressBookImpl->expects($this->never())->method('createUid'); @@ -216,7 +200,7 @@ class AddressBookImplTest extends TestCase { $vCard = new vCard; $textProperty = $vCard->createProperty('KEY', 'value'); - /** @var \PHPUnit\Framework\MockObject\MockObject | AddressBookImpl $addressBookImpl */ + /** @var MockObject&AddressBookImpl $addressBookImpl */ $addressBookImpl = $this->getMockBuilder(AddressBookImpl::class) ->setConstructorArgs( [ @@ -228,7 +212,7 @@ class AddressBookImplTest extends TestCase { null ] ) - ->setMethods(['vCard2Array', 'createUid', 'createEmptyVCard', 'readCard']) + ->onlyMethods(['vCard2Array', 'createUid', 'createEmptyVCard', 'readCard']) ->getMock(); $this->backend->expects($this->once())->method('getCard') @@ -248,11 +232,8 @@ class AddressBookImplTest extends TestCase { /** * @dataProvider dataTestGetPermissions - * - * @param array $permissions - * @param int $expected */ - public function testGetPermissions($permissions, $expected): void { + public function testGetPermissions(array $permissions, int $expected): void { $this->addressBook->expects($this->once())->method('getACL') ->willReturn($permissions); @@ -261,7 +242,7 @@ class AddressBookImplTest extends TestCase { ); } - public function dataTestGetPermissions() { + public static function dataTestGetPermissions(): array { return [ [[], 0], [[['privilege' => '{DAV:}read']], 1], @@ -299,7 +280,7 @@ class AddressBookImplTest extends TestCase { } public function testCreateUid(): void { - /** @var \PHPUnit\Framework\MockObject\MockObject | AddressBookImpl $addressBookImpl */ + /** @var MockObject&AddressBookImpl $addressBookImpl */ $addressBookImpl = $this->getMockBuilder(AddressBookImpl::class) ->setConstructorArgs( [ @@ -311,7 +292,7 @@ class AddressBookImplTest extends TestCase { null ] ) - ->setMethods(['getUid']) + ->onlyMethods(['getUid']) ->getMock(); $addressBookImpl->expects($this->exactly(2)) diff --git a/apps/dav/tests/unit/CardDAV/AddressBookTest.php b/apps/dav/tests/unit/CardDAV/AddressBookTest.php index cbdb9a1402c..043b192e2c8 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -28,19 +29,20 @@ class AddressBookTest extends TestCase { 'uri' => 'default', ]; $l10n = $this->createMock(IL10N::class); - $logger = $this->createMock(LoggerInterface::class); - $addressBook = new AddressBook($backend, $addressBookInfo, $l10n, $logger); + $addressBook = new AddressBook($backend, $addressBookInfo, $l10n); $card = new Card($backend, $addressBookInfo, ['id' => 5, 'carddata' => 'RANDOM VCF DATA', 'uri' => 'something', 'addressbookid' => 23]); - $backend->expects($this->once())->method('moveCard')->with(23, 666, 'something', 'user1')->willReturn(true); + $backend->expects($this->once())->method('moveCard') + ->with(23, 666, 'something', 'user1') + ->willReturn(true); $addressBook->moveInto('new', 'old', $card); } public function testDelete(): void { /** @var MockObject | CardDavBackend $backend */ - $backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock(); + $backend = $this->createMock(CardDavBackend::class); $backend->expects($this->once())->method('updateShares'); $backend->expects($this->any())->method('getShares')->willReturn([ ['href' => 'principal:user2'] @@ -54,7 +56,7 @@ class AddressBookTest extends TestCase { ]; $l10n = $this->createMock(IL10N::class); $logger = $this->createMock(LoggerInterface::class); - $addressBook = new AddressBook($backend, $addressBookInfo, $l10n, $logger); + $addressBook = new AddressBook($backend, $addressBookInfo, $l10n); $addressBook->delete(); } @@ -63,7 +65,7 @@ class AddressBookTest extends TestCase { $this->expectException(Forbidden::class); /** @var MockObject | CardDavBackend $backend */ - $backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock(); + $backend = $this->createMock(CardDavBackend::class); $backend->expects($this->never())->method('updateShares'); $backend->expects($this->any())->method('getShares')->willReturn([ ['href' => 'principal:group2'] @@ -77,14 +79,14 @@ class AddressBookTest extends TestCase { ]; $l10n = $this->createMock(IL10N::class); $logger = $this->createMock(LoggerInterface::class); - $addressBook = new AddressBook($backend, $addressBookInfo, $l10n, $logger); + $addressBook = new AddressBook($backend, $addressBookInfo, $l10n); $addressBook->delete(); } public function testPropPatchShared(): void { /** @var MockObject | CardDavBackend $backend */ - $backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock(); + $backend = $this->createMock(CardDavBackend::class); $backend->expects($this->never())->method('updateAddressBook'); $addressBookInfo = [ '{http://owncloud.org/ns}owner-principal' => 'user1', @@ -95,13 +97,13 @@ class AddressBookTest extends TestCase { ]; $l10n = $this->createMock(IL10N::class); $logger = $this->createMock(LoggerInterface::class); - $addressBook = new AddressBook($backend, $addressBookInfo, $l10n, $logger); + $addressBook = new AddressBook($backend, $addressBookInfo, $l10n); $addressBook->propPatch(new PropPatch(['{DAV:}displayname' => 'Test address book'])); } public function testPropPatchNotShared(): void { /** @var MockObject | CardDavBackend $backend */ - $backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock(); + $backend = $this->createMock(CardDavBackend::class); $backend->expects($this->atLeast(1))->method('updateAddressBook'); $addressBookInfo = [ '{DAV:}displayname' => 'Test address book', @@ -111,16 +113,16 @@ class AddressBookTest extends TestCase { ]; $l10n = $this->createMock(IL10N::class); $logger = $this->createMock(LoggerInterface::class); - $addressBook = new AddressBook($backend, $addressBookInfo, $l10n, $logger); + $addressBook = new AddressBook($backend, $addressBookInfo, $l10n); $addressBook->propPatch(new PropPatch(['{DAV:}displayname' => 'Test address book'])); } /** * @dataProvider providesReadOnlyInfo */ - public function testAcl($expectsWrite, $readOnlyValue, $hasOwnerSet): void { + public function testAcl(bool $expectsWrite, ?bool $readOnlyValue, bool $hasOwnerSet): void { /** @var MockObject | CardDavBackend $backend */ - $backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock(); + $backend = $this->createMock(CardDavBackend::class); $backend->expects($this->any())->method('applyShareAcl')->willReturnArgument(1); $addressBookInfo = [ '{DAV:}displayname' => 'Test address book', @@ -136,7 +138,7 @@ class AddressBookTest extends TestCase { } $l10n = $this->createMock(IL10N::class); $logger = $this->createMock(LoggerInterface::class); - $addressBook = new AddressBook($backend, $addressBookInfo, $l10n, $logger); + $addressBook = new AddressBook($backend, $addressBookInfo, $l10n); $acl = $addressBook->getACL(); $childAcl = $addressBook->getChildACL(); @@ -171,7 +173,7 @@ class AddressBookTest extends TestCase { $this->assertEquals($expectedAcl, $childAcl); } - public function providesReadOnlyInfo(): array { + public static function providesReadOnlyInfo(): array { return [ 'read-only property not set' => [true, null, true], 'read-only property is false' => [true, false, true], diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php index aeee04fd6ee..5a1210da339 100644 --- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -14,25 +15,19 @@ use OCA\DAV\DAV\GroupPrincipalBackend; use OCP\IConfig; use OCP\IDBConnection; use OCP\IL10N; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\VObject\Component\VCalendar; use Sabre\VObject\Reader; use Test\TestCase; class BirthdayServiceTest extends TestCase { - /** @var BirthdayService */ - private $service; - /** @var CalDavBackend | \PHPUnit\Framework\MockObject\MockObject */ - private $calDav; - /** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject */ - private $cardDav; - /** @var GroupPrincipalBackend | \PHPUnit\Framework\MockObject\MockObject */ - private $groupPrincipalBackend; - /** @var IConfig | \PHPUnit\Framework\MockObject\MockObject */ - private $config; - /** @var IDBConnection | \PHPUnit\Framework\MockObject\MockObject */ - private $dbConnection; - /** @var IL10N | \PHPUnit\Framework\MockObject\MockObject */ - private $l10n; + private CalDavBackend&MockObject $calDav; + private CardDavBackend&MockObject $cardDav; + private GroupPrincipalBackend&MockObject $groupPrincipalBackend; + private IConfig&MockObject $config; + private IDBConnection&MockObject $dbConnection; + private IL10N&MockObject $l10n; + private BirthdayService $service; protected function setUp(): void { parent::setUp(); @@ -57,16 +52,8 @@ class BirthdayServiceTest extends TestCase { /** * @dataProvider providesVCards - * @param string $expectedSummary - * @param string $expectedDTStart - * @param string $expectedRrule - * @param string $expectedFieldType - * @param string $expectedUnknownYear - * @param string $expectedOriginalYear - * @param string|null $expectedReminder - * @param string | null $data */ - public function testBuildBirthdayFromContact($expectedSummary, $expectedDTStart, $expectedRrule, $expectedFieldType, $expectedUnknownYear, $expectedOriginalYear, $expectedReminder, $data, $fieldType, $prefix, $supports4Bytes, $configuredReminder): void { + public function testBuildBirthdayFromContact(?string $expectedSummary, ?string $expectedDTStart, ?string $expectedRrule, ?string $expectedFieldType, ?string $expectedUnknownYear, ?string $expectedOriginalYear, ?string $expectedReminder, ?string $data, string $fieldType, string $prefix, bool $supports4Bytes, ?string $configuredReminder): void { $this->dbConnection->method('supports4ByteText')->willReturn($supports4Bytes); $cal = $this->service->buildDateFromContact($data, $fieldType, $prefix, $configuredReminder); @@ -152,13 +139,17 @@ class BirthdayServiceTest extends TestCase { ->willReturn([ 'id' => 1234 ]); - $this->calDav->expects($this->exactly(3)) + $calls = [ + [1234, 'default-gump.vcf.ics'], + [1234, 'default-gump.vcf-death.ics'], + [1234, 'default-gump.vcf-anniversary.ics'], + ]; + $this->calDav->expects($this->exactly(count($calls))) ->method('deleteCalendarObject') - ->withConsecutive( - [1234, 'default-gump.vcf.ics'], - [1234, 'default-gump.vcf-death.ics'], - [1234, 'default-gump.vcf-anniversary.ics'], - ); + ->willReturnCallback(function ($calendarId, $objectUri) use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, [$calendarId, $objectUri]); + }); $this->cardDav->expects($this->once())->method('getShares')->willReturn([]); $this->service->onCardDeleted(666, 'gump.vcf'); @@ -173,7 +164,7 @@ class BirthdayServiceTest extends TestCase { $this->cardDav->expects($this->never())->method('getAddressBookById'); $service = $this->getMockBuilder(BirthdayService::class) - ->setMethods(['buildDateFromContact', 'birthdayEvenChanged']) + ->onlyMethods(['buildDateFromContact', 'birthdayEvenChanged']) ->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection, $this->l10n]) ->getMock(); @@ -200,9 +191,9 @@ class BirthdayServiceTest extends TestCase { $this->cardDav->expects($this->once())->method('getShares')->willReturn([]); $this->calDav->expects($this->never())->method('getCalendarByUri'); - /** @var BirthdayService | \PHPUnit\Framework\MockObject\MockObject $service */ + /** @var BirthdayService&MockObject $service */ $service = $this->getMockBuilder(BirthdayService::class) - ->setMethods(['buildDateFromContact', 'birthdayEvenChanged']) + ->onlyMethods(['buildDateFromContact', 'birthdayEvenChanged']) ->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection, $this->l10n]) ->getMock(); @@ -212,7 +203,7 @@ class BirthdayServiceTest extends TestCase { /** * @dataProvider providesCardChanges */ - public function testOnCardChanged($expectedOp): void { + public function testOnCardChanged(string $expectedOp): void { $this->config->expects($this->once()) ->method('getAppValue') ->with('dav', 'generateBirthdayCalendar', 'yes') @@ -220,11 +211,10 @@ class BirthdayServiceTest extends TestCase { $this->config->expects($this->exactly(2)) ->method('getUserValue') - ->withConsecutive( - ['user01', 'dav', 'generateBirthdayCalendar', 'yes'], - ['user01', 'dav', 'birthdayCalendarReminderOffset', 'PT9H'], - ) - ->willReturnOnConsecutiveCalls('yes', 'PT9H'); + ->willReturnMap([ + ['user01', 'dav', 'generateBirthdayCalendar', 'yes', 'yes'], + ['user01', 'dav', 'birthdayCalendarReminderOffset', 'PT9H', 'PT9H'], + ]); $this->cardDav->expects($this->once())->method('getAddressBookById') ->with(666) @@ -239,31 +229,45 @@ class BirthdayServiceTest extends TestCase { ]); $this->cardDav->expects($this->once())->method('getShares')->willReturn([]); - /** @var BirthdayService | \PHPUnit\Framework\MockObject\MockObject $service */ + /** @var BirthdayService&MockObject $service */ $service = $this->getMockBuilder(BirthdayService::class) - ->setMethods(['buildDateFromContact', 'birthdayEvenChanged']) + ->onlyMethods(['buildDateFromContact', 'birthdayEvenChanged']) ->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection, $this->l10n]) ->getMock(); if ($expectedOp === 'delete') { $this->calDav->expects($this->exactly(3))->method('getCalendarObject')->willReturn(''); $service->expects($this->exactly(3))->method('buildDateFromContact')->willReturn(null); - $this->calDav->expects($this->exactly(3))->method('deleteCalendarObject')->withConsecutive( + + $calls = [ [1234, 'default-gump.vcf.ics'], [1234, 'default-gump.vcf-death.ics'], [1234, 'default-gump.vcf-anniversary.ics'] - ); + ]; + $this->calDav->expects($this->exactly(count($calls))) + ->method('deleteCalendarObject') + ->willReturnCallback(function ($calendarId, $objectUri) use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, [$calendarId, $objectUri]); + }); } if ($expectedOp === 'create') { $vCal = new VCalendar(); $vCal->PRODID = '-//Nextcloud testing//mocked object//'; $service->expects($this->exactly(3))->method('buildDateFromContact')->willReturn($vCal); - $this->calDav->expects($this->exactly(3))->method('createCalendarObject')->withConsecutive( + + $createCalendarObjectCalls = [ [1234, 'default-gump.vcf.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"], [1234, 'default-gump.vcf-death.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"], [1234, 'default-gump.vcf-anniversary.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"] - ); + ]; + $this->calDav->expects($this->exactly(count($createCalendarObjectCalls))) + ->method('createCalendarObject') + ->willReturnCallback(function ($calendarId, $objectUri, $calendarData) use (&$createCalendarObjectCalls) { + $expected = array_shift($createCalendarObjectCalls); + $this->assertEquals($expected, [$calendarId, $objectUri, $calendarData]); + }); } if ($expectedOp === 'update') { $vCal = new VCalendar(); @@ -272,11 +276,18 @@ class BirthdayServiceTest extends TestCase { $service->expects($this->exactly(3))->method('buildDateFromContact')->willReturn($vCal); $service->expects($this->exactly(3))->method('birthdayEvenChanged')->willReturn(true); $this->calDav->expects($this->exactly(3))->method('getCalendarObject')->willReturn(['calendardata' => '']); - $this->calDav->expects($this->exactly(3))->method('updateCalendarObject')->withConsecutive( + + $updateCalendarObjectCalls = [ [1234, 'default-gump.vcf.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"], [1234, 'default-gump.vcf-death.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"], [1234, 'default-gump.vcf-anniversary.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"] - ); + ]; + $this->calDav->expects($this->exactly(count($updateCalendarObjectCalls))) + ->method('updateCalendarObject') + ->willReturnCallback(function ($calendarId, $objectUri, $calendarData) use (&$updateCalendarObjectCalls) { + $expected = array_shift($updateCalendarObjectCalls); + $this->assertEquals($expected, [$calendarId, $objectUri, $calendarData]); + }); } $service->onCardChanged(666, 'gump.vcf', ''); @@ -284,11 +295,8 @@ class BirthdayServiceTest extends TestCase { /** * @dataProvider providesBirthday - * @param $expected - * @param $old - * @param $new */ - public function testBirthdayEvenChanged($expected, $old, $new): void { + public function testBirthdayEvenChanged(bool $expected, string $old, string $new): void { $new = Reader::read($new); $this->assertEquals($expected, $this->service->birthdayEvenChanged($old, $new)); } @@ -354,18 +362,22 @@ class BirthdayServiceTest extends TestCase { ->with(42, 0) ->willReturn([['uri' => '1.ics'], ['uri' => '2.ics'], ['uri' => '3.ics']]); - $this->calDav->expects($this->exactly(3)) + $calls = [ + [42, '1.ics', 0], + [42, '2.ics', 0], + [42, '3.ics', 0], + ]; + $this->calDav->expects($this->exactly(count($calls))) ->method('deleteCalendarObject') - ->withConsecutive( - [42, '1.ics', 0], - [42, '2.ics', 0], - [42, '3.ics', 0], - ); + ->willReturnCallback(function ($calendarId, $objectUri, $calendarType) use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, [$calendarId, $objectUri, $calendarType]); + }); $this->service->resetForUser('user123'); } - public function providesBirthday() { + public static function providesBirthday(): array { return [ [true, '', @@ -382,7 +394,7 @@ class BirthdayServiceTest extends TestCase { ]; } - public function providesCardChanges() { + public static function providesCardChanges(): array { return[ ['delete'], ['create'], @@ -390,7 +402,7 @@ class BirthdayServiceTest extends TestCase { ]; } - public function providesVCards() { + public static function providesVCards(): array { return [ // $expectedSummary, $expectedDTStart, $expectedRrule, $expectedFieldType, $expectedUnknownYear, $expectedOriginalYear, $expectedReminder, $data, $fieldType, $prefix, $supports4Byte, $configuredReminder [null, null, null, null, null, null, null, 'yasfewf', '', '', true, null], diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index 1516d41ea39..8a279d31b02 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -29,6 +29,7 @@ use OCP\IUserSession; use OCP\L10N\IFactory; use OCP\Server; use OCP\Share\IManager as ShareManager; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Sabre\DAV\Exception\BadRequest; use Sabre\DAV\PropPatch; @@ -45,29 +46,15 @@ use function time; * @package OCA\DAV\Tests\unit\CardDAV */ class CardDavBackendTest extends TestCase { - /** @var CardDavBackend */ - private $backend; - - /** @var Principal | \PHPUnit\Framework\MockObject\MockObject */ - private $principal; - - /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ - private $userManager; - - /** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */ - private $groupManager; - - /** @var IEventDispatcher|MockObject */ - private $dispatcher; + private Principal&MockObject $principal; + private IUserManager&MockObject $userManager; + private IGroupManager&MockObject $groupManager; + private IEventDispatcher&MockObject $dispatcher; private Backend $sharingBackend; - /** @var IDBConnection */ - private $db; - - /** @var string */ - private $dbCardsTable = 'cards'; - - /** @var string */ - private $dbCardsPropertiesTable = 'cards_properties'; + private IDBConnection $db; + private CardDavBackend $backend; + private string $dbCardsTable = 'cards'; + private string $dbCardsPropertiesTable = 'cards_properties'; public const UNIT_TEST_USER = 'principals/users/carddav-unit-test'; public const UNIT_TEST_USER1 = 'principals/users/carddav-unit-test1'; @@ -122,7 +109,7 @@ class CardDavBackendTest extends TestCase { $this->createMock(IConfig::class), $this->createMock(IFactory::class) ]) - ->setMethods(['getPrincipalByPath', 'getGroupMembership', 'findByUri']) + ->onlyMethods(['getPrincipalByPath', 'getGroupMembership', 'findByUri']) ->getMock(); $this->principal->method('getPrincipalByPath') ->willReturn([ @@ -151,16 +138,20 @@ class CardDavBackendTest extends TestCase { ); // start every test with a empty cards_properties and cards table $query = $this->db->getQueryBuilder(); - $query->delete('cards_properties')->execute(); + $query->delete('cards_properties')->executeStatement(); $query = $this->db->getQueryBuilder(); - $query->delete('cards')->execute(); + $query->delete('cards')->executeStatement(); - $this->tearDown(); + $this->principal->method('getGroupMembership') + ->withAnyParameters() + ->willReturn([self::UNIT_TEST_GROUP]); + $books = $this->backend->getAddressBooksForUser(self::UNIT_TEST_USER); + foreach ($books as $book) { + $this->backend->deleteAddressBook($book['id']); + } } protected function tearDown(): void { - parent::tearDown(); - if (is_null($this->backend)) { return; } @@ -172,6 +163,8 @@ class CardDavBackendTest extends TestCase { foreach ($books as $book) { $this->backend->deleteAddressBook($book['id']); } + + parent::tearDown(); } public function testAddressBookOperations(): void { @@ -236,10 +229,11 @@ class CardDavBackendTest extends TestCase { } public function testCardOperations(): void { - /** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject $backend */ + /** @var CardDavBackend&MockObject $backend */ $backend = $this->getMockBuilder(CardDavBackend::class) ->setConstructorArgs([$this->db, $this->principal, $this->userManager, $this->dispatcher, $this->sharingBackend]) - ->onlyMethods(['updateProperties', 'purgeProperties'])->getMock(); + ->onlyMethods(['updateProperties', 'purgeProperties']) + ->getMock(); // create a new address book $backend->createAddressBook(self::UNIT_TEST_USER, 'Example', []); @@ -249,12 +243,16 @@ class CardDavBackendTest extends TestCase { $uri = $this->getUniqueID('card'); // updateProperties is expected twice, once for createCard and once for updateCard - $backend->expects($this->exactly(2)) + $calls = [ + [$bookId, $uri, $this->vcardTest0], + [$bookId, $uri, $this->vcardTest1], + ]; + $backend->expects($this->exactly(count($calls))) ->method('updateProperties') - ->withConsecutive( - [$bookId, $uri, $this->vcardTest0], - [$bookId, $uri, $this->vcardTest1], - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); // Expect event $this->dispatcher @@ -294,7 +292,8 @@ class CardDavBackendTest extends TestCase { public function testMultiCard(): void { $this->backend = $this->getMockBuilder(CardDavBackend::class) ->setConstructorArgs([$this->db, $this->principal, $this->userManager, $this->dispatcher, $this->sharingBackend]) - ->setMethods(['updateProperties'])->getMock(); + ->onlyMethods(['updateProperties']) + ->getMock(); // create a new address book $this->backend->createAddressBook(self::UNIT_TEST_USER, 'Example', []); @@ -347,7 +346,8 @@ class CardDavBackendTest extends TestCase { public function testMultipleUIDOnDifferentAddressbooks(): void { $this->backend = $this->getMockBuilder(CardDavBackend::class) ->setConstructorArgs([$this->db, $this->principal, $this->userManager, $this->dispatcher, $this->sharingBackend]) - ->onlyMethods(['updateProperties'])->getMock(); + ->onlyMethods(['updateProperties']) + ->getMock(); // create 2 new address books $this->backend->createAddressBook(self::UNIT_TEST_USER, 'Example', []); @@ -369,7 +369,8 @@ class CardDavBackendTest extends TestCase { public function testMultipleUIDDenied(): void { $this->backend = $this->getMockBuilder(CardDavBackend::class) ->setConstructorArgs([$this->db, $this->principal, $this->userManager, $this->dispatcher, $this->sharingBackend]) - ->setMethods(['updateProperties'])->getMock(); + ->onlyMethods(['updateProperties']) + ->getMock(); // create a new address book $this->backend->createAddressBook(self::UNIT_TEST_USER, 'Example', []); @@ -390,7 +391,8 @@ class CardDavBackendTest extends TestCase { public function testNoValidUID(): void { $this->backend = $this->getMockBuilder(CardDavBackend::class) ->setConstructorArgs([$this->db, $this->principal, $this->userManager, $this->dispatcher, $this->sharingBackend]) - ->setMethods(['updateProperties'])->getMock(); + ->onlyMethods(['updateProperties']) + ->getMock(); // create a new address book $this->backend->createAddressBook(self::UNIT_TEST_USER, 'Example', []); @@ -428,12 +430,17 @@ class CardDavBackendTest extends TestCase { ->method('getCardId') ->with($bookId, $uri) ->willThrowException(new \InvalidArgumentException()); - $this->backend->expects($this->exactly(2)) + + $calls = [ + [$bookId, $uri, 1], + [$bookId, $uri, 3], + ]; + $this->backend->expects($this->exactly(count($calls))) ->method('addChange') - ->withConsecutive( - [$bookId, $uri, 1], - [$bookId, $uri, 3] - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); $this->backend->expects($this->never()) ->method('purgeProperties'); @@ -447,7 +454,8 @@ class CardDavBackendTest extends TestCase { public function testSyncSupport(): void { $this->backend = $this->getMockBuilder(CardDavBackend::class) ->setConstructorArgs([$this->db, $this->principal, $this->userManager, $this->dispatcher, $this->sharingBackend]) - ->setMethods(['updateProperties'])->getMock(); + ->onlyMethods(['updateProperties']) + ->getMock(); // create a new address book $this->backend->createAddressBook(self::UNIT_TEST_USER, 'Example', []); @@ -639,13 +647,8 @@ class CardDavBackendTest extends TestCase { /** * @dataProvider dataTestSearch - * - * @param string $pattern - * @param array $properties - * @param array $options - * @param array $expected */ - public function testSearch($pattern, $properties, $options, $expected): void { + public function testSearch(string $pattern, array $properties, array $options, array $expected): void { /** @var VCard $vCards */ $vCards = []; $vCards[0] = new VCard(); @@ -756,7 +759,7 @@ class CardDavBackendTest extends TestCase { $this->assertSame(count($expected), count($found)); } - public function dataTestSearch() { + public static function dataTestSearch(): array { return [ ['John', ['FN'], [], [['uri0', 'John Doe'], ['uri1', 'John M. Doe']]], ['M. Doe', ['FN'], [], [['uri1', 'John M. Doe']]], diff --git a/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php b/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php index 80f1f2a4445..bdd826f671b 100644 --- a/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php +++ b/apps/dav/tests/unit/CardDAV/ContactsManagerTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -13,16 +14,17 @@ use OCA\DAV\Db\PropertyMapper; use OCP\Contacts\IManager; use OCP\IL10N; use OCP\IURLGenerator; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class ContactsManagerTest extends TestCase { public function test(): void { - /** @var IManager | \PHPUnit\Framework\MockObject\MockObject $cm */ - $cm = $this->getMockBuilder(IManager::class)->disableOriginalConstructor()->getMock(); + /** @var IManager&MockObject $cm */ + $cm = $this->createMock(IManager::class); $cm->expects($this->exactly(2))->method('registerAddressBook'); - $urlGenerator = $this->getMockBuilder(IURLGenerator::class)->disableOriginalConstructor()->getMock(); - /** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject $backEnd */ - $backEnd = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock(); + $urlGenerator = $this->createMock(IURLGenerator::class); + /** @var CardDavBackend&MockObject $backEnd */ + $backEnd = $this->createMock(CardDavBackend::class); $backEnd->method('getAddressBooksForUser')->willReturn([ ['{DAV:}displayname' => 'Test address book', 'uri' => 'default'], ]); diff --git a/apps/dav/tests/unit/CardDAV/ConverterTest.php b/apps/dav/tests/unit/CardDAV/ConverterTest.php index c29e0db5070..59042ed91d4 100644 --- a/apps/dav/tests/unit/CardDAV/ConverterTest.php +++ b/apps/dav/tests/unit/CardDAV/ConverterTest.php @@ -22,17 +22,10 @@ use Psr\Log\LoggerInterface; use Test\TestCase; class ConverterTest extends TestCase { - - /** @var IAccountManager|\PHPUnit\Framework\MockObject\MockObject */ - private $accountManager; - /** @var IUserManager|(IUserManager&MockObject)|MockObject */ - private IUserManager|MockObject $userManager; - - /** @var IURLGenerator */ - private $urlGenerator; - - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ - private $logger; + private IAccountManager&MockObject $accountManager; + private IUserManager&MockObject $userManager; + private IURLGenerator&MockObject $urlGenerator; + private LoggerInterface&MockObject $logger; protected function setUp(): void { parent::setUp(); @@ -44,7 +37,7 @@ class ConverterTest extends TestCase { } /** - * @return IAccountProperty|MockObject + * @return IAccountProperty&MockObject */ protected function getAccountPropertyMock(string $name, ?string $value, string $scope) { $property = $this->createMock(IAccountProperty::class); @@ -77,10 +70,11 @@ class ConverterTest extends TestCase { yield $this->getAccountPropertyMock(IAccountManager::PROPERTY_TWITTER, '', IAccountManager::SCOPE_LOCAL); }); - $accountManager = $this->getMockBuilder(IAccountManager::class) - ->disableOriginalConstructor()->getMock(); + $accountManager = $this->createMock(IAccountManager::class); - $accountManager->expects($this->any())->method('getAccount')->willReturn($account); + $accountManager->expects($this->any()) + ->method('getAccount') + ->willReturn($account); return $accountManager; } @@ -126,7 +120,7 @@ class ConverterTest extends TestCase { ); } - protected function compareData($expected, $data) { + protected function compareData(array $expected, array $data): void { foreach ($expected as $key => $value) { $found = false; foreach ($data[1] as $d) { @@ -141,7 +135,7 @@ class ConverterTest extends TestCase { } } - public function providesNewUsers() { + public static function providesNewUsers(): array { return [ [ null @@ -197,17 +191,15 @@ class ConverterTest extends TestCase { /** * @dataProvider providesNames - * @param $expected - * @param $fullName */ - public function testNameSplitter($expected, $fullName): void { + public function testNameSplitter(string $expected, string $fullName): void { $converter = new Converter($this->accountManager, $this->userManager, $this->urlGenerator, $this->logger); $r = $converter->splitFullName($fullName); $r = implode(';', $r); $this->assertEquals($expected, $r); } - public function providesNames() { + public static function providesNames(): array { return [ ['Sauron;;;;', 'Sauron'], ['Baggins;Bilbo;;;', 'Bilbo Baggins'], @@ -216,16 +208,13 @@ class ConverterTest extends TestCase { } /** - * @param $displayName - * @param $eMailAddress - * @param $cloudId - * @return IUser | \PHPUnit\Framework\MockObject\MockObject + * @return IUser&MockObject */ protected function getUserMock(string $displayName, ?string $eMailAddress, ?string $cloudId) { - $image0 = $this->getMockBuilder(IImage::class)->disableOriginalConstructor()->getMock(); + $image0 = $this->createMock(IImage::class); $image0->method('mimeType')->willReturn('image/jpeg'); $image0->method('data')->willReturn('123456789'); - $user = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock(); + $user = $this->createMock(IUser::class); $user->method('getUID')->willReturn('12345'); $user->method('getDisplayName')->willReturn($displayName); $user->method('getEMailAddress')->willReturn($eMailAddress); diff --git a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php index d5c864d3e4e..8396234a819 100644 --- a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php +++ b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -13,6 +14,7 @@ use OCA\DAV\CardDAV\PhotoCache; use OCP\AppFramework\Http; use OCP\Files\NotFoundException; use OCP\Files\SimpleFS\ISimpleFile; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\CardDAV\Card; use Sabre\DAV\Node; use Sabre\DAV\Server; @@ -22,18 +24,12 @@ use Sabre\HTTP\ResponseInterface; use Test\TestCase; class ImageExportPluginTest extends TestCase { - /** @var ResponseInterface|\PHPUnit\Framework\MockObject\MockObject */ - private $response; - /** @var RequestInterface|\PHPUnit\Framework\MockObject\MockObject */ - private $request; - /** @var ImageExportPlugin|\PHPUnit\Framework\MockObject\MockObject */ - private $plugin; - /** @var Server */ - private $server; - /** @var Tree|\PHPUnit\Framework\MockObject\MockObject */ - private $tree; - /** @var PhotoCache|\PHPUnit\Framework\MockObject\MockObject */ - private $cache; + private ResponseInterface&MockObject $response; + private RequestInterface&MockObject $request; + private Server&MockObject $server; + private Tree&MockObject $tree; + private PhotoCache&MockObject $cache; + private ImageExportPlugin $plugin; protected function setUp(): void { parent::setUp(); @@ -45,24 +41,20 @@ class ImageExportPluginTest extends TestCase { $this->server->tree = $this->tree; $this->cache = $this->createMock(PhotoCache::class); - $this->plugin = $this->getMockBuilder(ImageExportPlugin::class) - ->setMethods(['getPhoto']) - ->setConstructorArgs([$this->cache]) - ->getMock(); + $this->plugin = new ImageExportPlugin($this->cache); $this->plugin->initialize($this->server); } /** * @dataProvider providesQueryParams - * @param $param */ - public function testQueryParams($param): void { + public function testQueryParams(array $param): void { $this->request->expects($this->once())->method('getQueryParameters')->willReturn($param); $result = $this->plugin->httpGet($this->request, $this->response); $this->assertTrue($result); } - public function providesQueryParams() { + public static function providesQueryParams(): array { return [ [[]], [['1']], @@ -87,7 +79,7 @@ class ImageExportPluginTest extends TestCase { $this->assertTrue($result); } - public function dataTestCard() { + public static function dataTestCard(): array { return [ [null, false], [null, true], @@ -98,11 +90,8 @@ class ImageExportPluginTest extends TestCase { /** * @dataProvider dataTestCard - * - * @param $size - * @param bool $photo */ - public function testCard($size, $photo): void { + public function testCard(?int $size, bool $photo): void { $query = ['photo' => null]; if ($size !== null) { $query['size'] = $size; @@ -145,14 +134,18 @@ class ImageExportPluginTest extends TestCase { ->with(1, 'card', $size, $card) ->willReturn($file); - $this->response->expects($this->exactly(4)) + $setHeaderCalls = [ + ['Cache-Control', 'private, max-age=3600, must-revalidate'], + ['Etag', '"myEtag"'], + ['Content-Type', 'image/jpeg'], + ['Content-Disposition', 'attachment; filename=card.jpg'], + ]; + $this->response->expects($this->exactly(count($setHeaderCalls))) ->method('setHeader') - ->withConsecutive( - ['Cache-Control', 'private, max-age=3600, must-revalidate'], - ['Etag', '"myEtag"'], - ['Content-Type', 'image/jpeg'], - ['Content-Disposition', 'attachment; filename=card.jpg'], - ); + ->willReturnCallback(function () use (&$setHeaderCalls) { + $expected = array_shift($setHeaderCalls); + $this->assertEquals($expected, func_get_args()); + }); $this->response->expects($this->once()) ->method('setStatus') @@ -161,12 +154,16 @@ class ImageExportPluginTest extends TestCase { ->method('setBody') ->with('imgdata'); } else { - $this->response->expects($this->exactly(2)) + $setHeaderCalls = [ + ['Cache-Control', 'private, max-age=3600, must-revalidate'], + ['Etag', '"myEtag"'], + ]; + $this->response->expects($this->exactly(count($setHeaderCalls))) ->method('setHeader') - ->withConsecutive( - ['Cache-Control', 'private, max-age=3600, must-revalidate'], - ['Etag', '"myEtag"'], - ); + ->willReturnCallback(function () use (&$setHeaderCalls) { + $expected = array_shift($setHeaderCalls); + $this->assertEquals($expected, func_get_args()); + }); $this->cache->method('get') ->with(1, 'card', $size, $card) ->willThrowException(new NotFoundException()); diff --git a/apps/dav/tests/unit/CardDAV/Security/CardDavRateLimitingPluginTest.php b/apps/dav/tests/unit/CardDAV/Security/CardDavRateLimitingPluginTest.php index 33ab83a74ac..ee599d5a76c 100644 --- a/apps/dav/tests/unit/CardDAV/Security/CardDavRateLimitingPluginTest.php +++ b/apps/dav/tests/unit/CardDAV/Security/CardDavRateLimitingPluginTest.php @@ -24,11 +24,11 @@ use Test\TestCase; class CardDavRateLimitingPluginTest extends TestCase { - private Limiter|MockObject $limiter; - private CardDavBackend|MockObject $cardDavBackend; - private IUserManager|MockObject $userManager; - private LoggerInterface|MockObject $logger; - private IAppConfig|MockObject $config; + private Limiter&MockObject $limiter; + private CardDavBackend&MockObject $cardDavBackend; + private IUserManager&MockObject $userManager; + private LoggerInterface&MockObject $logger; + private IAppConfig&MockObject $config; private string $userId = 'user123'; private CardDavRateLimitingPlugin $plugin; diff --git a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php index f35eb9f0040..1e934a69a53 100644 --- a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php +++ b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -12,6 +13,7 @@ use OCA\DAV\DAV\Sharing\IShareable; use OCA\DAV\DAV\Sharing\Plugin; use OCP\IConfig; use OCP\IRequest; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Server; use Sabre\DAV\SimpleCollection; use Sabre\HTTP\Request; @@ -19,31 +21,25 @@ use Sabre\HTTP\Response; use Test\TestCase; class PluginTest extends TestCase { - - /** @var Plugin */ - private $plugin; - /** @var Server */ - private $server; - /** @var IShareable | \PHPUnit\Framework\MockObject\MockObject */ - private $book; + private Plugin $plugin; + private Server $server; + private IShareable&MockObject $book; protected function setUp(): void { parent::setUp(); - /** @var Auth | \PHPUnit\Framework\MockObject\MockObject $authBackend */ - $authBackend = $this->getMockBuilder(Auth::class)->disableOriginalConstructor()->getMock(); - $authBackend->method('isDavAuthenticated')->willReturn(true); - - /** @var IRequest $request */ - $request = $this->getMockBuilder(IRequest::class)->disableOriginalConstructor()->getMock(); + $authBackend = $this->createMock(Auth::class); + $authBackend->method('isDavAuthenticated') + ->willReturn(true); + $request = $this->createMock(IRequest::class); $config = $this->createMock(IConfig::class); $this->plugin = new Plugin($authBackend, $request, $config); $root = new SimpleCollection('root'); $this->server = new \Sabre\DAV\Server($root); - /** @var SimpleCollection $node */ - $this->book = $this->getMockBuilder(IShareable::class)->disableOriginalConstructor()->getMock(); - $this->book->method('getName')->willReturn('addressbook1.vcf'); + $this->book = $this->createMock(IShareable::class); + $this->book->method('getName') + ->willReturn('addressbook1.vcf'); $root->addChild($this->book); $this->plugin->initialize($this->server); } diff --git a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php index 5af42e2ea4e..fd31ef36528 100644 --- a/apps/dav/tests/unit/CardDAV/SyncServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/SyncServiceTest.php @@ -20,6 +20,7 @@ use OCP\IConfig; use OCP\IDBConnection; use OCP\IUser; use OCP\IUserManager; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Http\Client\ClientExceptionInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; @@ -28,15 +29,18 @@ use Test\TestCase; class SyncServiceTest extends TestCase { - protected CardDavBackend $backend; - protected IUserManager $userManager; - protected IDBConnection $dbConnection; + protected CardDavBackend&MockObject $backend; + protected IUserManager&MockObject $userManager; + protected IDBConnection&MockObject $dbConnection; protected LoggerInterface $logger; - protected Converter $converter; - protected IClient $client; - protected IConfig $config; + protected Converter&MockObject $converter; + protected IClient&MockObject $client; + protected IConfig&MockObject $config; protected SyncService $service; + public function setUp(): void { + parent::setUp(); + $addressBook = [ 'id' => 1, 'uri' => 'system', @@ -293,8 +297,8 @@ END:VCARD'; } public function testEnsureSystemAddressBookExists(): void { - /** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject $backend */ - $backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock(); + /** @var CardDavBackend&MockObject $backend */ + $backend = $this->createMock(CardDavBackend::class); $backend->expects($this->exactly(1))->method('createAddressBook'); $backend->expects($this->exactly(2)) ->method('getAddressBooksByUri') @@ -303,10 +307,9 @@ END:VCARD'; [], ); - /** @var IUserManager $userManager */ - $userManager = $this->getMockBuilder(IUserManager::class)->disableOriginalConstructor()->getMock(); + $userManager = $this->createMock(IUserManager::class); $dbConnection = $this->createMock(IDBConnection::class); - $logger = $this->getMockBuilder(LoggerInterface::class)->disableOriginalConstructor()->getMock(); + $logger = $this->createMock(LoggerInterface::class); $converter = $this->createMock(Converter::class); $clientService = $this->createMock(IClientService::class); $config = $this->createMock(IConfig::class); @@ -315,7 +318,7 @@ END:VCARD'; $ss->ensureSystemAddressBookExists('principals/users/adam', 'contacts', []); } - public function dataActivatedUsers() { + public static function dataActivatedUsers(): array { return [ [true, 1, 1, 1], [false, 0, 0, 3], @@ -324,15 +327,9 @@ END:VCARD'; /** * @dataProvider dataActivatedUsers - * - * @param boolean $activated - * @param integer $createCalls - * @param integer $updateCalls - * @param integer $deleteCalls - * @return void */ - public function testUpdateAndDeleteUser($activated, $createCalls, $updateCalls, $deleteCalls): void { - /** @var CardDavBackend | \PHPUnit\Framework\MockObject\MockObject $backend */ + public function testUpdateAndDeleteUser(bool $activated, int $createCalls, int $updateCalls, int $deleteCalls): void { + /** @var CardDavBackend | MockObject $backend */ $backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock(); $logger = $this->getMockBuilder(LoggerInterface::class)->disableOriginalConstructor()->getMock(); @@ -348,12 +345,9 @@ END:VCARD'; ->with('principals/system/system', 'system') ->willReturn(['id' => -1]); - /** @var IUserManager | \PHPUnit\Framework\MockObject\MockObject $userManager */ - $userManager = $this->getMockBuilder(IUserManager::class)->disableOriginalConstructor()->getMock(); + $userManager = $this->createMock(IUserManager::class); $dbConnection = $this->createMock(IDBConnection::class); - - /** @var IUser | \PHPUnit\Framework\MockObject\MockObject $user */ - $user = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock(); + $user = $this->createMock(IUser::class); $user->method('getBackendClassName')->willReturn('unittest'); $user->method('getUID')->willReturn('test-user'); $user->method('getCloudId')->willReturn('cloudId'); @@ -475,7 +469,7 @@ END:VCARD'; ); } - public function providerUseAbsoluteUriReport(): array { + public static function providerUseAbsoluteUriReport(): array { return [ ['https://server.internal', 'https://server.internal/remote.php/dav/addressbooks/system/system/system'], ['https://server.internal/', 'https://server.internal/remote.php/dav/addressbooks/system/system/system'], diff --git a/apps/dav/tests/unit/CardDAV/SystemAddressBookTest.php b/apps/dav/tests/unit/CardDAV/SystemAddressBookTest.php index 806c71759f8..4a218fa4616 100644 --- a/apps/dav/tests/unit/CardDAV/SystemAddressBookTest.php +++ b/apps/dav/tests/unit/CardDAV/SystemAddressBookTest.php @@ -30,15 +30,15 @@ use Sabre\VObject\Reader; use Test\TestCase; class SystemAddressBookTest extends TestCase { - private MockObject|BackendInterface $cardDavBackend; + private BackendInterface&MockObject $cardDavBackend; private array $addressBookInfo; - private IL10N|MockObject $l10n; - private IConfig|MockObject $config; + private IL10N&MockObject $l10n; + private IConfig&MockObject $config; private IUserSession $userSession; - private IRequest|MockObject $request; + private IRequest&MockObject $request; private array $server; - private TrustedServers|MockObject $trustedServers; - private IGroupManager|MockObject $groupManager; + private TrustedServers&MockObject $trustedServers; + private IGroupManager&MockObject $groupManager; private SystemAddressbook $addressBook; protected function setUp(): void { diff --git a/apps/dav/tests/unit/CardDAV/Validation/CardDavValidatePluginTest.php b/apps/dav/tests/unit/CardDAV/Validation/CardDavValidatePluginTest.php index 39155aace8b..058735ba32a 100644 --- a/apps/dav/tests/unit/CardDAV/Validation/CardDavValidatePluginTest.php +++ b/apps/dav/tests/unit/CardDAV/Validation/CardDavValidatePluginTest.php @@ -20,9 +20,9 @@ use Test\TestCase; class CardDavValidatePluginTest extends TestCase { private CardDavValidatePlugin $plugin; - private IAppConfig|MockObject $config; - private RequestInterface|MockObject $request; - private ResponseInterface|MockObject $response; + private IAppConfig&MockObject $config; + private RequestInterface&MockObject $request; + private ResponseInterface&MockObject $response; protected function setUp(): void { parent::setUp(); @@ -36,7 +36,7 @@ class CardDavValidatePluginTest extends TestCase { } public function testPutSizeLessThenLimit(): void { - + // construct method responses $this->config ->method('getValueInt') @@ -50,11 +50,11 @@ class CardDavValidatePluginTest extends TestCase { $this->assertTrue( $this->plugin->beforePut($this->request, $this->response) ); - + } public function testPutSizeMoreThenLimit(): void { - + // construct method responses $this->config ->method('getValueInt') @@ -67,7 +67,7 @@ class CardDavValidatePluginTest extends TestCase { $this->expectException(Forbidden::class); // test condition $this->plugin->beforePut($this->request, $this->response); - + } } diff --git a/apps/dav/tests/unit/Command/DeleteCalendarTest.php b/apps/dav/tests/unit/Command/DeleteCalendarTest.php index b621e6737d5..2bd269de6dc 100644 --- a/apps/dav/tests/unit/Command/DeleteCalendarTest.php +++ b/apps/dav/tests/unit/Command/DeleteCalendarTest.php @@ -6,7 +6,7 @@ declare(strict_types=1); * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Command; +namespace OCA\DAV\Tests\unit\Command; use OCA\DAV\CalDAV\BirthdayService; use OCA\DAV\CalDAV\CalDavBackend; @@ -28,23 +28,12 @@ class DeleteCalendarTest extends TestCase { public const USER = 'user'; public const NAME = 'calendar'; - /** @var CalDavBackend|MockObject */ - private $calDav; - - /** @var IConfig|MockObject */ - private $config; - - /** @var IL10N|MockObject */ - private $l10n; - - /** @var IUserManager|MockObject */ - private $userManager; - - /** @var DeleteCalendar */ - private $command; - - /** @var MockObject|LoggerInterface */ - private $logger; + private CalDavBackend&MockObject $calDav; + private IConfig&MockObject $config; + private IL10N&MockObject $l10n; + private IUserManager&MockObject $userManager; + private LoggerInterface&MockObject $logger; + private DeleteCalendar $command; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/unit/Command/ListAddressbooksTest.php b/apps/dav/tests/unit/Command/ListAddressbooksTest.php index 2c6b1579042..624b0050bc5 100644 --- a/apps/dav/tests/unit/Command/ListAddressbooksTest.php +++ b/apps/dav/tests/unit/Command/ListAddressbooksTest.php @@ -5,7 +5,7 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Command; +namespace OCA\DAV\Tests\unit\Command; use OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\Command\ListAddressbooks; @@ -20,9 +20,8 @@ use Test\TestCase; * @package OCA\DAV\Tests\Command */ class ListAddressbooksTest extends TestCase { - - private IUserManager|MockObject $userManager; - private CardDavBackend|MockObject $cardDavBackend; + private IUserManager&MockObject $userManager; + private CardDavBackend&MockObject $cardDavBackend; private ListAddressbooks $command; public const USERNAME = 'username'; @@ -72,7 +71,7 @@ class ListAddressbooksTest extends TestCase { $this->assertStringContainsString('User <' . self::USERNAME . "> has no addressbooks\n", $commandTester->getDisplay()); } - public function dataExecute() { + public static function dataExecute(): array { return [ [false, '✓'], [true, 'x'] diff --git a/apps/dav/tests/unit/Command/ListCalendarSharesTest.php b/apps/dav/tests/unit/Command/ListCalendarSharesTest.php index 3b3f3a1519e..e5d4251cbf9 100644 --- a/apps/dav/tests/unit/Command/ListCalendarSharesTest.php +++ b/apps/dav/tests/unit/Command/ListCalendarSharesTest.php @@ -6,7 +6,7 @@ declare(strict_types=1); * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Command; +namespace OCA\DAV\Tests\unit\Command; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\Command\ListCalendarShares; diff --git a/apps/dav/tests/unit/Command/ListCalendarsTest.php b/apps/dav/tests/unit/Command/ListCalendarsTest.php index 1f5f9882ac4..247487433eb 100644 --- a/apps/dav/tests/unit/Command/ListCalendarsTest.php +++ b/apps/dav/tests/unit/Command/ListCalendarsTest.php @@ -1,14 +1,17 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Command; +namespace OCA\DAV\Tests\unit\Command; use OCA\DAV\CalDAV\BirthdayService; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\Command\ListCalendars; use OCP\IUserManager; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Console\Tester\CommandTester; use Test\TestCase; @@ -18,15 +21,9 @@ use Test\TestCase; * @package OCA\DAV\Tests\Command */ class ListCalendarsTest extends TestCase { - - /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject $userManager */ - private $userManager; - - /** @var CalDavBackend|\PHPUnit\Framework\MockObject\MockObject $l10n */ - private $calDav; - - /** @var ListCalendars */ - private $command; + private IUserManager&MockObject $userManager; + private CalDavBackend&MockObject $calDav; + private ListCalendars $command; public const USERNAME = 'username'; @@ -75,7 +72,7 @@ class ListCalendarsTest extends TestCase { $this->assertStringContainsString('User <' . self::USERNAME . "> has no calendars\n", $commandTester->getDisplay()); } - public function dataExecute() { + public static function dataExecute(): array { return [ [false, '✓'], [true, 'x'] diff --git a/apps/dav/tests/unit/Command/MoveCalendarTest.php b/apps/dav/tests/unit/Command/MoveCalendarTest.php index 9b935ca3cdb..c481f5cf15b 100644 --- a/apps/dav/tests/unit/Command/MoveCalendarTest.php +++ b/apps/dav/tests/unit/Command/MoveCalendarTest.php @@ -1,9 +1,11 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Command; +namespace OCA\DAV\Tests\unit\Command; use InvalidArgumentException; use OCA\DAV\CalDAV\CalDavBackend; @@ -24,29 +26,14 @@ use Test\TestCase; * @package OCA\DAV\Tests\Command */ class MoveCalendarTest extends TestCase { - /** @var IUserManager|MockObject $userManager */ - private $userManager; - - /** @var IGroupManager|MockObject $groupManager */ - private $groupManager; - - /** @var \OCP\Share\IManager|MockObject $shareManager */ - private $shareManager; - - /** @var IConfig|MockObject $l10n */ - private $config; - - /** @var IL10N|MockObject $l10n */ - private $l10n; - - /** @var CalDavBackend|MockObject $l10n */ - private $calDav; - - /** @var MoveCalendar */ - private $command; - - /** @var LoggerInterface|MockObject */ - private $logger; + private IUserManager&MockObject $userManager; + private IGroupManager&MockObject $groupManager; + private \OCP\Share\IManager&MockObject $shareManager; + private IConfig&MockObject $config; + private IL10N&MockObject $l10n; + private CalDavBackend&MockObject $calDav; + private LoggerInterface&MockObject $logger; + private MoveCalendar $command; protected function setUp(): void { parent::setUp(); @@ -70,7 +57,7 @@ class MoveCalendarTest extends TestCase { ); } - public function dataExecute() { + public static function dataExecute(): array { return [ [false, true], [true, false] @@ -79,23 +66,16 @@ class MoveCalendarTest extends TestCase { /** * @dataProvider dataExecute - * - * @param $userOriginExists - * @param $userDestinationExists */ - public function testWithBadUserOrigin($userOriginExists, $userDestinationExists): void { + public function testWithBadUserOrigin(bool $userOriginExists, bool $userDestinationExists): void { $this->expectException(\InvalidArgumentException::class); $this->userManager->expects($this->exactly($userOriginExists ? 2 : 1)) ->method('userExists') - ->withConsecutive( - ['user'], - ['user2'], - ) - ->willReturnOnConsecutiveCalls( - $userOriginExists, - $userDestinationExists, - ); + ->willReturnMap([ + ['user', $userOriginExists], + ['user2', $userDestinationExists], + ]); $commandTester = new CommandTester($this->command); $commandTester->execute([ @@ -112,11 +92,10 @@ class MoveCalendarTest extends TestCase { $this->userManager->expects($this->exactly(2)) ->method('userExists') - ->withConsecutive( - ['user'], - ['user2'], - ) - ->willReturn(true); + ->willReturnMap([ + ['user', true], + ['user2', true], + ]); $this->calDav->expects($this->once())->method('getCalendarByUri') ->with('principals/users/user', 'personal') @@ -137,20 +116,20 @@ class MoveCalendarTest extends TestCase { $this->userManager->expects($this->exactly(2)) ->method('userExists') - ->withConsecutive( - ['user'], - ['user2'], - ) - ->willReturn(true); + ->willReturnMap([ + ['user', true], + ['user2', true], + ]); $this->calDav->expects($this->exactly(2)) ->method('getCalendarByUri') - ->withConsecutive( - ['principals/users/user', 'personal'], - ['principals/users/user2', 'personal'], - ) - ->willReturn([ - 'id' => 1234, + ->willReturnMap([ + ['principals/users/user', 'personal', [ + 'id' => 1234, + ]], + ['principals/users/user2', 'personal', [ + 'id' => 1234, + ]], ]); $commandTester = new CommandTester($this->command); @@ -164,24 +143,19 @@ class MoveCalendarTest extends TestCase { public function testMove(): void { $this->userManager->expects($this->exactly(2)) ->method('userExists') - ->withConsecutive( - ['user'], - ['user2'], - ) - ->willReturn(true); + ->willReturnMap([ + ['user', true], + ['user2', true], + ]); $this->calDav->expects($this->exactly(2)) ->method('getCalendarByUri') - ->withConsecutive( - ['principals/users/user', 'personal'], - ['principals/users/user2', 'personal'], - ) - ->willReturnOnConsecutiveCalls( - [ + ->willReturnMap([ + ['principals/users/user', 'personal', [ 'id' => 1234, - ], - null, - ); + ]], + ['principals/users/user2', 'personal', null], + ]); $this->calDav->expects($this->once())->method('getShares') ->with(1234) @@ -197,7 +171,7 @@ class MoveCalendarTest extends TestCase { $this->assertStringContainsString('[OK] Calendar <personal> was moved from user <user> to <user2>', $commandTester->getDisplay()); } - public function dataTestMoveWithDestinationNotPartOfGroup(): array { + public static function dataTestMoveWithDestinationNotPartOfGroup(): array { return [ [true], [false] @@ -210,25 +184,20 @@ class MoveCalendarTest extends TestCase { public function testMoveWithDestinationNotPartOfGroup(bool $shareWithGroupMembersOnly): void { $this->userManager->expects($this->exactly(2)) ->method('userExists') - ->withConsecutive( - ['user'], - ['user2'], - ) - ->willReturn(true); + ->willReturnMap([ + ['user', true], + ['user2', true], + ]); $this->calDav->expects($this->exactly(2)) ->method('getCalendarByUri') - ->withConsecutive( - ['principals/users/user', 'personal'], - ['principals/users/user2', 'personal'], - ) - ->willReturnOnConsecutiveCalls( - [ + ->willReturnMap([ + ['principals/users/user', 'personal', [ 'id' => 1234, 'uri' => 'personal', - ], - null, - ); + ]], + ['principals/users/user2', 'personal', null], + ]); $this->shareManager->expects($this->once())->method('shareWithGroupMembersOnly') ->willReturn($shareWithGroupMembersOnly); @@ -254,25 +223,20 @@ class MoveCalendarTest extends TestCase { public function testMoveWithDestinationPartOfGroup(): void { $this->userManager->expects($this->exactly(2)) ->method('userExists') - ->withConsecutive( - ['user'], - ['user2'], - ) - ->willReturn(true); + ->willReturnMap([ + ['user', true], + ['user2', true], + ]); $this->calDav->expects($this->exactly(2)) ->method('getCalendarByUri') - ->withConsecutive( - ['principals/users/user', 'personal'], - ['principals/users/user2', 'personal'], - ) - ->willReturnOnConsecutiveCalls( - [ + ->willReturnMap([ + ['principals/users/user', 'personal', [ 'id' => 1234, 'uri' => 'personal', - ], - null, - ); + ]], + ['principals/users/user2', 'personal', null], + ]); $this->shareManager->expects($this->once())->method('shareWithGroupMembersOnly') ->willReturn(true); @@ -300,26 +264,21 @@ class MoveCalendarTest extends TestCase { public function testMoveWithDestinationNotPartOfGroupAndForce(): void { $this->userManager->expects($this->exactly(2)) ->method('userExists') - ->withConsecutive( - ['user'], - ['user2'], - ) - ->willReturn(true); + ->willReturnMap([ + ['user', true], + ['user2', true], + ]); $this->calDav->expects($this->exactly(2)) ->method('getCalendarByUri') - ->withConsecutive( - ['principals/users/user', 'personal'], - ['principals/users/user2', 'personal'], - ) - ->willReturnOnConsecutiveCalls( - [ + ->willReturnMap([ + ['principals/users/user', 'personal', [ 'id' => 1234, 'uri' => 'personal', '{DAV:}displayname' => 'Personal' - ], - null, - ); + ]], + ['principals/users/user2', 'personal', null], + ]); $this->shareManager->expects($this->once())->method('shareWithGroupMembersOnly') ->willReturn(true); @@ -345,7 +304,7 @@ class MoveCalendarTest extends TestCase { $this->assertStringContainsString('[OK] Calendar <personal> was moved from user <user> to <user2>', $commandTester->getDisplay()); } - public function dataTestMoveWithCalendarAlreadySharedToDestination(): array { + public static function dataTestMoveWithCalendarAlreadySharedToDestination(): array { return [ [true], [false] @@ -358,26 +317,21 @@ class MoveCalendarTest extends TestCase { public function testMoveWithCalendarAlreadySharedToDestination(bool $force): void { $this->userManager->expects($this->exactly(2)) ->method('userExists') - ->withConsecutive( - ['user'], - ['user2'], - ) - ->willReturn(true); + ->willReturnMap([ + ['user', true], + ['user2', true], + ]); $this->calDav->expects($this->exactly(2)) ->method('getCalendarByUri') - ->withConsecutive( - ['principals/users/user', 'personal'], - ['principals/users/user2', 'personal'], - ) - ->willReturnOnConsecutiveCalls( - [ + ->willReturnMap([ + ['principals/users/user', 'personal', [ 'id' => 1234, 'uri' => 'personal', '{DAV:}displayname' => 'Personal' - ], - null, - ); + ]], + ['principals/users/user2', 'personal', null], + ]); $this->calDav->expects($this->once())->method('getShares') ->with(1234) diff --git a/apps/dav/tests/unit/Command/RemoveInvalidSharesTest.php b/apps/dav/tests/unit/Command/RemoveInvalidSharesTest.php index f2346c211ce..ec56aa64eb2 100644 --- a/apps/dav/tests/unit/Command/RemoveInvalidSharesTest.php +++ b/apps/dav/tests/unit/Command/RemoveInvalidSharesTest.php @@ -1,16 +1,16 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2018 ownCloud GmbH * SPDX-License-Identifier: AGPL-3.0-only */ -namespace OCA\DAV\Tests\Unit\Command; +namespace OCA\DAV\Tests\unit\Command; use OCA\DAV\Command\RemoveInvalidShares; use OCA\DAV\Connector\Sabre\Principal; use OCP\IDBConnection; -use OCP\Migration\IOutput; use OCP\Server; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -37,18 +37,16 @@ class RemoveInvalidSharesTest extends TestCase { public function test(): void { $db = Server::get(IDBConnection::class); - /** @var Principal | \PHPUnit\Framework\MockObject\MockObject $principal */ $principal = $this->createMock(Principal::class); - /** @var IOutput | \PHPUnit\Framework\MockObject\MockObject $output */ - $output = $this->createMock(IOutput::class); - $repair = new RemoveInvalidShares($db, $principal); $this->invokePrivate($repair, 'run', [$this->createMock(InputInterface::class), $this->createMock(OutputInterface::class)]); $query = $db->getQueryBuilder(); - $result = $query->select('*')->from('dav_shares') - ->where($query->expr()->eq('principaluri', $query->createNamedParameter('principal:unknown')))->execute(); + $query->select('*') + ->from('dav_shares') + ->where($query->expr()->eq('principaluri', $query->createNamedParameter('principal:unknown'))); + $result = $query->executeQuery(); $data = $result->fetchAll(); $result->closeCursor(); $this->assertEquals(0, count($data)); diff --git a/apps/dav/tests/unit/Comments/CommentsNodeTest.php b/apps/dav/tests/unit/Comments/CommentsNodeTest.php index c253c59df0f..40da2e523c7 100644 --- a/apps/dav/tests/unit/Comments/CommentsNodeTest.php +++ b/apps/dav/tests/unit/Comments/CommentsNodeTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -14,38 +15,26 @@ use OCP\Comments\MessageTooLongException; use OCP\IUser; use OCP\IUserManager; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Sabre\DAV\PropPatch; class CommentsNodeTest extends \Test\TestCase { - - /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $commentsManager; - - protected $comment; - protected $node; - protected $userManager; - protected $logger; - protected $userSession; + protected ICommentsManager&MockObject $commentsManager; + protected IComment&MockObject $comment; + protected IUserManager&MockObject $userManager; + protected LoggerInterface&MockObject $logger; + protected IUserSession&MockObject $userSession; + protected CommentNode $node; protected function setUp(): void { parent::setUp(); - $this->commentsManager = $this->getMockBuilder(ICommentsManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->comment = $this->getMockBuilder(IComment::class) - ->disableOriginalConstructor() - ->getMock(); - $this->userManager = $this->getMockBuilder(IUserManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->userSession = $this->getMockBuilder(IUserSession::class) - ->disableOriginalConstructor() - ->getMock(); - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $this->commentsManager = $this->createMock(ICommentsManager::class); + $this->comment = $this->createMock(IComment::class); + $this->userManager = $this->createMock(IUserManager::class); + $this->userSession = $this->createMock(IUserSession::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->node = new CommentNode( $this->commentsManager, @@ -57,10 +46,7 @@ class CommentsNodeTest extends \Test\TestCase { } public function testDelete(): void { - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); - + $user = $this->createMock(IUser::class); $user->expects($this->once()) ->method('getUID') ->willReturn('alice'); @@ -92,10 +78,7 @@ class CommentsNodeTest extends \Test\TestCase { public function testDeleteForbidden(): void { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); - + $user = $this->createMock(IUser::class); $user->expects($this->once()) ->method('getUID') ->willReturn('mallory'); @@ -144,10 +127,7 @@ class CommentsNodeTest extends \Test\TestCase { public function testUpdateComment(): void { $msg = 'Hello Earth'; - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); - + $user = $this->createMock(IUser::class); $user->expects($this->once()) ->method('getUID') ->willReturn('alice'); @@ -182,10 +162,7 @@ class CommentsNodeTest extends \Test\TestCase { $msg = null; - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); - + $user = $this->createMock(IUser::class); $user->expects($this->once()) ->method('getUID') ->willReturn('alice'); @@ -221,10 +198,7 @@ class CommentsNodeTest extends \Test\TestCase { $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->expectExceptionMessage('Message exceeds allowed character limit of'); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); - + $user = $this->createMock(IUser::class); $user->expects($this->once()) ->method('getUID') ->willReturn('alice'); @@ -261,10 +235,7 @@ class CommentsNodeTest extends \Test\TestCase { $msg = 'HaXX0r'; - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); - + $user = $this->createMock(IUser::class); $user->expects($this->once()) ->method('getUID') ->willReturn('mallory'); @@ -296,10 +267,7 @@ class CommentsNodeTest extends \Test\TestCase { $msg = 'HaXX0r'; - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); - + $user = $this->createMock(IUser::class); $user->expects($this->never()) ->method('getUID'); @@ -344,10 +312,7 @@ class CommentsNodeTest extends \Test\TestCase { } public function testPropPatch(): void { - $propPatch = $this->getMockBuilder(PropPatch::class) - ->disableOriginalConstructor() - ->getMock(); - + $propPatch = $this->createMock(PropPatch::class); $propPatch->expects($this->once()) ->method('handle') ->with('{http://owncloud.org/ns}message'); @@ -396,11 +361,10 @@ class CommentsNodeTest extends \Test\TestCase { $this->commentsManager->expects($this->exactly(2)) ->method('resolveDisplayName') - ->withConsecutive( - [$this->equalTo('user'), $this->equalTo('alice')], - [$this->equalTo('user'), $this->equalTo('bob')] - ) - ->willReturnOnConsecutiveCalls('Alice Al-Isson', 'Unknown user'); + ->willReturnMap([ + ['user', 'alice', 'Alice Al-Isson'], + ['user', 'bob', 'Unknown user'] + ]); $this->comment->expects($this->once()) ->method('getId') @@ -491,7 +455,7 @@ class CommentsNodeTest extends \Test\TestCase { $this->assertTrue(empty($expected)); } - public function readCommentProvider() { + public static function readCommentProvider(): array { $creationDT = new \DateTime('2016-01-19 18:48:00'); $diff = new \DateInterval('PT2H'); $readDT1 = clone $creationDT; @@ -507,9 +471,8 @@ class CommentsNodeTest extends \Test\TestCase { /** * @dataProvider readCommentProvider - * @param $expected */ - public function testGetPropertiesUnreadProperty($creationDT, $readDT, $expected): void { + public function testGetPropertiesUnreadProperty(\DateTime $creationDT, ?\DateTime $readDT, string $expected): void { $this->comment->expects($this->any()) ->method('getCreationDateTime') ->willReturn($creationDT); diff --git a/apps/dav/tests/unit/Comments/CommentsPluginTest.php b/apps/dav/tests/unit/Comments/CommentsPluginTest.php index 5ca0cedf04b..35638391e67 100644 --- a/apps/dav/tests/unit/Comments/CommentsPluginTest.php +++ b/apps/dav/tests/unit/Comments/CommentsPluginTest.php @@ -14,44 +14,30 @@ use OCP\Comments\IComment; use OCP\Comments\ICommentsManager; use OCP\IUser; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\INode; use Sabre\DAV\Tree; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; class CommentsPluginTest extends \Test\TestCase { - /** @var \Sabre\DAV\Server */ - private $server; - - /** @var Tree */ - private $tree; - - /** @var ICommentsManager */ - private $commentsManager; - - /** @var IUserSession */ - private $userSession; - - /** @var CommentsPluginImplementation */ - private $plugin; + private \Sabre\DAV\Server&MockObject $server; + private Tree&MockObject $tree; + private ICommentsManager&MockObject $commentsManager; + private IUserSession&MockObject $userSession; + private CommentsPluginImplementation $plugin; protected function setUp(): void { parent::setUp(); - $this->tree = $this->getMockBuilder(Tree::class) - ->disableOriginalConstructor() - ->getMock(); + $this->tree = $this->createMock(Tree::class); - $this->server = $this->getMockBuilder('\Sabre\DAV\Server') + $this->server = $this->getMockBuilder(\Sabre\DAV\Server::class) ->setConstructorArgs([$this->tree]) - ->setMethods(['getRequestUri']) + ->onlyMethods(['getRequestUri']) ->getMock(); - $this->commentsManager = $this->getMockBuilder(ICommentsManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->userSession = $this->getMockBuilder(IUserSession::class) - ->disableOriginalConstructor() - ->getMock(); + $this->commentsManager = $this->createMock(ICommentsManager::class); + $this->userSession = $this->createMock(IUserSession::class); $this->plugin = new CommentsPluginImplementation($this->commentsManager, $this->userSession); } @@ -151,7 +137,7 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - + public function testCreateCommentInvalidObject(): void { $this->expectException(\Sabre\DAV\Exception\NotFound::class); @@ -233,7 +219,7 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - + public function testCreateCommentInvalidActor(): void { $this->expectException(\Sabre\DAV\Exception\BadRequest::class); @@ -321,7 +307,7 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - + public function testCreateCommentUnsupportedMediaType(): void { $this->expectException(\Sabre\DAV\Exception\UnsupportedMediaType::class); @@ -409,7 +395,7 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - + public function testCreateCommentInvalidPayload(): void { $this->expectException(\Sabre\DAV\Exception\BadRequest::class); @@ -503,7 +489,7 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - + public function testCreateCommentMessageTooLong(): void { $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->expectExceptionMessage('Message exceeds allowed character limit of'); @@ -597,7 +583,7 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - + public function testOnReportInvalidNode(): void { $this->expectException(\Sabre\DAV\Exception\ReportNotSupported::class); @@ -620,7 +606,7 @@ class CommentsPluginTest extends \Test\TestCase { $this->plugin->onReport(CommentsPluginImplementation::REPORT_NAME, [], '/' . $path); } - + public function testOnReportInvalidReportName(): void { $this->expectException(\Sabre\DAV\Exception\ReportNotSupported::class); diff --git a/apps/dav/tests/unit/Comments/EntityCollectionTest.php b/apps/dav/tests/unit/Comments/EntityCollectionTest.php index e5a68e5a726..fcf0748696c 100644 --- a/apps/dav/tests/unit/Comments/EntityCollectionTest.php +++ b/apps/dav/tests/unit/Comments/EntityCollectionTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -14,36 +15,23 @@ use OCP\Comments\ICommentsManager; use OCP\Comments\NotFoundException; use OCP\IUserManager; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; class EntityCollectionTest extends \Test\TestCase { - - /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $commentsManager; - /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $userManager; - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ - protected $logger; - /** @var EntityCollection */ - protected $collection; - /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */ - protected $userSession; + protected ICommentsManager&MockObject $commentsManager; + protected IUserManager&MockObject $userManager; + protected LoggerInterface&MockObject $logger; + protected IUserSession&MockObject $userSession; + protected EntityCollection $collection; protected function setUp(): void { parent::setUp(); - $this->commentsManager = $this->getMockBuilder(ICommentsManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->userManager = $this->getMockBuilder(IUserManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->userSession = $this->getMockBuilder(IUserSession::class) - ->disableOriginalConstructor() - ->getMock(); - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $this->commentsManager = $this->createMock(ICommentsManager::class); + $this->userManager = $this->createMock(IUserManager::class); + $this->userSession = $this->createMock(IUserSession::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->collection = new EntityCollection( '19', @@ -70,7 +58,7 @@ class EntityCollectionTest extends \Test\TestCase { ); $node = $this->collection->getChild('55'); - $this->assertTrue($node instanceof CommentNode); + $this->assertInstanceOf(CommentNode::class, $node); } @@ -97,8 +85,8 @@ class EntityCollectionTest extends \Test\TestCase { $result = $this->collection->getChildren(); - $this->assertSame(count($result), 1); - $this->assertTrue($result[0] instanceof CommentNode); + $this->assertCount(1, $result); + $this->assertInstanceOf(CommentNode::class, $result[0]); } public function testFindChildren(): void { @@ -114,8 +102,8 @@ class EntityCollectionTest extends \Test\TestCase { $result = $this->collection->findChildren(5, 15, $dt); - $this->assertSame(count($result), 1); - $this->assertTrue($result[0] instanceof CommentNode); + $this->assertCount(1, $result); + $this->assertInstanceOf(CommentNode::class, $result[0]); } public function testChildExistsTrue(): void { diff --git a/apps/dav/tests/unit/Comments/EntityTypeCollectionTest.php b/apps/dav/tests/unit/Comments/EntityTypeCollectionTest.php index e5706099270..e5178a3e786 100644 --- a/apps/dav/tests/unit/Comments/EntityTypeCollectionTest.php +++ b/apps/dav/tests/unit/Comments/EntityTypeCollectionTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -12,40 +13,25 @@ use OCA\DAV\Comments\EntityTypeCollection; use OCP\Comments\ICommentsManager; use OCP\IUserManager; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; class EntityTypeCollectionTest extends \Test\TestCase { - - /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $commentsManager; - /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $userManager; - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ - protected $logger; - /** @var EntityTypeCollection */ - protected $collection; - /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */ - protected $userSession; + protected ICommentsManager&MockObject $commentsManager; + protected IUserManager&MockObject $userManager; + protected LoggerInterface&MockObject $logger; + protected IUserSession&MockObject $userSession; + protected EntityTypeCollection $collection; protected $childMap = []; protected function setUp(): void { parent::setUp(); - $this->commentsManager = $this->getMockBuilder(ICommentsManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->userManager = $this->getMockBuilder(IUserManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->userSession = $this->getMockBuilder(IUserSession::class) - ->disableOriginalConstructor() - ->getMock(); - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $instance = $this; + $this->commentsManager = $this->createMock(ICommentsManager::class); + $this->userManager = $this->createMock(IUserManager::class); + $this->userSession = $this->createMock(IUserSession::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->collection = new EntityTypeCollection( 'files', @@ -53,8 +39,8 @@ class EntityTypeCollectionTest extends \Test\TestCase { $this->userManager, $this->userSession, $this->logger, - function ($child) use ($instance) { - return !empty($instance->childMap[$child]); + function ($child) { + return !empty($this->childMap[$child]); } ); } @@ -72,7 +58,7 @@ class EntityTypeCollectionTest extends \Test\TestCase { $this->childMap[17] = true; $ec = $this->collection->getChild('17'); - $this->assertTrue($ec instanceof EntityCollectionImplemantation); + $this->assertInstanceOf(EntityCollectionImplemantation::class, $ec); } diff --git a/apps/dav/tests/unit/Comments/RootCollectionTest.php b/apps/dav/tests/unit/Comments/RootCollectionTest.php index 5d9e828f687..9a05d996c8c 100644 --- a/apps/dav/tests/unit/Comments/RootCollectionTest.php +++ b/apps/dav/tests/unit/Comments/RootCollectionTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -16,44 +17,27 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\IUser; use OCP\IUserManager; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; class RootCollectionTest extends \Test\TestCase { - - /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $commentsManager; - /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $userManager; - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ - protected $logger; - /** @var RootCollection */ - protected $collection; - /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */ - protected $userSession; - /** @var IEventDispatcher */ - protected $dispatcher; - /** @var IUser|\PHPUnit\Framework\MockObject\MockObject */ - protected $user; + protected ICommentsManager&MockObject $commentsManager; + protected IUserManager&MockObject $userManager; + protected LoggerInterface&MockObject $logger; + protected IUserSession&MockObject $userSession; + protected IEventDispatcher $dispatcher; + protected IUser&MockObject $user; + protected RootCollection $collection; protected function setUp(): void { parent::setUp(); - $this->user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->commentsManager = $this->getMockBuilder(ICommentsManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->userManager = $this->getMockBuilder(IUserManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->userSession = $this->getMockBuilder(IUserSession::class) - ->disableOriginalConstructor() - ->getMock(); - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $this->user = $this->createMock(IUser::class); + + $this->commentsManager = $this->createMock(ICommentsManager::class); + $this->userManager = $this->createMock(IUserManager::class); + $this->userSession = $this->createMock(IUserSession::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->dispatcher = new EventDispatcher( new \Symfony\Component\EventDispatcher\EventDispatcher(), \OC::$server, @@ -69,7 +53,7 @@ class RootCollectionTest extends \Test\TestCase { ); } - protected function prepareForInitCollections() { + protected function prepareForInitCollections(): void { $this->user->expects($this->any()) ->method('getUID') ->willReturn('alice'); @@ -102,7 +86,7 @@ class RootCollectionTest extends \Test\TestCase { public function testGetChild(): void { $this->prepareForInitCollections(); $etc = $this->collection->getChild('files'); - $this->assertTrue($etc instanceof EntityTypeCollectionImplementation); + $this->assertInstanceOf(EntityTypeCollectionImplementation::class, $etc); } @@ -125,7 +109,7 @@ class RootCollectionTest extends \Test\TestCase { $children = $this->collection->getChildren(); $this->assertFalse(empty($children)); foreach ($children as $child) { - $this->assertTrue($child instanceof EntityTypeCollectionImplementation); + $this->assertInstanceOf(EntityTypeCollectionImplementation::class, $child); } } diff --git a/apps/dav/tests/unit/Connector/LegacyPublicAuthTest.php b/apps/dav/tests/unit/Connector/LegacyPublicAuthTest.php index 2bb68374162..8b8c775c8ec 100644 --- a/apps/dav/tests/unit/Connector/LegacyPublicAuthTest.php +++ b/apps/dav/tests/unit/Connector/LegacyPublicAuthTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -14,6 +15,7 @@ use OCP\Security\Bruteforce\IThrottler; use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IManager; use OCP\Share\IShare; +use PHPUnit\Framework\MockObject\MockObject; /** * Class LegacyPublicAuthTest @@ -23,36 +25,20 @@ use OCP\Share\IShare; * @package OCA\DAV\Tests\unit\Connector */ class LegacyPublicAuthTest extends \Test\TestCase { - - /** @var ISession|\PHPUnit\Framework\MockObject\MockObject */ - private $session; - /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */ - private $request; - /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ - private $shareManager; - /** @var LegacyPublicAuth */ - private $auth; - /** @var IThrottler|\PHPUnit\Framework\MockObject\MockObject */ - private $throttler; - - /** @var string */ - private $oldUser; + private ISession&MockObject $session; + private IRequest&MockObject $request; + private IManager&MockObject $shareManager; + private IThrottler&MockObject $throttler; + private LegacyPublicAuth $auth; + private string|false $oldUser; protected function setUp(): void { parent::setUp(); - $this->session = $this->getMockBuilder(ISession::class) - ->disableOriginalConstructor() - ->getMock(); - $this->request = $this->getMockBuilder(IRequest::class) - ->disableOriginalConstructor() - ->getMock(); - $this->shareManager = $this->getMockBuilder(IManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->throttler = $this->getMockBuilder(IThrottler::class) - ->disableOriginalConstructor() - ->getMock(); + $this->session = $this->createMock(ISession::class); + $this->request = $this->createMock(IRequest::class); + $this->shareManager = $this->createMock(IManager::class); + $this->throttler = $this->createMock(IThrottler::class); $this->auth = new LegacyPublicAuth( $this->request, @@ -70,7 +56,9 @@ class LegacyPublicAuthTest extends \Test\TestCase { // Set old user \OC_User::setUserId($this->oldUser); - \OC_Util::setupFS($this->oldUser); + if ($this->oldUser !== false) { + \OC_Util::setupFS($this->oldUser); + } parent::tearDown(); } @@ -86,9 +74,7 @@ class LegacyPublicAuthTest extends \Test\TestCase { } public function testShareNoPassword(): void { - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn(null); $this->shareManager->expects($this->once()) @@ -101,9 +87,7 @@ class LegacyPublicAuthTest extends \Test\TestCase { } public function testSharePasswordFancyShareType(): void { - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(42); @@ -118,9 +102,7 @@ class LegacyPublicAuthTest extends \Test\TestCase { public function testSharePasswordRemote(): void { - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_REMOTE); @@ -134,9 +116,7 @@ class LegacyPublicAuthTest extends \Test\TestCase { } public function testSharePasswordLinkValidPassword(): void { - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_LINK); @@ -156,9 +136,7 @@ class LegacyPublicAuthTest extends \Test\TestCase { } public function testSharePasswordMailValidPassword(): void { - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_EMAIL); @@ -178,9 +156,7 @@ class LegacyPublicAuthTest extends \Test\TestCase { } public function testInvalidSharePasswordLinkValidSession(): void { - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_LINK); $share->method('getId')->willReturn('42'); @@ -204,9 +180,7 @@ class LegacyPublicAuthTest extends \Test\TestCase { } public function testSharePasswordLinkInvalidSession(): void { - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_LINK); $share->method('getId')->willReturn('42'); @@ -231,9 +205,7 @@ class LegacyPublicAuthTest extends \Test\TestCase { public function testSharePasswordMailInvalidSession(): void { - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_EMAIL); $share->method('getId')->willReturn('42'); diff --git a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php index c6d247b3951..501ef3ef1d1 100644 --- a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -29,33 +30,20 @@ use Test\TestCase; * @group DB */ class AuthTest extends TestCase { - /** @var ISession&MockObject */ - private $session; - /** @var Auth */ - private $auth; - /** @var Session&MockObject */ - private $userSession; - /** @var IRequest&MockObject */ - private $request; - /** @var Manager&MockObject */ - private $twoFactorManager; - /** @var IThrottler&MockObject */ - private $throttler; + private ISession&MockObject $session; + private Session&MockObject $userSession; + private IRequest&MockObject $request; + private Manager&MockObject $twoFactorManager; + private IThrottler&MockObject $throttler; + private Auth $auth; protected function setUp(): void { parent::setUp(); - $this->session = $this->getMockBuilder(ISession::class) - ->disableOriginalConstructor()->getMock(); - $this->userSession = $this->getMockBuilder(Session::class) - ->disableOriginalConstructor()->getMock(); - $this->request = $this->getMockBuilder(IRequest::class) - ->disableOriginalConstructor()->getMock(); - $this->twoFactorManager = $this->getMockBuilder(Manager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->throttler = $this->getMockBuilder(IThrottler::class) - ->disableOriginalConstructor() - ->getMock(); + $this->session = $this->createMock(ISession::class); + $this->userSession = $this->createMock(Session::class); + $this->request = $this->createMock(IRequest::class); + $this->twoFactorManager = $this->createMock(Manager::class); + $this->throttler = $this->createMock(IThrottler::class); $this->auth = new Auth( $this->session, $this->userSession, @@ -72,7 +60,7 @@ class AuthTest extends TestCase { ->with('AUTHENTICATED_TO_DAV_BACKEND') ->willReturn(null); - $this->assertFalse($this->invokePrivate($this->auth, 'isDavAuthenticated', ['MyTestUser'])); + $this->assertFalse(self::invokePrivate($this->auth, 'isDavAuthenticated', ['MyTestUser'])); } public function testIsDavAuthenticatedWithWrongDavSession(): void { @@ -82,7 +70,7 @@ class AuthTest extends TestCase { ->with('AUTHENTICATED_TO_DAV_BACKEND') ->willReturn('AnotherUser'); - $this->assertFalse($this->invokePrivate($this->auth, 'isDavAuthenticated', ['MyTestUser'])); + $this->assertFalse(self::invokePrivate($this->auth, 'isDavAuthenticated', ['MyTestUser'])); } public function testIsDavAuthenticatedWithCorrectDavSession(): void { @@ -92,13 +80,11 @@ class AuthTest extends TestCase { ->with('AUTHENTICATED_TO_DAV_BACKEND') ->willReturn('MyTestUser'); - $this->assertTrue($this->invokePrivate($this->auth, 'isDavAuthenticated', ['MyTestUser'])); + $this->assertTrue(self::invokePrivate($this->auth, 'isDavAuthenticated', ['MyTestUser'])); } public function testValidateUserPassOfAlreadyDAVAuthenticatedUser(): void { - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->exactly(1)) ->method('getUID') ->willReturn('MyTestUser'); @@ -119,13 +105,11 @@ class AuthTest extends TestCase { ->expects($this->once()) ->method('close'); - $this->assertTrue($this->invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); + $this->assertTrue(self::invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); } public function testValidateUserPassOfInvalidDAVAuthenticatedUser(): void { - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->once()) ->method('getUID') ->willReturn('MyTestUser'); @@ -146,13 +130,11 @@ class AuthTest extends TestCase { ->expects($this->once()) ->method('close'); - $this->assertFalse($this->invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); + $this->assertFalse(self::invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); } public function testValidateUserPassOfInvalidDAVAuthenticatedUserWithValidPassword(): void { - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->exactly(2)) ->method('getUID') ->willReturn('MyTestUser'); @@ -182,7 +164,7 @@ class AuthTest extends TestCase { ->expects($this->once()) ->method('close'); - $this->assertTrue($this->invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); + $this->assertTrue(self::invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); } public function testValidateUserPassWithInvalidPassword(): void { @@ -199,7 +181,7 @@ class AuthTest extends TestCase { ->expects($this->once()) ->method('close'); - $this->assertFalse($this->invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); + $this->assertFalse(self::invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); } @@ -219,16 +201,12 @@ class AuthTest extends TestCase { ->expects($this->once()) ->method('close'); - $this->invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword']); + self::invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword']); } public function testAuthenticateAlreadyLoggedInWithoutCsrfTokenForNonGet(): void { - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $this->userSession ->expects($this->any()) ->method('isLoggedIn') @@ -242,9 +220,7 @@ class AuthTest extends TestCase { ->method('get') ->with('AUTHENTICATED_TO_DAV_BACKEND') ->willReturn(null); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->any()) ->method('getUID') ->willReturn('MyWrongDavUser'); @@ -266,12 +242,8 @@ class AuthTest extends TestCase { } public function testAuthenticateAlreadyLoggedInWithoutCsrfTokenAndCorrectlyDavAuthenticated(): void { - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $this->userSession ->expects($this->any()) ->method('isLoggedIn') @@ -289,9 +261,7 @@ class AuthTest extends TestCase { ->method('get') ->with('AUTHENTICATED_TO_DAV_BACKEND') ->willReturn('LoggedInUser'); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->any()) ->method('getUID') ->willReturn('LoggedInUser'); @@ -311,12 +281,8 @@ class AuthTest extends TestCase { $this->expectException(\Sabre\DAV\Exception\NotAuthenticated::class); $this->expectExceptionMessage('2FA challenge not passed.'); - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $this->userSession ->expects($this->any()) ->method('isLoggedIn') @@ -334,9 +300,7 @@ class AuthTest extends TestCase { ->method('get') ->with('AUTHENTICATED_TO_DAV_BACKEND') ->willReturn('LoggedInUser'); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->any()) ->method('getUID') ->willReturn('LoggedInUser'); @@ -360,12 +324,8 @@ class AuthTest extends TestCase { $this->expectException(\Sabre\DAV\Exception\NotAuthenticated::class); $this->expectExceptionMessage('CSRF check not passed.'); - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $this->userSession ->expects($this->any()) ->method('isLoggedIn') @@ -383,9 +343,7 @@ class AuthTest extends TestCase { ->method('get') ->with('AUTHENTICATED_TO_DAV_BACKEND') ->willReturn('AnotherUser'); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->any()) ->method('getUID') ->willReturn('LoggedInUser'); @@ -401,12 +359,8 @@ class AuthTest extends TestCase { } public function testAuthenticateAlreadyLoggedInWithoutCsrfTokenForNonGetAndDesktopClient(): void { - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $this->userSession ->expects($this->any()) ->method('isLoggedIn') @@ -424,9 +378,7 @@ class AuthTest extends TestCase { ->method('get') ->with('AUTHENTICATED_TO_DAV_BACKEND') ->willReturn(null); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->any()) ->method('getUID') ->willReturn('MyWrongDavUser'); @@ -443,12 +395,8 @@ class AuthTest extends TestCase { } public function testAuthenticateAlreadyLoggedInWithoutCsrfTokenForGet(): void { - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $this->userSession ->expects($this->any()) ->method('isLoggedIn') @@ -458,9 +406,7 @@ class AuthTest extends TestCase { ->method('get') ->with('AUTHENTICATED_TO_DAV_BACKEND') ->willReturn(null); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->any()) ->method('getUID') ->willReturn('MyWrongDavUser'); @@ -478,12 +424,8 @@ class AuthTest extends TestCase { } public function testAuthenticateAlreadyLoggedInWithCsrfTokenForGet(): void { - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $this->userSession ->expects($this->any()) ->method('isLoggedIn') @@ -493,9 +435,7 @@ class AuthTest extends TestCase { ->method('get') ->with('AUTHENTICATED_TO_DAV_BACKEND') ->willReturn(null); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->any()) ->method('getUID') ->willReturn('MyWrongDavUser'); @@ -513,15 +453,9 @@ class AuthTest extends TestCase { } public function testAuthenticateNoBasicAuthenticateHeadersProvided(): void { - $server = $this->getMockBuilder(Server::class) - ->disableOriginalConstructor() - ->getMock(); - $server->httpRequest = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $server->httpResponse = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $server = $this->createMock(Server::class); + $server->httpRequest = $this->createMock(RequestInterface::class); + $server->httpResponse = $this->createMock(ResponseInterface::class); $response = $this->auth->check($server->httpRequest, $server->httpResponse); $this->assertEquals([false, 'No \'Authorization: Basic\' header found. Either the client didn\'t send one, or the server is misconfigured'], $response); } @@ -532,13 +466,9 @@ class AuthTest extends TestCase { $this->expectExceptionMessage('Cannot authenticate over ajax calls'); /** @var \Sabre\HTTP\RequestInterface&MockObject $httpRequest */ - $httpRequest = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $httpRequest = $this->createMock(RequestInterface::class); /** @var \Sabre\HTTP\ResponseInterface&MockObject $httpResponse */ - $httpResponse = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $httpResponse = $this->createMock(ResponseInterface::class); $this->userSession ->expects($this->any()) ->method('isLoggedIn') @@ -562,13 +492,9 @@ class AuthTest extends TestCase { ->willReturn(false); /** @var \Sabre\HTTP\RequestInterface&MockObject $httpRequest */ - $httpRequest = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $httpRequest = $this->createMock(RequestInterface::class); /** @var \Sabre\HTTP\ResponseInterface&MockObject $httpResponse */ - $httpResponse = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $httpResponse = $this->createMock(ResponseInterface::class); $httpRequest ->expects($this->any()) ->method('getHeader') @@ -577,9 +503,7 @@ class AuthTest extends TestCase { ['Authorization', 'basic dXNlcm5hbWU6cGFzc3dvcmQ='], ]); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->any()) ->method('getUID') ->willReturn('MyDavUser'); @@ -602,17 +526,10 @@ class AuthTest extends TestCase { public function testAuthenticateNoBasicAuthenticateHeadersProvidedWithAjaxButUserIsStillLoggedIn(): void { /** @var \Sabre\HTTP\RequestInterface $httpRequest */ - $httpRequest = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $httpRequest = $this->createMock(RequestInterface::class); /** @var \Sabre\HTTP\ResponseInterface $httpResponse */ - $httpResponse = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - /** @var IUser */ - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $httpResponse = $this->createMock(ResponseInterface::class); + $user = $this->createMock(IUser::class); $user->method('getUID')->willReturn('MyTestUser'); $this->userSession ->expects($this->any()) @@ -643,29 +560,21 @@ class AuthTest extends TestCase { } public function testAuthenticateValidCredentials(): void { - $server = $this->getMockBuilder(Server::class) - ->disableOriginalConstructor() - ->getMock(); - $server->httpRequest = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $server = $this->createMock(Server::class); + $server->httpRequest = $this->createMock(RequestInterface::class); $server->httpRequest ->expects($this->once()) ->method('getHeader') ->with('Authorization') ->willReturn('basic dXNlcm5hbWU6cGFzc3dvcmQ='); - $server->httpResponse = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $server->httpResponse = $this->createMock(ResponseInterface::class); $this->userSession ->expects($this->once()) ->method('logClientIn') ->with('username', 'password') ->willReturn(true); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->exactly(2)) ->method('getUID') ->willReturn('MyTestUser'); @@ -678,12 +587,8 @@ class AuthTest extends TestCase { } public function testAuthenticateInvalidCredentials(): void { - $server = $this->getMockBuilder(Server::class) - ->disableOriginalConstructor() - ->getMock(); - $server->httpRequest = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $server = $this->createMock(Server::class); + $server->httpRequest = $this->createMock(RequestInterface::class); $server->httpRequest ->expects($this->exactly(2)) ->method('getHeader') @@ -691,9 +596,7 @@ class AuthTest extends TestCase { ['Authorization', 'basic dXNlcm5hbWU6cGFzc3dvcmQ='], ['X-Requested-With', null], ]); - $server->httpResponse = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $server->httpResponse = $this->createMock(ResponseInterface::class); $this->userSession ->expects($this->once()) ->method('logClientIn') diff --git a/apps/dav/tests/unit/Connector/Sabre/BearerAuthTest.php b/apps/dav/tests/unit/Connector/Sabre/BearerAuthTest.php index 99c2a461557..1e6267d4cbb 100644 --- a/apps/dav/tests/unit/Connector/Sabre/BearerAuthTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/BearerAuthTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -21,14 +23,10 @@ use Test\TestCase; * @group DB */ class BearerAuthTest extends TestCase { - /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */ - private $userSession; - /** @var ISession|\PHPUnit\Framework\MockObject\MockObject */ - private $session; - /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */ - private $request; - /** @var BearerAuth */ - private $bearerAuth; + private IUserSession&MockObject $userSession; + private ISession&MockObject $session; + private IRequest&MockObject $request; + private BearerAuth $bearerAuth; private IConfig&MockObject $config; @@ -74,9 +72,9 @@ class BearerAuthTest extends TestCase { } public function testChallenge(): void { - /** @var \PHPUnit\Framework\MockObject\MockObject|RequestInterface $request */ + /** @var RequestInterface&MockObject $request */ $request = $this->createMock(RequestInterface::class); - /** @var \PHPUnit\Framework\MockObject\MockObject|ResponseInterface $response */ + /** @var ResponseInterface&MockObject $response */ $response = $this->createMock(ResponseInterface::class); $result = $this->bearerAuth->challenge($request, $response); $this->assertEmpty($result); diff --git a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php index 072dd1a3b58..27ddd3f4a1f 100644 --- a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php @@ -83,7 +83,7 @@ class BlockLegacyClientPluginTest extends TestCase { } /** @var RequestInterface|MockObject $request */ - $request = $this->createMock('\Sabre\HTTP\RequestInterface'); + $request = $this->createMock(RequestInterface::class); $request ->expects($this->once()) ->method('getHeader') diff --git a/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php index 1cda0e4dbdb..6606dcd5717 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -8,62 +9,45 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre; use OCA\DAV\Connector\Sabre\CommentPropertiesPlugin as CommentPropertiesPluginImplementation; +use OCA\DAV\Connector\Sabre\Directory; use OCA\DAV\Connector\Sabre\File; use OCP\Comments\ICommentsManager; use OCP\IUser; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\PropFind; +use Sabre\DAV\Server; class CommentsPropertiesPluginTest extends \Test\TestCase { - - /** @var CommentPropertiesPluginImplementation */ - protected $plugin; - protected $commentsManager; - protected $userSession; - protected $server; + protected CommentPropertiesPluginImplementation $plugin; + protected ICommentsManager&MockObject $commentsManager; + protected IUserSession&MockObject $userSession; + protected Server&MockObject $server; protected function setUp(): void { parent::setUp(); - $this->commentsManager = $this->getMockBuilder(ICommentsManager::class) - ->disableOriginalConstructor() - ->getMock(); - $this->userSession = $this->getMockBuilder(IUserSession::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->server = $this->getMockBuilder('\Sabre\DAV\Server') - ->disableOriginalConstructor() - ->getMock(); + $this->commentsManager = $this->createMock(ICommentsManager::class); + $this->userSession = $this->createMock(IUserSession::class); + $this->server = $this->createMock(Server::class); $this->plugin = new CommentPropertiesPluginImplementation($this->commentsManager, $this->userSession); $this->plugin->initialize($this->server); } - public function nodeProvider() { - $mocks = []; - foreach (['\OCA\DAV\Connector\Sabre\File', '\OCA\DAV\Connector\Sabre\Directory', '\Sabre\DAV\INode'] as $class) { - $mocks[] = $this->getMockBuilder($class) - ->disableOriginalConstructor() - ->getMock(); - } - + public static function nodeProvider(): array { return [ - [$mocks[0], true], - [$mocks[1], true], - [$mocks[2], false] + [File::class, true], + [Directory::class, true], + [\Sabre\DAV\INode::class, false] ]; } /** * @dataProvider nodeProvider - * @param $node - * @param $expectedSuccessful */ - public function testHandleGetProperties($node, $expectedSuccessful): void { - $propFind = $this->getMockBuilder(PropFind::class) - ->disableOriginalConstructor() - ->getMock(); + public function testHandleGetProperties(string $class, bool $expectedSuccessful): void { + $propFind = $this->createMock(PropFind::class); if ($expectedSuccessful) { $propFind->expects($this->exactly(3)) @@ -73,10 +57,11 @@ class CommentsPropertiesPluginTest extends \Test\TestCase { ->method('handle'); } + $node = $this->createMock($class); $this->plugin->handleGetProperties($propFind, $node); } - public function baseUriProvider() { + public static function baseUriProvider(): array { return [ ['owncloud/remote.php/webdav/', '4567', 'owncloud/remote.php/dav/comments/files/4567'], ['owncloud/remote.php/files/', '4567', 'owncloud/remote.php/dav/comments/files/4567'], @@ -86,14 +71,9 @@ class CommentsPropertiesPluginTest extends \Test\TestCase { /** * @dataProvider baseUriProvider - * @param $baseUri - * @param $fid - * @param $expectedHref */ - public function testGetCommentsLink($baseUri, $fid, $expectedHref): void { - $node = $this->getMockBuilder(File::class) - ->disableOriginalConstructor() - ->getMock(); + public function testGetCommentsLink(string $baseUri, string $fid, ?string $expectedHref): void { + $node = $this->createMock(File::class); $node->expects($this->any()) ->method('getId') ->willReturn($fid); @@ -106,29 +86,25 @@ class CommentsPropertiesPluginTest extends \Test\TestCase { $this->assertSame($expectedHref, $href); } - public function userProvider() { + public static function userProvider(): array { return [ - [ - $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock() - ], + [IUser::class], [null] ]; } /** * @dataProvider userProvider - * @param $user */ - public function testGetUnreadCount($user): void { - $node = $this->getMockBuilder(File::class) - ->disableOriginalConstructor() - ->getMock(); + public function testGetUnreadCount(?string $user): void { + $node = $this->createMock(File::class); $node->expects($this->any()) ->method('getId') ->willReturn('4567'); + if ($user !== null) { + $user = $this->createMock($user); + } $this->userSession->expects($this->once()) ->method('getUser') ->willReturn($user); diff --git a/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php index bc19e071ee7..7067cf335ed 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -15,12 +16,8 @@ use Sabre\DAV\Tree; use Test\TestCase; class CopyEtagHeaderPluginTest extends TestCase { - - /** @var CopyEtagHeaderPlugin */ - private $plugin; - - /** @var Server */ - private $server; + private CopyEtagHeaderPlugin $plugin; + private Server $server; protected function setUp(): void { parent::setUp(); @@ -62,15 +59,11 @@ class CopyEtagHeaderPluginTest extends TestCase { } public function testAfterMove(): void { - $node = $this->getMockBuilder(File::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(File::class); $node->expects($this->once()) ->method('getETag') ->willReturn('123456'); - $tree = $this->getMockBuilder(Tree::class) - ->disableOriginalConstructor() - ->getMock(); + $tree = $this->createMock(Tree::class); $tree->expects($this->once()) ->method('getNodeForPath') ->with('test.txt') diff --git a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php index eb3f291e9c0..381206e336e 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -25,42 +26,21 @@ use Sabre\DAV\Tree; * @package OCA\DAV\Tests\unit\Connector\Sabre */ class CustomPropertiesBackendTest extends \Test\TestCase { - - /** - * @var \Sabre\DAV\Server - */ - private $server; - - /** - * @var \Sabre\DAV\Tree - */ - private $tree; - - /** - * @var CustomPropertiesBackend - */ - private $plugin; - - /** - * @var IUser - */ - private $user; - - /** @property MockObject|DefaultCalendarValidator */ - private $defaultCalendarValidator; + private \Sabre\DAV\Server $server; + private \Sabre\DAV\Tree&MockObject $tree; + private IUser&MockObject $user; + private DefaultCalendarValidator&MockObject $defaultCalendarValidator; + private CustomPropertiesBackend $plugin; protected function setUp(): void { parent::setUp(); + $this->server = new \Sabre\DAV\Server(); - $this->tree = $this->getMockBuilder(Tree::class) - ->disableOriginalConstructor() - ->getMock(); + $this->tree = $this->createMock(Tree::class); - $userId = $this->getUniqueID('testcustompropertiesuser'); + $userId = self::getUniqueID('testcustompropertiesuser'); - $this->user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $this->user = $this->createMock(IUser::class); $this->user->expects($this->any()) ->method('getUID') ->willReturn($userId); @@ -88,12 +68,12 @@ class CustomPropertiesBackendTest extends \Test\TestCase { ] ); $deleteStatement->closeCursor(); + + parent::tearDown(); } - private function createTestNode($class) { - $node = $this->getMockBuilder($class) - ->disableOriginalConstructor() - ->getMock(); + private function createTestNode(string $class) { + $node = $this->createMock($class); $node->expects($this->any()) ->method('getId') ->willReturn(123); diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php index 7fefe3e06da..85890c0f987 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php @@ -1,11 +1,12 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. * SPDX-License-Identifier: AGPL-3.0-only */ -namespace OCA\DAV\Tests\Unit\Connector\Sabre; +namespace OCA\DAV\Tests\unit\Connector\Sabre; use OC\Files\FileInfo; use OC\Files\Filesystem; @@ -21,6 +22,7 @@ use OCP\Files\ForbiddenException; use OCP\Files\InvalidPathException; use OCP\Files\Mount\IMountPoint; use OCP\Files\StorageNotAvailableException; +use PHPUnit\Framework\MockObject\MockObject; use Test\Traits\UserTrait; class TestViewDirectory extends View { @@ -43,7 +45,7 @@ class TestViewDirectory extends View { return $this->deletables[$path]; } - public function rename($path1, $path2, array $options = []) { + public function rename($source, $target, array $options = []) { return $this->canRename; } @@ -59,16 +61,14 @@ class TestViewDirectory extends View { class DirectoryTest extends \Test\TestCase { use UserTrait; - /** @var View|\PHPUnit\Framework\MockObject\MockObject */ - private $view; - /** @var FileInfo|\PHPUnit\Framework\MockObject\MockObject */ - private $info; + private View&MockObject $view; + private FileInfo&MockObject $info; protected function setUp(): void { parent::setUp(); - $this->view = $this->createMock('OC\Files\View'); - $this->info = $this->createMock('OC\Files\FileInfo'); + $this->view = $this->createMock(View::class); + $this->info = $this->createMock(FileInfo::class); $this->info->method('isReadable') ->willReturn(true); $this->info->method('getType') @@ -81,7 +81,7 @@ class DirectoryTest extends \Test\TestCase { ->willReturn(Constants::PERMISSION_READ); } - private function getDir($path = '/') { + private function getDir(string $path = '/'): Directory { $this->view->expects($this->once()) ->method('getRelativePath') ->willReturn($path); @@ -174,12 +174,8 @@ class DirectoryTest extends \Test\TestCase { } public function testGetChildren(): void { - $info1 = $this->getMockBuilder(FileInfo::class) - ->disableOriginalConstructor() - ->getMock(); - $info2 = $this->getMockBuilder(FileInfo::class) - ->disableOriginalConstructor() - ->getMock(); + $info1 = $this->createMock(FileInfo::class); + $info2 = $this->createMock(FileInfo::class); $info1->method('getName') ->willReturn('first'); $info1->method('getPath') @@ -214,7 +210,7 @@ class DirectoryTest extends \Test\TestCase { $dir = new Directory($this->view, $this->info); $nodes = $dir->getChildren(); - $this->assertEquals(2, count($nodes)); + $this->assertCount(2, $nodes); // calling a second time just returns the cached values, // does not call getDirectoryContents again @@ -273,12 +269,10 @@ class DirectoryTest extends \Test\TestCase { } public function testGetQuotaInfoUnlimited(): void { - self::createUser('user', 'password'); + $this->createUser('user', 'password'); self::loginAsUser('user'); $mountPoint = $this->createMock(IMountPoint::class); - $storage = $this->getMockBuilder(Quota::class) - ->disableOriginalConstructor() - ->getMock(); + $storage = $this->createMock(Quota::class); $mountPoint->method('getStorage') ->willReturn($storage); @@ -329,12 +323,10 @@ class DirectoryTest extends \Test\TestCase { } public function testGetQuotaInfoSpecific(): void { - self::createUser('user', 'password'); + $this->createUser('user', 'password'); self::loginAsUser('user'); $mountPoint = $this->createMock(IMountPoint::class); - $storage = $this->getMockBuilder(Quota::class) - ->disableOriginalConstructor() - ->getMock(); + $storage = $this->createMock(Quota::class); $mountPoint->method('getStorage') ->willReturn($storage); @@ -384,7 +376,7 @@ class DirectoryTest extends \Test\TestCase { /** * @dataProvider moveFailedProvider */ - public function testMoveFailed($source, $destination, $updatables, $deletables): void { + public function testMoveFailed(string $source, string $destination, array $updatables, array $deletables): void { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->moveTest($source, $destination, $updatables, $deletables); @@ -393,7 +385,7 @@ class DirectoryTest extends \Test\TestCase { /** * @dataProvider moveSuccessProvider */ - public function testMoveSuccess($source, $destination, $updatables, $deletables): void { + public function testMoveSuccess(string $source, string $destination, array $updatables, array $deletables): void { $this->moveTest($source, $destination, $updatables, $deletables); $this->addToAssertionCount(1); } @@ -401,19 +393,19 @@ class DirectoryTest extends \Test\TestCase { /** * @dataProvider moveFailedInvalidCharsProvider */ - public function testMoveFailedInvalidChars($source, $destination, $updatables, $deletables): void { + public function testMoveFailedInvalidChars(string $source, string $destination, array $updatables, array $deletables): void { $this->expectException(InvalidPath::class); $this->moveTest($source, $destination, $updatables, $deletables); } - public function moveFailedInvalidCharsProvider() { + public static function moveFailedInvalidCharsProvider(): array { return [ ['a/valid', "a/i\nvalid", ['a' => true, 'a/valid' => true, 'a/c*' => false], []], ]; } - public function moveFailedProvider() { + public static function moveFailedProvider(): array { return [ ['a/b', 'a/c', ['a' => false, 'a/b' => false, 'a/c' => false], []], ['a/b', 'b/b', ['a' => false, 'a/b' => false, 'b' => false, 'b/b' => false], []], @@ -424,7 +416,7 @@ class DirectoryTest extends \Test\TestCase { ]; } - public function moveSuccessProvider() { + public static function moveSuccessProvider(): array { return [ ['a/b', 'b/b', ['a' => true, 'a/b' => true, 'b' => true, 'b/b' => false], ['a/b' => true]], // older files with special chars can still be renamed to valid names @@ -432,12 +424,7 @@ class DirectoryTest extends \Test\TestCase { ]; } - /** - * @param $source - * @param $destination - * @param $updatables - */ - private function moveTest($source, $destination, $updatables, $deletables): void { + private function moveTest(string $source, string $destination, array $updatables, array $deletables): void { $view = new TestViewDirectory($updatables, $deletables); $sourceInfo = new FileInfo($source, null, null, [ @@ -449,7 +436,7 @@ class DirectoryTest extends \Test\TestCase { $sourceNode = new Directory($view, $sourceInfo); $targetNode = $this->getMockBuilder(Directory::class) - ->setMethods(['childExists']) + ->onlyMethods(['childExists']) ->setConstructorArgs([$view, $targetInfo]) ->getMock(); $targetNode->expects($this->any())->method('childExists') diff --git a/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php b/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php index 03c31dc47f8..2d688d64600 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -19,8 +20,7 @@ use Test\TestCase; * @package OCA\DAV\Tests\unit\Connector\Sabre */ class DummyGetResponsePluginTest extends TestCase { - /** @var DummyGetResponsePlugin */ - private $dummyGetResponsePlugin; + private DummyGetResponsePlugin $dummyGetResponsePlugin; protected function setUp(): void { parent::setUp(); @@ -29,10 +29,7 @@ class DummyGetResponsePluginTest extends TestCase { } public function testInitialize(): void { - /** @var Server $server */ - $server = $this->getMockBuilder(Server::class) - ->disableOriginalConstructor() - ->getMock(); + $server = $this->createMock(Server::class); $server ->expects($this->once()) ->method('on') @@ -44,13 +41,9 @@ class DummyGetResponsePluginTest extends TestCase { public function testHttpGet(): void { /** @var \Sabre\HTTP\RequestInterface $request */ - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); /** @var \Sabre\HTTP\ResponseInterface $response */ - $response = $server = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $response = $this->createMock(ResponseInterface::class); $response ->expects($this->once()) ->method('setBody'); diff --git a/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php b/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php index c7fb6066ed4..2f9e0ae9196 100644 --- a/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/Exception/ForbiddenTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -8,6 +9,7 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre\Exception; use OCA\DAV\Connector\Sabre\Exception\Forbidden; +use Sabre\DAV\Server; class ForbiddenTest extends \Test\TestCase { public function testSerialization(): void { @@ -32,9 +34,7 @@ class ForbiddenTest extends \Test\TestCase { EOD; $ex = new Forbidden($message, $retry); - $server = $this->getMockBuilder('Sabre\DAV\Server') - ->disableOriginalConstructor() - ->getMock(); + $server = $this->createMock(Server::class); $ex->serialize($server, $error); // assert diff --git a/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php b/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php index 98921d735fa..6f62bef86a3 100644 --- a/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/Exception/InvalidPathTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -8,6 +9,7 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre\Exception; use OCA\DAV\Connector\Sabre\Exception\InvalidPath; +use Sabre\DAV\Server; class InvalidPathTest extends \Test\TestCase { public function testSerialization(): void { @@ -32,9 +34,7 @@ class InvalidPathTest extends \Test\TestCase { EOD; $ex = new InvalidPath($message, $retry); - $server = $this->getMockBuilder('Sabre\DAV\Server') - ->disableOriginalConstructor() - ->getMock(); + $server = $this->createMock(Server::class); $ex->serialize($server, $error); // assert diff --git a/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php index 1d50fb2fb9a..a330a885b1f 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -11,21 +12,16 @@ use OC\SystemConfig; use OCA\DAV\Connector\Sabre\Exception\InvalidPath; use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin; use OCA\DAV\Exception\ServerMaintenanceMode; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\Server; use Test\TestCase; class ExceptionLoggerPluginTest extends TestCase { - - /** @var Server */ - private $server; - - /** @var ExceptionLoggerPlugin */ - private $plugin; - - /** @var LoggerInterface | \PHPUnit\Framework\MockObject\MockObject */ - private $logger; + private Server $server; + private ExceptionLoggerPlugin $plugin; + private LoggerInterface&MockObject $logger; private function init(): void { $config = $this->createMock(SystemConfig::class); @@ -59,7 +55,7 @@ class ExceptionLoggerPluginTest extends TestCase { $this->plugin->logException($e); } - public function providesExceptions() { + public static function providesExceptions(): array { return [ ['debug', new NotFound()], ['debug', new ServerMaintenanceMode('System is in maintenance mode.')], diff --git a/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php index 18165b79cb2..ef744d13e6a 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FakeLockerPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -22,8 +23,7 @@ use Test\TestCase; * @package OCA\DAV\Tests\unit\Connector\Sabre */ class FakeLockerPluginTest extends TestCase { - /** @var FakeLockerPlugin */ - private $fakeLockerPlugin; + private FakeLockerPlugin $fakeLockerPlugin; protected function setUp(): void { parent::setUp(); @@ -32,18 +32,19 @@ class FakeLockerPluginTest extends TestCase { public function testInitialize(): void { /** @var Server $server */ - $server = $this->getMockBuilder(Server::class) - ->disableOriginalConstructor() - ->getMock(); - $server - ->expects($this->exactly(4)) + $server = $this->createMock(Server::class); + $calls = [ + ['method:LOCK', [$this->fakeLockerPlugin, 'fakeLockProvider'], 1], + ['method:UNLOCK', [$this->fakeLockerPlugin, 'fakeUnlockProvider'], 1], + ['propFind', [$this->fakeLockerPlugin, 'propFind'], 100], + ['validateTokens', [$this->fakeLockerPlugin, 'validateTokens'], 100], + ]; + $server->expects($this->exactly(count($calls))) ->method('on') - ->withConsecutive( - ['method:LOCK', [$this->fakeLockerPlugin, 'fakeLockProvider'], 1], - ['method:UNLOCK', [$this->fakeLockerPlugin, 'fakeUnlockProvider'], 1], - ['propFind', [$this->fakeLockerPlugin, 'propFind']], - ['validateTokens', [$this->fakeLockerPlugin, 'validateTokens']], - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); $this->fakeLockerPlugin->initialize($server); } @@ -64,24 +65,24 @@ class FakeLockerPluginTest extends TestCase { } public function testPropFind(): void { - $propFind = $this->getMockBuilder(PropFind::class) - ->disableOriginalConstructor() - ->getMock(); - $node = $this->getMockBuilder(INode::class) - ->disableOriginalConstructor() - ->getMock(); + $propFind = $this->createMock(PropFind::class); + $node = $this->createMock(INode::class); - $propFind->expects($this->exactly(2)) + $calls = [ + '{DAV:}supportedlock', + '{DAV:}lockdiscovery', + ]; + $propFind->expects($this->exactly(count($calls))) ->method('handle') - ->withConsecutive( - ['{DAV:}supportedlock'], - ['{DAV:}lockdiscovery'], - ); + ->willReturnCallback(function ($propertyName) use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, $propertyName); + }); $this->fakeLockerPlugin->propFind($propFind, $node); } - public function tokenDataProvider() { + public static function tokenDataProvider(): array { return [ [ [ @@ -120,21 +121,15 @@ class FakeLockerPluginTest extends TestCase { /** * @dataProvider tokenDataProvider - * @param array $input - * @param array $expected */ public function testValidateTokens(array $input, array $expected): void { - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); $this->fakeLockerPlugin->validateTokens($request, $input); $this->assertSame($expected, $input); } public function testFakeLockProvider(): void { - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); $response = new Response(); $server = $this->getMockBuilder(Server::class) ->getMock(); @@ -152,12 +147,8 @@ class FakeLockerPluginTest extends TestCase { } public function testFakeUnlockProvider(): void { - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $response->expects($this->once()) ->method('setStatus') diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index ef02f145375..4a7ddad7115 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -53,16 +54,9 @@ class FileTest extends TestCase { use MountProviderTrait; use UserTrait; - /** - * @var string - */ - private $user; - - /** @var IConfig|MockObject */ - protected $config; - - /** @var IRequestId|MockObject */ - protected $requestId; + private string $user; + protected IConfig&MockObject $config; + protected IRequestId&MockObject $requestId; protected function setUp(): void { parent::setUp(); @@ -72,7 +66,7 @@ class FileTest extends TestCase { $this->user = 'test_user'; $this->createUser($this->user, 'pass'); - $this->loginAsUser($this->user); + self::loginAsUser($this->user); $this->config = $this->createMock(IConfig::class); $this->requestId = $this->createMock(IRequestId::class); @@ -86,9 +80,7 @@ class FileTest extends TestCase { } private function getMockStorage(): MockObject&IStorage { - $storage = $this->getMockBuilder(IStorage::class) - ->disableOriginalConstructor() - ->getMock(); + $storage = $this->createMock(IStorage::class); $storage->method('getId') ->willReturn('home::someuser'); return $storage; @@ -102,7 +94,7 @@ class FileTest extends TestCase { } - public function fopenFailuresProvider() { + public static function fopenFailuresProvider(): array { return [ [ // return false @@ -161,14 +153,14 @@ class FileTest extends TestCase { /** * @dataProvider fopenFailuresProvider */ - public function testSimplePutFails($thrownException, $expectedException, $checkPreviousClass = true): void { + public function testSimplePutFails(?\Throwable $thrownException, string $expectedException, bool $checkPreviousClass = true): void { // setup $storage = $this->getMockBuilder(Local::class) ->onlyMethods(['writeStream']) ->setConstructorArgs([['datadir' => Server::get(ITempManager::class)->getTemporaryFolder()]]) ->getMock(); Filesystem::mount($storage, [], $this->user . '/'); - /** @var View | MockObject $view */ + /** @var View&MockObject $view */ $view = $this->getMockBuilder(View::class) ->onlyMethods(['getRelativePath', 'resolvePath']) ->getMock(); @@ -221,12 +213,12 @@ class FileTest extends TestCase { * Simulate putting a file to the given path. * * @param string $path path to put the file into - * @param string $viewRoot root to use for the view + * @param ?string $viewRoot root to use for the view * @param null|Request $request the HTTP request * * @return null|string of the PUT operation which is usually the etag */ - private function doPut($path, $viewRoot = null, ?Request $request = null) { + private function doPut(string $path, ?string $viewRoot = null, ?Request $request = null) { $view = Filesystem::getView(); if (!is_null($viewRoot)) { $view = new View($viewRoot); @@ -245,7 +237,7 @@ class FileTest extends TestCase { null ); - /** @var File|MockObject $file */ + /** @var File&MockObject $file */ $file = $this->getMockBuilder(File::class) ->setConstructorArgs([$view, $info, null, $request]) ->onlyMethods(['header']) @@ -269,55 +261,55 @@ class FileTest extends TestCase { $this->assertNotEmpty($this->doPut('/foo.txt')); } - public function legalMtimeProvider() { + public static function legalMtimeProvider(): array { return [ 'string' => [ - 'HTTP_X_OC_MTIME' => 'string', - 'expected result' => null + 'requestMtime' => 'string', + 'resultMtime' => null ], 'castable string (int)' => [ - 'HTTP_X_OC_MTIME' => '987654321', - 'expected result' => 987654321 + 'requestMtime' => '987654321', + 'resultMtime' => 987654321 ], 'castable string (float)' => [ - 'HTTP_X_OC_MTIME' => '123456789.56', - 'expected result' => 123456789 + 'requestMtime' => '123456789.56', + 'resultMtime' => 123456789 ], 'float' => [ - 'HTTP_X_OC_MTIME' => 123456789.56, - 'expected result' => 123456789 + 'requestMtime' => 123456789.56, + 'resultMtime' => 123456789 ], 'zero' => [ - 'HTTP_X_OC_MTIME' => 0, - 'expected result' => null + 'requestMtime' => 0, + 'resultMtime' => null ], 'zero string' => [ - 'HTTP_X_OC_MTIME' => '0', - 'expected result' => null + 'requestMtime' => '0', + 'resultMtime' => null ], 'negative zero string' => [ - 'HTTP_X_OC_MTIME' => '-0', - 'expected result' => null + 'requestMtime' => '-0', + 'resultMtime' => null ], 'string starting with number following by char' => [ - 'HTTP_X_OC_MTIME' => '2345asdf', - 'expected result' => null + 'requestMtime' => '2345asdf', + 'resultMtime' => null ], 'string castable hex int' => [ - 'HTTP_X_OC_MTIME' => '0x45adf', - 'expected result' => null + 'requestMtime' => '0x45adf', + 'resultMtime' => null ], 'string that looks like invalid hex int' => [ - 'HTTP_X_OC_MTIME' => '0x123g', - 'expected result' => null + 'requestMtime' => '0x123g', + 'resultMtime' => null ], 'negative int' => [ - 'HTTP_X_OC_MTIME' => -34, - 'expected result' => null + 'requestMtime' => -34, + 'resultMtime' => null ], 'negative float' => [ - 'HTTP_X_OC_MTIME' => -34.43, - 'expected result' => null + 'requestMtime' => -34.43, + 'resultMtime' => null ], ]; } @@ -326,7 +318,7 @@ class FileTest extends TestCase { * Test putting a file with string Mtime * @dataProvider legalMtimeProvider */ - public function testPutSingleFileLegalMtime($requestMtime, $resultMtime): void { + public function testPutSingleFileLegalMtime(mixed $requestMtime, ?int $resultMtime): void { $request = new Request([ 'server' => [ 'HTTP_X_OC_MTIME' => (string)$requestMtime, @@ -482,7 +474,7 @@ class FileTest extends TestCase { */ public function testSimplePutFailsSizeCheck(): void { // setup - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->onlyMethods(['rename', 'getRelativePath', 'filesize']) ->getMock(); @@ -569,7 +561,7 @@ class FileTest extends TestCase { */ public function testSimplePutInvalidChars(): void { // setup - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->onlyMethods(['getRelativePath']) ->getMock(); @@ -609,7 +601,7 @@ class FileTest extends TestCase { $this->expectException(InvalidPath::class); // setup - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->onlyMethods(['getRelativePath']) ->getMock(); @@ -630,7 +622,7 @@ class FileTest extends TestCase { public function testUploadAbort(): void { // setup - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->onlyMethods(['rename', 'getRelativePath', 'filesize']) ->getMock(); @@ -680,7 +672,7 @@ class FileTest extends TestCase { public function testDeleteWhenAllowed(): void { // setup - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->getMock(); @@ -704,7 +696,7 @@ class FileTest extends TestCase { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); // setup - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->getMock(); @@ -724,7 +716,7 @@ class FileTest extends TestCase { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); // setup - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->getMock(); @@ -749,7 +741,7 @@ class FileTest extends TestCase { $this->expectException(Forbidden::class); // setup - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->getMock(); @@ -923,7 +915,7 @@ class FileTest extends TestCase { public function testGetFopenFails(): void { $this->expectException(\Sabre\DAV\Exception\ServiceUnavailable::class); - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->onlyMethods(['fopen']) ->getMock(); @@ -945,7 +937,7 @@ class FileTest extends TestCase { public function testGetFopenThrows(): void { $this->expectException(Forbidden::class); - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->onlyMethods(['fopen']) ->getMock(); @@ -967,7 +959,7 @@ class FileTest extends TestCase { public function testGetThrowsIfNoPermission(): void { $this->expectException(\Sabre\DAV\Exception\NotFound::class); - /** @var View|MockObject */ + /** @var View&MockObject */ $view = $this->getMockBuilder(View::class) ->onlyMethods(['fopen']) ->getMock(); diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php index 1352229b1f5..d8b32067dda 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -73,23 +74,15 @@ class FilesPluginTest extends TestCase { $this->accountManager, ); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $response = $this->createMock(ResponseInterface::class); $this->server->httpResponse = $response; $this->server->xml = new Service(); $this->plugin->initialize($this->server); } - /** - * @param string $class - * @return \PHPUnit\Framework\MockObject\MockObject - */ - private function createTestNode($class, $path = '/dummypath') { - $node = $this->getMockBuilder($class) - ->disableOriginalConstructor() - ->getMock(); + private function createTestNode(string $class, string $path = '/dummypath'): MockObject { + $node = $this->createMock($class); $node->expects($this->any()) ->method('getId') @@ -129,8 +122,8 @@ class FilesPluginTest extends TestCase { } public function testGetPropertiesForFile(): void { - /** @var File|\PHPUnit\Framework\MockObject\MockObject $node */ - $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); + /** @var File&MockObject $node */ + $node = $this->createTestNode(File::class); $propFind = new PropFind( '/dummyPath', @@ -149,8 +142,7 @@ class FilesPluginTest extends TestCase { 0 ); - $user = $this->getMockBuilder(User::class) - ->disableOriginalConstructor()->getMock(); + $user = $this->createMock(User::class); $user ->expects($this->once()) ->method('getUID') @@ -160,8 +152,7 @@ class FilesPluginTest extends TestCase { ->method('getDisplayName') ->willReturn('M. Foo'); - $owner = $this->getMockBuilder(Account::class) - ->disableOriginalConstructor()->getMock(); + $owner = $this->createMock(Account::class); $this->accountManager->expects($this->once()) ->method('getAccount') ->with($user) @@ -174,8 +165,7 @@ class FilesPluginTest extends TestCase { ->method('getOwner') ->willReturn($user); - $displayNameProp = $this->getMockBuilder(AccountProperty::class) - ->disableOriginalConstructor()->getMock(); + $displayNameProp = $this->createMock(AccountProperty::class); $owner ->expects($this->once()) ->method('getProperty') @@ -205,9 +195,7 @@ class FilesPluginTest extends TestCase { } public function testGetDisplayNamePropertyWhenNotPublished(): void { - /** @var File|\PHPUnit\Framework\MockObject\MockObject $node */ - $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); - + $node = $this->createTestNode(File::class); $propFind = new PropFind( '/dummyPath', [ @@ -220,15 +208,12 @@ class FilesPluginTest extends TestCase { ->method('getUser') ->willReturn(null); - $user = $this->getMockBuilder(User::class) - ->disableOriginalConstructor()->getMock(); + $user = $this->createMock(User::class); - $user - ->expects($this->never()) + $user->expects($this->never()) ->method('getDisplayName'); - $owner = $this->getMockBuilder(Account::class) - ->disableOriginalConstructor()->getMock(); + $owner = $this->createMock(Account::class); $this->accountManager->expects($this->once()) ->method('getAccount') ->with($user) @@ -238,8 +223,7 @@ class FilesPluginTest extends TestCase { ->method('getOwner') ->willReturn($user); - $displayNameProp = $this->getMockBuilder(AccountProperty::class) - ->disableOriginalConstructor()->getMock(); + $displayNameProp = $this->createMock(AccountProperty::class); $owner ->expects($this->once()) ->method('getProperty') @@ -257,10 +241,9 @@ class FilesPluginTest extends TestCase { $this->assertEquals(null, $propFind->get(FilesPlugin::OWNER_DISPLAY_NAME_PROPERTYNAME)); } - + public function testGetDisplayNamePropertyWhenNotPublishedButLoggedIn(): void { - /** @var File|\PHPUnit\Framework\MockObject\MockObject $node */ - $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); + $node = $this->createTestNode(File::class); $propFind = new PropFind( '/dummyPath', @@ -270,15 +253,13 @@ class FilesPluginTest extends TestCase { 0 ); - $user = $this->getMockBuilder(User::class) - ->disableOriginalConstructor()->getMock(); + $user = $this->createMock(User::class); $node->expects($this->once()) ->method('getOwner') ->willReturn($user); - $loggedInUser = $this->getMockBuilder(User::class) - ->disableOriginalConstructor()->getMock(); + $loggedInUser = $this->createMock(User::class); $this->userSession->expects($this->once()) ->method('getUser') ->willReturn($loggedInUser); @@ -300,8 +281,8 @@ class FilesPluginTest extends TestCase { } public function testGetPropertiesStorageNotAvailable(): void { - /** @var File|\PHPUnit\Framework\MockObject\MockObject $node */ - $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); + /** @var File&MockObject $node */ + $node = $this->createTestNode(File::class); $propFind = new PropFind( '/dummyPath', @@ -325,9 +306,7 @@ class FilesPluginTest extends TestCase { public function testGetPublicPermissions(): void { /** @var IRequest&MockObject */ - $request = $this->getMockBuilder(IRequest::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(IRequest::class); $this->plugin = new FilesPlugin( $this->tree, $this->config, @@ -348,8 +327,8 @@ class FilesPluginTest extends TestCase { 0 ); - /** @var File|\PHPUnit\Framework\MockObject\MockObject $node */ - $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); + /** @var File&MockObject $node */ + $node = $this->createTestNode(File::class); $node->expects($this->any()) ->method('getDavPermissions') ->willReturn('DWCKMSR'); @@ -363,8 +342,8 @@ class FilesPluginTest extends TestCase { } public function testGetPropertiesForDirectory(): void { - /** @var Directory|\PHPUnit\Framework\MockObject\MockObject $node */ - $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\Directory'); + /** @var Directory&MockObject $node */ + $node = $this->createTestNode(Directory::class); $propFind = new PropFind( '/dummyPath', @@ -398,10 +377,8 @@ class FilesPluginTest extends TestCase { } public function testGetPropertiesForRootDirectory(): void { - /** @var Directory|\PHPUnit\Framework\MockObject\MockObject $node */ - $node = $this->getMockBuilder(Directory::class) - ->disableOriginalConstructor() - ->getMock(); + /** @var Directory&MockObject $node */ + $node = $this->createMock(Directory::class); $node->expects($this->any())->method('getPath')->willReturn('/'); $fileInfo = $this->createMock(FileInfo::class); @@ -433,10 +410,8 @@ class FilesPluginTest extends TestCase { // No read permissions can be caused by files access control. // But we still want to load the directory list, so this is okay for us. // $this->expectException(\Sabre\DAV\Exception\NotFound::class); - /** @var Directory|\PHPUnit\Framework\MockObject\MockObject $node */ - $node = $this->getMockBuilder(Directory::class) - ->disableOriginalConstructor() - ->getMock(); + /** @var Directory&MockObject $node */ + $node = $this->createMock(Directory::class); $node->expects($this->any())->method('getPath')->willReturn('/'); $fileInfo = $this->createMock(FileInfo::class); @@ -465,7 +440,7 @@ class FilesPluginTest extends TestCase { } public function testUpdateProps(): void { - $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); + $node = $this->createTestNode(File::class); $testDate = 'Fri, 13 Feb 2015 00:01:02 GMT'; $testCreationDate = '2007-08-31T16:47+00:00'; @@ -549,16 +524,12 @@ class FilesPluginTest extends TestCase { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->expectExceptionMessage('FolderA/test.txt cannot be deleted'); - $fileInfoFolderATestTXT = $this->getMockBuilder(FileInfo::class) - ->disableOriginalConstructor() - ->getMock(); + $fileInfoFolderATestTXT = $this->createMock(FileInfo::class); $fileInfoFolderATestTXT->expects($this->once()) ->method('isDeletable') ->willReturn(false); - $node = $this->getMockBuilder(Node::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(Node::class); $node->expects($this->atLeastOnce()) ->method('getFileInfo') ->willReturn($fileInfoFolderATestTXT); @@ -571,16 +542,12 @@ class FilesPluginTest extends TestCase { } public function testMoveSrcDeletable(): void { - $fileInfoFolderATestTXT = $this->getMockBuilder(FileInfo::class) - ->disableOriginalConstructor() - ->getMock(); + $fileInfoFolderATestTXT = $this->createMock(FileInfo::class); $fileInfoFolderATestTXT->expects($this->once()) ->method('isDeletable') ->willReturn(true); - $node = $this->getMockBuilder(Node::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(Node::class); $node->expects($this->atLeastOnce()) ->method('getFileInfo') ->willReturn($fileInfoFolderATestTXT); @@ -596,9 +563,7 @@ class FilesPluginTest extends TestCase { $this->expectException(\Sabre\DAV\Exception\NotFound::class); $this->expectExceptionMessage('FolderA/test.txt does not exist'); - $node = $this->getMockBuilder(Node::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(Node::class); $node->expects($this->atLeastOnce()) ->method('getFileInfo') ->willReturn(null); @@ -674,7 +639,7 @@ class FilesPluginTest extends TestCase { $this->plugin->checkCopy('FolderA/test.txt', 'invalid\\path.txt'); } - public function downloadHeadersProvider() { + public static function downloadHeadersProvider(): array { return [ [ false, @@ -690,22 +655,16 @@ class FilesPluginTest extends TestCase { /** * @dataProvider downloadHeadersProvider */ - public function testDownloadHeaders($isClumsyAgent, $contentDispositionHeader): void { - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + public function testDownloadHeaders(bool $isClumsyAgent, string $contentDispositionHeader): void { + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $request ->expects($this->once()) ->method('getPath') ->willReturn('test/somefile.xml'); - $node = $this->getMockBuilder(File::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(File::class); $node ->expects($this->once()) ->method('getName') @@ -722,20 +681,24 @@ class FilesPluginTest extends TestCase { ->method('isUserAgent') ->willReturn($isClumsyAgent); + $calls = [ + ['Content-Disposition', $contentDispositionHeader], + ['X-Accel-Buffering', 'no'], + ]; $response - ->expects($this->exactly(2)) + ->expects($this->exactly(count($calls))) ->method('addHeader') - ->withConsecutive( - ['Content-Disposition', $contentDispositionHeader], - ['X-Accel-Buffering', 'no'] - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertSame($expected, func_get_args()); + }); $this->plugin->httpGet($request, $response); } public function testHasPreview(): void { - /** @var Directory|\PHPUnit\Framework\MockObject\MockObject $node */ - $node = $this->createTestNode('\OCA\DAV\Connector\Sabre\Directory'); + /** @var Directory&MockObject $node */ + $node = $this->createTestNode(Directory::class); $propFind = new PropFind( '/dummyPath', diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php index 6a9372ca3fd..e6cfb1f67b2 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -31,6 +32,7 @@ use OCP\SystemTag\ISystemTagObjectMapper; use OCP\SystemTag\TagNotFoundException; use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\INode; +use Sabre\DAV\Server; use Sabre\DAV\Tree; use Sabre\HTTP\ResponseInterface; @@ -52,15 +54,11 @@ class FilesReportPluginTest extends \Test\TestCase { protected function setUp(): void { parent::setUp(); - $this->tree = $this->getMockBuilder(Tree::class) - ->disableOriginalConstructor() - ->getMock(); - $this->view = $this->getMockBuilder(View::class) - ->disableOriginalConstructor() - ->getMock(); + $this->tree = $this->createMock(Tree::class); + $this->view = $this->createMock(View::class); - $this->server = $this->getMockBuilder('\Sabre\DAV\Server') + $this->server = $this->getMockBuilder(Server::class) ->setConstructorArgs([$this->tree]) ->onlyMethods(['getRequestUri', 'getBaseUri']) ->getMock(); @@ -69,22 +67,10 @@ class FilesReportPluginTest extends \Test\TestCase { ->method('getBaseUri') ->willReturn('http://example.com/owncloud/remote.php/dav'); - $this->groupManager = $this->getMockBuilder(IGroupManager::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->userFolder = $this->getMockBuilder(Folder::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->previewManager = $this->getMockBuilder(IPreview::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->appManager = $this->getMockBuilder(IAppManager::class) - ->disableOriginalConstructor() - ->getMock(); - + $this->groupManager = $this->createMock(IGroupManager::class); + $this->userFolder = $this->createMock(Folder::class); + $this->previewManager = $this->createMock(IPreview::class); + $this->appManager = $this->createMock(IAppManager::class); $this->tagManager = $this->createMock(ISystemTagManager::class); $this->tagMapper = $this->createMock(ISystemTagObjectMapper::class); $this->userSession = $this->createMock(IUserSession::class); @@ -95,9 +81,7 @@ class FilesReportPluginTest extends \Test\TestCase { ->with('files') ->willReturn($this->privateTags); - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->any()) ->method('getUID') ->willReturn('testuser'); @@ -124,11 +108,7 @@ class FilesReportPluginTest extends \Test\TestCase { $this->tree->expects($this->any()) ->method('getNodeForPath') ->with('/' . $path) - ->willReturn( - $this->getMockBuilder(INode::class) - ->disableOriginalConstructor() - ->getMock() - ); + ->willReturn($this->createMock(INode::class)); $this->server->expects($this->any()) ->method('getRequestUri') @@ -182,16 +162,12 @@ class FilesReportPluginTest extends \Test\TestCase { ->method('isAdmin') ->willReturn(true); - $reportTargetNode = $this->getMockBuilder(Directory::class) - ->disableOriginalConstructor() - ->getMock(); + $reportTargetNode = $this->createMock(Directory::class); $reportTargetNode->expects($this->any()) ->method('getPath') ->willReturn(''); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $response = $this->createMock(ResponseInterface::class); $response->expects($this->once()) ->method('setHeader') @@ -240,14 +216,10 @@ class FilesReportPluginTest extends \Test\TestCase { $this->userFolder->expects($this->exactly(2)) ->method('searchBySystemTag') - ->withConsecutive( - ['OneTwoThree'], - ['FourFiveSix'], - ) - ->willReturnOnConsecutiveCalls( - [$filesNode1], - [$filesNode2], - ); + ->willReturnMap([ + ['OneTwoThree', 'testuser', 0, 0, [$filesNode1]], + ['FourFiveSix', 'testuser', 0, 0, [$filesNode2]], + ]); $this->server->expects($this->any()) ->method('getRequestUri') @@ -259,74 +231,56 @@ class FilesReportPluginTest extends \Test\TestCase { } public function testFindNodesByFileIdsRoot(): void { - $filesNode1 = $this->getMockBuilder(Folder::class) - ->disableOriginalConstructor() - ->getMock(); + $filesNode1 = $this->createMock(Folder::class); $filesNode1->expects($this->once()) ->method('getName') ->willReturn('first node'); - $filesNode2 = $this->getMockBuilder(File::class) - ->disableOriginalConstructor() - ->getMock(); + $filesNode2 = $this->createMock(File::class); $filesNode2->expects($this->once()) ->method('getName') ->willReturn('second node'); - $reportTargetNode = $this->getMockBuilder(Directory::class) - ->disableOriginalConstructor() - ->getMock(); + $reportTargetNode = $this->createMock(Directory::class); $reportTargetNode->expects($this->any()) ->method('getPath') ->willReturn('/'); $this->userFolder->expects($this->exactly(2)) ->method('getFirstNodeById') - ->withConsecutive( - ['111'], - ['222'], - ) - ->willReturnOnConsecutiveCalls( - $filesNode1, - $filesNode2, - ); + ->willReturnMap([ + [111, $filesNode1], + [222, $filesNode2], + ]); /** @var Directory&MockObject $reportTargetNode */ $result = $this->plugin->findNodesByFileIds($reportTargetNode, ['111', '222']); $this->assertCount(2, $result); - $this->assertInstanceOf('\OCA\DAV\Connector\Sabre\Directory', $result[0]); + $this->assertInstanceOf(Directory::class, $result[0]); $this->assertEquals('first node', $result[0]->getName()); - $this->assertInstanceOf('\OCA\DAV\Connector\Sabre\File', $result[1]); + $this->assertInstanceOf(\OCA\DAV\Connector\Sabre\File::class, $result[1]); $this->assertEquals('second node', $result[1]->getName()); } public function testFindNodesByFileIdsSubDir(): void { - $filesNode1 = $this->getMockBuilder(Folder::class) - ->disableOriginalConstructor() - ->getMock(); + $filesNode1 = $this->createMock(Folder::class); $filesNode1->expects($this->once()) ->method('getName') ->willReturn('first node'); - $filesNode2 = $this->getMockBuilder(File::class) - ->disableOriginalConstructor() - ->getMock(); + $filesNode2 = $this->createMock(File::class); $filesNode2->expects($this->once()) ->method('getName') ->willReturn('second node'); - $reportTargetNode = $this->getMockBuilder(Directory::class) - ->disableOriginalConstructor() - ->getMock(); + $reportTargetNode = $this->createMock(Directory::class); $reportTargetNode->expects($this->any()) ->method('getPath') ->willReturn('/sub1/sub2'); - $subNode = $this->getMockBuilder(Folder::class) - ->disableOriginalConstructor() - ->getMock(); + $subNode = $this->createMock(Folder::class); $this->userFolder->expects($this->once()) ->method('get') @@ -335,22 +289,18 @@ class FilesReportPluginTest extends \Test\TestCase { $subNode->expects($this->exactly(2)) ->method('getFirstNodeById') - ->withConsecutive( - ['111'], - ['222'], - ) - ->willReturnOnConsecutiveCalls( - $filesNode1, - $filesNode2, - ); + ->willReturnMap([ + [111, $filesNode1], + [222, $filesNode2], + ]); /** @var Directory&MockObject $reportTargetNode */ $result = $this->plugin->findNodesByFileIds($reportTargetNode, ['111', '222']); $this->assertCount(2, $result); - $this->assertInstanceOf('\OCA\DAV\Connector\Sabre\Directory', $result[0]); + $this->assertInstanceOf(Directory::class, $result[0]); $this->assertEquals('first node', $result[0]->getName()); - $this->assertInstanceOf('\OCA\DAV\Connector\Sabre\File', $result[1]); + $this->assertInstanceOf(\OCA\DAV\Connector\Sabre\File::class, $result[1]); $this->assertEquals('second node', $result[1]->getName()); } @@ -360,12 +310,8 @@ class FilesReportPluginTest extends \Test\TestCase { $fileInfo = $this->createMock(FileInfo::class); $fileInfo->method('isReadable')->willReturn(true); - $node1 = $this->getMockBuilder(Directory::class) - ->disableOriginalConstructor() - ->getMock(); - $node2 = $this->getMockBuilder(\OCA\DAV\Connector\Sabre\File::class) - ->disableOriginalConstructor() - ->getMock(); + $node1 = $this->createMock(Directory::class); + $node2 = $this->createMock(\OCA\DAV\Connector\Sabre\File::class); $node1->expects($this->once()) ->method('getInternalFileId') @@ -385,10 +331,7 @@ class FilesReportPluginTest extends \Test\TestCase { ->willReturn('/sub/node2'); $node2->method('getFileInfo')->willReturn($fileInfo); - $config = $this->getMockBuilder(IConfig::class) - ->disableOriginalConstructor() - ->getMock(); - + $config = $this->createMock(IConfig::class); $validator = $this->createMock(IFilenameValidator::class); $accountManager = $this->createMock(IAccountManager::class); @@ -461,7 +404,7 @@ class FilesReportPluginTest extends \Test\TestCase { ->with('OneTwoThree') ->willReturn([$filesNode1, $filesNode2]); - $this->assertEquals([$filesNode1, $filesNode2], $this->invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, 0, 0])); + $this->assertEquals([$filesNode1, $filesNode2], self::invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, 0, 0])); } public function testProcessFilterRulesAndCondition(): void { @@ -513,21 +456,17 @@ class FilesReportPluginTest extends \Test\TestCase { $this->userFolder->expects($this->exactly(2)) ->method('searchBySystemTag') - ->withConsecutive( - ['OneTwoThree'], - ['FourFiveSix'], - ) - ->willReturnOnConsecutiveCalls( - [$filesNode1, $filesNode2], - [$filesNode2, $filesNode3], - ); + ->willReturnMap([ + ['OneTwoThree', 'testuser', 0, 0, [$filesNode1, $filesNode2]], + ['FourFiveSix', 'testuser', 0, 0, [$filesNode2, $filesNode3]], + ]); $rules = [ ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '123'], ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '456'], ]; - $this->assertEquals([$filesNode2], array_values($this->invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null]))); + $this->assertEquals([$filesNode2], array_values(self::invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null]))); } public function testProcessFilterRulesAndConditionWithOneEmptyResult(): void { @@ -572,21 +511,17 @@ class FilesReportPluginTest extends \Test\TestCase { $this->userFolder->expects($this->exactly(2)) ->method('searchBySystemTag') - ->withConsecutive( - ['OneTwoThree'], - ['FourFiveSix'], - ) - ->willReturnOnConsecutiveCalls( - [$filesNode1, $filesNode2], - [], - ); + ->willReturnMap([ + ['OneTwoThree', 'testuser', 0, 0, [$filesNode1, $filesNode2]], + ['FourFiveSix', 'testuser', 0, 0, []], + ]); $rules = [ ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '123'], ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '456'], ]; - $this->assertEquals([], $this->invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null])); + $this->assertEquals([], self::invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null])); } public function testProcessFilterRulesAndConditionWithFirstEmptyResult(): void { @@ -631,18 +566,16 @@ class FilesReportPluginTest extends \Test\TestCase { $this->userFolder->expects($this->once()) ->method('searchBySystemTag') - ->with('OneTwoThree') - ->willReturnOnConsecutiveCalls( - [], - [$filesNode1, $filesNode2], - ); + ->willReturnMap([ + ['OneTwoThree', 'testuser', 0, 0, []], + ]); $rules = [ ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '123'], ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '456'], ]; - $this->assertEquals([], $this->invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null])); + $this->assertEquals([], self::invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null])); } public function testProcessFilterRulesAndConditionWithEmptyMidResult(): void { @@ -689,7 +622,7 @@ class FilesReportPluginTest extends \Test\TestCase { $tag789 = $this->createMock(ISystemTag::class); $tag789->expects($this->any()) ->method('getName') - ->willReturn('SevenEightNein'); + ->willReturn('SevenEightNine'); $tag789->expects($this->any()) ->method('isUserVisible') ->willReturn(true); @@ -701,12 +634,10 @@ class FilesReportPluginTest extends \Test\TestCase { $this->userFolder->expects($this->exactly(2)) ->method('searchBySystemTag') - ->withConsecutive(['OneTwoThree'], ['FourFiveSix'], ['SevenEightNein']) - ->willReturnOnConsecutiveCalls( - [$filesNode1, $filesNode2], - [$filesNode3], - [$filesNode1, $filesNode2], - ); + ->willReturnMap([ + ['OneTwoThree', 'testuser', 0, 0, [$filesNode1, $filesNode2]], + ['FourFiveSix', 'testuser', 0, 0, [$filesNode3]], + ]); $rules = [ ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '123'], @@ -714,7 +645,7 @@ class FilesReportPluginTest extends \Test\TestCase { ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '789'], ]; - $this->assertEquals([], array_values($this->invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null]))); + $this->assertEquals([], array_values(self::invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null]))); } public function testProcessFilterRulesInvisibleTagAsAdmin(): void { @@ -766,18 +697,17 @@ class FilesReportPluginTest extends \Test\TestCase { $this->userFolder->expects($this->exactly(2)) ->method('searchBySystemTag') - ->withConsecutive(['OneTwoThree'], ['FourFiveSix']) - ->willReturnOnConsecutiveCalls( - [$filesNode1, $filesNode2], - [$filesNode2, $filesNode3], - ); + ->willReturnMap([ + ['OneTwoThree', 'testuser', 0, 0, [$filesNode1, $filesNode2]], + ['FourFiveSix', 'testuser', 0, 0, [$filesNode2, $filesNode3]], + ]); $rules = [ ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '123'], ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '456'], ]; - $this->assertEquals([$filesNode2], array_values($this->invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null]))); + $this->assertEquals([$filesNode2], array_values(self::invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null]))); } @@ -816,7 +746,7 @@ class FilesReportPluginTest extends \Test\TestCase { ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '456'], ]; - $this->invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null]); + self::invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null]); } public function testProcessFilterRulesVisibleTagAsUser(): void { @@ -881,18 +811,17 @@ class FilesReportPluginTest extends \Test\TestCase { // main assertion: only user visible tags are being passed through. $this->userFolder->expects($this->exactly(2)) ->method('searchBySystemTag') - ->withConsecutive(['OneTwoThree'], ['FourFiveSix']) - ->willReturnOnConsecutiveCalls( - [$filesNode1, $filesNode2], - [$filesNode2, $filesNode3], - ); + ->willReturnMap([ + ['OneTwoThree', 'testuser', 0, 0, [$filesNode1, $filesNode2]], + ['FourFiveSix', 'testuser', 0, 0, [$filesNode2, $filesNode3]], + ]); $rules = [ ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '123'], ['name' => '{http://owncloud.org/ns}systemtag', 'value' => '456'], ]; - $this->assertEquals([$filesNode2], array_values($this->invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null]))); + $this->assertEquals([$filesNode2], array_values(self::invokePrivate($this->plugin, 'processFilterRulesForFileNodes', [$rules, null, null]))); } public function testProcessFavoriteFilter(): void { @@ -904,10 +833,10 @@ class FilesReportPluginTest extends \Test\TestCase { ->method('getFavorites') ->willReturn(['456', '789']); - $this->assertEquals(['456', '789'], array_values($this->invokePrivate($this->plugin, 'processFilterRulesForFileIDs', [$rules]))); + $this->assertEquals(['456', '789'], array_values(self::invokePrivate($this->plugin, 'processFilterRulesForFileIDs', [$rules]))); } - public function filesBaseUriProvider() { + public static function filesBaseUriProvider(): array { return [ ['', '', ''], ['files/username', '', '/files/username'], @@ -920,7 +849,7 @@ class FilesReportPluginTest extends \Test\TestCase { /** * @dataProvider filesBaseUriProvider */ - public function testFilesBaseUri($uri, $reportPath, $expectedUri): void { - $this->assertEquals($expectedUri, $this->invokePrivate($this->plugin, 'getFilesBaseUri', [$uri, $reportPath])); + public function testFilesBaseUri(string $uri, string $reportPath, string $expectedUri): void { + $this->assertEquals($expectedUri, self::invokePrivate($this->plugin, 'getFilesBaseUri', [$uri, $reportPath])); } } diff --git a/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php b/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php index 9ecc49222e9..bc1d50ac41f 100644 --- a/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -10,6 +11,7 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre; use OCA\DAV\Connector\Sabre\MaintenancePlugin; use OCP\IConfig; use OCP\IL10N; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; /** @@ -18,18 +20,15 @@ use Test\TestCase; * @package OCA\DAV\Tests\unit\Connector\Sabre */ class MaintenancePluginTest extends TestCase { - /** @var IConfig */ - private $config; - /** @var \PHPUnit\Framework\MockObject\Builder\InvocationMocker|\PHPUnit_Framework_MockObject_Builder_InvocationMocker|IL10N */ - private $l10n; - /** @var MaintenancePlugin */ - private $maintenancePlugin; + private IConfig&MockObject $config; + private IL10N&MockObject $l10n; + private MaintenancePlugin $maintenancePlugin; protected function setUp(): void { parent::setUp(); - $this->config = $this->getMockBuilder(IConfig::class)->getMock(); - $this->l10n = $this->getMockBuilder(IL10N::class)->getMock(); + $this->config = $this->createMock(IConfig::class); + $this->l10n = $this->createMock(IL10N::class); $this->maintenancePlugin = new MaintenancePlugin($this->config, $this->l10n); } diff --git a/apps/dav/tests/unit/Connector/Sabre/NodeTest.php b/apps/dav/tests/unit/Connector/Sabre/NodeTest.php index 04cd60fbdaa..3dea5cf281b 100644 --- a/apps/dav/tests/unit/Connector/Sabre/NodeTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/NodeTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -32,7 +33,7 @@ use PHPUnit\Framework\MockObject\MockObject; * @package OCA\DAV\Tests\unit\Connector\Sabre */ class NodeTest extends \Test\TestCase { - public function davPermissionsProvider() { + public static function davPermissionsProvider(): array { return [ [Constants::PERMISSION_ALL, 'file', false, Constants::PERMISSION_ALL, false, 'test', 'RGDNVW'], [Constants::PERMISSION_ALL, 'dir', false, Constants::PERMISSION_ALL, false, 'test', 'RGDNVCK'], @@ -53,7 +54,7 @@ class NodeTest extends \Test\TestCase { /** * @dataProvider davPermissionsProvider */ - public function testDavPermissions($permissions, $type, $shared, $shareRootPermissions, $mounted, $internalPath, $expected): void { + public function testDavPermissions(int $permissions, string $type, bool $shared, int $shareRootPermissions, bool $mounted, string $internalPath, string $expected): void { $info = $this->getMockBuilder(FileInfo::class) ->disableOriginalConstructor() ->onlyMethods(['getPermissions', 'isShared', 'isMounted', 'getType', 'getInternalPath', 'getStorage', 'getMountPoint']) @@ -94,15 +95,13 @@ class NodeTest extends \Test\TestCase { } $info->method('getStorage') ->willReturn($storage); - $view = $this->getMockBuilder(View::class) - ->disableOriginalConstructor() - ->getMock(); + $view = $this->createMock(View::class); $node = new File($view, $info); $this->assertEquals($expected, $node->getDavPermissions()); } - public function sharePermissionsProvider() { + public static function sharePermissionsProvider(): array { return [ [\OCP\Files\FileInfo::TYPE_FILE, null, 1, 1], [\OCP\Files\FileInfo::TYPE_FILE, null, 3, 3], @@ -145,18 +144,14 @@ class NodeTest extends \Test\TestCase { /** * @dataProvider sharePermissionsProvider */ - public function testSharePermissions($type, $user, $permissions, $expected): void { - $storage = $this->getMockBuilder(IStorage::class) - ->disableOriginalConstructor() - ->getMock(); + public function testSharePermissions(string $type, ?string $user, int $permissions, int $expected): void { + $storage = $this->createMock(IStorage::class); $storage->method('getPermissions')->willReturn($permissions); - $mountpoint = $this->getMockBuilder(IMountPoint::class) - ->disableOriginalConstructor() - ->getMock(); + $mountpoint = $this->createMock(IMountPoint::class); $mountpoint->method('getMountPoint')->willReturn('myPath'); - $shareManager = $this->getMockBuilder(IManager::class)->disableOriginalConstructor()->getMock(); - $share = $this->getMockBuilder(IShare::class)->disableOriginalConstructor()->getMock(); + $shareManager = $this->createMock(IManager::class); + $share = $this->createMock(IShare::class); if ($user === null) { $shareManager->expects($this->never())->method('getShareByToken'); @@ -169,7 +164,7 @@ class NodeTest extends \Test\TestCase { $info = $this->getMockBuilder(FileInfo::class) ->disableOriginalConstructor() - ->setMethods(['getStorage', 'getType', 'getMountPoint', 'getPermissions']) + ->onlyMethods(['getStorage', 'getType', 'getMountPoint', 'getPermissions']) ->getMock(); $info->method('getStorage')->willReturn($storage); @@ -177,9 +172,7 @@ class NodeTest extends \Test\TestCase { $info->method('getMountPoint')->willReturn($mountpoint); $info->method('getPermissions')->willReturn($permissions); - $view = $this->getMockBuilder(View::class) - ->disableOriginalConstructor() - ->getMock(); + $view = $this->createMock(View::class); $node = new File($view, $info); $this->invokePrivate($node, 'shareManager', [$shareManager]); @@ -189,11 +182,11 @@ class NodeTest extends \Test\TestCase { public function testShareAttributes(): void { $storage = $this->getMockBuilder(SharedStorage::class) ->disableOriginalConstructor() - ->setMethods(['getShare']) + ->onlyMethods(['getShare']) ->getMock(); - $shareManager = $this->getMockBuilder(IManager::class)->disableOriginalConstructor()->getMock(); - $share = $this->getMockBuilder(IShare::class)->disableOriginalConstructor()->getMock(); + $shareManager = $this->createMock(IManager::class); + $share = $this->createMock(IShare::class); $storage->expects($this->once()) ->method('getShare') @@ -214,9 +207,7 @@ class NodeTest extends \Test\TestCase { $info->method('getType')->willReturn(FileInfo::TYPE_FOLDER); /** @var View&MockObject $view */ - $view = $this->getMockBuilder(View::class) - ->disableOriginalConstructor() - ->getMock(); + $view = $this->createMock(View::class); $node = new File($view, $info); $this->invokePrivate($node, 'shareManager', [$shareManager]); @@ -224,11 +215,8 @@ class NodeTest extends \Test\TestCase { } public function testShareAttributesNonShare(): void { - $storage = $this->getMockBuilder(IStorage::class) - ->disableOriginalConstructor() - ->getMock(); - - $shareManager = $this->getMockBuilder(IManager::class)->disableOriginalConstructor()->getMock(); + $storage = $this->createMock(IStorage::class); + $shareManager = $this->createMock(IManager::class); /** @var Folder&MockObject */ $info = $this->getMockBuilder(Folder::class) @@ -240,16 +228,14 @@ class NodeTest extends \Test\TestCase { $info->method('getType')->willReturn(FileInfo::TYPE_FOLDER); /** @var View&MockObject */ - $view = $this->getMockBuilder(View::class) - ->disableOriginalConstructor() - ->getMock(); + $view = $this->createMock(View::class); $node = new File($view, $info); $this->invokePrivate($node, 'shareManager', [$shareManager]); $this->assertEquals([], $node->getShareAttributes()); } - public function sanitizeMtimeProvider() { + public static function sanitizeMtimeProvider(): array { return [ [123456789, 123456789], ['987654321', 987654321], @@ -259,7 +245,7 @@ class NodeTest extends \Test\TestCase { /** * @dataProvider sanitizeMtimeProvider */ - public function testSanitizeMtime($mtime, $expected): void { + public function testSanitizeMtime(string|int $mtime, int $expected): void { $view = $this->getMockBuilder(View::class) ->disableOriginalConstructor() ->getMock(); @@ -272,7 +258,7 @@ class NodeTest extends \Test\TestCase { $this->assertEquals($expected, $result); } - public function invalidSanitizeMtimeProvider() { + public static function invalidSanitizeMtimeProvider(): array { return [ [-1337], [0], ['abcdef'], ['-1337'], ['0'], [12321], [24 * 60 * 60 - 1], ]; @@ -281,17 +267,13 @@ class NodeTest extends \Test\TestCase { /** * @dataProvider invalidSanitizeMtimeProvider */ - public function testInvalidSanitizeMtime($mtime): void { + public function testInvalidSanitizeMtime(int|string $mtime): void { $this->expectException(\InvalidArgumentException::class); - $view = $this->getMockBuilder(View::class) - ->disableOriginalConstructor() - ->getMock(); - $info = $this->getMockBuilder(FileInfo::class) - ->disableOriginalConstructor() - ->getMock(); + $view = $this->createMock(View::class); + $info = $this->createMock(FileInfo::class); $node = new File($view, $info); - $result = $this->invokePrivate($node, 'sanitizeMtime', [$mtime]); + self::invokePrivate($node, 'sanitizeMtime', [$mtime]); } } diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php index 393f3c72c20..4a5937e365b 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -27,7 +28,7 @@ use OCP\Files\Mount\IMountManager; * @package OCA\DAV\Tests\Unit\Connector\Sabre */ class ObjectTreeTest extends \Test\TestCase { - public function copyDataProvider() { + public static function copyDataProvider(): array { return [ // copy into same dir ['a', 'b', ''], @@ -41,7 +42,7 @@ class ObjectTreeTest extends \Test\TestCase { /** * @dataProvider copyDataProvider */ - public function testCopy($sourcePath, $targetPath, $targetParent): void { + public function testCopy(string $sourcePath, string $targetPath, string $targetParent): void { $view = $this->createMock(View::class); $view->expects($this->once()) ->method('verifyPath') @@ -67,7 +68,7 @@ class ObjectTreeTest extends \Test\TestCase { $rootDir = new Directory($view, $info); $objectTree = $this->getMockBuilder(ObjectTree::class) - ->setMethods(['nodeExists', 'getNodeForPath']) + ->onlyMethods(['nodeExists', 'getNodeForPath']) ->setConstructorArgs([$rootDir, $view]) ->getMock(); @@ -110,7 +111,7 @@ class ObjectTreeTest extends \Test\TestCase { $rootDir = new Directory($view, $info); $objectTree = $this->getMockBuilder(ObjectTree::class) - ->setMethods(['nodeExists', 'getNodeForPath']) + ->onlyMethods(['nodeExists', 'getNodeForPath']) ->setConstructorArgs([$rootDir, $view]) ->getMock(); @@ -127,23 +128,15 @@ class ObjectTreeTest extends \Test\TestCase { * @dataProvider nodeForPathProvider */ public function testGetNodeForPath( - $inputFileName, - $fileInfoQueryPath, - $outputFileName, - $type, + string $inputFileName, + string $fileInfoQueryPath, + string $outputFileName, + string $type, ): void { - $rootNode = $this->getMockBuilder(Directory::class) - ->disableOriginalConstructor() - ->getMock(); - $mountManager = $this->getMockBuilder(Manager::class) - ->disableOriginalConstructor() - ->getMock(); - $view = $this->getMockBuilder(View::class) - ->disableOriginalConstructor() - ->getMock(); - $fileInfo = $this->getMockBuilder(FileInfo::class) - ->disableOriginalConstructor() - ->getMock(); + $rootNode = $this->createMock(Directory::class); + $mountManager = $this->createMock(Manager::class); + $view = $this->createMock(View::class); + $fileInfo = $this->createMock(FileInfo::class); $fileInfo->method('getType') ->willReturn($type); $fileInfo->method('getName') @@ -164,13 +157,13 @@ class ObjectTreeTest extends \Test\TestCase { $this->assertEquals($outputFileName, $node->getName()); if ($type === 'file') { - $this->assertTrue($node instanceof File); + $this->assertInstanceOf(File::class, $node); } else { - $this->assertTrue($node instanceof Directory); + $this->assertInstanceOf(Directory::class, $node); } } - public function nodeForPathProvider() { + public static function nodeForPathProvider(): array { return [ // regular file [ @@ -213,7 +206,7 @@ class ObjectTreeTest extends \Test\TestCase { $storage = new Temporary([]); $view = $this->getMockBuilder(View::class) - ->setMethods(['resolvePath']) + ->onlyMethods(['resolvePath']) ->getMock(); $view->expects($this->once()) ->method('resolvePath') @@ -221,9 +214,7 @@ class ObjectTreeTest extends \Test\TestCase { return [$storage, ltrim($path, '/')]; }); - $rootNode = $this->getMockBuilder(Directory::class) - ->disableOriginalConstructor() - ->getMock(); + $rootNode = $this->createMock(Directory::class); $mountManager = $this->createMock(IMountManager::class); $tree = new ObjectTree(); @@ -239,7 +230,7 @@ class ObjectTreeTest extends \Test\TestCase { $storage = new Temporary([]); $view = $this->getMockBuilder(View::class) - ->setMethods(['resolvePath']) + ->onlyMethods(['resolvePath']) ->getMock(); $view->expects($this->any()) ->method('resolvePath') @@ -247,9 +238,7 @@ class ObjectTreeTest extends \Test\TestCase { return [$storage, ltrim($path, '/')]; }); - $rootNode = $this->getMockBuilder(Directory::class) - ->disableOriginalConstructor() - ->getMock(); + $rootNode = $this->createMock(Directory::class); $mountManager = $this->createMock(IMountManager::class); $tree = new ObjectTree(); diff --git a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php index 30e2c995d18..087bbd66107 100644 --- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -30,38 +32,21 @@ use Sabre\DAV\PropPatch; use Test\TestCase; class PrincipalTest extends TestCase { - /** @var IUserManager | MockObject */ - private $userManager; - - /** @var Principal */ - private $connector; - - /** @var IGroupManager | MockObject */ - private $groupManager; - - /** @var IAccountManager|MockObject */ - private $accountManager; - - /** @var IManager | MockObject */ - private $shareManager; - - /** @var IUserSession | MockObject */ - private $userSession; - - /** @var IAppManager | MockObject */ - private $appManager; - - /** @var ProxyMapper | MockObject */ - private $proxyMapper; - - /** @var KnownUserService|MockObject */ - private $knownUserService; - /** @var IConfig | MockObject */ - private $config; - /** @var IFactory|MockObject */ - private $languageFactory; + private IUserManager&MockObject $userManager; + private IGroupManager&MockObject $groupManager; + private IAccountManager&MockObject $accountManager; + private IManager&MockObject $shareManager; + private IUserSession&MockObject $userSession; + private IAppManager&MockObject $appManager; + private ProxyMapper&MockObject $proxyMapper; + private KnownUserService&MockObject $knownUserService; + private IConfig&MockObject $config; + private IFactory&MockObject $languageFactory; + private Principal $connector; protected function setUp(): void { + parent::setUp(); + $this->userManager = $this->createMock(IUserManager::class); $this->groupManager = $this->createMock(IGroupManager::class); $this->accountManager = $this->createMock(IAccountManager::class); @@ -85,7 +70,6 @@ class PrincipalTest extends TestCase { $this->config, $this->languageFactory ); - parent::setUp(); } public function testGetPrincipalsByPrefixWithoutPrefix(): void { @@ -125,13 +109,14 @@ class PrincipalTest extends TestCase { $this->languageFactory ->expects($this->exactly(2)) ->method('getUserLanguage') - ->withConsecutive([$fooUser], [$barUser]) - ->willReturnOnConsecutiveCalls('de', 'en'); + ->willReturnMap([ + [$fooUser, 'de'], + [$barUser, 'en'], + ]); $fooAccountPropertyCollection = $this->createMock(IAccountPropertyCollection::class); $fooAccountPropertyCollection->expects($this->once()) ->method('getProperties') - ->with() ->willReturn([]); $fooAccount = $this->createMock(IAccount::class); $fooAccount->expects($this->once()) @@ -142,18 +127,15 @@ class PrincipalTest extends TestCase { $emailPropertyOne = $this->createMock(IAccountProperty::class); $emailPropertyOne->expects($this->once()) ->method('getValue') - ->with() ->willReturn('alias@nextcloud.com'); $emailPropertyTwo = $this->createMock(IAccountProperty::class); $emailPropertyTwo->expects($this->once()) ->method('getValue') - ->with() ->willReturn('alias2@nextcloud.com'); $barAccountPropertyCollection = $this->createMock(IAccountPropertyCollection::class); $barAccountPropertyCollection->expects($this->once()) ->method('getProperties') - ->with() ->willReturn([$emailPropertyOne, $emailPropertyTwo]); $barAccount = $this->createMock(IAccount::class); $barAccount->expects($this->once()) @@ -164,8 +146,10 @@ class PrincipalTest extends TestCase { $this->accountManager ->expects($this->exactly(2)) ->method('getAccount') - ->withConsecutive([$fooUser], [$barUser]) - ->willReturnOnConsecutiveCalls($fooAccount, $barAccount); + ->willReturnMap([ + [$fooUser, $fooAccount], + [$barUser, $barAccount], + ]); $expectedResponse = [ 0 => [ @@ -482,7 +466,7 @@ class PrincipalTest extends TestCase { /** * @dataProvider searchPrincipalsDataProvider */ - public function testSearchPrincipals($sharingEnabled, $groupsOnly, $test, $result): void { + public function testSearchPrincipals(bool $sharingEnabled, bool $groupsOnly, string $test, array $result): void { $this->shareManager->expects($this->once()) ->method('shareAPIEnabled') ->willReturn($sharingEnabled); @@ -556,7 +540,7 @@ class PrincipalTest extends TestCase { '{DAV:}displayname' => 'User 12'], $test)); } - public function searchPrincipalsDataProvider(): array { + public static function searchPrincipalsDataProvider(): array { return [ [true, false, 'allof', ['principals/users/user3']], [true, false, 'anyof', ['principals/users/user2', 'principals/users/user3', 'principals/users/user4']], @@ -845,7 +829,7 @@ class PrincipalTest extends TestCase { /** * @dataProvider findByUriWithGroupRestrictionDataProvider */ - public function testFindByUriWithGroupRestriction($uri, $email, $expects): void { + public function testFindByUriWithGroupRestriction(string $uri, string $email, ?string $expects): void { $this->shareManager->expects($this->once()) ->method('shareApiEnabled') ->willReturn(true); @@ -872,31 +856,23 @@ class PrincipalTest extends TestCase { if ($email === 'user2@foo.bar') { $this->groupManager->expects($this->exactly(2)) ->method('getUserGroupIds') - ->withConsecutive( - [$user], - [$user2], - ) - ->willReturnOnConsecutiveCalls( - ['group1', 'group2'], - ['group1', 'group3'], - ); + ->willReturnMap([ + [$user, ['group1', 'group2']], + [$user2, ['group1', 'group3']], + ]); } else { $this->groupManager->expects($this->exactly(2)) ->method('getUserGroupIds') - ->withConsecutive( - [$user], - [$user3], - ) - ->willReturnOnConsecutiveCalls( - ['group1', 'group2'], - ['group3', 'group3'], - ); + ->willReturnMap([ + [$user, ['group1', 'group2']], + [$user3, ['group3', 'group3']], + ]); } $this->assertEquals($expects, $this->connector->findByUri($uri, 'principals/users')); } - public function findByUriWithGroupRestrictionDataProvider(): array { + public static function findByUriWithGroupRestrictionDataProvider(): array { return [ ['mailto:user2@foo.bar', 'user2@foo.bar', 'principals/users/user2'], ['mailto:user3@foo.bar', 'user3@foo.bar', null], @@ -906,7 +882,7 @@ class PrincipalTest extends TestCase { /** * @dataProvider findByUriWithoutGroupRestrictionDataProvider */ - public function testFindByUriWithoutGroupRestriction($uri, $email, $expects): void { + public function testFindByUriWithoutGroupRestriction(string $uri, string $email, string $expects): void { $this->shareManager->expects($this->once()) ->method('shareApiEnabled') ->willReturn(true); @@ -928,7 +904,7 @@ class PrincipalTest extends TestCase { $this->assertEquals($expects, $this->connector->findByUri($uri, 'principals/users')); } - public function findByUriWithoutGroupRestrictionDataProvider(): array { + public static function findByUriWithoutGroupRestrictionDataProvider(): array { return [ ['mailto:user2@foo.bar', 'user2@foo.bar', 'principals/users/user2'], ['mailto:user3@foo.bar', 'user3@foo.bar', 'principals/users/user3'], diff --git a/apps/dav/tests/unit/Connector/Sabre/PropfindCompressionPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/PropfindCompressionPluginTest.php index 42414ad6efb..e6f696ed160 100644 --- a/apps/dav/tests/unit/Connector/Sabre/PropfindCompressionPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/PropfindCompressionPluginTest.php @@ -14,8 +14,7 @@ use Sabre\HTTP\Response; use Test\TestCase; class PropfindCompressionPluginTest extends TestCase { - /** @var PropfindCompressionPlugin */ - private $plugin; + private PropfindCompressionPlugin $plugin; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/unit/Connector/Sabre/PublicAuthTest.php b/apps/dav/tests/unit/Connector/Sabre/PublicAuthTest.php index 67e7f6af675..2340890ae5a 100644 --- a/apps/dav/tests/unit/Connector/Sabre/PublicAuthTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/PublicAuthTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -30,12 +31,12 @@ class PublicAuthTest extends \Test\TestCase { private ISession&MockObject $session; private IRequest&MockObject $request; private IManager&MockObject $shareManager; - private PublicAuth $auth; private IThrottler&MockObject $throttler; private LoggerInterface&MockObject $logger; private IURLGenerator&MockObject $urlGenerator; + private PublicAuth $auth; - private string $oldUser; + private bool|string $oldUser; protected function setUp(): void { parent::setUp(); @@ -65,7 +66,9 @@ class PublicAuthTest extends \Test\TestCase { // Set old user \OC_User::setUserId($this->oldUser); - \OC_Util::setupFS($this->oldUser); + if ($this->oldUser !== false) { + \OC_Util::setupFS($this->oldUser); + } parent::tearDown(); } @@ -74,7 +77,7 @@ class PublicAuthTest extends \Test\TestCase { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $result = $this->invokePrivate($this->auth, 'getToken'); + $result = self::invokePrivate($this->auth, 'getToken'); $this->assertSame('GX9HSGQrGE', $result); } @@ -84,16 +87,14 @@ class PublicAuthTest extends \Test\TestCase { ->willReturn('/dav/files'); $this->expectException(\Sabre\DAV\Exception\NotFound::class); - $this->invokePrivate($this->auth, 'getToken'); + self::invokePrivate($this->auth, 'getToken'); } public function testCheckTokenValidShare(): void { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn(null); $this->shareManager->expects($this->once()) @@ -101,7 +102,7 @@ class PublicAuthTest extends \Test\TestCase { ->with('GX9HSGQrGE') ->willReturn($share); - $result = $this->invokePrivate($this->auth, 'checkToken'); + $result = self::invokePrivate($this->auth, 'checkToken'); $this->assertSame([true, 'principals/GX9HSGQrGE'], $result); } @@ -116,16 +117,14 @@ class PublicAuthTest extends \Test\TestCase { ->will($this->throwException(new ShareNotFound())); $this->expectException(\Sabre\DAV\Exception\NotFound::class); - $this->invokePrivate($this->auth, 'checkToken'); + self::invokePrivate($this->auth, 'checkToken'); } public function testCheckTokenAlreadyAuthenticated(): void { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getShareType')->willReturn(42); $this->shareManager->expects($this->once()) @@ -136,7 +135,7 @@ class PublicAuthTest extends \Test\TestCase { $this->session->method('exists')->with('public_link_authenticated')->willReturn(true); $this->session->method('get')->with('public_link_authenticated')->willReturn('42'); - $result = $this->invokePrivate($this->auth, 'checkToken'); + $result = self::invokePrivate($this->auth, 'checkToken'); $this->assertSame([true, 'principals/GX9HSGQrGE'], $result); } @@ -144,9 +143,7 @@ class PublicAuthTest extends \Test\TestCase { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(42); @@ -158,16 +155,14 @@ class PublicAuthTest extends \Test\TestCase { $this->session->method('exists')->with('public_link_authenticated')->willReturn(false); $this->expectException(\Sabre\DAV\Exception\NotAuthenticated::class); - $this->invokePrivate($this->auth, 'checkToken'); + self::invokePrivate($this->auth, 'checkToken'); } public function testCheckTokenPasswordAuthenticatedWrongShare(): void { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(42); @@ -180,7 +175,7 @@ class PublicAuthTest extends \Test\TestCase { $this->session->method('get')->with('public_link_authenticated')->willReturn('43'); $this->expectException(\Sabre\DAV\Exception\NotAuthenticated::class); - $this->invokePrivate($this->auth, 'checkToken'); + self::invokePrivate($this->auth, 'checkToken'); } public function testNoShare(): void { @@ -192,7 +187,7 @@ class PublicAuthTest extends \Test\TestCase { ->with('GX9HSGQrGE') ->willThrowException(new ShareNotFound()); - $result = $this->invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); + $result = self::invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); $this->assertFalse($result); } @@ -201,9 +196,7 @@ class PublicAuthTest extends \Test\TestCase { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn(null); $this->shareManager->expects($this->once()) @@ -211,7 +204,7 @@ class PublicAuthTest extends \Test\TestCase { ->with('GX9HSGQrGE') ->willReturn($share); - $result = $this->invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); + $result = self::invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); $this->assertTrue($result); } @@ -220,9 +213,7 @@ class PublicAuthTest extends \Test\TestCase { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(42); @@ -231,7 +222,7 @@ class PublicAuthTest extends \Test\TestCase { ->with('GX9HSGQrGE') ->willReturn($share); - $result = $this->invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); + $result = self::invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); $this->assertFalse($result); } @@ -241,9 +232,7 @@ class PublicAuthTest extends \Test\TestCase { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_REMOTE); @@ -252,7 +241,7 @@ class PublicAuthTest extends \Test\TestCase { ->with('GX9HSGQrGE') ->willReturn($share); - $result = $this->invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); + $result = self::invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); $this->assertTrue($result); } @@ -261,9 +250,7 @@ class PublicAuthTest extends \Test\TestCase { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_LINK); @@ -278,7 +265,7 @@ class PublicAuthTest extends \Test\TestCase { $this->equalTo('password') )->willReturn(true); - $result = $this->invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); + $result = self::invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); $this->assertTrue($result); } @@ -287,9 +274,7 @@ class PublicAuthTest extends \Test\TestCase { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_EMAIL); @@ -304,7 +289,7 @@ class PublicAuthTest extends \Test\TestCase { $this->equalTo('password') )->willReturn(true); - $result = $this->invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); + $result = self::invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); $this->assertTrue($result); } @@ -313,9 +298,7 @@ class PublicAuthTest extends \Test\TestCase { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_LINK); $share->method('getId')->willReturn('42'); @@ -335,7 +318,7 @@ class PublicAuthTest extends \Test\TestCase { $this->session->method('exists')->with('public_link_authenticated')->willReturn(true); $this->session->method('get')->with('public_link_authenticated')->willReturn('42'); - $result = $this->invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); + $result = self::invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); $this->assertTrue($result); } @@ -344,9 +327,7 @@ class PublicAuthTest extends \Test\TestCase { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_LINK); $share->method('getId')->willReturn('42'); @@ -366,7 +347,7 @@ class PublicAuthTest extends \Test\TestCase { $this->session->method('exists')->with('public_link_authenticated')->willReturn(true); $this->session->method('get')->with('public_link_authenticated')->willReturn('43'); - $result = $this->invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); + $result = self::invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); $this->assertFalse($result); } @@ -376,9 +357,7 @@ class PublicAuthTest extends \Test\TestCase { $this->request->method('getPathInfo') ->willReturn('/dav/files/GX9HSGQrGE'); - $share = $this->getMockBuilder(IShare::class) - ->disableOriginalConstructor() - ->getMock(); + $share = $this->createMock(IShare::class); $share->method('getPassword')->willReturn('password'); $share->method('getShareType')->willReturn(IShare::TYPE_EMAIL); $share->method('getId')->willReturn('42'); @@ -398,7 +377,7 @@ class PublicAuthTest extends \Test\TestCase { $this->session->method('exists')->with('public_link_authenticated')->willReturn(true); $this->session->method('get')->with('public_link_authenticated')->willReturn('43'); - $result = $this->invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); + $result = self::invokePrivate($this->auth, 'validateUserPass', ['username', 'password']); $this->assertFalse($result); } diff --git a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php index c370e0fb0f7..a78a1a223c5 100644 --- a/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/QuotaPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2013-2016 ownCloud, Inc. @@ -13,29 +14,23 @@ use OCP\Files\FileInfo; use Test\TestCase; class QuotaPluginTest extends TestCase { - /** @var \Sabre\DAV\Server | \PHPUnit\Framework\MockObject\MockObject */ - private $server; + private \Sabre\DAV\Server $server; - /** @var QuotaPlugin|\PHPUnit\Framework\MockObject\MockObject */ - private $plugin; + private QuotaPlugin $plugin; - private function init($quota, $checkedPath = ''): void { - $view = $this->buildFileViewMock($quota, $checkedPath); + private function init(int $quota, string $checkedPath = ''): void { + $view = $this->buildFileViewMock((string)$quota, $checkedPath); $this->server = new \Sabre\DAV\Server(); - $this->plugin = $this->getMockBuilder(QuotaPlugin::class) - ->setConstructorArgs([$view]) - ->setMethods(['getFileChunking']) - ->getMock(); + $this->plugin = new QuotaPlugin($view); $this->plugin->initialize($this->server); } /** * @dataProvider lengthProvider */ - public function testLength($expected, $headers): void { + public function testLength(?int $expected, array $headers): void { $this->init(0); - $this->plugin->expects($this->never()) - ->method('getFileChunking'); + $this->server->httpRequest = new \Sabre\HTTP\Request('POST', 'dummy.file', $headers); $length = $this->plugin->getLength(); $this->assertEquals($expected, $length); @@ -44,10 +39,8 @@ class QuotaPluginTest extends TestCase { /** * @dataProvider quotaOkayProvider */ - public function testCheckQuota($quota, $headers): void { + public function testCheckQuota(int $quota, array $headers): void { $this->init($quota); - $this->plugin->expects($this->never()) - ->method('getFileChunking'); $this->server->httpRequest = new \Sabre\HTTP\Request('POST', 'dummy.file', $headers); $result = $this->plugin->checkQuota(''); @@ -57,12 +50,10 @@ class QuotaPluginTest extends TestCase { /** * @dataProvider quotaExceededProvider */ - public function testCheckExceededQuota($quota, $headers): void { + public function testCheckExceededQuota(int $quota, array $headers): void { $this->expectException(\Sabre\DAV\Exception\InsufficientStorage::class); $this->init($quota); - $this->plugin->expects($this->never()) - ->method('getFileChunking'); $this->server->httpRequest = new \Sabre\HTTP\Request('POST', 'dummy.file', $headers); $this->plugin->checkQuota(''); @@ -71,17 +62,15 @@ class QuotaPluginTest extends TestCase { /** * @dataProvider quotaOkayProvider */ - public function testCheckQuotaOnPath($quota, $headers): void { + public function testCheckQuotaOnPath(int $quota, array $headers): void { $this->init($quota, 'sub/test.txt'); - $this->plugin->expects($this->never()) - ->method('getFileChunking'); $this->server->httpRequest = new \Sabre\HTTP\Request('POST', 'dummy.file', $headers); $result = $this->plugin->checkQuota('/sub/test.txt'); $this->assertTrue($result); } - public function quotaOkayProvider() { + public static function quotaOkayProvider(): array { return [ [1024, []], [1024, ['X-EXPECTED-ENTITY-LENGTH' => '1024']], @@ -100,7 +89,7 @@ class QuotaPluginTest extends TestCase { ]; } - public function quotaExceededProvider() { + public static function quotaExceededProvider(): array { return [ [1023, ['X-EXPECTED-ENTITY-LENGTH' => '1024']], [511, ['CONTENT-LENGTH' => '512']], @@ -108,7 +97,7 @@ class QuotaPluginTest extends TestCase { ]; } - public function lengthProvider() { + public static function lengthProvider(): array { return [ [null, []], [1024, ['X-EXPECTED-ENTITY-LENGTH' => '1024']], @@ -124,7 +113,7 @@ class QuotaPluginTest extends TestCase { ]; } - public function quotaChunkedOkProvider() { + public static function quotaChunkedOkProvider(): array { return [ [1024, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']], [1024, 0, ['CONTENT-LENGTH' => '512']], @@ -143,7 +132,7 @@ class QuotaPluginTest extends TestCase { ]; } - public function quotaChunkedFailProvider() { + public static function quotaChunkedFailProvider(): array { return [ [400, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']], [400, 0, ['CONTENT-LENGTH' => '512']], @@ -155,15 +144,15 @@ class QuotaPluginTest extends TestCase { ]; } - private function buildFileViewMock($quota, $checkedPath) { - // mock filesysten + private function buildFileViewMock(string $quota, string $checkedPath): View { + // mock filesystem $view = $this->getMockBuilder(View::class) - ->setMethods(['free_space']) + ->onlyMethods(['free_space']) ->disableOriginalConstructor() ->getMock(); $view->expects($this->any()) ->method('free_space') - ->with($this->identicalTo($checkedPath)) + ->with($checkedPath) ->willReturn($quota); return $view; diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php index 836766b366d..b01807d5bbb 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/DeleteTest.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/DeleteTest.php index e7f20fbadfa..c5c7e99c7e5 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/DeleteTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/DeleteTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -18,7 +19,7 @@ use OCP\AppFramework\Http; */ class DeleteTest extends RequestTestCase { public function testBasicUpload(): void { - $user = $this->getUniqueID(); + $user = self::getUniqueID(); $view = $this->setupUser($user, 'pass'); $view->file_put_contents('foo.txt', 'asd'); @@ -29,7 +30,7 @@ class DeleteTest extends RequestTestCase { $mount->getStorage()->unlink($mount->getInternalPath($internalPath)); // cache entry still exists - $this->assertInstanceOf('\OCP\Files\FileInfo', $view->getFileInfo('foo.txt')); + $this->assertInstanceOf(\OCP\Files\FileInfo::class, $view->getFileInfo('foo.txt')); $response = $this->request($view, $user, 'pass', 'DELETE', '/foo.txt'); diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/DownloadTest.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/DownloadTest.php index bec4cd9967b..34171963ef0 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/DownloadTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/DownloadTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -19,7 +20,7 @@ use OCP\Lock\ILockingProvider; */ class DownloadTest extends RequestTestCase { public function testDownload(): void { - $user = $this->getUniqueID(); + $user = self::getUniqueID(); $view = $this->setupUser($user, 'pass'); $view->file_put_contents('foo.txt', 'bar'); @@ -30,7 +31,7 @@ class DownloadTest extends RequestTestCase { } public function testDownloadWriteLocked(): void { - $user = $this->getUniqueID(); + $user = self::getUniqueID(); $view = $this->setupUser($user, 'pass'); $view->file_put_contents('foo.txt', 'bar'); @@ -42,7 +43,7 @@ class DownloadTest extends RequestTestCase { } public function testDownloadReadLocked(): void { - $user = $this->getUniqueID(); + $user = self::getUniqueID(); $view = $this->setupUser($user, 'pass'); $view->file_put_contents('foo.txt', 'bar'); diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/EncryptionMasterKeyUploadTest.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/EncryptionMasterKeyUploadTest.php index 92d89d7753a..615490ddc92 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/EncryptionMasterKeyUploadTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/EncryptionMasterKeyUploadTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -23,7 +24,7 @@ use Test\Traits\EncryptionTrait; class EncryptionMasterKeyUploadTest extends UploadTest { use EncryptionTrait; - protected function setupUser($name, $password) { + protected function setupUser($name, $password): View { $this->createUser($name, $password); $tmpFolder = Server::get(ITempManager::class)->getTemporaryFolder(); $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]); diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/EncryptionUploadTest.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/EncryptionUploadTest.php index 935ef6d9464..efa7bb54cf8 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/EncryptionUploadTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/EncryptionUploadTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -23,7 +24,7 @@ use Test\Traits\EncryptionTrait; class EncryptionUploadTest extends UploadTest { use EncryptionTrait; - protected function setupUser($name, $password) { + protected function setupUser($name, $password): View { $this->createUser($name, $password); $tmpFolder = Server::get(ITempManager::class)->getTemporaryFolder(); $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]); diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/ExceptionPlugin.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/ExceptionPlugin.php index b1e68f9597b..0c53e4b1009 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/ExceptionPlugin.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/ExceptionPlugin.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/PartFileInRootUploadTest.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/PartFileInRootUploadTest.php index 5f3dc6f4e32..e6fa489fb24 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/PartFileInRootUploadTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/PartFileInRootUploadTest.php @@ -21,9 +21,7 @@ use OCP\Server; class PartFileInRootUploadTest extends UploadTest { protected function setUp(): void { $config = Server::get(IConfig::class); - $mockConfig = $this->getMockBuilder(IConfig::class) - ->disableOriginalConstructor() - ->getMock(); + $mockConfig = $this->createMock(IConfig::class); $mockConfig->expects($this->any()) ->method('getSystemValue') ->willReturnCallback(function ($key, $default) use ($config) { diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php index d02f1d76cac..404dc7fa5d7 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -20,6 +21,7 @@ use OCP\IRequestId; use OCP\ITagManager; use OCP\ITempManager; use OCP\IUserSession; +use OCP\L10N\IFactory; use Psr\Log\LoggerInterface; use Sabre\HTTP\Request; use Test\TestCase; @@ -29,11 +31,7 @@ use Test\Traits\UserTrait; abstract class RequestTestCase extends TestCase { use UserTrait; use MountProviderTrait; - - /** - * @var ServerFactory - */ - protected $serverFactory; + protected ServerFactory $serverFactory; protected function getStream($string) { $stream = fopen('php://temp', 'r+'); @@ -52,20 +50,18 @@ abstract class RequestTestCase extends TestCase { \OCP\Server::get(IUserSession::class), \OCP\Server::get(IMountManager::class), \OCP\Server::get(ITagManager::class), - $this->getMockBuilder(IRequest::class) - ->disableOriginalConstructor() - ->getMock(), + $this->createMock(IRequest::class), \OCP\Server::get(IPreview::class), \OCP\Server::get(IEventDispatcher::class), - \OC::$server->getL10N('dav') + \OCP\Server::get(IFactory::class)->get('dav'), ); } - protected function setupUser($name, $password) { + protected function setupUser($name, $password): View { $this->createUser($name, $password); $tmpFolder = \OCP\Server::get(ITempManager::class)->getTemporaryFolder(); $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]); - $this->loginAsUser($name); + self::loginAsUser($name); return new View('/' . $name . '/files'); } diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Sapi.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Sapi.php index f12c93468ff..08d774e56b8 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Sapi.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Sapi.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/UploadTest.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/UploadTest.php index 60decd4c846..5c6d0f03334 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/UploadTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/UploadTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -19,7 +20,7 @@ use OCP\Lock\ILockingProvider; */ class UploadTest extends RequestTestCase { public function testBasicUpload(): void { - $user = $this->getUniqueID(); + $user = self::getUniqueID(); $view = $this->setupUser($user, 'pass'); $this->assertFalse($view->file_exists('foo.txt')); @@ -35,7 +36,7 @@ class UploadTest extends RequestTestCase { } public function testUploadOverWrite(): void { - $user = $this->getUniqueID(); + $user = self::getUniqueID(); $view = $this->setupUser($user, 'pass'); $view->file_put_contents('foo.txt', 'foobar'); @@ -51,7 +52,7 @@ class UploadTest extends RequestTestCase { } public function testUploadOverWriteReadLocked(): void { - $user = $this->getUniqueID(); + $user = self::getUniqueID(); $view = $this->setupUser($user, 'pass'); $view->file_put_contents('foo.txt', 'bar'); @@ -63,7 +64,7 @@ class UploadTest extends RequestTestCase { } public function testUploadOverWriteWriteLocked(): void { - $user = $this->getUniqueID(); + $user = self::getUniqueID(); $view = $this->setupUser($user, 'pass'); $this->loginAsUser($user); diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php index 97d3ba79046..00ac5b5543f 100644 --- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -17,35 +18,17 @@ use OCP\IUser; use OCP\IUserSession; use OCP\Share\IManager; use OCP\Share\IShare; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Tree; class SharesPluginTest extends \Test\TestCase { public const SHARETYPES_PROPERTYNAME = SharesPlugin::SHARETYPES_PROPERTYNAME; - /** - * @var \Sabre\DAV\Server - */ - private $server; - - /** - * @var \Sabre\DAV\Tree - */ - private $tree; - - /** - * @var \OCP\Share\IManager - */ - private $shareManager; - - /** - * @var Folder - */ - private $userFolder; - - /** - * @var SharesPlugin - */ - private $plugin; + private \Sabre\DAV\Server $server; + private \Sabre\DAV\Tree&MockObject $tree; + private \OCP\Share\IManager&MockObject $shareManager; + private Folder&MockObject $userFolder; + private SharesPlugin $plugin; protected function setUp(): void { parent::setUp(); @@ -74,10 +57,8 @@ class SharesPluginTest extends \Test\TestCase { /** * @dataProvider sharesGetPropertiesDataProvider */ - public function testGetProperties($shareTypes): void { - $sabreNode = $this->getMockBuilder(Node::class) - ->disableOriginalConstructor() - ->getMock(); + public function testGetProperties(array $shareTypes): void { + $sabreNode = $this->createMock(Node::class); $sabreNode->expects($this->any()) ->method('getId') ->willReturn(123); @@ -86,9 +67,7 @@ class SharesPluginTest extends \Test\TestCase { ->willReturn('/subdir'); // node API nodes - $node = $this->getMockBuilder(Folder::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(Folder::class); $sabreNode->method('getNode') ->willReturn($node); @@ -143,7 +122,7 @@ class SharesPluginTest extends \Test\TestCase { /** * @dataProvider sharesGetPropertiesDataProvider */ - public function testPreloadThenGetProperties($shareTypes): void { + public function testPreloadThenGetProperties(array $shareTypes): void { $sabreNode1 = $this->createMock(File::class); $sabreNode1->method('getId') ->willReturn(111); @@ -182,7 +161,7 @@ class SharesPluginTest extends \Test\TestCase { ->willReturn($node2); $dummyShares = array_map(function ($type) { - $share = $this->getMockBuilder(IShare::class)->getMock(); + $share = $this->createMock(IShare::class); $share->expects($this->any()) ->method('getShareType') ->willReturn($type); @@ -268,7 +247,7 @@ class SharesPluginTest extends \Test\TestCase { $this->assertEquals($shareTypes, $result[200][self::SHARETYPES_PROPERTYNAME]->getShareTypes()); } - public function sharesGetPropertiesDataProvider() { + public static function sharesGetPropertiesDataProvider(): array { return [ [[]], [[IShare::TYPE_USER]], @@ -287,9 +266,7 @@ class SharesPluginTest extends \Test\TestCase { } public function testGetPropertiesSkipChunks(): void { - $sabreNode = $this->getMockBuilder(UploadFile::class) - ->disableOriginalConstructor() - ->getMock(); + $sabreNode = $this->createMock(UploadFile::class); $propFind = new \Sabre\DAV\PropFind( '/dummyPath', diff --git a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php index 43c08a1a61c..bef508e08ca 100644 --- a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2014-2016 ownCloud, Inc. @@ -18,6 +19,7 @@ use OCP\ITagManager; use OCP\ITags; use OCP\IUser; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Tree; class TagsPluginTest extends \Test\TestCase { @@ -25,61 +27,24 @@ class TagsPluginTest extends \Test\TestCase { public const FAVORITE_PROPERTYNAME = TagsPlugin::FAVORITE_PROPERTYNAME; public const TAG_FAVORITE = TagsPlugin::TAG_FAVORITE; - /** - * @var \Sabre\DAV\Server - */ - private $server; - - /** - * @var Tree - */ - private $tree; - - /** - * @var ITagManager - */ - private $tagManager; - - /** - * @var ITags - */ - private $tagger; - - /** - * @var IEventDispatcher - */ - private $eventDispatcher; - - /** - * @var IUserSession - */ - private $userSession; - - /** - * @var TagsPlugin - */ - private $plugin; + private \Sabre\DAV\Server $server; + private Tree&MockObject $tree; + private ITagManager&MockObject $tagManager; + private ITags&MockObject $tagger; + private IEventDispatcher&MockObject $eventDispatcher; + private IUserSession&MockObject $userSession; + private TagsPlugin $plugin; protected function setUp(): void { parent::setUp(); + $this->server = new \Sabre\DAV\Server(); - $this->tree = $this->getMockBuilder(Tree::class) - ->disableOriginalConstructor() - ->getMock(); - $this->tagger = $this->getMockBuilder(ITags::class) - ->disableOriginalConstructor() - ->getMock(); - $this->tagManager = $this->getMockBuilder(ITagManager::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->eventDispatcher = $this->getMockBuilder(IEventDispatcher::class) - ->disableOriginalConstructor() - ->getMock(); + $this->tree = $this->createMock(Tree::class); + $this->tagger = $this->createMock(ITags::class); + $this->tagManager = $this->createMock(ITagManager::class); + $this->eventDispatcher = $this->createMock(IEventDispatcher::class); $user = $this->createMock(IUser::class); - /** - * @var IUserSession - */ + $this->userSession = $this->createMock(IUserSession::class); $this->userSession->expects($this->any()) ->method('getUser') @@ -96,10 +61,8 @@ class TagsPluginTest extends \Test\TestCase { /** * @dataProvider tagsGetPropertiesDataProvider */ - public function testGetProperties($tags, $requestedProperties, $expectedProperties): void { - $node = $this->getMockBuilder(Node::class) - ->disableOriginalConstructor() - ->getMock(); + public function testGetProperties(array $tags, array $requestedProperties, array $expectedProperties): void { + $node = $this->createMock(Node::class); $node->expects($this->any()) ->method('getId') ->willReturn(123); @@ -135,16 +98,12 @@ class TagsPluginTest extends \Test\TestCase { /** * @dataProvider tagsGetPropertiesDataProvider */ - public function testPreloadThenGetProperties($tags, $requestedProperties, $expectedProperties): void { - $node1 = $this->getMockBuilder(File::class) - ->disableOriginalConstructor() - ->getMock(); + public function testPreloadThenGetProperties(array $tags, array $requestedProperties, array $expectedProperties): void { + $node1 = $this->createMock(File::class); $node1->expects($this->any()) ->method('getId') ->willReturn(111); - $node2 = $this->getMockBuilder(File::class) - ->disableOriginalConstructor() - ->getMock(); + $node2 = $this->createMock(File::class); $node2->expects($this->any()) ->method('getId') ->willReturn(222); @@ -157,9 +116,7 @@ class TagsPluginTest extends \Test\TestCase { $expectedCallCount = 1; } - $node = $this->getMockBuilder(Directory::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(Directory::class); $node->expects($this->any()) ->method('getId') ->willReturn(123); @@ -214,7 +171,7 @@ class TagsPluginTest extends \Test\TestCase { $this->assertEquals($expectedProperties, $result); } - public function tagsGetPropertiesDataProvider() { + public static function tagsGetPropertiesDataProvider(): array { return [ // request both, receive both [ @@ -270,9 +227,7 @@ class TagsPluginTest extends \Test\TestCase { } public function testGetPropertiesSkipChunks(): void { - $sabreNode = $this->getMockBuilder(UploadFile::class) - ->disableOriginalConstructor() - ->getMock(); + $sabreNode = $this->createMock(UploadFile::class); $propFind = new \Sabre\DAV\PropFind( '/dummyPath', @@ -292,9 +247,7 @@ class TagsPluginTest extends \Test\TestCase { public function testUpdateTags(): void { // this test will replace the existing tags "tagremove" with "tag1" and "tag2" // and keep "tagkeep" - $node = $this->getMockBuilder(Node::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(Node::class); $node->expects($this->any()) ->method('getId') ->willReturn(123); @@ -310,12 +263,16 @@ class TagsPluginTest extends \Test\TestCase { ->willReturn([123 => ['tagkeep', 'tagremove', self::TAG_FAVORITE]]); // then tag as tag1 and tag2 - $this->tagger->expects($this->exactly(2)) + $calls = [ + [123, 'tag1'], + [123, 'tag2'], + ]; + $this->tagger->expects($this->exactly(count($calls))) ->method('tagAs') - ->withConsecutive( - [123, 'tag1'], - [123, 'tag2'], - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); // it will untag tag3 $this->tagger->expects($this->once()) @@ -339,13 +296,11 @@ class TagsPluginTest extends \Test\TestCase { $result = $propPatch->getResult(); $this->assertEquals(200, $result[self::TAGS_PROPERTYNAME]); - $this->assertFalse(isset($result[self::FAVORITE_PROPERTYNAME])); + $this->assertArrayNotHasKey(self::FAVORITE_PROPERTYNAME, $result); } public function testUpdateTagsFromScratch(): void { - $node = $this->getMockBuilder(Node::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(Node::class); $node->expects($this->any()) ->method('getId') ->willReturn(123); @@ -361,12 +316,16 @@ class TagsPluginTest extends \Test\TestCase { ->willReturn([]); // then tag as tag1 and tag2 - $this->tagger->expects($this->exactly(2)) + $calls = [ + [123, 'tag1'], + [123, 'tag2'], + ]; + $this->tagger->expects($this->exactly(count($calls))) ->method('tagAs') - ->withConsecutive( - [123, 'tag1'], - [123, 'tag2'], - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); // properties to set $propPatch = new \Sabre\DAV\PropPatch([ @@ -385,15 +344,13 @@ class TagsPluginTest extends \Test\TestCase { $result = $propPatch->getResult(); $this->assertEquals(200, $result[self::TAGS_PROPERTYNAME]); - $this->assertFalse(false, isset($result[self::FAVORITE_PROPERTYNAME])); + $this->assertArrayNotHasKey(self::FAVORITE_PROPERTYNAME, $result); } public function testUpdateFav(): void { // this test will replace the existing tags "tagremove" with "tag1" and "tag2" // and keep "tagkeep" - $node = $this->getMockBuilder(Node::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(Node::class); $node->expects($this->any()) ->method('getId') ->willReturn(123); @@ -424,8 +381,8 @@ class TagsPluginTest extends \Test\TestCase { $this->assertEmpty($propPatch->getRemainingMutations()); $result = $propPatch->getResult(); - $this->assertFalse(false, isset($result[self::TAGS_PROPERTYNAME])); - $this->assertEquals(200, isset($result[self::FAVORITE_PROPERTYNAME])); + $this->assertArrayNotHasKey(self::TAGS_PROPERTYNAME, $result); + $this->assertEquals(200, $result[self::FAVORITE_PROPERTYNAME]); // unfavorite now // set favorite tag @@ -449,7 +406,7 @@ class TagsPluginTest extends \Test\TestCase { $this->assertEmpty($propPatch->getRemainingMutations()); $result = $propPatch->getResult(); - $this->assertFalse(false, isset($result[self::TAGS_PROPERTYNAME])); - $this->assertEquals(200, isset($result[self::FAVORITE_PROPERTYNAME])); + $this->assertArrayNotHasKey(self::TAGS_PROPERTYNAME, $result); + $this->assertEquals(200, $result[self::FAVORITE_PROPERTYNAME]); } } diff --git a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php index c7c2bf0e431..9aa0ef3a2a7 100644 --- a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php +++ b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php @@ -1,43 +1,33 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\DAV\Controller; +namespace OCA\DAV\Tests\unit\DAV\Controller; use OCA\DAV\BackgroundJob\GenerateBirthdayCalendarBackgroundJob; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\Controller\BirthdayCalendarController; +use OCP\AppFramework\Http\JSONResponse; use OCP\BackgroundJob\IJobList; use OCP\IConfig; use OCP\IDBConnection; use OCP\IRequest; use OCP\IUser; use OCP\IUserManager; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class BirthdayCalendarControllerTest extends TestCase { - - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - private $config; - - /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */ - private $request; - - /** @var IDBConnection|\PHPUnit\Framework\MockObject\MockObject */ - private $db; - - /** @var IJobList|\PHPUnit\Framework\MockObject\MockObject */ - private $jobList; - - /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ - private $userManager; - - /** @var CalDavBackend|\PHPUnit\Framework\MockObject\MockObject */ - private $caldav; - - /** @var BirthdayCalendarController|\PHPUnit\Framework\MockObject\MockObject */ - private $controller; + private IConfig&MockObject $config; + private IRequest&MockObject $request; + private IDBConnection&MockObject $db; + private IJobList&MockObject $jobList; + private IUserManager&MockObject $userManager; + private CalDavBackend&MockObject $caldav; + private BirthdayCalendarController $controller; protected function setUp(): void { parent::setUp(); @@ -74,16 +64,20 @@ class BirthdayCalendarControllerTest extends TestCase { $closure($user3); }); + $calls = [ + [GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid1']], + [GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid2']], + [GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid3']], + ]; $this->jobList->expects($this->exactly(3)) ->method('add') - ->withConsecutive( - [GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid1']], - [GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid2']], - [GenerateBirthdayCalendarBackgroundJob::class, ['userId' => 'uid3']], - ); + ->willReturnCallback(function () use (&$calls): void { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); $response = $this->controller->enable(); - $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $response); + $this->assertInstanceOf(JSONResponse::class, $response); } public function testDisable(): void { @@ -97,6 +91,6 @@ class BirthdayCalendarControllerTest extends TestCase { ->method('deleteAllBirthdayCalendars'); $response = $this->controller->disable(); - $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $response); + $this->assertInstanceOf(JSONResponse::class, $response); } } diff --git a/apps/dav/tests/unit/Controller/DirectControllerTest.php b/apps/dav/tests/unit/Controller/DirectControllerTest.php index faaf67d266b..837adde1da7 100644 --- a/apps/dav/tests/unit/Controller/DirectControllerTest.php +++ b/apps/dav/tests/unit/Controller/DirectControllerTest.php @@ -6,7 +6,7 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\DAV\Controller; +namespace OCA\DAV\Tests\unit\DAV\Controller; use OCA\DAV\Controller\DirectController; use OCA\DAV\Db\Direct; @@ -20,29 +20,18 @@ use OCP\Files\File; use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\IRequest; -use OCP\IUrlGenerator; +use OCP\IURLGenerator; use OCP\Security\ISecureRandom; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class DirectControllerTest extends TestCase { - - /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */ - private $rootFolder; - - /** @var DirectMapper|\PHPUnit\Framework\MockObject\MockObject */ - private $directMapper; - - /** @var ISecureRandom|\PHPUnit\Framework\MockObject\MockObject */ - private $random; - - /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */ - private $timeFactory; - - /** @var IUrlGenerator|\PHPUnit\Framework\MockObject\MockObject */ - private $urlGenerator; - - /** @var IEventDispatcher|\PHPUnit\Framework\MockObject\MockObject */ - private $eventDispatcher; + private IRootFolder&MockObject $rootFolder; + private DirectMapper&MockObject $directMapper; + private ISecureRandom&MockObject $random; + private ITimeFactory&MockObject $timeFactory; + private IURLGenerator&MockObject $urlGenerator; + private IEventDispatcher&MockObject $eventDispatcher; private DirectController $controller; @@ -53,7 +42,7 @@ class DirectControllerTest extends TestCase { $this->directMapper = $this->createMock(DirectMapper::class); $this->random = $this->createMock(ISecureRandom::class); $this->timeFactory = $this->createMock(ITimeFactory::class); - $this->urlGenerator = $this->createMock(IUrlGenerator::class); + $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->eventDispatcher = $this->createMock(IEventDispatcher::class); $this->controller = new DirectController( diff --git a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php index 640c66b75e5..895a84b8404 100644 --- a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php +++ b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php @@ -7,7 +7,7 @@ declare(strict_types=1); * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\DAV\Controller; +namespace OCA\DAV\Tests\unit\DAV\Controller; use OCA\DAV\CalDAV\InvitationResponse\InvitationResponseServer; use OCA\DAV\Controller\InvitationResponseController; @@ -18,24 +18,16 @@ use OCP\DB\QueryBuilder\IExpressionBuilder; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use OCP\IRequest; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\VObject\ITip\Message; use Test\TestCase; class InvitationResponseControllerTest extends TestCase { - /** @var InvitationResponseController */ - private $controller; - - /** @var IDBConnection|\PHPUnit\Framework\MockObject\MockObject */ - private $dbConnection; - - /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */ - private $request; - - /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */ - private $timeFactory; - - /** @var InvitationResponseServer|\PHPUnit\Framework\MockObject\MockObject */ - private $responseServer; + private IDBConnection&MockObject $dbConnection; + private IRequest&MockObject $request; + private ITimeFactory&MockObject $timeFactory; + private InvitationResponseServer&MockObject $responseServer; + private InvitationResponseController $controller; protected function setUp(): void { parent::setUp(); @@ -43,9 +35,7 @@ class InvitationResponseControllerTest extends TestCase { $this->dbConnection = $this->createMock(IDBConnection::class); $this->request = $this->createMock(IRequest::class); $this->timeFactory = $this->createMock(ITimeFactory::class); - $this->responseServer = $this->getMockBuilder(InvitationResponseServer::class) - ->disableOriginalConstructor() - ->getMock(); + $this->responseServer = $this->createMock(InvitationResponseServer::class); $this->controller = new InvitationResponseController( 'appName', @@ -56,7 +46,7 @@ class InvitationResponseControllerTest extends TestCase { ); } - public function attendeeProvider(): array { + public static function attendeeProvider(): array { return [ 'local attendee' => [false], 'external attendee' => [true] @@ -424,7 +414,7 @@ EOF; $this->assertTrue($called); } - private function buildQueryExpects($token, $return, $time): void { + private function buildQueryExpects(string $token, ?array $return, int $time): void { $queryBuilder = $this->createMock(IQueryBuilder::class); $stmt = $this->createMock(IResult::class); $expr = $this->createMock(IExpressionBuilder::class); diff --git a/apps/dav/tests/unit/Controller/UpcomingEventsControllerTest.php b/apps/dav/tests/unit/Controller/UpcomingEventsControllerTest.php index bab0ef77bd0..527943e5221 100644 --- a/apps/dav/tests/unit/Controller/UpcomingEventsControllerTest.php +++ b/apps/dav/tests/unit/Controller/UpcomingEventsControllerTest.php @@ -7,7 +7,7 @@ declare(strict_types=1); * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\DAV\Service; +namespace OCA\DAV\Tests\unit\DAV\Service; use OCA\DAV\CalDAV\UpcomingEvent; use OCA\DAV\CalDAV\UpcomingEventsService; @@ -17,9 +17,8 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class UpcomingEventsControllerTest extends TestCase { - - private IRequest|MockObject $request; - private UpcomingEventsService|MockObject $service; + private IRequest&MockObject $request; + private UpcomingEventsService&MockObject $service; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php index ea5450391e8..c99ebf327c8 100644 --- a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php +++ b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php @@ -1,9 +1,11 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\tests\unit\DAV; +namespace OCA\DAV\Tests\unit\DAV; use OCA\DAV\Connector\Sabre\AnonymousOptionsPlugin; use Sabre\DAV\Auth\Backend\BasicCallBack; @@ -14,7 +16,7 @@ use Sabre\HTTP\Sapi; use Test\TestCase; class AnonymousOptionsTest extends TestCase { - private function sendRequest($method, $path, $userAgent = '') { + private function sendRequest(string $method, string $path, string $userAgent = '') { $server = new Server(); $server->addPlugin(new AnonymousOptionsPlugin()); $server->addPlugin(new Plugin(new BasicCallBack(function () { diff --git a/apps/dav/tests/unit/DAV/BrowserErrorPagePluginTest.php b/apps/dav/tests/unit/DAV/BrowserErrorPagePluginTest.php index 088330cecff..23ee2b66f77 100644 --- a/apps/dav/tests/unit/DAV/BrowserErrorPagePluginTest.php +++ b/apps/dav/tests/unit/DAV/BrowserErrorPagePluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -8,6 +9,7 @@ namespace OCA\DAV\Tests\unit\DAV; use OCA\DAV\Files\BrowserErrorPagePlugin; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Exception\NotFound; use Sabre\HTTP\Response; @@ -15,18 +17,16 @@ class BrowserErrorPagePluginTest extends \Test\TestCase { /** * @dataProvider providesExceptions - * @param $expectedCode - * @param $exception */ - public function test($expectedCode, $exception): void { - /** @var BrowserErrorPagePlugin | \PHPUnit\Framework\MockObject\MockObject $plugin */ - $plugin = $this->getMockBuilder(BrowserErrorPagePlugin::class)->setMethods(['sendResponse', 'generateBody'])->getMock(); + public function test(int $expectedCode, \Throwable $exception): void { + /** @var BrowserErrorPagePlugin&MockObject $plugin */ + $plugin = $this->getMockBuilder(BrowserErrorPagePlugin::class)->onlyMethods(['sendResponse', 'generateBody'])->getMock(); $plugin->expects($this->once())->method('generateBody')->willReturn(':boom:'); $plugin->expects($this->once())->method('sendResponse'); - /** @var \Sabre\DAV\Server | \PHPUnit\Framework\MockObject\MockObject $server */ - $server = $this->getMockBuilder('Sabre\DAV\Server')->disableOriginalConstructor()->getMock(); + /** @var \Sabre\DAV\Server&MockObject $server */ + $server = $this->createMock('Sabre\DAV\Server'); $server->expects($this->once())->method('on'); - $httpResponse = $this->getMockBuilder(Response::class)->disableOriginalConstructor()->getMock(); + $httpResponse = $this->createMock(Response::class); $httpResponse->expects($this->once())->method('addHeaders'); $httpResponse->expects($this->once())->method('setStatus')->with($expectedCode); $httpResponse->expects($this->once())->method('setBody')->with(':boom:'); @@ -35,7 +35,7 @@ class BrowserErrorPagePluginTest extends \Test\TestCase { $plugin->logException($exception); } - public function providesExceptions() { + public static function providesExceptions(): array { return [ [ 404, new NotFound()], [ 500, new \RuntimeException()], diff --git a/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php index 5590e8c1ff0..7c77b3fcb28 100644 --- a/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php +++ b/apps/dav/tests/unit/DAV/CustomPropertiesBackendTest.php @@ -1,10 +1,11 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\DAV; +namespace OCA\DAV\Tests\unit\DAV; use OCA\DAV\CalDAV\Calendar; use OCA\DAV\CalDAV\DefaultCalendarValidator; @@ -12,6 +13,7 @@ use OCA\DAV\DAV\CustomPropertiesBackend; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use OCP\IUser; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\PropFind; use Sabre\DAV\PropPatch; @@ -28,23 +30,12 @@ use Test\TestCase; class CustomPropertiesBackendTest extends TestCase { private const BASE_URI = '/remote.php/dav/'; - /** @var Server | \PHPUnit\Framework\MockObject\MockObject */ - private $server; - - /** @var Tree | \PHPUnit\Framework\MockObject\MockObject */ - private $tree; - - /** @var IDBConnection */ - private $dbConnection; - - /** @var IUser | \PHPUnit\Framework\MockObject\MockObject */ - private $user; - - /** @var CustomPropertiesBackend | \PHPUnit\Framework\MockObject\MockObject */ - private $backend; - - /** @property DefaultCalendarValidator | \PHPUnit\Framework\MockObject\MockObject */ - private $defaultCalendarValidator; + private Server&MockObject $server; + private Tree&MockObject $tree; + private IDBConnection $dbConnection; + private IUser&MockObject $user; + private DefaultCalendarValidator&MockObject $defaultCalendarValidator; + private CustomPropertiesBackend $backend; protected function setUp(): void { parent::setUp(); @@ -85,13 +76,13 @@ class CustomPropertiesBackendTest extends TestCase { } } - protected function insertProps(string $user, string $path, array $props) { + protected function insertProps(string $user, string $path, array $props): void { foreach ($props as $name => $value) { $this->insertProp($user, $path, $name, $value); } } - protected function insertProp(string $user, string $path, string $name, mixed $value) { + protected function insertProp(string $user, string $path, string $name, mixed $value): void { $type = CustomPropertiesBackend::PROPERTY_TYPE_STRING; if ($value instanceof Href) { $value = $value->getHref(); @@ -110,7 +101,7 @@ class CustomPropertiesBackendTest extends TestCase { $query->execute(); } - protected function getProps(string $user, string $path) { + protected function getProps(string $user, string $path): array { $query = $this->dbConnection->getQueryBuilder(); $query->select('propertyname', 'propertyvalue', 'valuetype') ->from('properties') @@ -245,7 +236,7 @@ class CustomPropertiesBackendTest extends TestCase { $this->assertEquals($props, $setProps); } - public function propFindPrincipalScheduleDefaultCalendarProviderUrlProvider(): array { + public static function propFindPrincipalScheduleDefaultCalendarProviderUrlProvider(): array { // [ user, nodes, existingProps, requestedProps, returnedProps ] return [ [ // Exists @@ -373,7 +364,7 @@ class CustomPropertiesBackendTest extends TestCase { $this->assertEquals($result, $storedProps); } - public function propPatchProvider() { + public static function propPatchProvider(): array { $longPath = str_repeat('long_path', 100); return [ ['foo_bar_path_1337', [], ['{DAV:}displayname' => 'anything'], ['{DAV:}displayname' => 'anything']], @@ -436,7 +427,7 @@ class CustomPropertiesBackendTest extends TestCase { $this->assertEquals([], $this->getProps('dummy_user_42', $path)); } - public function deleteProvider() { + public static function deleteProvider(): array { return [ ['foo_bar_path_1337'], [str_repeat('long_path', 100)] @@ -453,7 +444,7 @@ class CustomPropertiesBackendTest extends TestCase { $this->assertEquals(['foo' => 'bar'], $this->getProps('dummy_user_42', $target)); } - public function moveProvider() { + public static function moveProvider(): array { return [ ['foo_bar_path_1337', 'foo_bar_path_7333'], [str_repeat('long_path1', 100), str_repeat('long_path2', 100)] @@ -475,5 +466,4 @@ class CustomPropertiesBackendTest extends TestCase { $this->assertInstanceOf(\Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp::class, $decodeValue); $this->assertEquals('opaque', $decodeValue->getValue()); } - } diff --git a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php index bfc4c5b2493..2ede450c36b 100644 --- a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php +++ b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -18,20 +20,11 @@ use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\PropPatch; class GroupPrincipalTest extends \Test\TestCase { - /** @var IConfig|MockObject */ - private $config; - - /** @var IGroupManager | MockObject */ - private $groupManager; - - /** @var IUserSession | MockObject */ - private $userSession; - - /** @var IManager | MockObject */ - private $shareManager; - - /** @var GroupPrincipalBackend */ - private $connector; + private IConfig&MockObject $config; + private IGroupManager&MockObject $groupManager; + private IUserSession&MockObject $userSession; + private IManager&MockObject $shareManager; + private GroupPrincipalBackend $connector; protected function setUp(): void { $this->groupManager = $this->createMock(IGroupManager::class); @@ -201,11 +194,6 @@ class GroupPrincipalTest extends \Test\TestCase { /** * @dataProvider searchPrincipalsDataProvider - * @param bool $sharingEnabled - * @param bool $groupSharingEnabled - * @param bool $groupsOnly - * @param string $test - * @param array $result */ public function testSearchPrincipals(bool $sharingEnabled, bool $groupSharingEnabled, bool $groupsOnly, string $test, array $result): void { $this->shareManager->expects($this->once()) @@ -264,7 +252,7 @@ class GroupPrincipalTest extends \Test\TestCase { ['{DAV:}displayname' => 'Foo'], $test)); } - public function searchPrincipalsDataProvider() { + public static function searchPrincipalsDataProvider(): array { return [ [true, true, false, 'allof', ['principals/groups/group1', 'principals/groups/group2', 'principals/groups/group3', 'principals/groups/group4', 'principals/groups/group5']], [true, true, false, 'anyof', ['principals/groups/group1', 'principals/groups/group2', 'principals/groups/group3', 'principals/groups/group4', 'principals/groups/group5']], @@ -279,11 +267,6 @@ class GroupPrincipalTest extends \Test\TestCase { /** * @dataProvider findByUriDataProvider - * @param bool $sharingEnabled - * @param bool $groupSharingEnabled - * @param bool $groupsOnly - * @param string $findUri - * @param string|null $result */ public function testFindByUri(bool $sharingEnabled, bool $groupSharingEnabled, bool $groupsOnly, string $findUri, ?string $result): void { $this->shareManager->expects($this->once()) @@ -320,7 +303,7 @@ class GroupPrincipalTest extends \Test\TestCase { $this->assertEquals($result, $this->connector->findByUri($findUri, 'principals/groups')); } - public function findByUriDataProvider() { + public static function findByUriDataProvider(): array { return [ [false, false, false, 'principal:principals/groups/group1', null], [false, false, false, 'principal:principals/groups/group3', null], @@ -337,10 +320,7 @@ class GroupPrincipalTest extends \Test\TestCase { ]; } - /** - * @return Group|MockObject - */ - private function mockGroup($gid) { + private function mockGroup(string $gid): Group&MockObject { $fooGroup = $this->createMock(Group::class); $fooGroup ->expects($this->exactly(1)) diff --git a/apps/dav/tests/unit/DAV/Listener/UserEventsListenerTest.php b/apps/dav/tests/unit/DAV/Listener/UserEventsListenerTest.php index a0876d8e483..420f0a0d937 100644 --- a/apps/dav/tests/unit/DAV/Listener/UserEventsListenerTest.php +++ b/apps/dav/tests/unit/DAV/Listener/UserEventsListenerTest.php @@ -51,9 +51,7 @@ class UserEventsListenerTest extends TestCase { } public function test(): void { - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->once())->method('getUID')->willReturn('newUser'); $this->defaults->expects($this->once())->method('getColorPrimary')->willReturn('#745bca'); @@ -76,9 +74,7 @@ class UserEventsListenerTest extends TestCase { } public function testWithExisting(): void { - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->once())->method('getUID')->willReturn('newUser'); $this->calDavBackend->expects($this->once())->method('getCalendarsForUserCount')->willReturn(1); @@ -91,9 +87,7 @@ class UserEventsListenerTest extends TestCase { } public function testWithBirthdayCalendar(): void { - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->once())->method('getUID')->willReturn('newUser'); $this->defaults->expects($this->once())->method('getColorPrimary')->willReturn('#745bca'); @@ -116,9 +110,7 @@ class UserEventsListenerTest extends TestCase { } public function testDeleteCalendar(): void { - $user = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->once())->method('getUID')->willReturn('newUser'); $this->syncService->expects($this->once()) diff --git a/apps/dav/tests/unit/DAV/Sharing/BackendTest.php b/apps/dav/tests/unit/DAV/Sharing/BackendTest.php index dd2681d149f..556a623a73f 100644 --- a/apps/dav/tests/unit/DAV/Sharing/BackendTest.php +++ b/apps/dav/tests/unit/DAV/Sharing/BackendTest.php @@ -24,14 +24,14 @@ use Test\TestCase; class BackendTest extends TestCase { - private IDBConnection|MockObject $db; - private IUserManager|MockObject $userManager; - private IGroupManager|MockObject $groupManager; - private MockObject|Principal $principalBackend; - private MockObject|ICache $shareCache; - private LoggerInterface|MockObject $logger; - private MockObject|ICacheFactory $cacheFactory; - private Service|MockObject $calendarService; + private IDBConnection&MockObject $db; + private IUserManager&MockObject $userManager; + private IGroupManager&MockObject $groupManager; + private Principal&MockObject $principalBackend; + private ICache&MockObject $shareCache; + private LoggerInterface&MockObject $logger; + private ICacheFactory&MockObject $cacheFactory; + private Service&MockObject $calendarService; private CalendarSharingBackend $backend; protected function setUp(): void { diff --git a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php index 9c6950f19e8..7a88f7cc5dd 100644 --- a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php +++ b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -12,6 +13,7 @@ use OCA\DAV\DAV\Sharing\IShareable; use OCA\DAV\DAV\Sharing\Plugin; use OCP\IConfig; use OCP\IRequest; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Server; use Sabre\DAV\SimpleCollection; use Sabre\HTTP\Request; @@ -19,32 +21,24 @@ use Sabre\HTTP\Response; use Test\TestCase; class PluginTest extends TestCase { - - /** @var Plugin */ - private $plugin; - /** @var Server */ - private $server; - /** @var IShareable | \PHPUnit\Framework\MockObject\MockObject */ - private $book; + private Plugin $plugin; + private Server $server; + private IShareable&MockObject $book; protected function setUp(): void { parent::setUp(); - /** @var Auth | \PHPUnit\Framework\MockObject\MockObject $authBackend */ - $authBackend = $this->getMockBuilder(Auth::class)->disableOriginalConstructor()->getMock(); + $authBackend = $this->createMock(Auth::class); $authBackend->method('isDavAuthenticated')->willReturn(true); - /** @var IRequest $request */ - $request = $this->getMockBuilder(IRequest::class)->disableOriginalConstructor()->getMock(); + $request = $this->createMock(IRequest::class); $config = $this->createMock(IConfig::class); $this->plugin = new Plugin($authBackend, $request, $config); $root = new SimpleCollection('root'); $this->server = new \Sabre\DAV\Server($root); /** @var SimpleCollection $node */ - $this->book = $this->getMockBuilder(IShareable::class)-> - disableOriginalConstructor()-> - getMock(); + $this->book = $this->createMock(IShareable::class); $this->book->method('getName')->willReturn('addressbook1.vcf'); $root->addChild($this->book); $this->plugin->initialize($this->server); diff --git a/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php b/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php index 32916804080..127de1ede0a 100644 --- a/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php +++ b/apps/dav/tests/unit/DAV/SystemPrincipalBackendTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -8,22 +9,21 @@ namespace OCA\DAV\Tests\unit\DAV; use OCA\DAV\DAV\SystemPrincipalBackend; +use Sabre\DAV\Exception; use Test\TestCase; class SystemPrincipalBackendTest extends TestCase { /** * @dataProvider providesPrefix - * @param $expected - * @param $prefix */ - public function testGetPrincipalsByPrefix($expected, $prefix): void { + public function testGetPrincipalsByPrefix(array $expected, string $prefix): void { $backend = new SystemPrincipalBackend(); $result = $backend->getPrincipalsByPrefix($prefix); $this->assertEquals($expected, $result); } - public function providesPrefix() { + public static function providesPrefix(): array { return [ [[], ''], [[[ @@ -40,16 +40,14 @@ class SystemPrincipalBackendTest extends TestCase { /** * @dataProvider providesPath - * @param $expected - * @param $path */ - public function testGetPrincipalByPath($expected, $path): void { + public function testGetPrincipalByPath(?array $expected, string $path): void { $backend = new SystemPrincipalBackend(); $result = $backend->getPrincipalByPath($path); $this->assertEquals($expected, $result); } - public function providesPath() { + public static function providesPath(): array { return [ [null, ''], [null, 'principals'], @@ -63,28 +61,22 @@ class SystemPrincipalBackendTest extends TestCase { /** * @dataProvider providesPrincipalForGetGroupMemberSet - * - * @param string $principal - * @throws \Sabre\DAV\Exception */ - public function testGetGroupMemberSetExceptional($principal): void { - $this->expectException(\Sabre\DAV\Exception::class); + public function testGetGroupMemberSetExceptional(?string $principal): void { + $this->expectException(Exception::class); $this->expectExceptionMessage('Principal not found'); $backend = new SystemPrincipalBackend(); $backend->getGroupMemberSet($principal); } - public function providesPrincipalForGetGroupMemberSet() { + public static function providesPrincipalForGetGroupMemberSet(): array { return [ [null], ['principals/system'], ]; } - /** - * @throws \Sabre\DAV\Exception - */ public function testGetGroupMemberSet(): void { $backend = new SystemPrincipalBackend(); $result = $backend->getGroupMemberSet('principals/system/system'); @@ -93,27 +85,21 @@ class SystemPrincipalBackendTest extends TestCase { /** * @dataProvider providesPrincipalForGetGroupMembership - * - * @param string $principal - * @throws \Sabre\DAV\Exception */ - public function testGetGroupMembershipExceptional($principal): void { - $this->expectException(\Sabre\DAV\Exception::class); + public function testGetGroupMembershipExceptional(string $principal): void { + $this->expectException(Exception::class); $this->expectExceptionMessage('Principal not found'); $backend = new SystemPrincipalBackend(); $backend->getGroupMembership($principal); } - public function providesPrincipalForGetGroupMembership() { + public static function providesPrincipalForGetGroupMembership(): array { return [ ['principals/system/a'], ]; } - /** - * @throws \Sabre\DAV\Exception - */ public function testGetGroupMembership(): void { $backend = new SystemPrincipalBackend(); $result = $backend->getGroupMembership('principals/system/system'); diff --git a/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php b/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php index 7a4828dd2de..9227d34b30f 100644 --- a/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php +++ b/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2019 ownCloud GmbH @@ -20,30 +21,29 @@ use OCP\Files\Storage\IStorage; use OCP\IUser; use OCP\Share\IAttributes; use OCP\Share\IShare; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Server; use Sabre\DAV\Tree; use Sabre\HTTP\RequestInterface; use Test\TestCase; class ViewOnlyPluginTest extends TestCase { - + private Tree&MockObject $tree; + private RequestInterface&MockObject $request; + private Folder&MockObject $userFolder; private ViewOnlyPlugin $plugin; - /** @var Tree | \PHPUnit\Framework\MockObject\MockObject */ - private $tree; - /** @var RequestInterface | \PHPUnit\Framework\MockObject\MockObject */ - private $request; - /** @var Folder | \PHPUnit\Framework\MockObject\MockObject */ - private $userFolder; public function setUp(): void { + parent::setUp(); + $this->userFolder = $this->createMock(Folder::class); - $this->plugin = new ViewOnlyPlugin( - $this->userFolder, - ); $this->request = $this->createMock(RequestInterface::class); $this->tree = $this->createMock(Tree::class); - $server = $this->createMock(Server::class); + + $this->plugin = new ViewOnlyPlugin( + $this->userFolder, + ); $server->tree = $this->tree; $this->plugin->initialize($server); @@ -71,7 +71,7 @@ class ViewOnlyPluginTest extends TestCase { $this->assertTrue($this->plugin->checkViewOnly($this->request)); } - public function providesDataForCanGet(): array { + public static function providesDataForCanGet(): array { return [ // has attribute permissions-download enabled - can get file [false, true, true], diff --git a/apps/dav/tests/unit/Direct/DirectFileTest.php b/apps/dav/tests/unit/Direct/DirectFileTest.php index 07d19807ef0..f6f0f49fa8c 100644 --- a/apps/dav/tests/unit/Direct/DirectFileTest.php +++ b/apps/dav/tests/unit/Direct/DirectFileTest.php @@ -6,7 +6,7 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\Direct; +namespace OCA\DAV\Tests\unit\Direct; use OCA\DAV\Db\Direct; use OCA\DAV\Direct\DirectFile; @@ -14,28 +14,17 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\File; use OCP\Files\Folder; use OCP\Files\IRootFolder; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Exception\Forbidden; use Test\TestCase; class DirectFileTest extends TestCase { - - /** @var Direct */ - private $direct; - - /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */ - private $rootFolder; - - /** @var Folder|\PHPUnit\Framework\MockObject\MockObject */ - private $userFolder; - - /** @var File|\PHPUnit\Framework\MockObject\MockObject */ - private $file; - - /** @var DirectFile */ - private $directFile; - - /** @var IEventDispatcher */ - private $eventDispatcher; + private Direct $direct; + private IRootFolder&MockObject $rootFolder; + private Folder&MockObject $userFolder; + private File&MockObject $file; + private IEventDispatcher&MockObject $eventDispatcher; + private DirectFile $directFile; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/unit/Direct/DirectHomeTest.php b/apps/dav/tests/unit/Direct/DirectHomeTest.php index 06fb48a64d8..94c82c2b7c5 100644 --- a/apps/dav/tests/unit/Direct/DirectHomeTest.php +++ b/apps/dav/tests/unit/Direct/DirectHomeTest.php @@ -6,7 +6,7 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\Direct; +namespace OCA\DAV\Tests\unit\Direct; use OCA\DAV\Db\Direct; use OCA\DAV\Db\DirectMapper; @@ -18,33 +18,20 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\IRootFolder; use OCP\IRequest; use OCP\Security\Bruteforce\IThrottler; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\MethodNotAllowed; use Sabre\DAV\Exception\NotFound; use Test\TestCase; class DirectHomeTest extends TestCase { - - /** @var DirectMapper|\PHPUnit\Framework\MockObject\MockObject */ - private $directMapper; - - /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */ - private $rootFolder; - - /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */ - private $timeFactory; - - /** @var IThrottler|\PHPUnit\Framework\MockObject\MockObject */ - private $throttler; - - /** @var IRequest */ - private $request; - - /** @var DirectHome */ - private $directHome; - - /** @var IEventDispatcher */ - private $eventDispatcher; + private DirectMapper&MockObject $directMapper; + private IRootFolder&MockObject $rootFolder; + private ITimeFactory&MockObject $timeFactory; + private IThrottler&MockObject $throttler; + private IRequest&MockObject $request; + private IEventDispatcher&MockObject $eventDispatcher; + private DirectHome $directHome; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/unit/Files/FileSearchBackendTest.php b/apps/dav/tests/unit/Files/FileSearchBackendTest.php index aaa3d8c147e..ce56dde5fbd 100644 --- a/apps/dav/tests/unit/Files/FileSearchBackendTest.php +++ b/apps/dav/tests/unit/Files/FileSearchBackendTest.php @@ -1,10 +1,12 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Files; +namespace OCA\DAV\Tests\unit\Files; use OC\Files\Search\SearchComparison; use OC\Files\Search\SearchQuery; @@ -23,42 +25,26 @@ use OCP\Files\Search\ISearchQuery; use OCP\FilesMetadata\IFilesMetadataManager; use OCP\IUser; use OCP\Share\IManager; +use PHPUnit\Framework\MockObject\MockObject; use SearchDAV\Backend\SearchPropertyDefinition; use SearchDAV\Query\Limit; +use SearchDAV\Query\Literal; use SearchDAV\Query\Operator; use SearchDAV\Query\Query; +use SearchDAV\Query\Scope; use Test\TestCase; class FileSearchBackendTest extends TestCase { - /** @var ObjectTree|\PHPUnit\Framework\MockObject\MockObject */ - private $tree; - - /** @var IUser */ - private $user; - - /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */ - private $rootFolder; - - /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ - private $shareManager; - - /** @var View|\PHPUnit\Framework\MockObject\MockObject */ - private $view; - - /** @var Folder|\PHPUnit\Framework\MockObject\MockObject */ - private $searchFolder; - - /** @var FileSearchBackend */ - private $search; - - /** @var Directory|\PHPUnit\Framework\MockObject\MockObject */ - private $davFolder; + private ObjectTree&MockObject $tree; + private IUser&MockObject $user; + private IRootFolder&MockObject $rootFolder; + private IManager&MockObject $shareManager; + private View&MockObject $view; + private Folder&MockObject $searchFolder; + private Directory&MockObject $davFolder; + private FileSearchBackend $search; protected function setUp(): void { - if (PHP_VERSION_ID >= 80400) { - $this->markTestSkipped('SearchDAV is not yet PHP 8.4 compatible'); - } - parent::setUp(); $this->user = $this->createMock(IUser::class); @@ -66,11 +52,13 @@ class FileSearchBackendTest extends TestCase { ->method('getUID') ->willReturn('test'); - $this->tree = $this->getMockBuilder(ObjectTree::class) - ->disableOriginalConstructor() - ->getMock(); - + $this->tree = $this->createMock(ObjectTree::class); $this->view = $this->createMock(View::class); + $this->rootFolder = $this->createMock(IRootFolder::class); + $this->shareManager = $this->createMock(IManager::class); + $this->searchFolder = $this->createMock(Folder::class); + $fileInfo = $this->createMock(FileInfo::class); + $this->davFolder = $this->createMock(Directory::class); $this->view->expects($this->any()) ->method('getRoot') @@ -80,16 +68,6 @@ class FileSearchBackendTest extends TestCase { ->method('getRelativePath') ->willReturnArgument(0); - $this->rootFolder = $this->createMock(IRootFolder::class); - - $this->shareManager = $this->createMock(IManager::class); - - $this->searchFolder = $this->createMock(Folder::class); - - $fileInfo = $this->createMock(FileInfo::class); - - $this->davFolder = $this->createMock(Directory::class); - $this->davFolder->expects($this->any()) ->method('getFileInfo') ->willReturn($fileInfo); @@ -263,8 +241,8 @@ class FileSearchBackendTest extends TestCase { $this->search->search($query); } - private function getBasicQuery($type, $property, $value = null) { - $scope = new \SearchDAV\Query\Scope('/', 'infinite'); + private function getBasicQuery(string $type, string $property, int|string|null $value = null) { + $scope = new Scope('/', 'infinite'); $scope->path = '/'; $from = [$scope]; $orderBy = []; @@ -272,12 +250,12 @@ class FileSearchBackendTest extends TestCase { if (is_null($value)) { $where = new Operator( $type, - [new \SearchDAV\Query\Literal($property)] + [new Literal($property)] ); } else { $where = new Operator( $type, - [new SearchPropertyDefinition($property, true, true, true), new \SearchDAV\Query\Literal($value)] + [new SearchPropertyDefinition($property, true, true, true), new Literal($value)] ); } $limit = new Limit(); @@ -350,11 +328,11 @@ class FileSearchBackendTest extends TestCase { [ new Operator( Operator::OPERATION_EQUAL, - [new SearchPropertyDefinition('{DAV:}getcontenttype', true, true, true), new \SearchDAV\Query\Literal('image/png')] + [new SearchPropertyDefinition('{DAV:}getcontenttype', true, true, true), new Literal('image/png')] ), new Operator( Operator::OPERATION_EQUAL, - [new SearchPropertyDefinition(FilesPlugin::OWNER_ID_PROPERTYNAME, true, true, true), new \SearchDAV\Query\Literal($this->user->getUID())] + [new SearchPropertyDefinition(FilesPlugin::OWNER_ID_PROPERTYNAME, true, true, true), new Literal($this->user->getUID())] ), ] ); @@ -383,7 +361,7 @@ class FileSearchBackendTest extends TestCase { $innerOperator = new Operator( Operator::OPERATION_EQUAL, - [new SearchPropertyDefinition('{DAV:}getcontenttype', true, true, true), new \SearchDAV\Query\Literal('image/png')] + [new SearchPropertyDefinition('{DAV:}getcontenttype', true, true, true), new Literal('image/png')] ); // 5 child operators $level1Operator = new Operator( diff --git a/apps/dav/tests/unit/Files/MultipartRequestParserTest.php b/apps/dav/tests/unit/Files/MultipartRequestParserTest.php index 40880bdca9c..dc0e884f07c 100644 --- a/apps/dav/tests/unit/Files/MultipartRequestParserTest.php +++ b/apps/dav/tests/unit/Files/MultipartRequestParserTest.php @@ -1,10 +1,12 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-only */ -namespace OCA\DAV\Tests\unit\DAV; +namespace OCA\DAV\Tests\unit\Files; use OCA\DAV\BulkUpload\MultipartRequestParser; use PHPUnit\Framework\MockObject\MockObject; @@ -17,10 +19,11 @@ class MultipartRequestParserTest extends TestCase { protected LoggerInterface&MockObject $logger; protected function setUp(): void { + parent::setUp(); $this->logger = $this->createMock(LoggerInterface::class); } - private function getValidBodyObject() { + private static function getValidBodyObject(): array { return [ [ 'headers' => [ @@ -99,7 +102,7 @@ class MultipartRequestParserTest extends TestCase { * - valid file path */ public function testValidRequest(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); unset($bodyObject['0']['headers']['X-File-MD5']); $multipartParser = $this->getMultipartParser($bodyObject); @@ -122,7 +125,7 @@ class MultipartRequestParserTest extends TestCase { * - valid file path */ public function testValidRequestWithMd5(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); unset($bodyObject['0']['headers']['OC-Checksum']); $multipartParser = $this->getMultipartParser($bodyObject); @@ -140,7 +143,7 @@ class MultipartRequestParserTest extends TestCase { * Test with invalid hash. */ public function testInvalidHash(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); $bodyObject['0']['headers']['OC-Checksum'] = 'md5:f2377b4d911f7ec46325fe603c3af03'; unset($bodyObject['0']['headers']['X-File-MD5']); $multipartParser = $this->getMultipartParser( @@ -155,7 +158,7 @@ class MultipartRequestParserTest extends TestCase { * Test with invalid md5 hash. */ public function testInvalidMd5Hash(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); unset($bodyObject['0']['headers']['OC-Checksum']); $bodyObject['0']['headers']['X-File-MD5'] = 'f2377b4d911f7ec46325fe603c3af03'; $multipartParser = $this->getMultipartParser( @@ -170,7 +173,7 @@ class MultipartRequestParserTest extends TestCase { * Test with a null hash headers. */ public function testNullHash(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); unset($bodyObject['0']['headers']['OC-Checksum']); unset($bodyObject['0']['headers']['X-File-MD5']); $multipartParser = $this->getMultipartParser( @@ -185,7 +188,7 @@ class MultipartRequestParserTest extends TestCase { * Test with a null Content-Length. */ public function testNullContentLength(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); unset($bodyObject['0']['headers']['Content-Length']); $multipartParser = $this->getMultipartParser( $bodyObject @@ -199,7 +202,7 @@ class MultipartRequestParserTest extends TestCase { * Test with a lower Content-Length. */ public function testLowerContentLength(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); $bodyObject['0']['headers']['Content-Length'] = 6; $multipartParser = $this->getMultipartParser( $bodyObject @@ -213,7 +216,7 @@ class MultipartRequestParserTest extends TestCase { * Test with a higher Content-Length. */ public function testHigherContentLength(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); $bodyObject['0']['headers']['Content-Length'] = 8; $multipartParser = $this->getMultipartParser( $bodyObject @@ -227,7 +230,7 @@ class MultipartRequestParserTest extends TestCase { * Test with wrong boundary in body. */ public function testWrongBoundary(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); $multipartParser = $this->getMultipartParser( $bodyObject, ['Content-Type' => 'multipart/related; boundary=boundary_poiuytreza'] @@ -241,7 +244,7 @@ class MultipartRequestParserTest extends TestCase { * Test with no boundary in request headers. */ public function testNoBoundaryInHeader(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); $this->expectExceptionMessage('Error while parsing boundary in Content-Type header.'); $this->getMultipartParser( $bodyObject, @@ -253,7 +256,7 @@ class MultipartRequestParserTest extends TestCase { * Test with no boundary in the request's headers. */ public function testNoBoundaryInBody(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); $multipartParser = $this->getMultipartParser( $bodyObject, ['Content-Type' => 'multipart/related; boundary=boundary_azertyuiop'], @@ -268,7 +271,7 @@ class MultipartRequestParserTest extends TestCase { * Test with a boundary with quotes in the request's headers. */ public function testBoundaryWithQuotes(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); $multipartParser = $this->getMultipartParser( $bodyObject, ['Content-Type' => 'multipart/related; boundary="boundary_azertyuiop"'], @@ -284,7 +287,7 @@ class MultipartRequestParserTest extends TestCase { * Test with a wrong Content-Type in the request's headers. */ public function testWrongContentType(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); $this->expectExceptionMessage('Content-Type must be multipart/related'); $this->getMultipartParser( $bodyObject, @@ -296,7 +299,7 @@ class MultipartRequestParserTest extends TestCase { * Test with a wrong key after the content type in the request's headers. */ public function testWrongKeyInContentType(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); $this->expectExceptionMessage('Boundary is invalid'); $this->getMultipartParser( $bodyObject, @@ -308,7 +311,7 @@ class MultipartRequestParserTest extends TestCase { * Test with a null Content-Type in the request's headers. */ public function testNullContentType(): void { - $bodyObject = $this->getValidBodyObject(); + $bodyObject = self::getValidBodyObject(); $this->expectExceptionMessage('Content-Type can not be null'); $this->getMultipartParser( $bodyObject, diff --git a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php index 16891ced3d0..545bea9a406 100644 --- a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php +++ b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php @@ -1,9 +1,11 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Files\Sharing; +namespace OCA\DAV\Tests\unit\Files\Sharing; use OCA\DAV\Files\Sharing\FilesDropPlugin; use OCP\Files\Folder; @@ -205,7 +207,7 @@ class FilesDropPluginTest extends TestCase { $this->request->method('getHeader') ->with('X-NC-Nickname') ->willReturn('nickname'); - + $this->request->method('getPath') ->willReturn('/files/token/folder/subfolder/file.txt'); $this->request->method('getBaseUrl') diff --git a/apps/dav/tests/unit/Listener/ActivityUpdaterListenerTest.php b/apps/dav/tests/unit/Listener/ActivityUpdaterListenerTest.php index 78769c7fb47..7bd7bdc2167 100644 --- a/apps/dav/tests/unit/Listener/ActivityUpdaterListenerTest.php +++ b/apps/dav/tests/unit/Listener/ActivityUpdaterListenerTest.php @@ -6,7 +6,7 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\Listener; +namespace OCA\DAV\Tests\unit\Listener; use OCA\DAV\CalDAV\Activity\Backend as ActivityBackend; use OCA\DAV\CalDAV\Activity\Provider\Event; @@ -20,10 +20,8 @@ use Test\TestCase; class ActivityUpdaterListenerTest extends TestCase { - /** @var ActivityBackend|MockObject */ - private $activityBackend; - /** @var LoggerInterface|MockObject */ - private $logger; + private ActivityBackend&MockObject $activityBackend; + private LoggerInterface&MockObject $logger; private ActivityUpdaterListener $listener; protected function setUp(): void { @@ -55,7 +53,7 @@ class ActivityUpdaterListenerTest extends TestCase { $this->listener->handle($event); } - public function dataForTestHandleCalendarObjectDeletedEvent(): array { + public static function dataForTestHandleCalendarObjectDeletedEvent(): array { return [ [1, [], [], [], true], [1, [], [], ['{' . SharingPlugin::NS_NEXTCLOUD . '}deleted-at' => 120], false], @@ -77,7 +75,7 @@ class ActivityUpdaterListenerTest extends TestCase { $this->listener->handle($event); } - public function dataForTestHandleCalendarDeletedEvent(): array { + public static function dataForTestHandleCalendarDeletedEvent(): array { return [ [1, [], [], true], [1, ['{' . SharingPlugin::NS_NEXTCLOUD . '}deleted-at' => 120], [], false], diff --git a/apps/dav/tests/unit/Listener/CalendarContactInteractionListenerTest.php b/apps/dav/tests/unit/Listener/CalendarContactInteractionListenerTest.php index 96d8514da41..dc3dce8a62f 100644 --- a/apps/dav/tests/unit/Listener/CalendarContactInteractionListenerTest.php +++ b/apps/dav/tests/unit/Listener/CalendarContactInteractionListenerTest.php @@ -6,7 +6,7 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\Listener; +namespace OCA\DAV\Tests\unit\Listener; use OCA\DAV\Connector\Sabre\Principal; use OCA\DAV\Events\CalendarShareUpdatedEvent; @@ -23,24 +23,12 @@ use Psr\Log\LoggerInterface; use Test\TestCase; class CalendarContactInteractionListenerTest extends TestCase { - - /** @var IEventDispatcher|MockObject */ - private $eventDispatcher; - - /** @var IUserSession|MockObject */ - private $userSession; - - /** @var Principal|MockObject */ - private $principalConnector; - - /** @var LoggerInterface|MockObject */ - private $logger; - - /** @var IMailer|MockObject */ - private $mailer; - - /** @var CalendarContactInteractionListener */ - private $listener; + private IEventDispatcher&MockObject $eventDispatcher; + private IUserSession&MockObject $userSession; + private Principal&MockObject $principalConnector; + private LoggerInterface&MockObject $logger; + private IMailer&MockObject $mailer; + private CalendarContactInteractionListener $listener; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/unit/Listener/OutOfOfficeListenerTest.php b/apps/dav/tests/unit/Listener/OutOfOfficeListenerTest.php index a21d3a5e928..971d113b742 100644 --- a/apps/dav/tests/unit/Listener/OutOfOfficeListenerTest.php +++ b/apps/dav/tests/unit/Listener/OutOfOfficeListenerTest.php @@ -7,7 +7,7 @@ declare(strict_types=1); * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\Listener; +namespace OCA\DAV\Tests\unit\Listener; use DateTimeImmutable; use InvalidArgumentException; @@ -27,7 +27,6 @@ use OCP\User\Events\OutOfOfficeChangedEvent; use OCP\User\Events\OutOfOfficeClearedEvent; use OCP\User\Events\OutOfOfficeScheduledEvent; use OCP\User\IOutOfOfficeData; -use OCP\UserStatus\IManager; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Sabre\DAV\Exception\NotFound; @@ -42,11 +41,10 @@ use Test\TestCase; */ class OutOfOfficeListenerTest extends TestCase { - private ServerFactory|MockObject $serverFactory; - private IConfig|MockObject $appConfig; - private LoggerInterface|MockObject $loggerInterface; - private MockObject|TimezoneService $timezoneService; - private IManager|MockObject $manager; + private ServerFactory&MockObject $serverFactory; + private IConfig&MockObject $appConfig; + private LoggerInterface&MockObject $loggerInterface; + private TimezoneService&MockObject $timezoneService; private OutOfOfficeListener $listener; protected function setUp(): void { @@ -56,14 +54,12 @@ class OutOfOfficeListenerTest extends TestCase { $this->appConfig = $this->createMock(IConfig::class); $this->timezoneService = $this->createMock(TimezoneService::class); $this->loggerInterface = $this->createMock(LoggerInterface::class); - $this->manager = $this->createMock(IManager::class); $this->listener = new OutOfOfficeListener( $this->serverFactory, $this->appConfig, $this->timezoneService, $this->loggerInterface, - $this->manager ); } @@ -453,8 +449,6 @@ class OutOfOfficeListenerTest extends TestCase { ->method('getPlugin') ->with('caldav') ->willReturn($caldavPlugin); - $this->manager->expects(self::never()) - ->method('revertUserStatus'); $event = new OutOfOfficeClearedEvent($data); $this->listener->handle($event); @@ -483,8 +477,6 @@ class OutOfOfficeListenerTest extends TestCase { ->method('getNodeForPath') ->with('/home/calendar') ->willThrowException(new NotFound('nope')); - $this->manager->expects(self::never()) - ->method('revertUserStatus'); $event = new OutOfOfficeClearedEvent($data); $this->listener->handle($event); @@ -522,8 +514,6 @@ class OutOfOfficeListenerTest extends TestCase { ->method('getChild') ->with('personal-1') ->willThrowException(new NotFound('nope')); - $this->manager->expects(self::never()) - ->method('revertUserStatus'); $event = new OutOfOfficeClearedEvent($data); $this->listener->handle($event); @@ -565,8 +555,6 @@ class OutOfOfficeListenerTest extends TestCase { $calendar->expects(self::once()) ->method('getChild') ->willThrowException(new NotFound()); - $this->manager->expects(self::never()) - ->method('revertUserStatus'); $event = new OutOfOfficeClearedEvent($data); $this->listener->handle($event); diff --git a/apps/dav/tests/unit/Migration/CalDAVRemoveEmptyValueTest.php b/apps/dav/tests/unit/Migration/CalDAVRemoveEmptyValueTest.php index be2c64c47a4..1852d2709c1 100644 --- a/apps/dav/tests/unit/Migration/CalDAVRemoveEmptyValueTest.php +++ b/apps/dav/tests/unit/Migration/CalDAVRemoveEmptyValueTest.php @@ -1,15 +1,18 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\DAV\Migration; +namespace OCA\DAV\Tests\unit\DAV\Migration; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\Migration\CalDAVRemoveEmptyValue; use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Server; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Sabre\VObject\InvalidDataException; use Test\TestCase; @@ -21,18 +24,10 @@ use Test\TestCase; * @group DB */ class CalDAVRemoveEmptyValueTest extends TestCase { - - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ - private $logger; - - /** @var CalDavBackend|\PHPUnit\Framework\MockObject\MockObject */ - private $backend; - - /** @var IOutput|\PHPUnit\Framework\MockObject\MockObject */ - private $output; - - /** @var string */ - private $invalid = 'BEGIN:VCALENDAR + private LoggerInterface&MockObject $logger; + private CalDavBackend&MockObject $backend; + private IOutput&MockObject $output; + private string $invalid = 'BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Apple Inc.//Mac OS X 10.11.2//EN CALSCALE:GREGORIAN @@ -52,8 +47,7 @@ CREATED;VALUE=:20151214T091032Z END:VEVENT END:VCALENDAR'; - /** @var string */ - private $valid = 'BEGIN:VCALENDAR + private string $valid = 'BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Apple Inc.//Mac OS X 10.11.2//EN CALSCALE:GREGORIAN @@ -82,14 +76,14 @@ END:VCALENDAR'; } public function testRunAllValid(): void { - /** @var CalDAVRemoveEmptyValue|\PHPUnit\Framework\MockObject\MockObject $step */ + /** @var CalDAVRemoveEmptyValue&MockObject $step */ $step = $this->getMockBuilder(CalDAVRemoveEmptyValue::class) ->setConstructorArgs([ Server::get(IDBConnection::class), $this->backend, $this->logger ]) - ->setMethods(['getInvalidObjects']) + ->onlyMethods(['getInvalidObjects']) ->getMock(); $step->expects($this->once()) @@ -106,14 +100,14 @@ END:VCALENDAR'; } public function testRunInvalid(): void { - /** @var CalDAVRemoveEmptyValue|\PHPUnit\Framework\MockObject\MockObject $step */ + /** @var CalDAVRemoveEmptyValue&MockObject $step */ $step = $this->getMockBuilder(CalDAVRemoveEmptyValue::class) ->setConstructorArgs([ Server::get(IDBConnection::class), $this->backend, $this->logger ]) - ->setMethods(['getInvalidObjects']) + ->onlyMethods(['getInvalidObjects']) ->getMock(); $step->expects($this->once()) @@ -149,14 +143,14 @@ END:VCALENDAR'; } public function testRunValid(): void { - /** @var CalDAVRemoveEmptyValue|\PHPUnit\Framework\MockObject\MockObject $step */ + /** @var CalDAVRemoveEmptyValue&MockObject $step */ $step = $this->getMockBuilder(CalDAVRemoveEmptyValue::class) ->setConstructorArgs([ Server::get(IDBConnection::class), $this->backend, $this->logger ]) - ->setMethods(['getInvalidObjects']) + ->onlyMethods(['getInvalidObjects']) ->getMock(); $step->expects($this->once()) @@ -191,14 +185,14 @@ END:VCALENDAR'; } public function testRunStillInvalid(): void { - /** @var CalDAVRemoveEmptyValue|\PHPUnit\Framework\MockObject\MockObject $step */ + /** @var CalDAVRemoveEmptyValue&MockObject $step */ $step = $this->getMockBuilder(CalDAVRemoveEmptyValue::class) ->setConstructorArgs([ Server::get(IDBConnection::class), $this->backend, $this->logger ]) - ->setMethods(['getInvalidObjects']) + ->onlyMethods(['getInvalidObjects']) ->getMock(); $step->expects($this->once()) diff --git a/apps/dav/tests/unit/Migration/CreateSystemAddressBookStepTest.php b/apps/dav/tests/unit/Migration/CreateSystemAddressBookStepTest.php index bbecd0607b4..667d2e39d3a 100644 --- a/apps/dav/tests/unit/Migration/CreateSystemAddressBookStepTest.php +++ b/apps/dav/tests/unit/Migration/CreateSystemAddressBookStepTest.php @@ -7,7 +7,7 @@ declare(strict_types=1); * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\Migration; +namespace OCA\DAV\Tests\unit\Migration; use OCA\DAV\CardDAV\SyncService; use OCA\DAV\Migration\CreateSystemAddressBookStep; @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; class CreateSystemAddressBookStepTest extends TestCase { - private SyncService|MockObject $syncService; + private SyncService&MockObject $syncService; private CreateSystemAddressBookStep $step; protected function setUp(): void { diff --git a/apps/dav/tests/unit/Migration/RefreshWebcalJobRegistrarTest.php b/apps/dav/tests/unit/Migration/RefreshWebcalJobRegistrarTest.php index bf4c60b3cf1..73d9c1efd29 100644 --- a/apps/dav/tests/unit/Migration/RefreshWebcalJobRegistrarTest.php +++ b/apps/dav/tests/unit/Migration/RefreshWebcalJobRegistrarTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -12,17 +14,13 @@ use OCP\DB\IResult; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; use OCP\Migration\IOutput; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class RefreshWebcalJobRegistrarTest extends TestCase { - /** @var IDBConnection | \PHPUnit\Framework\MockObject\MockObject */ - private $db; - - /** @var IJobList | \PHPUnit\Framework\MockObject\MockObject */ - private $jobList; - - /** @var RefreshWebcalJobRegistrar */ - private $migration; + private IDBConnection&MockObject $db; + private IJobList&MockObject $jobList; + private RefreshWebcalJobRegistrar $migration; protected function setUp(): void { parent::setUp(); @@ -80,35 +78,37 @@ class RefreshWebcalJobRegistrarTest extends TestCase { $this->jobList->expects($this->exactly(3)) ->method('has') - ->withConsecutive( + ->willReturnMap([ [RefreshWebcalJob::class, [ 'principaluri' => 'foo1', 'uri' => 'bar1', - ]], + ], false], [RefreshWebcalJob::class, [ 'principaluri' => 'foo2', 'uri' => 'bar2', - ]], + ], true ], [RefreshWebcalJob::class, [ 'principaluri' => 'foo3', 'uri' => 'bar3', - ]]) - ->willReturnOnConsecutiveCalls( - false, - true, - false, - ); + ], false], + ]); + + $calls = [ + [RefreshWebcalJob::class, [ + 'principaluri' => 'foo1', + 'uri' => 'bar1', + ]], + [RefreshWebcalJob::class, [ + 'principaluri' => 'foo3', + 'uri' => 'bar3', + ]] + ]; $this->jobList->expects($this->exactly(2)) ->method('add') - ->withConsecutive( - [RefreshWebcalJob::class, [ - 'principaluri' => 'foo1', - 'uri' => 'bar1', - ]], - [RefreshWebcalJob::class, [ - 'principaluri' => 'foo3', - 'uri' => 'bar3', - ]]); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); $output->expects($this->once()) ->method('info') diff --git a/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php b/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php index e2ac45526d2..6f681badb8b 100644 --- a/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php +++ b/apps/dav/tests/unit/Migration/RegenerateBirthdayCalendarsTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -10,18 +12,13 @@ use OCA\DAV\Migration\RegenerateBirthdayCalendars; use OCP\BackgroundJob\IJobList; use OCP\IConfig; use OCP\Migration\IOutput; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class RegenerateBirthdayCalendarsTest extends TestCase { - - /** @var IJobList | \PHPUnit\Framework\MockObject\MockObject */ - private $jobList; - - /** @var IConfig | \PHPUnit\Framework\MockObject\MockObject */ - private $config; - - /** @var RegenerateBirthdayCalendars */ - private $migration; + private IJobList&MockObject $jobList; + private IConfig&MockObject $config; + private RegenerateBirthdayCalendars $migration; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/unit/Migration/RemoveDeletedUsersCalendarSubscriptionsTest.php b/apps/dav/tests/unit/Migration/RemoveDeletedUsersCalendarSubscriptionsTest.php index a3daf1c918a..0a646e91602 100644 --- a/apps/dav/tests/unit/Migration/RemoveDeletedUsersCalendarSubscriptionsTest.php +++ b/apps/dav/tests/unit/Migration/RemoveDeletedUsersCalendarSubscriptionsTest.php @@ -22,23 +22,10 @@ use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class RemoveDeletedUsersCalendarSubscriptionsTest extends TestCase { - /** - * @var IDBConnection|MockObject - */ - private $dbConnection; - /** - * @var IUserManager|MockObject - */ - private $userManager; - - /** - * @var IOutput|MockObject - */ - private $output; - /** - * @var RemoveDeletedUsersCalendarSubscriptions - */ - private $migration; + private IDBConnection&MockObject $dbConnection; + private IUserManager&MockObject $userManager; + private IOutput&MockObject $output; + private RemoveDeletedUsersCalendarSubscriptions $migration; protected function setUp(): void { @@ -60,10 +47,6 @@ class RemoveDeletedUsersCalendarSubscriptionsTest extends TestCase { /** * @dataProvider dataTestRun - * @param array $subscriptions - * @param array $userExists - * @param int $deletions - * @throws \Exception */ public function testRun(array $subscriptions, array $userExists, int $deletions): void { $qb = $this->createMock(IQueryBuilder::class); @@ -132,21 +115,28 @@ class RemoveDeletedUsersCalendarSubscriptionsTest extends TestCase { $this->migration->run($this->output); } - public function dataTestRun(): array { + public static function dataTestRun(): array { return [ [[], [], 0], - [[[ - 'id' => 1, - 'principaluri' => 'users/principals/foo1', - ], + [ [ - 'id' => 2, - 'principaluri' => 'users/principals/bar1', + [ + 'id' => 1, + 'principaluri' => 'users/principals/foo1', + ], + [ + 'id' => 2, + 'principaluri' => 'users/principals/bar1', + ], + [ + 'id' => 3, + 'principaluri' => 'users/principals/bar1', + ], + [], ], - [ - 'id' => 3, - 'principaluri' => 'users/principals/bar1', - ]], ['foo1' => true, 'bar1' => false], 2] + ['foo1' => true, 'bar1' => false], + 2 + ], ]; } } diff --git a/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningNodeTest.php b/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningNodeTest.php index 0979aff8a81..53de908ca27 100644 --- a/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningNodeTest.php +++ b/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningNodeTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -7,15 +9,13 @@ namespace OCA\DAV\Tests\unit\Provisioning\Apple; use OCA\DAV\Provisioning\Apple\AppleProvisioningNode; use OCP\AppFramework\Utility\ITimeFactory; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\PropPatch; use Test\TestCase; class AppleProvisioningNodeTest extends TestCase { - /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */ - private $timeFactory; - - /** @var AppleProvisioningNode */ - private $node; + private ITimeFactory&MockObject $timeFactory; + private AppleProvisioningNode $node; protected function setUp(): void { parent::setUp(); @@ -28,7 +28,6 @@ class AppleProvisioningNodeTest extends TestCase { $this->assertEquals('apple-provisioning.mobileconfig', $this->node->getName()); } - public function testSetName(): void { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->expectExceptionMessage('Renaming apple-provisioning.mobileconfig is forbidden'); diff --git a/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php b/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php index dbb399ea7a6..ba44efe7421 100644 --- a/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php +++ b/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -12,40 +14,27 @@ use OCP\IRequest; use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; +use Sabre\DAV\Server; +use Sabre\HTTP\RequestInterface; +use Sabre\HTTP\ResponseInterface; use Test\TestCase; class AppleProvisioningPluginTest extends TestCase { - /** @var \Sabre\DAV\Server|\PHPUnit\Framework\MockObject\MockObject */ - protected $server; - - /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */ - protected $userSession; - - /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */ - protected $urlGenerator; - - /** @var ThemingDefaults|\PHPUnit\Framework\MockObject\MockObject */ - protected $themingDefaults; - - /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */ - protected $request; - - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - protected $l10n; - - /** @var \Sabre\HTTP\RequestInterface|\PHPUnit\Framework\MockObject\MockObject */ - protected $sabreRequest; - - /** @var \Sabre\HTTP\ResponseInterface|\PHPUnit\Framework\MockObject\MockObject */ - protected $sabreResponse; - - /** @var AppleProvisioningPlugin */ - protected $plugin; + protected Server&MockObject $server; + protected IUserSession&MockObject $userSession; + protected IURLGenerator&MockObject $urlGenerator; + protected ThemingDefaults&MockObject $themingDefaults; + protected IRequest&MockObject $request; + protected IL10N&MockObject $l10n; + protected RequestInterface&MockObject $sabreRequest; + protected ResponseInterface&MockObject $sabreResponse; + protected AppleProvisioningPlugin $plugin; protected function setUp(): void { parent::setUp(); - $this->server = $this->createMock(\Sabre\DAV\Server::class); + $this->server = $this->createMock(Server::class); $this->userSession = $this->createMock(IUserSession::class); $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->themingDefaults = $this->createMock(ThemingDefaults::class); @@ -62,12 +51,12 @@ class AppleProvisioningPluginTest extends TestCase { } ); - $this->sabreRequest = $this->createMock(\Sabre\HTTP\RequestInterface::class); - $this->sabreResponse = $this->createMock(\Sabre\HTTP\ResponseInterface::class); + $this->sabreRequest = $this->createMock(RequestInterface::class); + $this->sabreResponse = $this->createMock(ResponseInterface::class); } public function testInitialize(): void { - $server = $this->createMock(\Sabre\DAV\Server::class); + $server = $this->createMock(Server::class); $plugin = new AppleProvisioningPlugin($this->userSession, $this->urlGenerator, $this->themingDefaults, $this->request, $this->l10n, @@ -149,24 +138,25 @@ class AppleProvisioningPluginTest extends TestCase { $this->l10n->expects($this->exactly(2)) ->method('t') - ->withConsecutive( - ['Configures a CalDAV account'], - ['Configures a CardDAV account'], - ) - ->willReturnOnConsecutiveCalls( - 'LocalizedConfiguresCalDAV', - 'LocalizedConfiguresCardDAV', - ); + ->willReturnMap([ + ['Configures a CalDAV account', [], 'LocalizedConfiguresCalDAV'], + ['Configures a CardDAV account', [], 'LocalizedConfiguresCardDAV'], + ]); $this->sabreResponse->expects($this->once()) ->method('setStatus') ->with(200); + + $calls = [ + ['Content-Disposition', 'attachment; filename="userName-apple-provisioning.mobileconfig"'], + ['Content-Type', 'application/xml; charset=utf-8'], + ]; $this->sabreResponse->expects($this->exactly(2)) ->method('setHeader') - ->withConsecutive( - ['Content-Disposition', 'attachment; filename="userName-apple-provisioning.mobileconfig"'], - ['Content-Type', 'application/xml; charset=utf-8'], - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); $this->sabreResponse->expects($this->once()) ->method('setBody') ->with(<<<EOF diff --git a/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php b/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php index 0a83d238f0f..f0e5a5ea354 100644 --- a/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/ContactsSearchProviderTest.php @@ -17,27 +17,18 @@ use OCP\IUser; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; use OCP\Search\SearchResultEntry; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\VObject\Reader; use Test\TestCase; class ContactsSearchProviderTest extends TestCase { + private IAppManager&MockObject $appManager; + private IL10N&MockObject $l10n; + private IURLGenerator&MockObject $urlGenerator; + private CardDavBackend&MockObject $backend; + private ContactsSearchProvider $provider; - /** @var IAppManager|\PHPUnit\Framework\MockObject\MockObject */ - private $appManager; - - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - private $l10n; - - /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */ - private $urlGenerator; - - /** @var CardDavBackend|\PHPUnit\Framework\MockObject\MockObject */ - private $backend; - - /** @var ContactsSearchProvider */ - private $provider; - - private $vcardTest0 = 'BEGIN:VCARD' . PHP_EOL . + private string $vcardTest0 = 'BEGIN:VCARD' . PHP_EOL . 'VERSION:3.0' . PHP_EOL . 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . 'UID:Test' . PHP_EOL . @@ -46,7 +37,7 @@ class ContactsSearchProviderTest extends TestCase { 'EMAIL:forrestgump@example.com' . PHP_EOL . 'END:VCARD'; - private $vcardTest1 = 'BEGIN:VCARD' . PHP_EOL . + private string $vcardTest1 = 'BEGIN:VCARD' . PHP_EOL . 'VERSION:3.0' . PHP_EOL . 'PRODID:-//Sabre//Sabre VObject 4.1.2//EN' . PHP_EOL . 'PHOTO;ENCODING=b;TYPE=image/jpeg:' . PHP_EOL . @@ -174,7 +165,7 @@ class ContactsSearchProviderTest extends TestCase { $this->urlGenerator, $this->backend, ]) - ->setMethods([ + ->onlyMethods([ 'getDavUrlForContact', 'getDeepLinkToContactsApp', 'generateSubline', @@ -191,11 +182,10 @@ class ContactsSearchProviderTest extends TestCase { ->willReturn('subline'); $provider->expects($this->exactly(2)) ->method('getDeepLinkToContactsApp') - ->withConsecutive( - ['addressbook-uri-99', 'Test'], - ['addressbook-uri-123', 'Test2'] - ) - ->willReturn('deep-link-to-contacts'); + ->willReturnMap([ + ['addressbook-uri-99', 'Test', 'deep-link-to-contacts'], + ['addressbook-uri-123', 'Test2', 'deep-link-to-contacts'], + ]); $actual = $provider->search($user, $query); $data = $actual->jsonSerialize(); diff --git a/apps/dav/tests/unit/Search/EventsSearchProviderTest.php b/apps/dav/tests/unit/Search/EventsSearchProviderTest.php index 0eafe0782e5..7c0b74e8ff3 100644 --- a/apps/dav/tests/unit/Search/EventsSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/EventsSearchProviderTest.php @@ -18,27 +18,19 @@ use OCP\Search\IFilter; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; use OCP\Search\SearchResultEntry; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\VObject\Reader; use Test\TestCase; class EventsSearchProviderTest extends TestCase { - /** @var IAppManager|\PHPUnit\Framework\MockObject\MockObject */ - private $appManager; - - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - private $l10n; - - /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */ - private $urlGenerator; - - /** @var CalDavBackend|\PHPUnit\Framework\MockObject\MockObject */ - private $backend; - - /** @var EventsSearchProvider */ - private $provider; + private IAppManager&MockObject $appManager; + private IL10N&MockObject $l10n; + private IURLGenerator&MockObject $urlGenerator; + private CalDavBackend&MockObject $backend; + private EventsSearchProvider $provider; // NO SUMMARY - private $vEvent0 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vEvent0 = 'BEGIN:VCALENDAR' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . 'CALSCALE:GREGORIAN' . PHP_EOL . @@ -54,7 +46,7 @@ class EventsSearchProviderTest extends TestCase { 'END:VCALENDAR'; // TIMED SAME DAY - private $vEvent1 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vEvent1 = 'BEGIN:VCALENDAR' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'PRODID:-//Tests//' . PHP_EOL . 'CALSCALE:GREGORIAN' . PHP_EOL . @@ -88,7 +80,7 @@ class EventsSearchProviderTest extends TestCase { 'END:VCALENDAR'; // TIMED DIFFERENT DAY - private $vEvent2 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vEvent2 = 'BEGIN:VCALENDAR' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'PRODID:-//Tests//' . PHP_EOL . 'CALSCALE:GREGORIAN' . PHP_EOL . @@ -122,7 +114,7 @@ class EventsSearchProviderTest extends TestCase { 'END:VCALENDAR'; // ALL-DAY ONE-DAY - private $vEvent3 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vEvent3 = 'BEGIN:VCALENDAR' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . 'CALSCALE:GREGORIAN' . PHP_EOL . @@ -138,7 +130,7 @@ class EventsSearchProviderTest extends TestCase { 'END:VCALENDAR'; // ALL-DAY MULTIPLE DAYS - private $vEvent4 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vEvent4 = 'BEGIN:VCALENDAR' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . 'CALSCALE:GREGORIAN' . PHP_EOL . @@ -154,7 +146,7 @@ class EventsSearchProviderTest extends TestCase { 'END:VCALENDAR'; // DURATION - private $vEvent5 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vEvent5 = 'BEGIN:VCALENDAR' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . 'CALSCALE:GREGORIAN' . PHP_EOL . @@ -170,7 +162,7 @@ class EventsSearchProviderTest extends TestCase { 'END:VCALENDAR'; // NO DTEND - DATE - private $vEvent6 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vEvent6 = 'BEGIN:VCALENDAR' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'PRODID:-//Apple Inc.//Mac OS X 10.11.6//EN' . PHP_EOL . 'CALSCALE:GREGORIAN' . PHP_EOL . @@ -185,7 +177,7 @@ class EventsSearchProviderTest extends TestCase { 'END:VCALENDAR'; // NO DTEND - DATE-TIME - private $vEvent7 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vEvent7 = 'BEGIN:VCALENDAR' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'PRODID:-//Tests//' . PHP_EOL . 'CALSCALE:GREGORIAN' . PHP_EOL . @@ -327,19 +319,19 @@ class EventsSearchProviderTest extends TestCase { 'calendarid' => 99, 'calendartype' => CalDavBackend::CALENDAR_TYPE_CALENDAR, 'uri' => 'event0.ics', - 'calendardata' => $this->vEvent0, + 'calendardata' => self::$vEvent0, ], [ 'calendarid' => 123, 'calendartype' => CalDavBackend::CALENDAR_TYPE_CALENDAR, 'uri' => 'event1.ics', - 'calendardata' => $this->vEvent1, + 'calendardata' => self::$vEvent1, ], [ 'calendarid' => 1337, 'calendartype' => CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION, 'uri' => 'event2.ics', - 'calendardata' => $this->vEvent2, + 'calendardata' => self::$vEvent2, ] ]); @@ -350,7 +342,7 @@ class EventsSearchProviderTest extends TestCase { $this->urlGenerator, $this->backend, ]) - ->setMethods([ + ->onlyMethods([ 'getDeepLinkToCalendarApp', 'generateSubline', ]) @@ -361,12 +353,11 @@ class EventsSearchProviderTest extends TestCase { ->willReturn('subline'); $provider->expects($this->exactly(3)) ->method('getDeepLinkToCalendarApp') - ->withConsecutive( - ['principals/users/john.doe', 'calendar-uri-99', 'event0.ics'], - ['principals/users/john.doe', 'calendar-uri-123', 'event1.ics'], - ['principals/users/john.doe', 'subscription-uri-1337', 'event2.ics'] - ) - ->willReturn('deep-link-to-calendar'); + ->willReturnMap([ + ['principals/users/john.doe', 'calendar-uri-99', 'event0.ics', 'deep-link-to-calendar'], + ['principals/users/john.doe', 'calendar-uri-123', 'event1.ics', 'deep-link-to-calendar'], + ['principals/users/john.doe', 'subscription-uri-1337', 'event2.ics', 'deep-link-to-calendar'] + ]); $actual = $provider->search($user, $query); $data = $actual->jsonSerialize(); @@ -428,9 +419,6 @@ class EventsSearchProviderTest extends TestCase { } /** - * @param string $ics - * @param string $expectedSubline - * * @dataProvider generateSublineDataProvider */ public function testGenerateSubline(string $ics, string $expectedSubline): void { @@ -450,15 +438,15 @@ class EventsSearchProviderTest extends TestCase { $this->assertEquals($expectedSubline, $actual); } - public function generateSublineDataProvider(): array { + public static function generateSublineDataProvider(): array { return [ - [$this->vEvent1, '08-16 09:00 - 10:00'], - [$this->vEvent2, '08-16 09:00 - 08-17 10:00'], - [$this->vEvent3, '10-05'], - [$this->vEvent4, '10-05 - 10-07'], - [$this->vEvent5, '10-05 - 10-09'], - [$this->vEvent6, '10-05'], - [$this->vEvent7, '08-16 09:00 - 09:00'], + [self::$vEvent1, '08-16 09:00 - 10:00'], + [self::$vEvent2, '08-16 09:00 - 08-17 10:00'], + [self::$vEvent3, '10-05'], + [self::$vEvent4, '10-05 - 10-07'], + [self::$vEvent5, '10-05 - 10-09'], + [self::$vEvent6, '10-05'], + [self::$vEvent7, '08-16 09:00 - 09:00'], ]; } } diff --git a/apps/dav/tests/unit/Search/TasksSearchProviderTest.php b/apps/dav/tests/unit/Search/TasksSearchProviderTest.php index de4e29058da..bd242080547 100644 --- a/apps/dav/tests/unit/Search/TasksSearchProviderTest.php +++ b/apps/dav/tests/unit/Search/TasksSearchProviderTest.php @@ -17,28 +17,19 @@ use OCP\IUser; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; use OCP\Search\SearchResultEntry; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\VObject\Reader; use Test\TestCase; class TasksSearchProviderTest extends TestCase { - - /** @var IAppManager|\PHPUnit\Framework\MockObject\MockObject */ - private $appManager; - - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - private $l10n; - - /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */ - private $urlGenerator; - - /** @var CalDavBackend|\PHPUnit\Framework\MockObject\MockObject */ - private $backend; - - /** @var TasksSearchProvider */ - private $provider; + private IAppManager&MockObject $appManager; + private IL10N&MockObject $l10n; + private IURLGenerator&MockObject $urlGenerator; + private CalDavBackend&MockObject $backend; + private TasksSearchProvider $provider; // NO DUE NOR COMPLETED NOR SUMMARY - private $vTodo0 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vTodo0 = 'BEGIN:VCALENDAR' . PHP_EOL . 'PRODID:TEST' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'BEGIN:VTODO' . PHP_EOL . @@ -49,7 +40,7 @@ class TasksSearchProviderTest extends TestCase { 'END:VCALENDAR'; // DUE AND COMPLETED - private $vTodo1 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vTodo1 = 'BEGIN:VCALENDAR' . PHP_EOL . 'PRODID:TEST' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'BEGIN:VTODO' . PHP_EOL . @@ -63,7 +54,7 @@ class TasksSearchProviderTest extends TestCase { 'END:VCALENDAR'; // COMPLETED ONLY - private $vTodo2 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vTodo2 = 'BEGIN:VCALENDAR' . PHP_EOL . 'PRODID:TEST' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'BEGIN:VTODO' . PHP_EOL . @@ -76,7 +67,7 @@ class TasksSearchProviderTest extends TestCase { 'END:VCALENDAR'; // DUE DATE - private $vTodo3 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vTodo3 = 'BEGIN:VCALENDAR' . PHP_EOL . 'PRODID:TEST' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'BEGIN:VTODO' . PHP_EOL . @@ -89,7 +80,7 @@ class TasksSearchProviderTest extends TestCase { 'END:VCALENDAR'; // DUE DATETIME - private $vTodo4 = 'BEGIN:VCALENDAR' . PHP_EOL . + private static string $vTodo4 = 'BEGIN:VCALENDAR' . PHP_EOL . 'PRODID:TEST' . PHP_EOL . 'VERSION:2.0' . PHP_EOL . 'BEGIN:VTODO' . PHP_EOL . @@ -204,19 +195,19 @@ class TasksSearchProviderTest extends TestCase { 'calendarid' => 99, 'calendartype' => CalDavBackend::CALENDAR_TYPE_CALENDAR, 'uri' => 'todo0.ics', - 'calendardata' => $this->vTodo0, + 'calendardata' => self::$vTodo0, ], [ 'calendarid' => 123, 'calendartype' => CalDavBackend::CALENDAR_TYPE_CALENDAR, 'uri' => 'todo1.ics', - 'calendardata' => $this->vTodo1, + 'calendardata' => self::$vTodo1, ], [ 'calendarid' => 1337, 'calendartype' => CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION, 'uri' => 'todo2.ics', - 'calendardata' => $this->vTodo2, + 'calendardata' => self::$vTodo2, ] ]); @@ -227,7 +218,7 @@ class TasksSearchProviderTest extends TestCase { $this->urlGenerator, $this->backend, ]) - ->setMethods([ + ->onlyMethods([ 'getDeepLinkToTasksApp', 'generateSubline', ]) @@ -238,12 +229,11 @@ class TasksSearchProviderTest extends TestCase { ->willReturn('subline'); $provider->expects($this->exactly(3)) ->method('getDeepLinkToTasksApp') - ->withConsecutive( - ['calendar-uri-99', 'todo0.ics'], - ['calendar-uri-123', 'todo1.ics'], - ['subscription-uri-1337', 'todo2.ics'] - ) - ->willReturn('deep-link-to-tasks'); + ->willReturnMap([ + ['calendar-uri-99', 'todo0.ics', 'deep-link-to-tasks'], + ['calendar-uri-123', 'todo1.ics', 'deep-link-to-tasks'], + ['subscription-uri-1337', 'todo2.ics', 'deep-link-to-tasks'] + ]); $actual = $provider->search($user, $query); $data = $actual->jsonSerialize(); @@ -300,9 +290,6 @@ class TasksSearchProviderTest extends TestCase { } /** - * @param string $ics - * @param string $expectedSubline - * * @dataProvider generateSublineDataProvider */ public function testGenerateSubline(string $ics, string $expectedSubline): void { @@ -310,19 +297,19 @@ class TasksSearchProviderTest extends TestCase { $taskComponent = $vCalendar->VTODO; $this->l10n->method('t')->willReturnArgument(0); - $this->l10n->method('l')->willReturnArgument(''); + $this->l10n->method('l')->willReturnArgument(0); $actual = self::invokePrivate($this->provider, 'generateSubline', [$taskComponent]); $this->assertEquals($expectedSubline, $actual); } - public function generateSublineDataProvider(): array { + public static function generateSublineDataProvider(): array { return [ - [$this->vTodo0, ''], - [$this->vTodo1, 'Completed on %s'], - [$this->vTodo2, 'Completed on %s'], - [$this->vTodo3, 'Due on %s'], - [$this->vTodo4, 'Due on %s by %s'], + [self::$vTodo0, ''], + [self::$vTodo1, 'Completed on %s'], + [self::$vTodo2, 'Completed on %s'], + [self::$vTodo3, 'Due on %s'], + [self::$vTodo4, 'Due on %s by %s'], ]; } } diff --git a/apps/dav/tests/unit/ServerTest.php b/apps/dav/tests/unit/ServerTest.php index 16e0a5b80aa..0baef015056 100644 --- a/apps/dav/tests/unit/ServerTest.php +++ b/apps/dav/tests/unit/ServerTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -22,7 +23,7 @@ class ServerTest extends \Test\TestCase { /** * @dataProvider providesUris */ - public function test($uri, array $plugins): void { + public function test(string $uri, array $plugins): void { /** @var IRequest | \PHPUnit\Framework\MockObject\MockObject $r */ $r = $this->createMock(IRequest::class); $r->expects($this->any())->method('getRequestUri')->willReturn($uri); @@ -33,7 +34,7 @@ class ServerTest extends \Test\TestCase { $this->assertNotNull($s->server->getPlugin($plugin)); } } - public function providesUris() { + public static function providesUris(): array { return [ 'principals' => ['principals/users/admin', ['caldav', 'oc-resource-sharing', 'carddav']], 'calendars' => ['calendars/admin', ['caldav', 'oc-resource-sharing']], diff --git a/apps/dav/tests/unit/Service/AbsenceServiceTest.php b/apps/dav/tests/unit/Service/AbsenceServiceTest.php index 5cff29a6f61..c16c715d5c2 100644 --- a/apps/dav/tests/unit/Service/AbsenceServiceTest.php +++ b/apps/dav/tests/unit/Service/AbsenceServiceTest.php @@ -7,7 +7,7 @@ declare(strict_types=1); * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\dav\tests\unit\Service; +namespace OCA\DAV\Tests\unit\Service; use DateTimeImmutable; use DateTimeZone; @@ -24,25 +24,16 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\IUser; use OCP\User\Events\OutOfOfficeChangedEvent; use OCP\User\Events\OutOfOfficeScheduledEvent; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class AbsenceServiceTest extends TestCase { private AbsenceService $absenceService; - - /** @var MockObject|AbsenceMapper */ - private $absenceMapper; - - /** @var MockObject|IEventDispatcher */ - private $eventDispatcher; - - /** @var MockObject|IJobList */ - private $jobList; - - /** @var MockObject|TimezoneService */ - private $timezoneService; - - /** @var MockObject|ITimeFactory */ - private $timeFactory; + private AbsenceMapper&MockObject $absenceMapper; + private IEventDispatcher&MockObject $eventDispatcher; + private IJobList&MockObject $jobList; + private TimezoneService&MockObject $timezoneService; + private ITimeFactory&MockObject $timeFactory; protected function setUp(): void { parent::setUp(); diff --git a/apps/dav/tests/unit/Service/DefaultContactServiceTest.php b/apps/dav/tests/unit/Service/DefaultContactServiceTest.php index 68bbc02ed08..3bd8c9cb6f6 100644 --- a/apps/dav/tests/unit/Service/DefaultContactServiceTest.php +++ b/apps/dav/tests/unit/Service/DefaultContactServiceTest.php @@ -7,7 +7,7 @@ declare(strict_types=1); * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\Service; +namespace OCA\DAV\Tests\unit\Service; use OCA\DAV\CardDAV\CardDavBackend; use OCA\DAV\Service\DefaultContactService; @@ -24,12 +24,12 @@ use Symfony\Component\Uid\Uuid; use Test\TestCase; class DefaultContactServiceTest extends TestCase { - private DefaultContactService $service; - private MockObject|CardDavBackend $cardDav; - private MockObject|IAppManager $appManager; - private MockObject|IAppDataFactory $appDataFactory; - private MockObject|LoggerInterface $logger; - private MockObject|IAppConfig $config; + protected DefaultContactService $service; + protected CardDavBackend&MockObject $cardDav; + protected IAppManager&MockObject $appManager; + protected IAppDataFactory&MockObject $appDataFactory; + protected LoggerInterface&MockObject $logger; + protected IAppConfig&MockObject $config; protected function setUp(): void { parent::setUp(); @@ -84,7 +84,7 @@ class DefaultContactServiceTest extends TestCase { $folder->method('getFile')->willReturn($file); $appData->method('getFolder')->willReturn($folder); $this->appDataFactory->method('get')->willReturn($appData); - + $capturedCardData = null; $this->cardDav->expects($this->once()) ->method('createCard') @@ -97,9 +97,9 @@ class DefaultContactServiceTest extends TestCase { }), $this->anything() )->willReturn(null); - + $this->service->createDefaultContact(123); - + $vcard = \Sabre\VObject\Reader::read($capturedCardData); $this->assertNotEquals($originalUid, $vcard->UID->getValue()); $this->assertTrue(Uuid::isValid($vcard->UID->getValue())); diff --git a/apps/dav/tests/unit/Service/UpcomingEventsServiceTest.php b/apps/dav/tests/unit/Service/UpcomingEventsServiceTest.php index ecb0268c8c2..fdfe37d8918 100644 --- a/apps/dav/tests/unit/Service/UpcomingEventsServiceTest.php +++ b/apps/dav/tests/unit/Service/UpcomingEventsServiceTest.php @@ -7,7 +7,7 @@ declare(strict_types=1); * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\DAV\Service; +namespace OCA\DAV\Tests\unit\DAV\Service; use DateTimeImmutable; use OCA\DAV\CalDAV\UpcomingEventsService; @@ -22,11 +22,11 @@ use PHPUnit\Framework\TestCase; class UpcomingEventsServiceTest extends TestCase { - private MockObject|IManager $calendarManager; - private ITimeFactory|MockObject $timeFactory; - private IUserManager|MockObject $userManager; - private IAppManager|MockObject $appManager; - private IURLGenerator|MockObject $urlGenerator; + private IManager&MockObject $calendarManager; + private ITimeFactory&MockObject $timeFactory; + private IUserManager&MockObject $userManager; + private IAppManager&MockObject $appManager; + private IURLGenerator&MockObject $urlGenerator; private UpcomingEventsService $service; protected function setUp(): void { diff --git a/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php b/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php index 9f2d2582884..df7a08d5d08 100644 --- a/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php +++ b/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php @@ -1,9 +1,11 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\DAV\Tests\Unit\DAV\Settings; +namespace OCA\DAV\Tests\unit\DAV\Settings; use OCA\DAV\Settings\CalDAVSettings; use OCP\App\IAppManager; @@ -15,19 +17,10 @@ use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class CalDAVSettingsTest extends TestCase { - - /** @var IConfig|MockObject */ - private $config; - - /** @var IInitialState|MockObject */ - private $initialState; - - /** @var IURLGenerator|MockObject */ - private $urlGenerator; - - /** @var IAppManager|MockObject */ - private $appManager; - + private IConfig&MockObject $config; + private IInitialState&MockObject $initialState; + private IURLGenerator&MockObject $urlGenerator; + private IAppManager&MockObject $appManager; private CalDAVSettings $settings; protected function setUp(): void { @@ -42,28 +35,32 @@ class CalDAVSettingsTest extends TestCase { public function testGetForm(): void { $this->config->method('getAppValue') - ->withConsecutive( - ['dav', 'sendInvitations', 'yes'], - ['dav', 'generateBirthdayCalendar', 'yes'], - ['dav', 'sendEventReminders', 'yes'], - ['dav', 'sendEventRemindersToSharedUsers', 'yes'], - ['dav', 'sendEventRemindersPush', 'yes'], - ) - ->will($this->onConsecutiveCalls('yes', 'no', 'yes', 'yes', 'yes')); + ->willReturnMap([ + ['dav', 'sendInvitations', 'yes', 'yes'], + ['dav', 'generateBirthdayCalendar', 'yes', 'no'], + ['dav', 'sendEventReminders', 'yes', 'yes'], + ['dav', 'sendEventRemindersToSharedUsers', 'yes', 'yes'], + ['dav', 'sendEventRemindersPush', 'yes', 'yes'], + ]); $this->urlGenerator ->expects($this->once()) ->method('linkToDocs') ->with('user-sync-calendars') ->willReturn('Some docs URL'); + + $calls = [ + ['userSyncCalendarsDocUrl', 'Some docs URL'], + ['sendInvitations', true], + ['generateBirthdayCalendar', false], + ['sendEventReminders', true], + ['sendEventRemindersToSharedUsers', true], + ['sendEventRemindersPush', true], + ]; $this->initialState->method('provideInitialState') - ->withConsecutive( - ['userSyncCalendarsDocUrl', 'Some docs URL'], - ['sendInvitations', true], - ['generateBirthdayCalendar', false], - ['sendEventReminders', true], - ['sendEventRemindersToSharedUsers', true], - ['sendEventRemindersPush', true], - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); $result = $this->settings->getForm(); $this->assertInstanceOf(TemplateResponse::class, $result); @@ -88,5 +85,4 @@ class CalDAVSettingsTest extends TestCase { public function testGetPriority(): void { $this->assertEquals(10, $this->settings->getPriority()); } - } diff --git a/apps/dav/tests/unit/SystemTag/SystemTagMappingNodeTest.php b/apps/dav/tests/unit/SystemTag/SystemTagMappingNodeTest.php index ed830685b7a..0096b188291 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagMappingNodeTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagMappingNodeTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -14,30 +15,28 @@ use OCP\SystemTag\ISystemTag; use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\ISystemTagObjectMapper; use OCP\SystemTag\TagNotFoundException; +use PHPUnit\Framework\MockObject\MockObject; class SystemTagMappingNodeTest extends \Test\TestCase { - private ISystemTagManager $tagManager; - private ISystemTagObjectMapper $tagMapper; - private IUser $user; + private ISystemTagManager&MockObject $tagManager; + private ISystemTagObjectMapper&MockObject $tagMapper; + private IUser&MockObject $user; protected function setUp(): void { parent::setUp(); - $this->tagManager = $this->getMockBuilder(ISystemTagManager::class) - ->getMock(); - $this->tagMapper = $this->getMockBuilder(ISystemTagObjectMapper::class) - ->getMock(); - $this->user = $this->getMockBuilder(IUser::class) - ->getMock(); + $this->tagManager = $this->createMock(ISystemTagManager::class); + $this->tagMapper = $this->createMock(ISystemTagObjectMapper::class); + $this->user = $this->createMock(IUser::class); } public function getMappingNode($tag = null, array $writableNodeIds = []) { if ($tag === null) { - $tag = new SystemTag(1, 'Test', true, true); + $tag = new SystemTag('1', 'Test', true, true); } return new SystemTagMappingNode( $tag, - 123, + '123', 'files', $this->user, $this->tagManager, @@ -47,7 +46,7 @@ class SystemTagMappingNodeTest extends \Test\TestCase { } public function testGetters(): void { - $tag = new SystemTag(1, 'Test', true, false); + $tag = new SystemTag('1', 'Test', true, false); $node = $this->getMappingNode($tag); $this->assertEquals('1', $node->getName()); $this->assertEquals($tag, $node->getSystemTag()); @@ -93,16 +92,16 @@ class SystemTagMappingNodeTest extends \Test\TestCase { $node->delete(); } - public function tagNodeDeleteProviderPermissionException() { + public static function tagNodeDeleteProviderPermissionException(): array { return [ [ // cannot unassign invisible tag - new SystemTag(1, 'Original', false, true), + new SystemTag('1', 'Original', false, true), 'Sabre\DAV\Exception\NotFound', ], [ // cannot unassign non-assignable tag - new SystemTag(1, 'Original', true, false), + new SystemTag('1', 'Original', true, false), 'Sabre\DAV\Exception\Forbidden', ], ]; @@ -141,7 +140,7 @@ class SystemTagMappingNodeTest extends \Test\TestCase { // assuming the tag existed at the time the node was created, // but got deleted concurrently in the database - $tag = new SystemTag(1, 'Test', true, true); + $tag = new SystemTag('1', 'Test', true, true); $this->tagManager->expects($this->once()) ->method('canUserSeeTag') ->with($tag) diff --git a/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php b/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php index 32ee733dce8..642cc21319b 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -15,39 +16,25 @@ use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\ISystemTagObjectMapper; use OCP\SystemTag\TagAlreadyExistsException; use OCP\SystemTag\TagNotFoundException; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Exception\Forbidden; class SystemTagNodeTest extends \Test\TestCase { - - /** - * @var ISystemTagManager|\PHPUnit\Framework\MockObject\MockObject - */ - private $tagManager; - - /** - * @var ISystemTagObjectMapper|\PHPUnit\Framework\MockObject\MockObject - */ - private $tagMapper; - - /** - * @var IUser - */ - private $user; + private ISystemTagManager&MockObject $tagManager; + private ISystemTagObjectMapper&MockObject $tagMapper; + private IUser&MockObject $user; protected function setUp(): void { parent::setUp(); - $this->tagManager = $this->getMockBuilder(ISystemTagManager::class) - ->getMock(); - $this->tagMapper = $this->getMockBuilder(ISystemTagObjectMapper::class) - ->getMock(); - $this->user = $this->getMockBuilder(IUser::class) - ->getMock(); + $this->tagManager = $this->createMock(ISystemTagManager::class); + $this->tagMapper = $this->createMock(ISystemTagObjectMapper::class); + $this->user = $this->createMock(IUser::class); } protected function getTagNode($isAdmin = true, $tag = null) { if ($tag === null) { - $tag = new SystemTag(1, 'Test', true, true); + $tag = new SystemTag('1', 'Test', true, true); } return new SystemTagNode( $tag, @@ -58,14 +45,14 @@ class SystemTagNodeTest extends \Test\TestCase { ); } - public function adminFlagProvider() { + public static function adminFlagProvider(): array { return [[true], [false]]; } /** * @dataProvider adminFlagProvider */ - public function testGetters($isAdmin): void { + public function testGetters(bool $isAdmin): void { $tag = new SystemTag('1', 'Test', true, true); $node = $this->getTagNode($isAdmin, $tag); $this->assertEquals('1', $node->getName()); @@ -79,24 +66,24 @@ class SystemTagNodeTest extends \Test\TestCase { $this->getTagNode()->setName('2'); } - public function tagNodeProvider() { + public static function tagNodeProvider(): array { return [ // admin [ true, - new SystemTag(1, 'Original', true, true), + new SystemTag('1', 'Original', true, true), ['Renamed', true, true, null] ], [ true, - new SystemTag(1, 'Original', true, true), + new SystemTag('1', 'Original', true, true), ['Original', false, false, null] ], // non-admin [ // renaming allowed false, - new SystemTag(1, 'Original', true, true), + new SystemTag('1', 'Original', true, true), ['Rename', true, true, '0082c9'] ], ]; @@ -105,7 +92,7 @@ class SystemTagNodeTest extends \Test\TestCase { /** * @dataProvider tagNodeProvider */ - public function testUpdateTag($isAdmin, ISystemTag $originalTag, $changedArgs): void { + public function testUpdateTag(bool $isAdmin, ISystemTag $originalTag, array $changedArgs): void { $this->tagManager->expects($this->once()) ->method('canUserSeeTag') ->with($originalTag) @@ -121,41 +108,41 @@ class SystemTagNodeTest extends \Test\TestCase { ->update($changedArgs[0], $changedArgs[1], $changedArgs[2], $changedArgs[3]); } - public function tagNodeProviderPermissionException() { + public static function tagNodeProviderPermissionException(): array { return [ [ // changing permissions not allowed - new SystemTag(1, 'Original', true, true), + new SystemTag('1', 'Original', true, true), ['Original', false, true, ''], 'Sabre\DAV\Exception\Forbidden', ], [ // changing permissions not allowed - new SystemTag(1, 'Original', true, true), + new SystemTag('1', 'Original', true, true), ['Original', true, false, ''], 'Sabre\DAV\Exception\Forbidden', ], [ // changing permissions not allowed - new SystemTag(1, 'Original', true, true), + new SystemTag('1', 'Original', true, true), ['Original', false, false, ''], 'Sabre\DAV\Exception\Forbidden', ], [ // changing non-assignable not allowed - new SystemTag(1, 'Original', true, false), + new SystemTag('1', 'Original', true, false), ['Rename', true, false, ''], 'Sabre\DAV\Exception\Forbidden', ], [ // changing non-assignable not allowed - new SystemTag(1, 'Original', true, false), + new SystemTag('1', 'Original', true, false), ['Original', true, true, ''], 'Sabre\DAV\Exception\Forbidden', ], [ // invisible tag does not exist - new SystemTag(1, 'Original', false, false), + new SystemTag('1', 'Original', false, false), ['Rename', false, false, ''], 'Sabre\DAV\Exception\NotFound', ], @@ -165,7 +152,7 @@ class SystemTagNodeTest extends \Test\TestCase { /** * @dataProvider tagNodeProviderPermissionException */ - public function testUpdateTagPermissionException(ISystemTag $originalTag, $changedArgs, $expectedException = null): void { + public function testUpdateTagPermissionException(ISystemTag $originalTag, array $changedArgs, string $expectedException): void { $this->tagManager->expects($this->any()) ->method('canUserSeeTag') ->with($originalTag) @@ -193,7 +180,7 @@ class SystemTagNodeTest extends \Test\TestCase { public function testUpdateTagAlreadyExists(): void { $this->expectException(\Sabre\DAV\Exception\Conflict::class); - $tag = new SystemTag(1, 'tag1', true, true); + $tag = new SystemTag('1', 'tag1', true, true); $this->tagManager->expects($this->any()) ->method('canUserSeeTag') ->with($tag) @@ -213,7 +200,7 @@ class SystemTagNodeTest extends \Test\TestCase { public function testUpdateTagNotFound(): void { $this->expectException(\Sabre\DAV\Exception\NotFound::class); - $tag = new SystemTag(1, 'tag1', true, true); + $tag = new SystemTag('1', 'tag1', true, true); $this->tagManager->expects($this->any()) ->method('canUserSeeTag') ->with($tag) @@ -232,8 +219,8 @@ class SystemTagNodeTest extends \Test\TestCase { /** * @dataProvider adminFlagProvider */ - public function testDeleteTag($isAdmin): void { - $tag = new SystemTag(1, 'tag1', true, true); + public function testDeleteTag(bool $isAdmin): void { + $tag = new SystemTag('1', 'tag1', true, true); $this->tagManager->expects($isAdmin ? $this->once() : $this->never()) ->method('canUserSeeTag') ->with($tag) @@ -247,16 +234,16 @@ class SystemTagNodeTest extends \Test\TestCase { $this->getTagNode($isAdmin, $tag)->delete(); } - public function tagNodeDeleteProviderPermissionException() { + public static function tagNodeDeleteProviderPermissionException(): array { return [ [ // cannot delete invisible tag - new SystemTag(1, 'Original', false, true), + new SystemTag('1', 'Original', false, true), 'Sabre\DAV\Exception\Forbidden', ], [ // cannot delete non-assignable tag - new SystemTag(1, 'Original', true, false), + new SystemTag('1', 'Original', true, false), 'Sabre\DAV\Exception\Forbidden', ], ]; @@ -265,7 +252,7 @@ class SystemTagNodeTest extends \Test\TestCase { /** * @dataProvider tagNodeDeleteProviderPermissionException */ - public function testDeleteTagPermissionException(ISystemTag $tag, $expectedException): void { + public function testDeleteTagPermissionException(ISystemTag $tag, string $expectedException): void { $this->tagManager->expects($this->any()) ->method('canUserSeeTag') ->with($tag) @@ -281,7 +268,7 @@ class SystemTagNodeTest extends \Test\TestCase { public function testDeleteTagNotFound(): void { $this->expectException(\Sabre\DAV\Exception\NotFound::class); - $tag = new SystemTag(1, 'tag1', true, true); + $tag = new SystemTag('1', 'tag1', true, true); $this->tagManager->expects($this->any()) ->method('canUserSeeTag') ->with($tag) diff --git a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php index ab5253147a7..a9368794cc2 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -20,6 +21,7 @@ use OCP\SystemTag\ISystemTag; use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\ISystemTagObjectMapper; use OCP\SystemTag\TagAlreadyExistsException; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Tree; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; @@ -32,67 +34,26 @@ class SystemTagPluginTest extends \Test\TestCase { public const CANASSIGN_PROPERTYNAME = SystemTagPlugin::CANASSIGN_PROPERTYNAME; public const GROUPS_PROPERTYNAME = SystemTagPlugin::GROUPS_PROPERTYNAME; - /** - * @var \Sabre\DAV\Server - */ - private $server; - - /** - * @var \Sabre\DAV\Tree - */ - private $tree; - - /** - * @var ISystemTagManager - */ - private $tagManager; - - /** - * @var IGroupManager - */ - private $groupManager; - - /** - * @var IUserSession - */ - private $userSession; - - /** - * @var IRootFolder - */ - private $rootFolder; - - /** - * @var IUser - */ - private $user; - - /** - * @var SystemTagPlugin - */ - private $plugin; - - /** - * @var ISystemTagObjectMapper - */ - private $tagMapper; + private \Sabre\DAV\Server $server; + private \Sabre\DAV\Tree&MockObject $tree; + private ISystemTagManager&MockObject $tagManager; + private IGroupManager&MockObject $groupManager; + private IUserSession&MockObject $userSession; + private IRootFolder&MockObject $rootFolder; + private IUser&MockObject $user; + private ISystemTagObjectMapper&MockObject $tagMapper; + private SystemTagPlugin $plugin; protected function setUp(): void { parent::setUp(); - $this->tree = $this->getMockBuilder(Tree::class) - ->disableOriginalConstructor() - ->getMock(); + $this->tree = $this->createMock(Tree::class); $this->server = new \Sabre\DAV\Server($this->tree); - $this->tagManager = $this->getMockBuilder(ISystemTagManager::class) - ->getMock(); - $this->groupManager = $this->getMockBuilder(IGroupManager::class) - ->getMock(); - $this->user = $this->getMockBuilder(IUser::class) - ->getMock(); - $this->userSession = $this->getMockBuilder(IUserSession::class) - ->getMock(); + $this->tagManager = $this->createMock(ISystemTagManager::class); + $this->groupManager = $this->createMock(IGroupManager::class); + $this->user = $this->createMock(IUser::class); + $this->userSession = $this->createMock(IUserSession::class); $this->userSession ->expects($this->any()) ->method('getUser') @@ -102,10 +63,8 @@ class SystemTagPluginTest extends \Test\TestCase { ->method('isLoggedIn') ->willReturn(true); - $this->tagMapper = $this->getMockBuilder(ISystemTagObjectMapper::class) - ->getMock(); - $this->rootFolder = $this->getMockBuilder(IRootFolder::class) - ->getMock(); + $this->tagMapper = $this->createMock(ISystemTagObjectMapper::class); + $this->rootFolder = $this->createMock(IRootFolder::class); $this->plugin = new SystemTagPlugin( $this->tagManager, @@ -117,10 +76,10 @@ class SystemTagPluginTest extends \Test\TestCase { $this->plugin->initialize($this->server); } - public function getPropertiesDataProvider() { + public static function getPropertiesDataProvider(): array { return [ [ - new SystemTag(1, 'Test', true, true), + new SystemTag('1', 'Test', true, true), [], [ self::ID_PROPERTYNAME, @@ -138,7 +97,7 @@ class SystemTagPluginTest extends \Test\TestCase { ] ], [ - new SystemTag(1, 'Test', true, false), + new SystemTag('1', 'Test', true, false), [], [ self::ID_PROPERTYNAME, @@ -156,7 +115,7 @@ class SystemTagPluginTest extends \Test\TestCase { ] ], [ - new SystemTag(1, 'Test', true, false), + new SystemTag('1', 'Test', true, false), ['group1', 'group2'], [ self::ID_PROPERTYNAME, @@ -168,7 +127,7 @@ class SystemTagPluginTest extends \Test\TestCase { ] ], [ - new SystemTag(1, 'Test', true, true), + new SystemTag('1', 'Test', true, true), ['group1', 'group2'], [ self::ID_PROPERTYNAME, @@ -186,7 +145,7 @@ class SystemTagPluginTest extends \Test\TestCase { /** * @dataProvider getPropertiesDataProvider */ - public function testGetProperties(ISystemTag $systemTag, $groups, $requestedProperties, $expectedProperties): void { + public function testGetProperties(ISystemTag $systemTag, array $groups, array $requestedProperties, array $expectedProperties): void { $this->user->expects($this->any()) ->method('getUID') ->willReturn('admin'); @@ -237,7 +196,7 @@ class SystemTagPluginTest extends \Test\TestCase { public function testGetPropertiesForbidden(): void { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); - $systemTag = new SystemTag(1, 'Test', true, false); + $systemTag = new SystemTag('1', 'Test', true, false); $requestedProperties = [ self::ID_PROPERTYNAME, self::GROUPS_PROPERTYNAME, @@ -276,7 +235,7 @@ class SystemTagPluginTest extends \Test\TestCase { } public function testUpdatePropertiesAdmin(): void { - $systemTag = new SystemTag(1, 'Test', true, false); + $systemTag = new SystemTag('1', 'Test', true, false); $this->user->expects($this->any()) ->method('getUID') ->willReturn('admin'); @@ -334,7 +293,7 @@ class SystemTagPluginTest extends \Test\TestCase { public function testUpdatePropertiesForbidden(): void { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); - $systemTag = new SystemTag(1, 'Test', true, false); + $systemTag = new SystemTag('1', 'Test', true, false); $this->user->expects($this->any()) ->method('getUID') ->willReturn('admin'); @@ -375,7 +334,7 @@ class SystemTagPluginTest extends \Test\TestCase { $propPatch->commit(); } - public function createTagInsufficientPermissionsProvider() { + public static function createTagInsufficientPermissionsProvider(): array { return [ [true, false, ''], [false, true, ''], @@ -385,7 +344,7 @@ class SystemTagPluginTest extends \Test\TestCase { /** * @dataProvider createTagInsufficientPermissionsProvider */ - public function testCreateNotAssignableTagAsRegularUser($userVisible, $userAssignable, $groups): void { + public function testCreateNotAssignableTagAsRegularUser(bool $userVisible, bool $userAssignable, string $groups): void { $this->expectException(\Sabre\DAV\Exception\BadRequest::class); $this->expectExceptionMessage('Not sufficient permissions'); @@ -408,9 +367,7 @@ class SystemTagPluginTest extends \Test\TestCase { } $requestData = json_encode($requestData); - $node = $this->getMockBuilder(SystemTagsByIdCollection::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(SystemTagsByIdCollection::class); $this->tagManager->expects($this->never()) ->method('createTag'); $this->tagManager->expects($this->never()) @@ -421,12 +378,8 @@ class SystemTagPluginTest extends \Test\TestCase { ->with('/systemtags') ->willReturn($node); - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $request->expects($this->once()) ->method('getPath') @@ -445,7 +398,7 @@ class SystemTagPluginTest extends \Test\TestCase { } public function testCreateTagInByIdCollectionAsRegularUser(): void { - $systemTag = new SystemTag(1, 'Test', true, false); + $systemTag = new SystemTag('1', 'Test', true, false); $requestData = json_encode([ 'name' => 'Test', @@ -453,9 +406,7 @@ class SystemTagPluginTest extends \Test\TestCase { 'userAssignable' => true, ]); - $node = $this->getMockBuilder(SystemTagsByIdCollection::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(SystemTagsByIdCollection::class); $this->tagManager->expects($this->once()) ->method('createTag') ->with('Test', true, true) @@ -466,12 +417,8 @@ class SystemTagPluginTest extends \Test\TestCase { ->with('/systemtags') ->willReturn($node); - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $request->expects($this->once()) ->method('getPath') @@ -497,7 +444,7 @@ class SystemTagPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - public function createTagProvider() { + public static function createTagProvider(): array { return [ [true, false, ''], [false, false, ''], @@ -508,7 +455,7 @@ class SystemTagPluginTest extends \Test\TestCase { /** * @dataProvider createTagProvider */ - public function testCreateTagInByIdCollection($userVisible, $userAssignable, $groups): void { + public function testCreateTagInByIdCollection(bool $userVisible, bool $userAssignable, string $groups): void { $this->user->expects($this->once()) ->method('getUID') ->willReturn('admin'); @@ -518,7 +465,7 @@ class SystemTagPluginTest extends \Test\TestCase { ->with('admin') ->willReturn(true); - $systemTag = new SystemTag(1, 'Test', true, false); + $systemTag = new SystemTag('1', 'Test', true, false); $requestData = [ 'name' => 'Test', @@ -530,9 +477,7 @@ class SystemTagPluginTest extends \Test\TestCase { } $requestData = json_encode($requestData); - $node = $this->getMockBuilder(SystemTagsByIdCollection::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(SystemTagsByIdCollection::class); $this->tagManager->expects($this->once()) ->method('createTag') ->with('Test', $userVisible, $userAssignable) @@ -553,12 +498,8 @@ class SystemTagPluginTest extends \Test\TestCase { ->with('/systemtags') ->willReturn($node); - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $request->expects($this->once()) ->method('getPath') @@ -584,7 +525,7 @@ class SystemTagPluginTest extends \Test\TestCase { $this->plugin->httpPost($request, $response); } - public function nodeClassProvider() { + public static function nodeClassProvider(): array { return [ ['\OCA\DAV\SystemTag\SystemTagsByIdCollection'], ['\OCA\DAV\SystemTag\SystemTagsObjectMappingCollection'], @@ -601,7 +542,7 @@ class SystemTagPluginTest extends \Test\TestCase { ->with('admin') ->willReturn(true); - $systemTag = new SystemTag(1, 'Test', true, false); + $systemTag = new SystemTag('1', 'Test', true, false); $requestData = json_encode([ 'name' => 'Test', @@ -609,9 +550,7 @@ class SystemTagPluginTest extends \Test\TestCase { 'userAssignable' => false, ]); - $node = $this->getMockBuilder(SystemTagsObjectMappingCollection::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(SystemTagsObjectMappingCollection::class); $this->tagManager->expects($this->once()) ->method('createTag') @@ -627,12 +566,8 @@ class SystemTagPluginTest extends \Test\TestCase { ->method('createFile') ->with(1); - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $request->expects($this->once()) ->method('getPath') @@ -662,9 +597,7 @@ class SystemTagPluginTest extends \Test\TestCase { public function testCreateTagToUnknownNode(): void { $this->expectException(\Sabre\DAV\Exception\NotFound::class); - $node = $this->getMockBuilder(SystemTagsObjectMappingCollection::class) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock(SystemTagsObjectMappingCollection::class); $this->tree->expects($this->any()) ->method('getNodeForPath') @@ -676,12 +609,8 @@ class SystemTagPluginTest extends \Test\TestCase { $node->expects($this->never()) ->method('createFile'); - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $request->expects($this->once()) ->method('getPath') @@ -693,7 +622,7 @@ class SystemTagPluginTest extends \Test\TestCase { /** * @dataProvider nodeClassProvider */ - public function testCreateTagConflict($nodeClass): void { + public function testCreateTagConflict(string $nodeClass): void { $this->expectException(\Sabre\DAV\Exception\Conflict::class); $this->user->expects($this->once()) @@ -711,9 +640,7 @@ class SystemTagPluginTest extends \Test\TestCase { 'userAssignable' => false, ]); - $node = $this->getMockBuilder($nodeClass) - ->disableOriginalConstructor() - ->getMock(); + $node = $this->createMock($nodeClass); $this->tagManager->expects($this->once()) ->method('createTag') ->with('Test', true, false) @@ -724,12 +651,8 @@ class SystemTagPluginTest extends \Test\TestCase { ->with('/systemtags') ->willReturn($node); - $request = $this->getMockBuilder(RequestInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $request = $this->createMock(RequestInterface::class); + $response = $this->createMock(ResponseInterface::class); $request->expects($this->once()) ->method('getPath') diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php index b26171650a2..a6c97af26b4 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -18,50 +19,36 @@ use OCP\SystemTag\TagNotFoundException; use PHPUnit\Framework\MockObject\MockObject; class SystemTagsByIdCollectionTest extends \Test\TestCase { - - /** - * @var ISystemTagManager - */ - private $tagManager; - - /** - * @var IUser - */ - private $user; + private ISystemTagManager&MockObject $tagManager; + private IUser&MockObject $user; protected function setUp(): void { parent::setUp(); - $this->tagManager = $this->getMockBuilder(ISystemTagManager::class) - ->getMock(); + $this->tagManager = $this->createMock(ISystemTagManager::class); } - public function getNode($isAdmin = true) { - $this->user = $this->getMockBuilder(IUser::class) - ->getMock(); + public function getNode(bool $isAdmin = true) { + $this->user = $this->createMock(IUser::class); $this->user->expects($this->any()) ->method('getUID') ->willReturn('testuser'); - /** @var IUserSession|MockObject */ - $userSession = $this->getMockBuilder(IUserSession::class) - ->getMock(); + /** @var IUserSession&MockObject */ + $userSession = $this->createMock(IUserSession::class); $userSession->expects($this->any()) ->method('getUser') ->willReturn($this->user); - /** @var IGroupManager|MockObject */ - $groupManager = $this->getMockBuilder(IGroupManager::class) - ->getMock(); + /** @var IGroupManager&MockObject */ + $groupManager = $this->createMock(IGroupManager::class); $groupManager->expects($this->any()) ->method('isAdmin') ->with('testuser') ->willReturn($isAdmin); - /** @var ISystemTagObjectMapper|MockObject */ - $tagMapper = $this->getMockBuilder(ISystemTagObjectMapper::class) - ->getMock(); - + /** @var ISystemTagObjectMapper&MockObject */ + $tagMapper = $this->createMock(ISystemTagObjectMapper::class); return new SystemTagsByIdCollection( $this->tagManager, $userSession, @@ -70,18 +57,18 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { ); } - public function adminFlagProvider() { + public static function adminFlagProvider(): array { return [[true], [false]]; } - + public function testForbiddenCreateFile(): void { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->getNode()->createFile('555'); } - + public function testForbiddenCreateDirectory(): void { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -89,7 +76,7 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { } public function testGetChild(): void { - $tag = new SystemTag(123, 'Test', true, false); + $tag = new SystemTag('123', 'Test', true, false); $this->tagManager->expects($this->once()) ->method('canUserSeeTag') ->with($tag) @@ -107,7 +94,7 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { $this->assertEquals($tag, $childNode->getSystemTag()); } - + public function testGetChildInvalidName(): void { $this->expectException(\Sabre\DAV\Exception\BadRequest::class); @@ -119,7 +106,7 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { $this->getNode()->getChild('invalid'); } - + public function testGetChildNotFound(): void { $this->expectException(\Sabre\DAV\Exception\NotFound::class); @@ -131,11 +118,11 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { $this->getNode()->getChild('444'); } - + public function testGetChildUserNotVisible(): void { $this->expectException(\Sabre\DAV\Exception\NotFound::class); - $tag = new SystemTag(123, 'Test', false, false); + $tag = new SystemTag('123', 'Test', false, false); $this->tagManager->expects($this->once()) ->method('getTagsByIds') @@ -146,8 +133,8 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { } public function testGetChildrenAdmin(): void { - $tag1 = new SystemTag(123, 'One', true, false); - $tag2 = new SystemTag(456, 'Two', true, true); + $tag1 = new SystemTag('123', 'One', true, false); + $tag2 = new SystemTag('456', 'Two', true, true); $this->tagManager->expects($this->once()) ->method('getAllTags') @@ -165,8 +152,8 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { } public function testGetChildrenNonAdmin(): void { - $tag1 = new SystemTag(123, 'One', true, false); - $tag2 = new SystemTag(456, 'Two', true, true); + $tag1 = new SystemTag('123', 'One', true, false); + $tag2 = new SystemTag('456', 'Two', true, true); $this->tagManager->expects($this->once()) ->method('getAllTags') @@ -191,7 +178,7 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { $this->assertCount(0, $this->getNode()->getChildren()); } - public function childExistsProvider() { + public static function childExistsProvider(): array { return [ [true, true], [false, false], @@ -201,8 +188,8 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { /** * @dataProvider childExistsProvider */ - public function testChildExists($userVisible, $expectedResult): void { - $tag = new SystemTag(123, 'One', $userVisible, false); + public function testChildExists(bool $userVisible, bool $expectedResult): void { + $tag = new SystemTag('123', 'One', $userVisible, false); $this->tagManager->expects($this->once()) ->method('canUserSeeTag') ->with($tag) @@ -225,7 +212,7 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { $this->assertFalse($this->getNode()->childExists('123')); } - + public function testChildExistsBadRequest(): void { $this->expectException(\Sabre\DAV\Exception\BadRequest::class); diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php index 66052847f16..59cd3955f1f 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -13,27 +14,24 @@ use OCP\IUser; use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\ISystemTagObjectMapper; use OCP\SystemTag\TagNotFoundException; +use PHPUnit\Framework\MockObject\MockObject; class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { - private ISystemTagManager $tagManager; - private ISystemTagObjectMapper $tagMapper; - private IUser $user; + private ISystemTagManager&MockObject $tagManager; + private ISystemTagObjectMapper&MockObject $tagMapper; + private IUser&MockObject $user; protected function setUp(): void { parent::setUp(); - $this->tagManager = $this->getMockBuilder(ISystemTagManager::class) - ->getMock(); - $this->tagMapper = $this->getMockBuilder(ISystemTagObjectMapper::class) - ->getMock(); - - $this->user = $this->getMockBuilder(IUser::class) - ->getMock(); + $this->tagManager = $this->createMock(ISystemTagManager::class); + $this->tagMapper = $this->createMock(ISystemTagObjectMapper::class); + $this->user = $this->createMock(IUser::class); } - public function getNode(array $writableNodeIds = []) { + public function getNode(array $writableNodeIds = []): SystemTagsObjectMappingCollection { return new SystemTagsObjectMappingCollection( - 111, + '111', 'files', $this->user, $this->tagManager, @@ -86,7 +84,7 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { $this->getNode()->createFile('555'); } - public function permissionsProvider() { + public static function permissionsProvider(): array { return [ // invisible, tag does not exist for user [false, true, '\Sabre\DAV\Exception\PreconditionFailed'], @@ -98,7 +96,7 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { /** * @dataProvider permissionsProvider */ - public function testAssignTagNoPermission($userVisible, $userAssignable, $expectedException): void { + public function testAssignTagNoPermission(bool $userVisible, bool $userAssignable, string $expectedException): void { $tag = new SystemTag('1', 'Test', $userVisible, $userAssignable); $this->tagManager->expects($this->once()) ->method('canUserSeeTag') @@ -146,7 +144,7 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { } public function testGetChild(): void { - $tag = new SystemTag(555, 'TheTag', true, false); + $tag = new SystemTag('555', 'TheTag', true, false); $this->tagManager->expects($this->once()) ->method('canUserSeeTag') ->with($tag) @@ -172,7 +170,7 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { public function testGetChildNonVisible(): void { $this->expectException(\Sabre\DAV\Exception\NotFound::class); - $tag = new SystemTag(555, 'TheTag', false, false); + $tag = new SystemTag('555', 'TheTag', false, false); $this->tagManager->expects($this->once()) ->method('canUserSeeTag') ->with($tag) @@ -228,9 +226,9 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { } public function testGetChildren(): void { - $tag1 = new SystemTag(555, 'TagOne', true, false); - $tag2 = new SystemTag(556, 'TagTwo', true, true); - $tag3 = new SystemTag(557, 'InvisibleTag', false, true); + $tag1 = new SystemTag('555', 'TagOne', true, false); + $tag2 = new SystemTag('556', 'TagTwo', true, true); + $tag3 = new SystemTag('557', 'InvisibleTag', false, true); $this->tagMapper->expects($this->once()) ->method('getTagIdsForObjects') @@ -265,7 +263,7 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { } public function testChildExistsWithVisibleTag(): void { - $tag = new SystemTag(555, 'TagOne', true, false); + $tag = new SystemTag('555', 'TagOne', true, false); $this->tagMapper->expects($this->once()) ->method('haveTag') @@ -286,7 +284,7 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { } public function testChildExistsWithInvisibleTag(): void { - $tag = new SystemTag(555, 'TagOne', false, false); + $tag = new SystemTag('555', 'TagOne', false, false); $this->tagMapper->expects($this->once()) ->method('haveTag') diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php index ba9304d33fc..301eb528436 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -15,60 +16,39 @@ use OCP\IUser; use OCP\IUserSession; use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\ISystemTagObjectMapper; +use PHPUnit\Framework\MockObject\MockObject; class SystemTagsObjectTypeCollectionTest extends \Test\TestCase { - - /** - * @var SystemTagsObjectTypeCollection - */ - private $node; - - /** - * @var ISystemTagManager - */ - private $tagManager; - - /** - * @var ISystemTagObjectMapper - */ - private $tagMapper; - - /** - * @var Folder - */ - private $userFolder; + private ISystemTagManager&MockObject $tagManager; + private ISystemTagObjectMapper&MockObject $tagMapper; + private Folder&MockObject $userFolder; + private SystemTagsObjectTypeCollection $node; protected function setUp(): void { parent::setUp(); - $this->tagManager = $this->getMockBuilder(ISystemTagManager::class) - ->getMock(); - $this->tagMapper = $this->getMockBuilder(ISystemTagObjectMapper::class) - ->getMock(); + $this->tagManager = $this->createMock(ISystemTagManager::class); + $this->tagMapper = $this->createMock(ISystemTagObjectMapper::class); - $user = $this->getMockBuilder(IUser::class) - ->getMock(); + $user = $this->createMock(IUser::class); $user->expects($this->any()) ->method('getUID') ->willReturn('testuser'); - $userSession = $this->getMockBuilder(IUserSession::class) - ->getMock(); + $userSession = $this->createMock(IUserSession::class); $userSession->expects($this->any()) ->method('getUser') ->willReturn($user); - $groupManager = $this->getMockBuilder(IGroupManager::class) - ->getMock(); + $groupManager = $this->createMock(IGroupManager::class); $groupManager->expects($this->any()) ->method('isAdmin') ->with('testuser') ->willReturn(true); - $this->userFolder = $this->getMockBuilder(Folder::class) - ->getMock(); + $this->userFolder = $this->createMock(Folder::class); $userFolder = $this->userFolder; $closure = function ($name) use ($userFolder) { - $node = $userFolder->getFirstNodeById(intval($name)); + $node = $userFolder->getFirstNodeById((int)$name); return $node !== null; }; $writeAccessClosure = function ($name) use ($userFolder) { diff --git a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php index 87feebf5d09..00ed7657dd3 100644 --- a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php +++ b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2017 ownCloud GmbH @@ -10,40 +11,24 @@ namespace OCA\DAV\Tests\unit\Upload; use OCA\DAV\Connector\Sabre\Directory; use OCA\DAV\Upload\ChunkingPlugin; use OCA\DAV\Upload\FutureFile; +use PHPUnit\Framework\MockObject\MockObject; use Sabre\DAV\Exception\NotFound; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; use Test\TestCase; class ChunkingPluginTest extends TestCase { - /** - * @var \Sabre\DAV\Server | \PHPUnit\Framework\MockObject\MockObject - */ - private $server; - - /** - * @var \Sabre\DAV\Tree | \PHPUnit\Framework\MockObject\MockObject - */ - private $tree; - - /** - * @var ChunkingPlugin - */ - private $plugin; - /** @var RequestInterface | \PHPUnit\Framework\MockObject\MockObject */ - private $request; - /** @var ResponseInterface | \PHPUnit\Framework\MockObject\MockObject */ - private $response; + private \Sabre\DAV\Server&MockObject $server; + private \Sabre\DAV\Tree&MockObject $tree; + private ChunkingPlugin $plugin; + private RequestInterface&MockObject $request; + private ResponseInterface&MockObject $response; protected function setUp(): void { parent::setUp(); - $this->server = $this->getMockBuilder('\Sabre\DAV\Server') - ->disableOriginalConstructor() - ->getMock(); - $this->tree = $this->getMockBuilder('\Sabre\DAV\Tree') - ->disableOriginalConstructor() - ->getMock(); + $this->server = $this->createMock('\Sabre\DAV\Server'); + $this->tree = $this->createMock('\Sabre\DAV\Tree'); $this->server->tree = $this->tree; $this->plugin = new ChunkingPlugin(); @@ -78,14 +63,10 @@ class ChunkingPluginTest extends TestCase { $this->tree->expects($this->exactly(2)) ->method('getNodeForPath') - ->withConsecutive( - ['source'], - ['target'], - ) - ->willReturnOnConsecutiveCalls( - $sourceNode, - $targetNode, - ); + ->willReturnMap([ + ['source', $sourceNode], + ['target', $targetNode], + ]); $this->response->expects($this->never()) ->method('setStatus'); @@ -98,16 +79,20 @@ class ChunkingPluginTest extends TestCase { ->method('getSize') ->willReturn(4); + $calls = [ + ['source', $sourceNode], + ['target', new NotFound()], + ]; $this->tree->expects($this->exactly(2)) ->method('getNodeForPath') - ->withConsecutive( - ['source'], - ['target'], - ) - ->willReturnOnConsecutiveCalls( - $sourceNode, - $this->throwException(new NotFound()), - ); + ->willReturnCallback(function (string $path) use (&$calls) { + $expected = array_shift($calls); + $this->assertSame($expected[0], $path); + if ($expected[1] instanceof \Throwable) { + throw $expected[1]; + } + return $expected[1]; + }); $this->tree->expects($this->any()) ->method('nodeExists') ->with('target') @@ -132,17 +117,21 @@ class ChunkingPluginTest extends TestCase { ->method('getSize') ->willReturn(4); - + $calls = [ + ['source', $sourceNode], + ['target', new NotFound()], + ]; $this->tree->expects($this->exactly(2)) ->method('getNodeForPath') - ->withConsecutive( - ['source'], - ['target'], - ) - ->willReturnOnConsecutiveCalls( - $sourceNode, - $this->throwException(new NotFound()), - ); + ->willReturnCallback(function (string $path) use (&$calls) { + $expected = array_shift($calls); + $this->assertSame($expected[0], $path); + if ($expected[1] instanceof \Throwable) { + throw $expected[1]; + } + return $expected[1]; + }); + $this->tree->expects($this->any()) ->method('nodeExists') ->with('target') @@ -175,17 +164,21 @@ class ChunkingPluginTest extends TestCase { ->method('getSize') ->willReturn(3); - + $calls = [ + ['source', $sourceNode], + ['target', new NotFound()], + ]; $this->tree->expects($this->exactly(2)) ->method('getNodeForPath') - ->withConsecutive( - ['source'], - ['target'], - ) - ->willReturnOnConsecutiveCalls( - $sourceNode, - $this->throwException(new NotFound()), - ); + ->willReturnCallback(function (string $path) use (&$calls) { + $expected = array_shift($calls); + $this->assertSame($expected[0], $path); + if ($expected[1] instanceof \Throwable) { + throw $expected[1]; + } + return $expected[1]; + }); + $this->request->expects($this->once()) ->method('getHeader') ->with('OC-Total-Length') diff --git a/apps/dav/tests/unit/Upload/FutureFileTest.php b/apps/dav/tests/unit/Upload/FutureFileTest.php index 750670992eb..1409df937c0 100644 --- a/apps/dav/tests/unit/Upload/FutureFileTest.php +++ b/apps/dav/tests/unit/Upload/FutureFileTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -45,7 +46,7 @@ class FutureFileTest extends \Test\TestCase { public function testDelete(): void { $d = $this->getMockBuilder(Directory::class) ->disableOriginalConstructor() - ->setMethods(['delete']) + ->onlyMethods(['delete']) ->getMock(); $d->expects($this->once()) @@ -55,7 +56,7 @@ class FutureFileTest extends \Test\TestCase { $f->delete(); } - + public function testPut(): void { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -63,7 +64,7 @@ class FutureFileTest extends \Test\TestCase { $f->put(''); } - + public function testSetName(): void { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -71,13 +72,10 @@ class FutureFileTest extends \Test\TestCase { $f->setName(''); } - /** - * @return FutureFile - */ - private function mockFutureFile() { + private function mockFutureFile(): FutureFile { $d = $this->getMockBuilder(Directory::class) ->disableOriginalConstructor() - ->setMethods(['getETag', 'getLastModified', 'getChildren']) + ->onlyMethods(['getETag', 'getLastModified', 'getChildren']) ->getMock(); $d->expects($this->any()) diff --git a/apps/encryption/tests/Command/FixEncryptedVersionTest.php b/apps/encryption/tests/Command/FixEncryptedVersionTest.php index 7a69b4bf901..d0af359183b 100644 --- a/apps/encryption/tests/Command/FixEncryptedVersionTest.php +++ b/apps/encryption/tests/Command/FixEncryptedVersionTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2019 ownCloud GmbH @@ -16,6 +18,7 @@ use OCP\IConfig; use OCP\ITempManager; use OCP\IUserManager; use OCP\Server; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Tester\CommandTester; use Test\TestCase; @@ -34,16 +37,13 @@ class FixEncryptedVersionTest extends TestCase { use EncryptionTrait; use UserTrait; - private $userId; + private string $userId; - /** @var FixEncryptedVersion */ - private $fixEncryptedVersion; + private FixEncryptedVersion $fixEncryptedVersion; - /** @var CommandTester */ - private $commandTester; + private CommandTester $commandTester; - /** @var Util|\PHPUnit\Framework\MockObject\MockObject */ - protected $util; + protected Util&MockObject $util; public function setUp(): void { parent::setUp(); diff --git a/apps/encryption/tests/Command/TestEnableMasterKey.php b/apps/encryption/tests/Command/TestEnableMasterKey.php index c4678b778bc..744bbaed6f8 100644 --- a/apps/encryption/tests/Command/TestEnableMasterKey.php +++ b/apps/encryption/tests/Command/TestEnableMasterKey.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. diff --git a/apps/encryption/tests/Controller/RecoveryControllerTest.php b/apps/encryption/tests/Controller/RecoveryControllerTest.php index 9de583b387c..7eff312d6ce 100644 --- a/apps/encryption/tests/Controller/RecoveryControllerTest.php +++ b/apps/encryption/tests/Controller/RecoveryControllerTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -13,26 +15,23 @@ use OCP\AppFramework\Http; use OCP\IConfig; use OCP\IL10N; use OCP\IRequest; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class RecoveryControllerTest extends TestCase { - /** @var RecoveryController */ - private $controller; - /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */ - private $requestMock; - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - private $configMock; - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - private $l10nMock; - /** @var Recovery|\PHPUnit\Framework\MockObject\MockObject */ - private $recoveryMock; - - public function adminRecoveryProvider() { + protected RecoveryController $controller; + + protected IRequest&MockObject $requestMock; + protected IConfig&MockObject $configMock; + protected IL10N&MockObject $l10nMock; + protected Recovery&MockObject $recoveryMock; + + public static function adminRecoveryProvider(): array { return [ ['test', 'test', '1', 'Recovery key successfully enabled', Http::STATUS_OK], ['', 'test', '1', 'Missing recovery key password', Http::STATUS_BAD_REQUEST], ['test', '', '1', 'Please repeat the recovery key password', Http::STATUS_BAD_REQUEST], - ['test', 'soimething that doesn\'t match', '1', 'Repeated recovery key password does not match the provided recovery key password', Http::STATUS_BAD_REQUEST], + ['test', 'something that doesn\'t match', '1', 'Repeated recovery key password does not match the provided recovery key password', Http::STATUS_BAD_REQUEST], ['test', 'test', '0', 'Recovery key successfully disabled', Http::STATUS_OK], ]; } @@ -63,7 +62,7 @@ class RecoveryControllerTest extends TestCase { $this->assertEquals($expectedStatus, $response->getStatus()); } - public function changeRecoveryPasswordProvider() { + public static function changeRecoveryPasswordProvider(): array { return [ ['test', 'test', 'oldtestFail', 'Could not change the password. Maybe the old password was not correct.', Http::STATUS_BAD_REQUEST], ['test', 'test', 'oldtest', 'Password successfully changed.', Http::STATUS_OK], @@ -98,7 +97,7 @@ class RecoveryControllerTest extends TestCase { $this->assertEquals($expectedStatus, $response->getStatus()); } - public function userSetRecoveryProvider() { + public static function userSetRecoveryProvider(): array { return [ ['1', 'Recovery Key enabled', Http::STATUS_OK], ['0', 'Could not enable the recovery key, please try again or contact your administrator', Http::STATUS_BAD_REQUEST] diff --git a/apps/encryption/tests/Controller/SettingsControllerTest.php b/apps/encryption/tests/Controller/SettingsControllerTest.php index b676d57164f..bee20f67cec 100644 --- a/apps/encryption/tests/Controller/SettingsControllerTest.php +++ b/apps/encryption/tests/Controller/SettingsControllerTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -24,37 +26,18 @@ use Test\TestCase; class SettingsControllerTest extends TestCase { - /** @var SettingsController */ - private $controller; - - /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */ - private $requestMock; - - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - private $l10nMock; - - /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ - private $userManagerMock; - - /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */ - private $userSessionMock; - - /** @var KeyManager|\PHPUnit\Framework\MockObject\MockObject */ - private $keyManagerMock; + protected SettingsController $controller; - /** @var Crypt|\PHPUnit\Framework\MockObject\MockObject */ - private $cryptMock; - - /** @var Session|\PHPUnit\Framework\MockObject\MockObject */ - private $sessionMock; - /** @var MockObject|IUser */ - private $user; - - /** @var ISession|\PHPUnit\Framework\MockObject\MockObject */ - private $ocSessionMock; - - /** @var Util|\PHPUnit\Framework\MockObject\MockObject */ - private $utilMock; + protected IRequest&MockObject $requestMock; + protected IL10N&MockObject $l10nMock; + protected IUserManager&MockObject $userManagerMock; + protected IUserSession&MockObject $userSessionMock; + protected KeyManager&MockObject $keyManagerMock; + protected Crypt&MockObject $cryptMock; + protected Session&MockObject $sessionMock; + protected IUser&MockObject $user; + protected ISession&MockObject $ocSessionMock; + protected Util&MockObject $utilMock; protected function setUp(): void { parent::setUp(); @@ -171,21 +154,17 @@ class SettingsControllerTest extends TestCase { $newPassword = 'new'; $this->ocSessionMock->expects($this->once()) - ->method('get')->with('loginname')->willReturn('testUser'); + ->method('get') + ->with('loginname') + ->willReturn('testUser'); $this->userManagerMock ->expects($this->exactly(2)) ->method('checkPassword') - ->withConsecutive( - ['testUserUid', 'new'], - ['testUser', 'new'], - ) - ->willReturnOnConsecutiveCalls( - false, - true, - ); - - + ->willReturnMap([ + ['testUserUid', 'new', false], + ['testUser', 'new', true], + ]); $this->cryptMock ->expects($this->once()) diff --git a/apps/encryption/tests/Controller/StatusControllerTest.php b/apps/encryption/tests/Controller/StatusControllerTest.php index fbe44f52fb7..616114927e8 100644 --- a/apps/encryption/tests/Controller/StatusControllerTest.php +++ b/apps/encryption/tests/Controller/StatusControllerTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -12,24 +14,17 @@ use OCA\Encryption\Session; use OCP\Encryption\IManager; use OCP\IL10N; use OCP\IRequest; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class StatusControllerTest extends TestCase { - /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */ - private $requestMock; - - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - private $l10nMock; - - /** @var Session|\PHPUnit\Framework\MockObject\MockObject */ - protected $sessionMock; - - /** @var IManager | \PHPUnit\Framework\MockObject\MockObject */ - protected $encryptionManagerMock; + protected IRequest&MockObject $requestMock; + protected IL10N&MockObject $l10nMock; + protected Session&MockObject $sessionMock; + protected IManager&MockObject $encryptionManagerMock; - /** @var StatusController */ - protected $controller; + protected StatusController $controller; protected function setUp(): void { parent::setUp(); @@ -68,7 +63,7 @@ class StatusControllerTest extends TestCase { $this->assertSame($expectedStatus, $data['status']); } - public function dataTestGetStatus() { + public static function dataTestGetStatus(): array { return [ [Session::INIT_EXECUTED, 'interactionNeeded'], [Session::INIT_SUCCESSFUL, 'success'], diff --git a/apps/encryption/tests/Crypto/CryptTest.php b/apps/encryption/tests/Crypto/CryptTest.php index 74afc6d44a1..345311da4d0 100644 --- a/apps/encryption/tests/Crypto/CryptTest.php +++ b/apps/encryption/tests/Crypto/CryptTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -12,24 +14,17 @@ use OCP\Encryption\Exceptions\GenericEncryptionException; use OCP\IConfig; use OCP\IL10N; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Test\TestCase; class CryptTest extends TestCase { - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ - private $logger; - - /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */ - private $userSession; - - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - private $config; + protected LoggerInterface&MockObject $logger; + protected IUserSession&MockObject $userSession; + protected IConfig&MockObject $config; + protected IL10N&MockObject $l; - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - private $l; - - /** @var Crypt */ - private $crypt; + protected Crypt $crypt; protected function setUp(): void { parent::setUp(); @@ -113,10 +108,7 @@ class CryptTest extends TestCase { $this->crypt->generateHeader('unknown'); } - /** - * @return array - */ - public function dataTestGenerateHeader() { + public static function dataTestGenerateHeader(): array { return [ [null, 'HBEGIN:cipher:AES-128-CFB:keyFormat:hash2:encoding:binary:HEND'], ['password', 'HBEGIN:cipher:AES-128-CFB:keyFormat:password:encoding:binary:HEND'], @@ -155,10 +147,8 @@ class CryptTest extends TestCase { /** * data provider for testGetCipher - * - * @return array */ - public function dataProviderGetCipher() { + public static function dataProviderGetCipher(): array { return [ ['AES-128-CFB', 'AES-128-CFB'], ['AES-256-CFB', 'AES-256-CFB'], @@ -201,7 +191,7 @@ class CryptTest extends TestCase { $this->assertSame($expected['signature'], $result['signature']); } - public function dataTestSplitMetaData() { + public static function dataTestSplitMetaData(): array { return [ ['encryptedContent00iv001234567890123456xx', ['encrypted' => 'encryptedContent', 'iv' => '1234567890123456', 'signature' => false]], @@ -222,7 +212,7 @@ class CryptTest extends TestCase { ); } - public function dataTestHasSignature() { + public static function dataTestHasSignature(): array { return [ ['encryptedContent00iv001234567890123456xx', false], ['encryptedContent00iv00123456789012345600sig00e1992521e437f6915f9173b190a512cfc38a00ac24502db44e0ba10c2bb0cc86xxx', true] @@ -239,7 +229,7 @@ class CryptTest extends TestCase { $this->invokePrivate($this->crypt, 'hasSignature', [$data, $cipher]); } - public function dataTestHasSignatureFail() { + public static function dataTestHasSignatureFail(): array { return [ ['AES-256-CTR'], ['aes-256-ctr'], @@ -270,10 +260,8 @@ class CryptTest extends TestCase { /** * data provider for testRemovePadding - * - * @return array */ - public function dataProviderRemovePadding() { + public static function dataProviderRemovePadding(): array { return [ ['dataxx', 'data'], ['data', false] @@ -357,10 +345,7 @@ class CryptTest extends TestCase { $this->invokePrivate($this->crypt, 'getKeySize', ['foo']); } - /** - * @return array - */ - public function dataTestGetKeySize() { + public static function dataTestGetKeySize(): array { return [ ['AES-256-CFB', 32], ['AES-128-CFB', 16], @@ -374,28 +359,25 @@ class CryptTest extends TestCase { */ public function testDecryptPrivateKey($header, $privateKey, $expectedCipher, $isValidKey, $expected): void { $this->config->method('getSystemValueBool') - ->withConsecutive(['encryption.legacy_format_support', false], - ['encryption.use_legacy_base64_encoding', false]) - ->willReturnOnConsecutiveCalls(true, false); + ->willReturnMap([ + ['encryption.legacy_format_support', false, true], + ['encryption.use_legacy_base64_encoding', false, false], + ]); /** @var Crypt|\PHPUnit\Framework\MockObject\MockObject $crypt */ $crypt = $this->getMockBuilder(Crypt::class) - ->setConstructorArgs( - [ - $this->logger, - $this->userSession, - $this->config, - $this->l - ] - ) - ->setMethods( - [ - 'parseHeader', - 'generatePasswordHash', - 'symmetricDecryptFileContent', - 'isValidPrivateKey' - ] - ) + ->setConstructorArgs([ + $this->logger, + $this->userSession, + $this->config, + $this->l + ]) + ->onlyMethods([ + 'parseHeader', + 'generatePasswordHash', + 'symmetricDecryptFileContent', + 'isValidPrivateKey' + ]) ->getMock(); $crypt->expects($this->once())->method('parseHeader')->willReturn($header); @@ -416,10 +398,7 @@ class CryptTest extends TestCase { $this->assertSame($expected, $result); } - /** - * @return array - */ - public function dataTestDecryptPrivateKey() { + public static function dataTestDecryptPrivateKey(): array { return [ [['cipher' => 'AES-128-CFB', 'keyFormat' => 'password'], 'HBEGIN:HENDprivateKey', 'AES-128-CFB', true, 'key'], [['cipher' => 'AES-256-CFB', 'keyFormat' => 'password'], 'HBEGIN:HENDprivateKey', 'AES-256-CFB', true, 'key'], diff --git a/apps/encryption/tests/Crypto/DecryptAllTest.php b/apps/encryption/tests/Crypto/DecryptAllTest.php index 0d8543153ef..83684b8be32 100644 --- a/apps/encryption/tests/Crypto/DecryptAllTest.php +++ b/apps/encryption/tests/Crypto/DecryptAllTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -12,28 +14,19 @@ use OCA\Encryption\Crypto\DecryptAll; use OCA\Encryption\KeyManager; use OCA\Encryption\Session; use OCA\Encryption\Util; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Console\Helper\QuestionHelper; use Test\TestCase; class DecryptAllTest extends TestCase { - /** @var DecryptAll */ - protected $instance; - - /** @var Util | \PHPUnit\Framework\MockObject\MockObject */ - protected $util; - - /** @var KeyManager | \PHPUnit\Framework\MockObject\MockObject */ - protected $keyManager; - - /** @var Crypt | \PHPUnit\Framework\MockObject\MockObject */ - protected $crypt; - - /** @var Session | \PHPUnit\Framework\MockObject\MockObject */ - protected $session; + protected DecryptAll $instance; - /** @var QuestionHelper | \PHPUnit\Framework\MockObject\MockObject */ - protected $questionHelper; + protected Util&MockObject $util; + protected KeyManager&MockObject $keyManager; + protected Crypt&MockObject $crypt; + protected Session&MockObject $session; + protected QuestionHelper&MockObject $questionHelper; protected function setUp(): void { parent::setUp(); @@ -75,6 +68,7 @@ class DecryptAllTest extends TestCase { $password = 'passwd'; $recoveryKey = 'recoveryKey'; $userKey = 'userKey'; + $masterKey = 'userKey'; $unencryptedKey = 'unencryptedKey'; $this->keyManager->expects($this->any())->method('getRecoveryKeyId') @@ -105,7 +99,7 @@ class DecryptAllTest extends TestCase { ); } - public function dataTestGetPrivateKey() { + public static function dataTestGetPrivateKey() { return [ ['user1', 'recoveryKey', 'masterKeyId'], ['recoveryKeyId', 'recoveryKeyId', 'masterKeyId'], diff --git a/apps/encryption/tests/Crypto/EncryptAllTest.php b/apps/encryption/tests/Crypto/EncryptAllTest.php index d702c123b9b..45743ae733b 100644 --- a/apps/encryption/tests/Crypto/EncryptAllTest.php +++ b/apps/encryption/tests/Crypto/EncryptAllTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -20,6 +22,7 @@ use OCP\L10N\IFactory; use OCP\Mail\IMailer; use OCP\Security\ISecureRandom; use OCP\UserInterface; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Helper\QuestionHelper; @@ -29,50 +32,22 @@ use Test\TestCase; class EncryptAllTest extends TestCase { - /** @var \PHPUnit\Framework\MockObject\MockObject|KeyManager */ - protected $keyManager; - - /** @var \PHPUnit\Framework\MockObject\MockObject|Util */ - protected $util; - - /** @var \PHPUnit\Framework\MockObject\MockObject|IUserManager */ - protected $userManager; - - /** @var \PHPUnit\Framework\MockObject\MockObject|Setup */ - protected $setupUser; - - /** @var \PHPUnit\Framework\MockObject\MockObject|View */ - protected $view; - - /** @var \PHPUnit\Framework\MockObject\MockObject|IConfig */ - protected $config; - - /** @var \PHPUnit\Framework\MockObject\MockObject|IMailer */ - protected $mailer; - - /** @var \PHPUnit\Framework\MockObject\MockObject|IL10N */ - protected $l; - - /** @var \PHPUnit\Framework\MockObject\MockObject | IFactory */ - protected $l10nFactory; - - /** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Helper\QuestionHelper */ - protected $questionHelper; - - /** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Input\InputInterface */ - protected $inputInterface; - - /** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Output\OutputInterface */ - protected $outputInterface; - - /** @var \PHPUnit\Framework\MockObject\MockObject|UserInterface */ - protected $userInterface; - - /** @var \PHPUnit\Framework\MockObject\MockObject|ISecureRandom */ - protected $secureRandom; - - /** @var EncryptAll */ - protected $encryptAll; + protected KeyManager&MockObject $keyManager; + protected Util&MockObject $util; + protected IUserManager&MockObject $userManager; + protected Setup&MockObject $setupUser; + protected View&MockObject $view; + protected IConfig&MockObject $config; + protected IMailer&MockObject $mailer; + protected IL10N&MockObject $l; + protected IFactory&MockObject $l10nFactory; + protected \Symfony\Component\Console\Helper\QuestionHelper&MockObject $questionHelper; + protected \Symfony\Component\Console\Input\InputInterface&MockObject $inputInterface; + protected \Symfony\Component\Console\Output\OutputInterface&MockObject $outputInterface; + protected UserInterface&MockObject $userInterface; + protected ISecureRandom&MockObject $secureRandom; + + protected EncryptAll $encryptAll; protected function setUp(): void { parent::setUp(); @@ -153,7 +128,7 @@ class EncryptAllTest extends TestCase { $this->secureRandom ] ) - ->setMethods(['createKeyPairs', 'encryptAllUsersFiles', 'outputPasswords']) + ->onlyMethods(['createKeyPairs', 'encryptAllUsersFiles', 'outputPasswords']) ->getMock(); $this->util->expects($this->any())->method('isMasterKeyEnabled')->willReturn(false); @@ -182,7 +157,7 @@ class EncryptAllTest extends TestCase { $this->secureRandom ] ) - ->setMethods(['createKeyPairs', 'encryptAllUsersFiles', 'outputPasswords']) + ->onlyMethods(['createKeyPairs', 'encryptAllUsersFiles', 'outputPasswords']) ->getMock(); $this->util->expects($this->any())->method('isMasterKeyEnabled')->willReturn(true); @@ -212,7 +187,7 @@ class EncryptAllTest extends TestCase { $this->secureRandom ] ) - ->setMethods(['setupUserFS', 'generateOneTimePassword']) + ->onlyMethods(['setupUserFS', 'generateOneTimePassword']) ->getMock(); @@ -245,7 +220,7 @@ class EncryptAllTest extends TestCase { } public function testEncryptAllUsersFiles(): void { - /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ + /** @var EncryptAll&MockObject $encryptAll */ $encryptAll = $this->getMockBuilder(EncryptAll::class) ->setConstructorArgs( [ @@ -262,7 +237,7 @@ class EncryptAllTest extends TestCase { $this->secureRandom ] ) - ->setMethods(['encryptUsersFiles']) + ->onlyMethods(['encryptUsersFiles']) ->getMock(); $this->util->expects($this->any())->method('isMasterKeyEnabled')->willReturn(false); @@ -271,17 +246,22 @@ class EncryptAllTest extends TestCase { $this->invokePrivate($encryptAll, 'output', [$this->outputInterface]); $this->invokePrivate($encryptAll, 'userPasswords', [['user1' => 'pwd1', 'user2' => 'pwd2']]); - $encryptAll->expects($this->exactly(2))->method('encryptUsersFiles') - ->withConsecutive( - ['user1'], - ['user2'], - ); + $encryptAllCalls = []; + $encryptAll->expects($this->exactly(2)) + ->method('encryptUsersFiles') + ->willReturnCallback(function ($uid) use (&$encryptAllCalls) { + $encryptAllCalls[] = $uid; + }); $this->invokePrivate($encryptAll, 'encryptAllUsersFiles'); + self::assertEquals([ + 'user1', + 'user2', + ], $encryptAllCalls); } public function testEncryptUsersFiles(): void { - /** @var EncryptAll | \PHPUnit\Framework\MockObject\MockObject $encryptAll */ + /** @var EncryptAll&MockObject $encryptAll */ $encryptAll = $this->getMockBuilder(EncryptAll::class) ->setConstructorArgs( [ @@ -298,24 +278,31 @@ class EncryptAllTest extends TestCase { $this->secureRandom ] ) - ->setMethods(['encryptFile', 'setupUserFS']) + ->onlyMethods(['encryptFile', 'setupUserFS']) ->getMock(); $this->util->expects($this->any())->method('isMasterKeyEnabled')->willReturn(false); $this->view->expects($this->exactly(2))->method('getDirectoryContent') - ->withConsecutive( - ['/user1/files'], - ['/user1/files/foo'], - )->willReturnOnConsecutiveCalls( + ->willReturnMap([ [ - ['name' => 'foo', 'type' => 'dir'], - ['name' => 'bar', 'type' => 'file'], + '/user1/files', + '', + null, + [ + ['name' => 'foo', 'type' => 'dir'], + ['name' => 'bar', 'type' => 'file'], + ], ], [ - ['name' => 'subfile', 'type' => 'file'] - ] - ); + '/user1/files/foo', + '', + null, + [ + ['name' => 'subfile', 'type' => 'file'] + ], + ], + ]); $this->view->expects($this->any())->method('is_dir') ->willReturnCallback( @@ -327,11 +314,12 @@ class EncryptAllTest extends TestCase { } ); - $encryptAll->expects($this->exactly(2))->method('encryptFile') - ->withConsecutive( - ['/user1/files/bar'], - ['/user1/files/foo/subfile'], - ); + $encryptAllCalls = []; + $encryptAll->expects($this->exactly(2)) + ->method('encryptFile') + ->willReturnCallback(function (string $path) use (&$encryptAllCalls) { + $encryptAllCalls[] = $path; + }); $outputFormatter = $this->createMock(OutputFormatterInterface::class); $outputFormatter->method('isDecorated')->willReturn(false); @@ -341,6 +329,10 @@ class EncryptAllTest extends TestCase { $progressBar = new ProgressBar($this->outputInterface); $this->invokePrivate($encryptAll, 'encryptUsersFiles', ['user1', $progressBar, '']); + self::assertEquals([ + '/user1/files/bar', + '/user1/files/foo/subfile', + ], $encryptAllCalls); } public function testGenerateOneTimePassword(): void { @@ -378,7 +370,7 @@ class EncryptAllTest extends TestCase { ); } - public function dataTestEncryptFile() { + public static function dataTestEncryptFile(): array { return [ [true], [false], diff --git a/apps/encryption/tests/Crypto/EncryptionTest.php b/apps/encryption/tests/Crypto/EncryptionTest.php index 7f3d9d1f348..999c6242f0c 100644 --- a/apps/encryption/tests/Crypto/EncryptionTest.php +++ b/apps/encryption/tests/Crypto/EncryptionTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -26,34 +28,18 @@ use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; class EncryptionTest extends TestCase { - /** @var Encryption */ - private $instance; - - /** @var KeyManager|\PHPUnit\Framework\MockObject\MockObject */ - private $keyManagerMock; - - /** @var EncryptAll|\PHPUnit\Framework\MockObject\MockObject */ - private $encryptAllMock; - - /** @var DecryptAll|\PHPUnit\Framework\MockObject\MockObject */ - private $decryptAllMock; - - /** @var Session|\PHPUnit\Framework\MockObject\MockObject */ - private $sessionMock; - - /** @var Crypt|\PHPUnit\Framework\MockObject\MockObject */ - private $cryptMock; - - /** @var Util|\PHPUnit\Framework\MockObject\MockObject */ - private $utilMock; - - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ - private $loggerMock; - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - private $l10nMock; + protected Encryption $instance; - private IStorage&MockObject $storageMock; + protected KeyManager&MockObject $keyManagerMock; + protected EncryptAll&MockObject $encryptAllMock; + protected DecryptAll&MockObject $decryptAllMock; + protected Session&MockObject $sessionMock; + protected Crypt&MockObject $cryptMock; + protected Util&MockObject $utilMock; + protected LoggerInterface&MockObject $loggerMock; + protected IL10N&MockObject $l10nMock; + protected IStorage&MockObject $storageMock; protected function setUp(): void { parent::setUp(); @@ -175,7 +161,7 @@ class EncryptionTest extends TestCase { ); } - public function dataProviderForTestGetPathToRealFile() { + public static function dataProviderForTestGetPathToRealFile(): array { return [ ['/user/files/foo/bar.txt', '/user/files/foo/bar.txt'], ['/user/files/foo.txt', '/user/files/foo.txt'], @@ -228,7 +214,7 @@ class EncryptionTest extends TestCase { } } - public function dataTestBegin() { + public static function dataTestBegin(): array { return [ ['w', ['cipher' => 'myCipher'], 'legacyCipher', 'defaultCipher', 'fileKey', 'defaultCipher'], ['r', ['cipher' => 'myCipher'], 'legacyCipher', 'defaultCipher', 'fileKey', 'myCipher'], @@ -305,7 +291,7 @@ class EncryptionTest extends TestCase { ); } - public function dataTestUpdate() { + public static function dataTestUpdate(): array { return [ ['', false], ['fileKey', true] @@ -387,7 +373,7 @@ class EncryptionTest extends TestCase { ); } - public function dataTestShouldEncrypt() { + public static function dataTestShouldEncrypt(): array { return [ ['/user1/files/foo.txt', true, true, true], ['/user1/files_versions/foo.txt', true, true, true], diff --git a/apps/encryption/tests/KeyManagerTest.php b/apps/encryption/tests/KeyManagerTest.php index 8f5c9a78faf..187c21bc687 100644 --- a/apps/encryption/tests/KeyManagerTest.php +++ b/apps/encryption/tests/KeyManagerTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -28,41 +30,19 @@ use Psr\Log\LoggerInterface; use Test\TestCase; class KeyManagerTest extends TestCase { - /** - * @var KeyManager - */ - private $instance; - /** - * @var string - */ - private $userId; - - /** @var string */ - private $systemKeyId; - - /** @var \OCP\Encryption\Keys\IStorage|\PHPUnit\Framework\MockObject\MockObject */ - private $keyStorageMock; - - /** @var Crypt|\PHPUnit\Framework\MockObject\MockObject */ - private $cryptMock; - - /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */ - private $userMock; - - /** @var Session|\PHPUnit\Framework\MockObject\MockObject */ - private $sessionMock; - - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ - private $logMock; - - /** @var Util|\PHPUnit\Framework\MockObject\MockObject */ - private $utilMock; - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - private $configMock; + protected KeyManager $instance; - /** @var ILockingProvider|MockObject */ - private $lockingProviderMock; + protected string $userId; + protected string $systemKeyId; + protected IStorage&MockObject $keyStorageMock; + protected Crypt&MockObject $cryptMock; + protected IUserSession&MockObject $userMock; + protected Session&MockObject $sessionMock; + protected LoggerInterface&MockObject $logMock; + protected Util&MockObject $utilMock; + protected IConfig&MockObject $configMock; + protected ILockingProvider&MockObject $lockingProviderMock; protected function setUp(): void { parent::setUp(); @@ -201,7 +181,7 @@ class KeyManagerTest extends TestCase { ); } - public function dataTestUserHasKeys() { + public static function dataTestUserHasKeys(): array { return [ ['key', true], ['', false] @@ -246,7 +226,7 @@ class KeyManagerTest extends TestCase { * @param bool $useMasterKey */ public function testInit($useMasterKey): void { - /** @var KeyManager|\PHPUnit\Framework\MockObject\MockObject $instance */ + /** @var KeyManager&MockObject $instance */ $instance = $this->getMockBuilder(KeyManager::class) ->setConstructorArgs( [ @@ -259,17 +239,18 @@ class KeyManagerTest extends TestCase { $this->utilMock, $this->lockingProviderMock ] - )->setMethods(['getMasterKeyId', 'getMasterKeyPassword', 'getSystemPrivateKey', 'getPrivateKey']) + )->onlyMethods(['getMasterKeyId', 'getMasterKeyPassword', 'getSystemPrivateKey', 'getPrivateKey']) ->getMock(); $this->utilMock->expects($this->once())->method('isMasterKeyEnabled') ->willReturn($useMasterKey); - $this->sessionMock->expects($this->exactly(2))->method('setStatus') - ->withConsecutive( - [Session::INIT_EXECUTED], - [Session::INIT_SUCCESSFUL], - ); + $sessionSetStatusCalls = []; + $this->sessionMock->expects($this->exactly(2)) + ->method('setStatus') + ->willReturnCallback(function (string $status) use (&$sessionSetStatusCalls) { + $sessionSetStatusCalls[] = $status; + }); $instance->expects($this->any())->method('getMasterKeyId')->willReturn('masterKeyId'); $instance->expects($this->any())->method('getMasterKeyPassword')->willReturn('masterKeyPassword'); @@ -290,9 +271,13 @@ class KeyManagerTest extends TestCase { ->with('key'); $this->assertTrue($instance->init($this->userId, 'pass')); + self::assertEquals([ + Session::INIT_EXECUTED, + Session::INIT_SUCCESSFUL, + ], $sessionSetStatusCalls); } - public function dataTestInit() { + public static function dataTestInit(): array { return [ [true], [false] @@ -349,7 +334,7 @@ class KeyManagerTest extends TestCase { $this->assertTrue($this->instance->getEncryptedFileKey('/')); } - public function dataTestGetFileKey() { + public static function dataTestGetFileKey(): array { return [ ['user1', false, 'privateKey', 'legacyKey', 'multiKeyDecryptResult'], ['user1', false, 'privateKey', '', 'multiKeyDecryptResult'], @@ -395,14 +380,10 @@ class KeyManagerTest extends TestCase { $this->keyStorageMock->expects($this->exactly(2)) ->method('getFileKey') - ->withConsecutive( - [$path, 'fileKey', 'OC_DEFAULT_MODULE'], - [$path, $expectedUid . '.shareKey', 'OC_DEFAULT_MODULE'], - ) - ->willReturnOnConsecutiveCalls( - $encryptedFileKey, - 'fileKey', - ); + ->willReturnMap([ + [$path, 'fileKey', 'OC_DEFAULT_MODULE', $encryptedFileKey], + [$path, $expectedUid . '.shareKey', 'OC_DEFAULT_MODULE', 'fileKey'], + ]); $this->utilMock->expects($this->any())->method('isMasterKeyEnabled') ->willReturn($isMasterKeyEnabled); @@ -515,7 +496,7 @@ class KeyManagerTest extends TestCase { * * @return array */ - public function dataTestAddSystemKeys() { + public static function dataTestAddSystemKeys(): array { return [ [['public' => true],[], 'user1', ['publicShareKey', 'recoveryKey']], [['public' => false], [], 'user1', ['recoveryKey']], @@ -563,7 +544,7 @@ class KeyManagerTest extends TestCase { * @param $masterKey */ public function testValidateMasterKey($masterKey): void { - /** @var KeyManager|\PHPUnit\Framework\MockObject\MockObject $instance */ + /** @var KeyManager&MockObject $instance */ $instance = $this->getMockBuilder(KeyManager::class) ->setConstructorArgs( [ @@ -576,7 +557,7 @@ class KeyManagerTest extends TestCase { $this->utilMock, $this->lockingProviderMock ] - )->setMethods(['getPublicMasterKey', 'setSystemPrivateKey', 'getMasterKeyPassword']) + )->onlyMethods(['getPublicMasterKey', 'setSystemPrivateKey', 'getMasterKeyPassword']) ->getMock(); $this->utilMock->expects($this->once())->method('isMasterKeyEnabled') @@ -611,20 +592,19 @@ class KeyManagerTest extends TestCase { } public function testValidateMasterKeyLocked(): void { - /** @var KeyManager|\PHPUnit_Framework_MockObject_MockObject $instance */ + /** @var KeyManager&MockObject $instance */ $instance = $this->getMockBuilder(KeyManager::class) - ->setConstructorArgs( - [ - $this->keyStorageMock, - $this->cryptMock, - $this->configMock, - $this->userMock, - $this->sessionMock, - $this->logMock, - $this->utilMock, - $this->lockingProviderMock - ] - )->setMethods(['getPublicMasterKey', 'getPrivateMasterKey', 'setSystemPrivateKey', 'getMasterKeyPassword']) + ->setConstructorArgs([ + $this->keyStorageMock, + $this->cryptMock, + $this->configMock, + $this->userMock, + $this->sessionMock, + $this->logMock, + $this->utilMock, + $this->lockingProviderMock + ]) + ->onlyMethods(['getPublicMasterKey', 'getPrivateMasterKey', 'setSystemPrivateKey', 'getMasterKeyPassword']) ->getMock(); $this->utilMock->expects($this->once())->method('isMasterKeyEnabled') @@ -646,7 +626,7 @@ class KeyManagerTest extends TestCase { $instance->validateMasterKey(); } - public function dataTestValidateMasterKey() { + public static function dataTestValidateMasterKey(): array { return [ ['masterKey'], [''] diff --git a/apps/encryption/tests/RecoveryTest.php b/apps/encryption/tests/RecoveryTest.php index 17ad385eca0..0627724a856 100644 --- a/apps/encryption/tests/RecoveryTest.php +++ b/apps/encryption/tests/RecoveryTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. diff --git a/apps/encryption/tests/SessionTest.php b/apps/encryption/tests/SessionTest.php index 3072bc6ef3b..9e38f857e73 100644 --- a/apps/encryption/tests/SessionTest.php +++ b/apps/encryption/tests/SessionTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -10,17 +12,14 @@ namespace OCA\Encryption\Tests; use OCA\Encryption\Exceptions\PrivateKeyMissingException; use OCA\Encryption\Session; use OCP\ISession; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class SessionTest extends TestCase { private static $tempStorage = []; - /** - * @var Session - */ - private $instance; - /** @var ISession|\PHPUnit\Framework\MockObject\MockObject */ - private $sessionMock; + protected Session $instance; + protected ISession&MockObject $sessionMock; public function testThatGetPrivateKeyThrowsExceptionWhenNotSet(): void { $this->expectException(PrivateKeyMissingException::class); @@ -122,10 +121,11 @@ class SessionTest extends TestCase { * @param bool $expected */ public function testIsReady($status, $expected): void { - /** @var Session | \PHPUnit\Framework\MockObject\MockObject $instance */ + /** @var Session&MockObject $instance */ $instance = $this->getMockBuilder(Session::class) ->setConstructorArgs([$this->sessionMock]) - ->setMethods(['getStatus'])->getMock(); + ->onlyMethods(['getStatus']) + ->getMock(); $instance->expects($this->once())->method('getStatus') ->willReturn($status); @@ -133,7 +133,7 @@ class SessionTest extends TestCase { $this->assertSame($expected, $instance->isReady()); } - public function dataTestIsReady() { + public static function dataTestIsReady(): array { return [ [Session::INIT_SUCCESSFUL, true], [Session::INIT_EXECUTED, false], diff --git a/apps/encryption/tests/Settings/AdminTest.php b/apps/encryption/tests/Settings/AdminTest.php index 4ddaeb1b84d..5ae9e7eb3c6 100644 --- a/apps/encryption/tests/Settings/AdminTest.php +++ b/apps/encryption/tests/Settings/AdminTest.php @@ -1,4 +1,7 @@ <?php + +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -12,24 +15,20 @@ use OCP\IL10N; use OCP\ISession; use OCP\IUserManager; use OCP\IUserSession; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Test\TestCase; class AdminTest extends TestCase { - /** @var Admin */ - private $admin; - /** @var IL10N */ - private $l; - /** @var LoggerInterface */ - private $logger; - /** @var IUserSession */ - private $userSession; - /** @var IConfig */ - private $config; - /** @var IUserManager */ - private $userManager; - /** @var ISession */ - private $session; + + protected Admin $admin; + + protected IL10N&MockObject $l; + protected LoggerInterface&MockObject $logger; + protected IUserSession&MockObject $userSession; + protected IConfig&MockObject $config; + protected IUserManager&MockObject $userManager; + protected ISession&MockObject $session; protected function setUp(): void { parent::setUp(); diff --git a/apps/encryption/tests/Users/SetupTest.php b/apps/encryption/tests/Users/SetupTest.php index 7a6beaf3594..b2abfcba1db 100644 --- a/apps/encryption/tests/Users/SetupTest.php +++ b/apps/encryption/tests/Users/SetupTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -10,21 +12,15 @@ namespace OCA\Encryption\Tests\Users; use OCA\Encryption\Crypto\Crypt; use OCA\Encryption\KeyManager; use OCA\Encryption\Users\Setup; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class SetupTest extends TestCase { - /** - * @var KeyManager|\PHPUnit\Framework\MockObject\MockObject - */ - private $keyManagerMock; - /** - * @var Crypt|\PHPUnit\Framework\MockObject\MockObject - */ - private $cryptMock; - /** - * @var Setup - */ - private $instance; + + protected Setup $instance; + + protected KeyManager&MockObject $keyManagerMock; + protected Crypt&MockObject $cryptMock; protected function setUp(): void { parent::setUp(); @@ -72,7 +68,7 @@ class SetupTest extends TestCase { ); } - public function dataTestSetupUser() { + public static function dataTestSetupUser(): array { return [ [true, true], [false, true] diff --git a/apps/encryption/tests/UtilTest.php b/apps/encryption/tests/UtilTest.php index 711564af5bd..3556b9e34c1 100644 --- a/apps/encryption/tests/UtilTest.php +++ b/apps/encryption/tests/UtilTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -20,22 +22,14 @@ use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class UtilTest extends TestCase { - private static $tempStorage = []; - - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - private $configMock; - - /** @var View|\PHPUnit\Framework\MockObject\MockObject */ - private $filesMock; - - /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ - private $userManagerMock; - /** @var IMountPoint|\PHPUnit\Framework\MockObject\MockObject */ - private $mountMock; + protected Util $instance; + protected static $tempStorage = []; - /** @var Util */ - private $instance; + protected IConfig&MockObject $configMock; + protected View&MockObject $filesMock; + protected IUserManager&MockObject $userManagerMock; + protected IMountPoint&MockObject $mountMock; public function testSetRecoveryForUser(): void { $this->instance->setRecoveryForUser('1'); @@ -134,7 +128,7 @@ class UtilTest extends TestCase { ); } - public function dataTestIsMasterKeyEnabled() { + public static function dataTestIsMasterKeyEnabled(): array { return [ ['0', false], ['1', true] @@ -155,7 +149,7 @@ class UtilTest extends TestCase { $this->instance->shouldEncryptHomeStorage()); } - public function dataTestShouldEncryptHomeStorage() { + public static function dataTestShouldEncryptHomeStorage(): array { return [ ['1', true], ['0', false] @@ -173,7 +167,7 @@ class UtilTest extends TestCase { $this->instance->setEncryptHomeStorage($value); } - public function dataTestSetEncryptHomeStorage() { + public static function dataTestSetEncryptHomeStorage(): array { return [ [true, '1'], [false, '0'] diff --git a/apps/files/l10n/ar.js b/apps/files/l10n/ar.js index 4cffecf72eb..2966ea64b30 100644 --- a/apps/files/l10n/ar.js +++ b/apps/files/l10n/ar.js @@ -279,12 +279,12 @@ OC.L10N.register( "Cancelled move or copy operation" : ".عملية النسخ أو النقل تمّ إلغاؤها", "Open folder {displayName}" : "فتح المجلد {displayName}", "Open in Files" : "فتح في \"الملفات\"", + "Open locally" : "الفتح محلّيّاً", + "Failed to redirect to client" : "فشل في التحويل الى العميل", "Open file locally" : "فتح الملف محلّيّاً", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "يجب أن يفتح الملف الآن على جهازك. إذا لم يحدث ذلك، فيرجى التأكد من تثبيت تطبيق سطح المكتب.", "Retry and close" : "أعِد المحاولة ثم أغلِق", "Open online" : "إفتَح مُتَّصِلاً بالإنترنت", - "Failed to redirect to client" : "فشل في التحويل الى العميل", - "Open locally" : "الفتح محلّيّاً", "Rename" : "إعادة التسمية", "Open details" : "فتح التفاصيل", "View in folder" : "عرض في المجلد", diff --git a/apps/files/l10n/ar.json b/apps/files/l10n/ar.json index 84c956af639..44bf401f1ec 100644 --- a/apps/files/l10n/ar.json +++ b/apps/files/l10n/ar.json @@ -277,12 +277,12 @@ "Cancelled move or copy operation" : ".عملية النسخ أو النقل تمّ إلغاؤها", "Open folder {displayName}" : "فتح المجلد {displayName}", "Open in Files" : "فتح في \"الملفات\"", + "Open locally" : "الفتح محلّيّاً", + "Failed to redirect to client" : "فشل في التحويل الى العميل", "Open file locally" : "فتح الملف محلّيّاً", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "يجب أن يفتح الملف الآن على جهازك. إذا لم يحدث ذلك، فيرجى التأكد من تثبيت تطبيق سطح المكتب.", "Retry and close" : "أعِد المحاولة ثم أغلِق", "Open online" : "إفتَح مُتَّصِلاً بالإنترنت", - "Failed to redirect to client" : "فشل في التحويل الى العميل", - "Open locally" : "الفتح محلّيّاً", "Rename" : "إعادة التسمية", "Open details" : "فتح التفاصيل", "View in folder" : "عرض في المجلد", diff --git a/apps/files/l10n/ast.js b/apps/files/l10n/ast.js index 036797e4a76..d9bdbf9b621 100644 --- a/apps/files/l10n/ast.js +++ b/apps/files/l10n/ast.js @@ -196,8 +196,8 @@ OC.L10N.register( "Cancelled move or copy operation" : "Anulóse la operación de mover o copiar", "Open folder {displayName}" : "Abrir la carpeta «{displayName}»", "Open in Files" : "Abrir en Ficheros", - "Failed to redirect to client" : "Nun se pue redirixir al veceru", "Open locally" : "Abrir llocalmente", + "Failed to redirect to client" : "Nun se pue redirixir al veceru", "Rename" : "Renomar", "Open details" : "Abrir los detalles", "View in folder" : "Ver na carpeta", diff --git a/apps/files/l10n/ast.json b/apps/files/l10n/ast.json index c44539d7603..3ccfed40a0c 100644 --- a/apps/files/l10n/ast.json +++ b/apps/files/l10n/ast.json @@ -194,8 +194,8 @@ "Cancelled move or copy operation" : "Anulóse la operación de mover o copiar", "Open folder {displayName}" : "Abrir la carpeta «{displayName}»", "Open in Files" : "Abrir en Ficheros", - "Failed to redirect to client" : "Nun se pue redirixir al veceru", "Open locally" : "Abrir llocalmente", + "Failed to redirect to client" : "Nun se pue redirixir al veceru", "Rename" : "Renomar", "Open details" : "Abrir los detalles", "View in folder" : "Ver na carpeta", diff --git a/apps/files/l10n/bg.js b/apps/files/l10n/bg.js index 454ccaf0894..a4e57455bba 100644 --- a/apps/files/l10n/bg.js +++ b/apps/files/l10n/bg.js @@ -144,9 +144,9 @@ OC.L10N.register( "Copy" : "Копирай", "Move" : "Преместване", "Move or copy" : "Премести или копирай", - "Open file locally" : "Локално отваряне на файл", - "Failed to redirect to client" : "Неуспешно пренасочване към клиент", "Open locally" : "Локално отваряне", + "Failed to redirect to client" : "Неуспешно пренасочване към клиент", + "Open file locally" : "Локално отваряне на файл", "Rename" : "Преименувай", "Open details" : "Отваряне на подробности", "View in folder" : "Преглед в папката", diff --git a/apps/files/l10n/bg.json b/apps/files/l10n/bg.json index 8f2d29bdb50..0ab99619fd5 100644 --- a/apps/files/l10n/bg.json +++ b/apps/files/l10n/bg.json @@ -142,9 +142,9 @@ "Copy" : "Копирай", "Move" : "Преместване", "Move or copy" : "Премести или копирай", - "Open file locally" : "Локално отваряне на файл", - "Failed to redirect to client" : "Неуспешно пренасочване към клиент", "Open locally" : "Локално отваряне", + "Failed to redirect to client" : "Неуспешно пренасочване към клиент", + "Open file locally" : "Локално отваряне на файл", "Rename" : "Преименувай", "Open details" : "Отваряне на подробности", "View in folder" : "Преглед в папката", diff --git a/apps/files/l10n/ca.js b/apps/files/l10n/ca.js index 460fc96ee21..0c0eb111936 100644 --- a/apps/files/l10n/ca.js +++ b/apps/files/l10n/ca.js @@ -279,12 +279,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "S'ha cancel·lat l'operació de desplaçament o còpia", "Open folder {displayName}" : "Obre la carpeta {displayName}", "Open in Files" : "Obre a Fitxers", + "Open locally" : "Obre en local", + "Failed to redirect to client" : "No s'ha pogut redirigir al client", "Open file locally" : "Obre el fitxer en local", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Ara s'hauria d'obrir el fitxer al dispositiu. Si no és així, comproveu que teniu instal·lada l'aplicació d'escriptori.", "Retry and close" : "Torna-ho a provar i tanca", "Open online" : "Obre en línia", - "Failed to redirect to client" : "No s'ha pogut redirigir al client", - "Open locally" : "Obre en local", "Rename" : "Canvia el nom", "Open details" : "Obre els detalls", "View in folder" : "Visualitza-ho en la carpeta", diff --git a/apps/files/l10n/ca.json b/apps/files/l10n/ca.json index 7b9690f94b4..a29248f26e9 100644 --- a/apps/files/l10n/ca.json +++ b/apps/files/l10n/ca.json @@ -277,12 +277,12 @@ "Cancelled move or copy operation" : "S'ha cancel·lat l'operació de desplaçament o còpia", "Open folder {displayName}" : "Obre la carpeta {displayName}", "Open in Files" : "Obre a Fitxers", + "Open locally" : "Obre en local", + "Failed to redirect to client" : "No s'ha pogut redirigir al client", "Open file locally" : "Obre el fitxer en local", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Ara s'hauria d'obrir el fitxer al dispositiu. Si no és així, comproveu que teniu instal·lada l'aplicació d'escriptori.", "Retry and close" : "Torna-ho a provar i tanca", "Open online" : "Obre en línia", - "Failed to redirect to client" : "No s'ha pogut redirigir al client", - "Open locally" : "Obre en local", "Rename" : "Canvia el nom", "Open details" : "Obre els detalls", "View in folder" : "Visualitza-ho en la carpeta", diff --git a/apps/files/l10n/cs.js b/apps/files/l10n/cs.js index 9fa7c438bc6..c4db8c2ebc9 100644 --- a/apps/files/l10n/cs.js +++ b/apps/files/l10n/cs.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Operace přesunutí či zkopírování zrušena", "Open folder {displayName}" : "Otevřít složku {displayName}", "Open in Files" : "Otevřít v Souborech", + "Open locally" : "Otevřít lokálně", + "Failed to redirect to client" : "Nepodařilo se přesměrovat klienta", "Open file locally" : "Otevřít soubor lokálně", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Soubor by se nyní měl otevřít na vašem zařízení. Pokud ne, zkontrolujte, zda máte nainstalovanou desktopovou aplikaci.", "Retry and close" : "Zkusit znovu a zavřít", "Open online" : "Otevřít online", - "Failed to redirect to client" : "Nepodařilo se přesměrovat klienta", - "Open locally" : "Otevřít lokálně", "Rename" : "Přejmenovat", "Open details" : "Otevřít podrobnosti", "View in folder" : "Zobrazit ve složce", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "Osobní soubory", "Text file" : "Textový soubor", "New text file.txt" : "Nový textový soubor.txt", + "%1$s (renamed)" : "%1$s (přejmenované)", + "renamed file" : "přejmenovaný soubor", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Po povolení názvů souborů, kompatibilních s Windows, stávající soubory už nebude možné změnit, ale je možné je přejmenovat na platné nové názvy jejich vlastníkem.", "{count} files could not be converted" : "{count} souborů nebylo možné převést", "{count} files successfully converted" : "{count} souborů úspěšně převedeno" }, diff --git a/apps/files/l10n/cs.json b/apps/files/l10n/cs.json index 6887c3f59de..b3ab9d87ded 100644 --- a/apps/files/l10n/cs.json +++ b/apps/files/l10n/cs.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Operace přesunutí či zkopírování zrušena", "Open folder {displayName}" : "Otevřít složku {displayName}", "Open in Files" : "Otevřít v Souborech", + "Open locally" : "Otevřít lokálně", + "Failed to redirect to client" : "Nepodařilo se přesměrovat klienta", "Open file locally" : "Otevřít soubor lokálně", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Soubor by se nyní měl otevřít na vašem zařízení. Pokud ne, zkontrolujte, zda máte nainstalovanou desktopovou aplikaci.", "Retry and close" : "Zkusit znovu a zavřít", "Open online" : "Otevřít online", - "Failed to redirect to client" : "Nepodařilo se přesměrovat klienta", - "Open locally" : "Otevřít lokálně", "Rename" : "Přejmenovat", "Open details" : "Otevřít podrobnosti", "View in folder" : "Zobrazit ve složce", @@ -453,6 +453,9 @@ "Personal Files" : "Osobní soubory", "Text file" : "Textový soubor", "New text file.txt" : "Nový textový soubor.txt", + "%1$s (renamed)" : "%1$s (přejmenované)", + "renamed file" : "přejmenovaný soubor", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Po povolení názvů souborů, kompatibilních s Windows, stávající soubory už nebude možné změnit, ale je možné je přejmenovat na platné nové názvy jejich vlastníkem.", "{count} files could not be converted" : "{count} souborů nebylo možné převést", "{count} files successfully converted" : "{count} souborů úspěšně převedeno" },"pluralForm" :"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;" diff --git a/apps/files/l10n/da.js b/apps/files/l10n/da.js index 3d2898dc93e..4c22f5a4cfe 100644 --- a/apps/files/l10n/da.js +++ b/apps/files/l10n/da.js @@ -279,12 +279,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Flytning eller kopiering er annulleret", "Open folder {displayName}" : "Åben mappe {displayName}", "Open in Files" : "Åben i Filer", + "Open locally" : "Åben lokalt", + "Failed to redirect to client" : "Kunne ikke omdirigere til klienten", "Open file locally" : "Åben fil lokalt", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Filen bør nu åbne på dit apparat. Hvis den ikke gør det, så kontroller venligst at desktop app'en er installeret.", "Retry and close" : "Forsøg igen og luk", "Open online" : "Åben online", - "Failed to redirect to client" : "Kunne ikke omdirigere til klienten", - "Open locally" : "Åben lokalt", "Rename" : "Omdøb", "Open details" : "Mere information", "View in folder" : "Vis i mappe", diff --git a/apps/files/l10n/da.json b/apps/files/l10n/da.json index e23ab072eb3..b791f81d82e 100644 --- a/apps/files/l10n/da.json +++ b/apps/files/l10n/da.json @@ -277,12 +277,12 @@ "Cancelled move or copy operation" : "Flytning eller kopiering er annulleret", "Open folder {displayName}" : "Åben mappe {displayName}", "Open in Files" : "Åben i Filer", + "Open locally" : "Åben lokalt", + "Failed to redirect to client" : "Kunne ikke omdirigere til klienten", "Open file locally" : "Åben fil lokalt", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Filen bør nu åbne på dit apparat. Hvis den ikke gør det, så kontroller venligst at desktop app'en er installeret.", "Retry and close" : "Forsøg igen og luk", "Open online" : "Åben online", - "Failed to redirect to client" : "Kunne ikke omdirigere til klienten", - "Open locally" : "Åben lokalt", "Rename" : "Omdøb", "Open details" : "Mere information", "View in folder" : "Vis i mappe", diff --git a/apps/files/l10n/de.js b/apps/files/l10n/de.js index d21936c8ec9..b201407f4c7 100644 --- a/apps/files/l10n/de.js +++ b/apps/files/l10n/de.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Verschieben oder Kopieren abgebrochen", "Open folder {displayName}" : "Ordner {displayName} öffnen", "Open in Files" : "In \"Dateien\" öffnen", + "Open locally" : "Lokal öffnen", + "Failed to redirect to client" : "Umleitung zum Client fehlgeschlagen", "Open file locally" : "Datei lokal öffnen", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Die Datei sollte sich jetzt auf deinem Gerät öffnen. Wenn dies nicht der Fall ist, überprüfe, ob du die Desktop-App installiert hast.", "Retry and close" : "Erneut versuchen und schließen", "Open online" : "Online öffnen", - "Failed to redirect to client" : "Umleitung zum Client fehlgeschlagen", - "Open locally" : "Lokal öffnen", "Rename" : "Umbenennen", "Open details" : "Details öffnen", "View in folder" : "In Ordner anzeigen", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "Persönliche Dateien", "Text file" : "Textdatei", "New text file.txt" : "Neue Textdatei file.txt", + "%1$s (renamed)" : "%1$s (umbenannt)", + "renamed file" : "Umbenannte Datei", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Nach Aktivierung der Windows-kompatiblen Dateinamen können vorhandene Dateien nicht mehr geändert, aber von ihrem Besitzer in gültige neue Namen umbenannt werden.", "{count} files could not be converted" : "{count} Dateien konnten nicht konvertiert werden", "{count} files successfully converted" : "{count} Dateien konvertiert" }, diff --git a/apps/files/l10n/de.json b/apps/files/l10n/de.json index 15fae9b76ba..8b16a6cf288 100644 --- a/apps/files/l10n/de.json +++ b/apps/files/l10n/de.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Verschieben oder Kopieren abgebrochen", "Open folder {displayName}" : "Ordner {displayName} öffnen", "Open in Files" : "In \"Dateien\" öffnen", + "Open locally" : "Lokal öffnen", + "Failed to redirect to client" : "Umleitung zum Client fehlgeschlagen", "Open file locally" : "Datei lokal öffnen", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Die Datei sollte sich jetzt auf deinem Gerät öffnen. Wenn dies nicht der Fall ist, überprüfe, ob du die Desktop-App installiert hast.", "Retry and close" : "Erneut versuchen und schließen", "Open online" : "Online öffnen", - "Failed to redirect to client" : "Umleitung zum Client fehlgeschlagen", - "Open locally" : "Lokal öffnen", "Rename" : "Umbenennen", "Open details" : "Details öffnen", "View in folder" : "In Ordner anzeigen", @@ -453,6 +453,9 @@ "Personal Files" : "Persönliche Dateien", "Text file" : "Textdatei", "New text file.txt" : "Neue Textdatei file.txt", + "%1$s (renamed)" : "%1$s (umbenannt)", + "renamed file" : "Umbenannte Datei", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Nach Aktivierung der Windows-kompatiblen Dateinamen können vorhandene Dateien nicht mehr geändert, aber von ihrem Besitzer in gültige neue Namen umbenannt werden.", "{count} files could not be converted" : "{count} Dateien konnten nicht konvertiert werden", "{count} files successfully converted" : "{count} Dateien konvertiert" },"pluralForm" :"nplurals=2; plural=(n != 1);" diff --git a/apps/files/l10n/de_DE.js b/apps/files/l10n/de_DE.js index f831a8be747..4eb6dbf8fdc 100644 --- a/apps/files/l10n/de_DE.js +++ b/apps/files/l10n/de_DE.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Verschieben oder kopieren abgebrochen", "Open folder {displayName}" : "Ordner {displayName} öffnen", "Open in Files" : "In Dateien öffnen", + "Open locally" : "Lokal öffnen", + "Failed to redirect to client" : "Umleitung zum Client fehlgeschlagen", "Open file locally" : "Datei lokal öffnen", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Die Datei sollte sich jetzt auf Ihrem Gerät öffnen. Wenn dies nicht der Fall ist, überprüfen Sie, ob Sie die Desktop-App installiert haben.", "Retry and close" : "Erneut versuchen und schließen", "Open online" : "Online öffnen", - "Failed to redirect to client" : "Umleitung zum Client fehlgeschlagen", - "Open locally" : "Lokal öffnen", "Rename" : "Umbenennen", "Open details" : "Details öffnen", "View in folder" : "In Ordner anzeigen", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "Persönliche Dateien", "Text file" : "Textdatei", "New text file.txt" : "Neue Textdatei file.txt", + "%1$s (renamed)" : "%1$s (umbenannt)", + "renamed file" : "Umbenannte Datei", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Nach Aktivierung der Windows-kompatiblen Dateinamen können vorhandene Dateien nicht mehr geändert, aber von ihrem Besitzer in gültige neue Namen umbenannt werden.", "{count} files could not be converted" : "{count} Dateien konnten nicht konvertiert werden", "{count} files successfully converted" : "{count} Dateien konvertiert" }, diff --git a/apps/files/l10n/de_DE.json b/apps/files/l10n/de_DE.json index ae1dbdeca62..6303adcd035 100644 --- a/apps/files/l10n/de_DE.json +++ b/apps/files/l10n/de_DE.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Verschieben oder kopieren abgebrochen", "Open folder {displayName}" : "Ordner {displayName} öffnen", "Open in Files" : "In Dateien öffnen", + "Open locally" : "Lokal öffnen", + "Failed to redirect to client" : "Umleitung zum Client fehlgeschlagen", "Open file locally" : "Datei lokal öffnen", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Die Datei sollte sich jetzt auf Ihrem Gerät öffnen. Wenn dies nicht der Fall ist, überprüfen Sie, ob Sie die Desktop-App installiert haben.", "Retry and close" : "Erneut versuchen und schließen", "Open online" : "Online öffnen", - "Failed to redirect to client" : "Umleitung zum Client fehlgeschlagen", - "Open locally" : "Lokal öffnen", "Rename" : "Umbenennen", "Open details" : "Details öffnen", "View in folder" : "In Ordner anzeigen", @@ -453,6 +453,9 @@ "Personal Files" : "Persönliche Dateien", "Text file" : "Textdatei", "New text file.txt" : "Neue Textdatei file.txt", + "%1$s (renamed)" : "%1$s (umbenannt)", + "renamed file" : "Umbenannte Datei", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Nach Aktivierung der Windows-kompatiblen Dateinamen können vorhandene Dateien nicht mehr geändert, aber von ihrem Besitzer in gültige neue Namen umbenannt werden.", "{count} files could not be converted" : "{count} Dateien konnten nicht konvertiert werden", "{count} files successfully converted" : "{count} Dateien konvertiert" },"pluralForm" :"nplurals=2; plural=(n != 1);" diff --git a/apps/files/l10n/en_GB.js b/apps/files/l10n/en_GB.js index 1499c95351b..c49fcc464f8 100644 --- a/apps/files/l10n/en_GB.js +++ b/apps/files/l10n/en_GB.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Cancelled move or copy operation", "Open folder {displayName}" : "Open folder {displayName}", "Open in Files" : "Open in Files", + "Open locally" : "Open locally", + "Failed to redirect to client" : "Failed to redirect to client", "Open file locally" : "Open file locally", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "The file should now open on your device. If it doesn't, please check that you have the desktop app installed.", "Retry and close" : "Retry and close", "Open online" : "Open online", - "Failed to redirect to client" : "Failed to redirect to client", - "Open locally" : "Open locally", "Rename" : "Rename", "Open details" : "Open details", "View in folder" : "View in folder", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "Personal Files", "Text file" : "Text file", "New text file.txt" : "New text file.txt", + "%1$s (renamed)" : "%1$s (renamed)", + "renamed file" : "renamed file", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner.", "{count} files could not be converted" : "{count} files could not be converted", "{count} files successfully converted" : "{count} files successfully converted" }, diff --git a/apps/files/l10n/en_GB.json b/apps/files/l10n/en_GB.json index 093e3fbf15e..640b2b24d64 100644 --- a/apps/files/l10n/en_GB.json +++ b/apps/files/l10n/en_GB.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Cancelled move or copy operation", "Open folder {displayName}" : "Open folder {displayName}", "Open in Files" : "Open in Files", + "Open locally" : "Open locally", + "Failed to redirect to client" : "Failed to redirect to client", "Open file locally" : "Open file locally", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "The file should now open on your device. If it doesn't, please check that you have the desktop app installed.", "Retry and close" : "Retry and close", "Open online" : "Open online", - "Failed to redirect to client" : "Failed to redirect to client", - "Open locally" : "Open locally", "Rename" : "Rename", "Open details" : "Open details", "View in folder" : "View in folder", @@ -453,6 +453,9 @@ "Personal Files" : "Personal Files", "Text file" : "Text file", "New text file.txt" : "New text file.txt", + "%1$s (renamed)" : "%1$s (renamed)", + "renamed file" : "renamed file", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner.", "{count} files could not be converted" : "{count} files could not be converted", "{count} files successfully converted" : "{count} files successfully converted" },"pluralForm" :"nplurals=2; plural=(n != 1);" diff --git a/apps/files/l10n/es.js b/apps/files/l10n/es.js index 9f1470a2e7b..04e9c3a8dc4 100644 --- a/apps/files/l10n/es.js +++ b/apps/files/l10n/es.js @@ -280,12 +280,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Se canceló la operación de mover o copiar", "Open folder {displayName}" : "Abrir carpeta {displayName}", "Open in Files" : "Abrir en Archivos", + "Open locally" : "Abrir localmente", + "Failed to redirect to client" : "Fallo al redirigir al cliente", "Open file locally" : "Abrir archivo localmente", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "El archivo se abrirá ahora en tu dispositivo. Si esto no ocurre, por favor verifica que has instalado la aplicación de escritorio", "Retry and close" : "Reintentar y cerrar", "Open online" : "Abrir en línea", - "Failed to redirect to client" : "Fallo al redirigir al cliente", - "Open locally" : "Abrir localmente", "Rename" : "Renombrar", "Open details" : "Abrir detalles", "View in folder" : "Ver en carpeta", @@ -447,6 +447,9 @@ OC.L10N.register( "Personal Files" : "Archivos Personales", "Text file" : "Archivo de texto", "New text file.txt" : "Nuevo archivo.txt", + "%1$s (renamed)" : "%1$s (renombrado)", + "renamed file" : "archivo renombrado", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Luego de habilitar los nombres de archivo compatibles con windows, los archivos existentes no podrán ser modificados, pero, podrán ser renombrados a nuevos nombres válidos por su respectivo propietario.", "{count} files could not be converted" : "{count} archivos no han podido ser convertidos", "{count} files successfully converted" : "{count} archivos convertidos correctamente" }, diff --git a/apps/files/l10n/es.json b/apps/files/l10n/es.json index 6f586c00097..a8ee83caba0 100644 --- a/apps/files/l10n/es.json +++ b/apps/files/l10n/es.json @@ -278,12 +278,12 @@ "Cancelled move or copy operation" : "Se canceló la operación de mover o copiar", "Open folder {displayName}" : "Abrir carpeta {displayName}", "Open in Files" : "Abrir en Archivos", + "Open locally" : "Abrir localmente", + "Failed to redirect to client" : "Fallo al redirigir al cliente", "Open file locally" : "Abrir archivo localmente", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "El archivo se abrirá ahora en tu dispositivo. Si esto no ocurre, por favor verifica que has instalado la aplicación de escritorio", "Retry and close" : "Reintentar y cerrar", "Open online" : "Abrir en línea", - "Failed to redirect to client" : "Fallo al redirigir al cliente", - "Open locally" : "Abrir localmente", "Rename" : "Renombrar", "Open details" : "Abrir detalles", "View in folder" : "Ver en carpeta", @@ -445,6 +445,9 @@ "Personal Files" : "Archivos Personales", "Text file" : "Archivo de texto", "New text file.txt" : "Nuevo archivo.txt", + "%1$s (renamed)" : "%1$s (renombrado)", + "renamed file" : "archivo renombrado", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Luego de habilitar los nombres de archivo compatibles con windows, los archivos existentes no podrán ser modificados, pero, podrán ser renombrados a nuevos nombres válidos por su respectivo propietario.", "{count} files could not be converted" : "{count} archivos no han podido ser convertidos", "{count} files successfully converted" : "{count} archivos convertidos correctamente" },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" diff --git a/apps/files/l10n/es_EC.js b/apps/files/l10n/es_EC.js index 7e353f0a6a4..2e937b91fae 100644 --- a/apps/files/l10n/es_EC.js +++ b/apps/files/l10n/es_EC.js @@ -149,9 +149,9 @@ OC.L10N.register( "Move" : "Mover", "Move or copy" : "Mover o copiar", "Open folder {displayName}" : "Abrir carpeta {displayName}.", - "Open file locally" : "Abrir archivo localmente", - "Failed to redirect to client" : "No se pudo redirigir al cliente.", "Open locally" : "Abrir localmente", + "Failed to redirect to client" : "No se pudo redirigir al cliente.", + "Open file locally" : "Abrir archivo localmente", "Rename" : "Renombrar", "Open details" : "Abrir detalles.", "View in folder" : "Ver en la carpeta", diff --git a/apps/files/l10n/es_EC.json b/apps/files/l10n/es_EC.json index 3f7ce16df35..ce46795a8ae 100644 --- a/apps/files/l10n/es_EC.json +++ b/apps/files/l10n/es_EC.json @@ -147,9 +147,9 @@ "Move" : "Mover", "Move or copy" : "Mover o copiar", "Open folder {displayName}" : "Abrir carpeta {displayName}.", - "Open file locally" : "Abrir archivo localmente", - "Failed to redirect to client" : "No se pudo redirigir al cliente.", "Open locally" : "Abrir localmente", + "Failed to redirect to client" : "No se pudo redirigir al cliente.", + "Open file locally" : "Abrir archivo localmente", "Rename" : "Renombrar", "Open details" : "Abrir detalles.", "View in folder" : "Ver en la carpeta", diff --git a/apps/files/l10n/es_MX.js b/apps/files/l10n/es_MX.js index 3fdea38848c..1825c108261 100644 --- a/apps/files/l10n/es_MX.js +++ b/apps/files/l10n/es_MX.js @@ -227,9 +227,9 @@ OC.L10N.register( "Cancelled move or copy operation" : "Se canceló la operación de mover o copiar", "Open folder {displayName}" : "Abrir carpeta {displayName}", "Open in Files" : "Abrir en Archivos", + "Failed to redirect to client" : "Fallo al redirigir al cliente", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "El archivo se abrirá ahora en tu dispositivo. Si esto no ocurre, por favor verifica que hayas instalado la aplicación de escritorio.", "Retry and close" : "Reintentar y cerrar", - "Failed to redirect to client" : "Fallo al redirigir al cliente", "Rename" : "Renombrar", "Open details" : "Abrir detalles", "View in folder" : "Ver en la carpeta", diff --git a/apps/files/l10n/es_MX.json b/apps/files/l10n/es_MX.json index 24a26109117..c15bb55f569 100644 --- a/apps/files/l10n/es_MX.json +++ b/apps/files/l10n/es_MX.json @@ -225,9 +225,9 @@ "Cancelled move or copy operation" : "Se canceló la operación de mover o copiar", "Open folder {displayName}" : "Abrir carpeta {displayName}", "Open in Files" : "Abrir en Archivos", + "Failed to redirect to client" : "Fallo al redirigir al cliente", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "El archivo se abrirá ahora en tu dispositivo. Si esto no ocurre, por favor verifica que hayas instalado la aplicación de escritorio.", "Retry and close" : "Reintentar y cerrar", - "Failed to redirect to client" : "Fallo al redirigir al cliente", "Rename" : "Renombrar", "Open details" : "Abrir detalles", "View in folder" : "Ver en la carpeta", diff --git a/apps/files/l10n/et_EE.js b/apps/files/l10n/et_EE.js index f5ca9e71e54..95ffdc76632 100644 --- a/apps/files/l10n/et_EE.js +++ b/apps/files/l10n/et_EE.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Teisaldamine või kopeerimine on katkestatud", "Open folder {displayName}" : "Ava kaust {displayName}", "Open in Files" : "Ava failirakenduses", + "Open locally" : "Ava kohalikust andmeruumist", + "Failed to redirect to client" : "Kliendi ümbersuunamine ei õnnestunud", "Open file locally" : "Ava fail kohalikus seadmes", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Fail peaks nüüd sinu seadmes või arvutis olema avatud. Kui see nii pole, siis palun kontrolli, et töölauarakendus on paigaldatud.", "Retry and close" : "Proovi uuesti ja sulge", "Open online" : "Ava võrgust", - "Failed to redirect to client" : "Kliendi ümbersuunamine ei õnnestunud", - "Open locally" : "Ava kohalikust andmeruumist", "Rename" : "Muuda nime", "Open details" : "Ava üksikasjad", "View in folder" : "Vaata kaustas", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "Isiklikud Failid", "Text file" : "Tekstifail", "New text file.txt" : "Uus tekstifail.txt", + "%1$s (renamed)" : "%1$s (nimi on muudetud)", + "renamed file" : "muudetud nimega fail", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Kui võtad kasutusele Windowsiga ühilduvad failinimed, siis olemasolevad mitteühilduvaid faile ei saa enam muuta, aga faili omanik saab failinime muuta ühilduvaks.", "{count} files could not be converted" : "{count} faili ei õnnestunud teisendada", "{count} files successfully converted" : "{count} faili teisendamine õnnestus" }, diff --git a/apps/files/l10n/et_EE.json b/apps/files/l10n/et_EE.json index 5b90843bdf3..80c27615d01 100644 --- a/apps/files/l10n/et_EE.json +++ b/apps/files/l10n/et_EE.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Teisaldamine või kopeerimine on katkestatud", "Open folder {displayName}" : "Ava kaust {displayName}", "Open in Files" : "Ava failirakenduses", + "Open locally" : "Ava kohalikust andmeruumist", + "Failed to redirect to client" : "Kliendi ümbersuunamine ei õnnestunud", "Open file locally" : "Ava fail kohalikus seadmes", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Fail peaks nüüd sinu seadmes või arvutis olema avatud. Kui see nii pole, siis palun kontrolli, et töölauarakendus on paigaldatud.", "Retry and close" : "Proovi uuesti ja sulge", "Open online" : "Ava võrgust", - "Failed to redirect to client" : "Kliendi ümbersuunamine ei õnnestunud", - "Open locally" : "Ava kohalikust andmeruumist", "Rename" : "Muuda nime", "Open details" : "Ava üksikasjad", "View in folder" : "Vaata kaustas", @@ -453,6 +453,9 @@ "Personal Files" : "Isiklikud Failid", "Text file" : "Tekstifail", "New text file.txt" : "Uus tekstifail.txt", + "%1$s (renamed)" : "%1$s (nimi on muudetud)", + "renamed file" : "muudetud nimega fail", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Kui võtad kasutusele Windowsiga ühilduvad failinimed, siis olemasolevad mitteühilduvaid faile ei saa enam muuta, aga faili omanik saab failinime muuta ühilduvaks.", "{count} files could not be converted" : "{count} faili ei õnnestunud teisendada", "{count} files successfully converted" : "{count} faili teisendamine õnnestus" },"pluralForm" :"nplurals=2; plural=(n != 1);" diff --git a/apps/files/l10n/eu.js b/apps/files/l10n/eu.js index c2cfee285f2..5c5863a131d 100644 --- a/apps/files/l10n/eu.js +++ b/apps/files/l10n/eu.js @@ -251,11 +251,11 @@ OC.L10N.register( "Cancelled move or copy operation" : "Mugitze edo kopiatze operazioa utzi da", "Open folder {displayName}" : "Ireki {displayName} karpeta", "Open in Files" : "Ireki Fitxategiak aplikazioan", + "Open locally" : "Ireki lokalean", + "Failed to redirect to client" : "Bezerora birbideratzeak huts egin du", "Open file locally" : "Ireki fitxategia lokalean", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Fitxategia orain zure gailuan ireki beharko litzateke. Hala ez bada, egiaztatu mahaigaineko aplikazioa instalatuta duzula.", "Retry and close" : "Saiatu berriro eta itxi", - "Failed to redirect to client" : "Bezerora birbideratzeak huts egin du", - "Open locally" : "Ireki lokalean", "Rename" : "Berrizendatu", "Open details" : "Ireki xehetasunak", "View in folder" : "Ikusi karpetan", diff --git a/apps/files/l10n/eu.json b/apps/files/l10n/eu.json index 3def8199ade..d285b0d0339 100644 --- a/apps/files/l10n/eu.json +++ b/apps/files/l10n/eu.json @@ -249,11 +249,11 @@ "Cancelled move or copy operation" : "Mugitze edo kopiatze operazioa utzi da", "Open folder {displayName}" : "Ireki {displayName} karpeta", "Open in Files" : "Ireki Fitxategiak aplikazioan", + "Open locally" : "Ireki lokalean", + "Failed to redirect to client" : "Bezerora birbideratzeak huts egin du", "Open file locally" : "Ireki fitxategia lokalean", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Fitxategia orain zure gailuan ireki beharko litzateke. Hala ez bada, egiaztatu mahaigaineko aplikazioa instalatuta duzula.", "Retry and close" : "Saiatu berriro eta itxi", - "Failed to redirect to client" : "Bezerora birbideratzeak huts egin du", - "Open locally" : "Ireki lokalean", "Rename" : "Berrizendatu", "Open details" : "Ireki xehetasunak", "View in folder" : "Ikusi karpetan", diff --git a/apps/files/l10n/fa.js b/apps/files/l10n/fa.js index 6a23baaa9a3..ff277d8be18 100644 --- a/apps/files/l10n/fa.js +++ b/apps/files/l10n/fa.js @@ -160,9 +160,9 @@ OC.L10N.register( "Move or copy" : "انتقال یا رونوشت", "Open folder {displayName}" : "باز کردن پوشه {displayName}", "Open in Files" : "در فایل باز کنید", - "Open file locally" : "گشودن محلی پرونده", - "Failed to redirect to client" : "هدایت به مشتری انجام نشد", "Open locally" : "گشودن محلی", + "Failed to redirect to client" : "هدایت به مشتری انجام نشد", + "Open file locally" : "گشودن محلی پرونده", "Rename" : "تغییرنام", "Open details" : "باز کردن جزئیات", "View in folder" : "مشاهده در پوشه", diff --git a/apps/files/l10n/fa.json b/apps/files/l10n/fa.json index af4a5027093..155eea0cd49 100644 --- a/apps/files/l10n/fa.json +++ b/apps/files/l10n/fa.json @@ -158,9 +158,9 @@ "Move or copy" : "انتقال یا رونوشت", "Open folder {displayName}" : "باز کردن پوشه {displayName}", "Open in Files" : "در فایل باز کنید", - "Open file locally" : "گشودن محلی پرونده", - "Failed to redirect to client" : "هدایت به مشتری انجام نشد", "Open locally" : "گشودن محلی", + "Failed to redirect to client" : "هدایت به مشتری انجام نشد", + "Open file locally" : "گشودن محلی پرونده", "Rename" : "تغییرنام", "Open details" : "باز کردن جزئیات", "View in folder" : "مشاهده در پوشه", diff --git a/apps/files/l10n/fi.js b/apps/files/l10n/fi.js index 4c419f2e482..6e6fd348feb 100644 --- a/apps/files/l10n/fi.js +++ b/apps/files/l10n/fi.js @@ -244,10 +244,10 @@ OC.L10N.register( "Cancelled move or copy operation" : "Siirto- tai kopiointitoiminto peruttu", "Open folder {displayName}" : "Avaa kansio {displayName}", "Open in Files" : "Avaa tiedostosovelluksessa", + "Open locally" : "Avaa paikallisesti", + "Failed to redirect to client" : "Uudelleenohjaus asiakkaaseen epäonnistui", "Open file locally" : "Avaa tiedosto paikallisesti", "Retry and close" : "Yritä uudelleen ja sulje", - "Failed to redirect to client" : "Uudelleenohjaus asiakkaaseen epäonnistui", - "Open locally" : "Avaa paikallisesti", "Rename" : "Nimeä uudelleen", "Open details" : "Avaa yksityiskohdat", "View in folder" : "Näe kansiossa", diff --git a/apps/files/l10n/fi.json b/apps/files/l10n/fi.json index fad7ebafc6e..c40fef57d23 100644 --- a/apps/files/l10n/fi.json +++ b/apps/files/l10n/fi.json @@ -242,10 +242,10 @@ "Cancelled move or copy operation" : "Siirto- tai kopiointitoiminto peruttu", "Open folder {displayName}" : "Avaa kansio {displayName}", "Open in Files" : "Avaa tiedostosovelluksessa", + "Open locally" : "Avaa paikallisesti", + "Failed to redirect to client" : "Uudelleenohjaus asiakkaaseen epäonnistui", "Open file locally" : "Avaa tiedosto paikallisesti", "Retry and close" : "Yritä uudelleen ja sulje", - "Failed to redirect to client" : "Uudelleenohjaus asiakkaaseen epäonnistui", - "Open locally" : "Avaa paikallisesti", "Rename" : "Nimeä uudelleen", "Open details" : "Avaa yksityiskohdat", "View in folder" : "Näe kansiossa", diff --git a/apps/files/l10n/fr.js b/apps/files/l10n/fr.js index 20142bbebf2..6d7ffb9200a 100644 --- a/apps/files/l10n/fr.js +++ b/apps/files/l10n/fr.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Opération de déplacement ou de copie annulée", "Open folder {displayName}" : "Ouvrir le dossier {displayName}", "Open in Files" : "Ouvrir dans Fichiers", + "Open locally" : "Ouvrir localement", + "Failed to redirect to client" : "Échec de la redirection vers le client", "Open file locally" : "Ouvrir le fichier localement", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Le fichier devrait maintenant s'ouvrir sur votre appareil. Si ce n'est pas le cas, vérifiez que vous avez installé l'application de bureau.", "Retry and close" : "Réessayer et fermer", "Open online" : "Ouvrir en ligne", - "Failed to redirect to client" : "Échec de la redirection vers le client", - "Open locally" : "Ouvrir localement", "Rename" : "Renommer", "Open details" : "Ouvrir les détails", "View in folder" : "Afficher dans le dossier", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "Fichiers personnels", "Text file" : "Fichier texte", "New text file.txt" : "Nouveau fichier texte.txt", + "%1$s (renamed)" : "%1$s (renommé)", + "renamed file" : "fichier renommé", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Après avoir activé les noms de fichiers compatibles Windows, les fichiers existants ne peuvent plus être modifiés, mais peuvent être renommés avec des noms valides par leur propriétaire.", "{count} files could not be converted" : "{count}fichier n'a pas pu être converti", "{count} files successfully converted" : "{count}fichier converti avec succès" }, diff --git a/apps/files/l10n/fr.json b/apps/files/l10n/fr.json index af4f5f70116..d7e622dd9c6 100644 --- a/apps/files/l10n/fr.json +++ b/apps/files/l10n/fr.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Opération de déplacement ou de copie annulée", "Open folder {displayName}" : "Ouvrir le dossier {displayName}", "Open in Files" : "Ouvrir dans Fichiers", + "Open locally" : "Ouvrir localement", + "Failed to redirect to client" : "Échec de la redirection vers le client", "Open file locally" : "Ouvrir le fichier localement", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Le fichier devrait maintenant s'ouvrir sur votre appareil. Si ce n'est pas le cas, vérifiez que vous avez installé l'application de bureau.", "Retry and close" : "Réessayer et fermer", "Open online" : "Ouvrir en ligne", - "Failed to redirect to client" : "Échec de la redirection vers le client", - "Open locally" : "Ouvrir localement", "Rename" : "Renommer", "Open details" : "Ouvrir les détails", "View in folder" : "Afficher dans le dossier", @@ -453,6 +453,9 @@ "Personal Files" : "Fichiers personnels", "Text file" : "Fichier texte", "New text file.txt" : "Nouveau fichier texte.txt", + "%1$s (renamed)" : "%1$s (renommé)", + "renamed file" : "fichier renommé", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Après avoir activé les noms de fichiers compatibles Windows, les fichiers existants ne peuvent plus être modifiés, mais peuvent être renommés avec des noms valides par leur propriétaire.", "{count} files could not be converted" : "{count}fichier n'a pas pu être converti", "{count} files successfully converted" : "{count}fichier converti avec succès" },"pluralForm" :"nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" diff --git a/apps/files/l10n/ga.js b/apps/files/l10n/ga.js index e08c16d1f7e..5e71dfac609 100644 --- a/apps/files/l10n/ga.js +++ b/apps/files/l10n/ga.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Oibríocht aistrithe nó cóipeála curtha ar ceal", "Open folder {displayName}" : "Oscail fillteán {displayName}", "Open in Files" : "Oscail i Comhaid", + "Open locally" : "Oscail go háitiúil", + "Failed to redirect to client" : "Theip ar atreorú chuig an gcliant", "Open file locally" : "Oscail comhad go háitiúil", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Ba cheart an comhad a oscailt anois ar do ghléas. Mura ndéanann sé, seiceáil le do thoil go bhfuil an aip deisce suiteáilte agat.", "Retry and close" : "Bain triail eile as agus dún", "Open online" : "Oscail ar líne", - "Failed to redirect to client" : "Theip ar atreorú chuig an gcliant", - "Open locally" : "Oscail go háitiúil", "Rename" : "Athainmnigh", "Open details" : "Sonraí oscailte", "View in folder" : "Amharc san fhillteán", @@ -455,6 +455,8 @@ OC.L10N.register( "Personal Files" : "Comhaid Phearsanta", "Text file" : "Comhad téacs", "New text file.txt" : "Comhad téacs nua.txt", + "%1$s (renamed)" : "%1$s (athainmnithe)", + "renamed file" : "comhad athainmnithe", "{count} files could not be converted" : "{count} níorbh fhéidir comhaid a thiontú", "{count} files successfully converted" : "{count} comhaid a thiontú go rathúil" }, diff --git a/apps/files/l10n/ga.json b/apps/files/l10n/ga.json index acc3249e017..3d2e164a6f3 100644 --- a/apps/files/l10n/ga.json +++ b/apps/files/l10n/ga.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Oibríocht aistrithe nó cóipeála curtha ar ceal", "Open folder {displayName}" : "Oscail fillteán {displayName}", "Open in Files" : "Oscail i Comhaid", + "Open locally" : "Oscail go háitiúil", + "Failed to redirect to client" : "Theip ar atreorú chuig an gcliant", "Open file locally" : "Oscail comhad go háitiúil", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Ba cheart an comhad a oscailt anois ar do ghléas. Mura ndéanann sé, seiceáil le do thoil go bhfuil an aip deisce suiteáilte agat.", "Retry and close" : "Bain triail eile as agus dún", "Open online" : "Oscail ar líne", - "Failed to redirect to client" : "Theip ar atreorú chuig an gcliant", - "Open locally" : "Oscail go háitiúil", "Rename" : "Athainmnigh", "Open details" : "Sonraí oscailte", "View in folder" : "Amharc san fhillteán", @@ -453,6 +453,8 @@ "Personal Files" : "Comhaid Phearsanta", "Text file" : "Comhad téacs", "New text file.txt" : "Comhad téacs nua.txt", + "%1$s (renamed)" : "%1$s (athainmnithe)", + "renamed file" : "comhad athainmnithe", "{count} files could not be converted" : "{count} níorbh fhéidir comhaid a thiontú", "{count} files successfully converted" : "{count} comhaid a thiontú go rathúil" },"pluralForm" :"nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4);" diff --git a/apps/files/l10n/gl.js b/apps/files/l10n/gl.js index c352a853798..4a73f0d8785 100644 --- a/apps/files/l10n/gl.js +++ b/apps/files/l10n/gl.js @@ -277,12 +277,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Foi cancelada a operación de movemento ou copia", "Open folder {displayName}" : "Abrir o cartafol {displayName}", "Open in Files" : "Abrir en Ficheiros", + "Open locally" : "Abrir localmente", + "Failed to redirect to client" : "Produciuse un fallo ao redirixir ao cliente", "Open file locally" : "Abrir o ficheiro localmente", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "O ficheiro debería abrirse agora no seu dispositivo. Se non é así, comprobe se ten instalada a aplicación de escritorio.", "Retry and close" : "Tentar de novo e pechar", "Open online" : "Abrir en liña", - "Failed to redirect to client" : "Produciuse un fallo ao redirixir ao cliente", - "Open locally" : "Abrir localmente", "Rename" : "Cambiar o nome", "Open details" : "Abrir detalles", "View in folder" : "Ver no cartafol", diff --git a/apps/files/l10n/gl.json b/apps/files/l10n/gl.json index 88363ce23bc..7911fe7ed11 100644 --- a/apps/files/l10n/gl.json +++ b/apps/files/l10n/gl.json @@ -275,12 +275,12 @@ "Cancelled move or copy operation" : "Foi cancelada a operación de movemento ou copia", "Open folder {displayName}" : "Abrir o cartafol {displayName}", "Open in Files" : "Abrir en Ficheiros", + "Open locally" : "Abrir localmente", + "Failed to redirect to client" : "Produciuse un fallo ao redirixir ao cliente", "Open file locally" : "Abrir o ficheiro localmente", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "O ficheiro debería abrirse agora no seu dispositivo. Se non é así, comprobe se ten instalada a aplicación de escritorio.", "Retry and close" : "Tentar de novo e pechar", "Open online" : "Abrir en liña", - "Failed to redirect to client" : "Produciuse un fallo ao redirixir ao cliente", - "Open locally" : "Abrir localmente", "Rename" : "Cambiar o nome", "Open details" : "Abrir detalles", "View in folder" : "Ver no cartafol", diff --git a/apps/files/l10n/hu.js b/apps/files/l10n/hu.js index a07747091f7..b9c8dbb0aba 100644 --- a/apps/files/l10n/hu.js +++ b/apps/files/l10n/hu.js @@ -264,11 +264,11 @@ OC.L10N.register( "Cancelled move or copy operation" : "Az áthelyezés vagy másolás művelet megszakítva", "Open folder {displayName}" : "A(z) {displayName} mappa megnyitása", "Open in Files" : "Megnyitás a Fájlokban", + "Open locally" : "Megnyitás helyben", + "Failed to redirect to client" : "Nem sikerült az átirányítás a klienshez", "Open file locally" : "A fájl megnyitása helyben", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "A fájlnak most már meg kellene nyílni az eszközén. Ha mégsem, ellenőrizze, hogy telepítve van-e az asztali alkalmazás.", "Retry and close" : "Újrapróbálás és bezárás", - "Failed to redirect to client" : "Nem sikerült az átirányítás a klienshez", - "Open locally" : "Megnyitás helyben", "Rename" : "Átnevezés", "Open details" : "Részletek megnyitása", "View in folder" : "Megtekintés mappában", diff --git a/apps/files/l10n/hu.json b/apps/files/l10n/hu.json index f396814aa2b..75a19cd5c04 100644 --- a/apps/files/l10n/hu.json +++ b/apps/files/l10n/hu.json @@ -262,11 +262,11 @@ "Cancelled move or copy operation" : "Az áthelyezés vagy másolás művelet megszakítva", "Open folder {displayName}" : "A(z) {displayName} mappa megnyitása", "Open in Files" : "Megnyitás a Fájlokban", + "Open locally" : "Megnyitás helyben", + "Failed to redirect to client" : "Nem sikerült az átirányítás a klienshez", "Open file locally" : "A fájl megnyitása helyben", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "A fájlnak most már meg kellene nyílni az eszközén. Ha mégsem, ellenőrizze, hogy telepítve van-e az asztali alkalmazás.", "Retry and close" : "Újrapróbálás és bezárás", - "Failed to redirect to client" : "Nem sikerült az átirányítás a klienshez", - "Open locally" : "Megnyitás helyben", "Rename" : "Átnevezés", "Open details" : "Részletek megnyitása", "View in folder" : "Megtekintés mappában", diff --git a/apps/files/l10n/is.js b/apps/files/l10n/is.js index 396e17102d2..69a2c015b82 100644 --- a/apps/files/l10n/is.js +++ b/apps/files/l10n/is.js @@ -263,9 +263,9 @@ OC.L10N.register( "Cancelled move or copy operation" : "Hætti við aðgerð við að færa eða afrita", "Open folder {displayName}" : "Opna möppu {displayName}", "Open in Files" : "Opna í skráaforritinu", + "Failed to redirect to client" : "Mistókst að endurbeina til biðlara", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Skráin ætti núna að opnast á tækinu þínu. Ef það gerist ekki, ættirðu að ganga úr skugga um að þú sért með vinnutölvuforritið uppsett.", "Retry and close" : "Prófa aftur og loka", - "Failed to redirect to client" : "Mistókst að endurbeina til biðlara", "Rename" : "Endurnefna", "Open details" : "Opna nánari upplýsingar", "View in folder" : "Skoða í möppu", diff --git a/apps/files/l10n/is.json b/apps/files/l10n/is.json index 4da31a7d937..ebf1c4095bb 100644 --- a/apps/files/l10n/is.json +++ b/apps/files/l10n/is.json @@ -261,9 +261,9 @@ "Cancelled move or copy operation" : "Hætti við aðgerð við að færa eða afrita", "Open folder {displayName}" : "Opna möppu {displayName}", "Open in Files" : "Opna í skráaforritinu", + "Failed to redirect to client" : "Mistókst að endurbeina til biðlara", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Skráin ætti núna að opnast á tækinu þínu. Ef það gerist ekki, ættirðu að ganga úr skugga um að þú sért með vinnutölvuforritið uppsett.", "Retry and close" : "Prófa aftur og loka", - "Failed to redirect to client" : "Mistókst að endurbeina til biðlara", "Rename" : "Endurnefna", "Open details" : "Opna nánari upplýsingar", "View in folder" : "Skoða í möppu", diff --git a/apps/files/l10n/it.js b/apps/files/l10n/it.js index e189cf4673a..c679e500af3 100644 --- a/apps/files/l10n/it.js +++ b/apps/files/l10n/it.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Operazione di spostamento o copia annullata", "Open folder {displayName}" : "Apri la cartella {displayName}", "Open in Files" : "Apri in File", + "Open locally" : "Aprire localmente", + "Failed to redirect to client" : "Reindirizzamento al client non riuscito", "Open file locally" : "Apri file localmente", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Il file dovrebbe ora aprirsi sul tuo dispositivo. In caso contrario, controlla di aver installato l'app desktop.", "Retry and close" : "Riprova e chiudi", "Open online" : "Apri online", - "Failed to redirect to client" : "Reindirizzamento al client non riuscito", - "Open locally" : "Aprire localmente", "Rename" : "Rinomina", "Open details" : "Apri i dettagli", "View in folder" : "Visualizza nella cartella", @@ -455,6 +455,8 @@ OC.L10N.register( "Personal Files" : "File personali", "Text file" : "File di testo", "New text file.txt" : "Nuovo file di testo.txt", + "%1$s (renamed)" : "%1$s (rinominato)", + "renamed file" : "file rinominato", "{count} files could not be converted" : "{count} file non possono essere convertiti", "{count} files successfully converted" : "{count} file convertiti con successo" }, diff --git a/apps/files/l10n/it.json b/apps/files/l10n/it.json index e3787686d41..22126950860 100644 --- a/apps/files/l10n/it.json +++ b/apps/files/l10n/it.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Operazione di spostamento o copia annullata", "Open folder {displayName}" : "Apri la cartella {displayName}", "Open in Files" : "Apri in File", + "Open locally" : "Aprire localmente", + "Failed to redirect to client" : "Reindirizzamento al client non riuscito", "Open file locally" : "Apri file localmente", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Il file dovrebbe ora aprirsi sul tuo dispositivo. In caso contrario, controlla di aver installato l'app desktop.", "Retry and close" : "Riprova e chiudi", "Open online" : "Apri online", - "Failed to redirect to client" : "Reindirizzamento al client non riuscito", - "Open locally" : "Aprire localmente", "Rename" : "Rinomina", "Open details" : "Apri i dettagli", "View in folder" : "Visualizza nella cartella", @@ -453,6 +453,8 @@ "Personal Files" : "File personali", "Text file" : "File di testo", "New text file.txt" : "Nuovo file di testo.txt", + "%1$s (renamed)" : "%1$s (rinominato)", + "renamed file" : "file rinominato", "{count} files could not be converted" : "{count} file non possono essere convertiti", "{count} files successfully converted" : "{count} file convertiti con successo" },"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" diff --git a/apps/files/l10n/ja.js b/apps/files/l10n/ja.js index 6b29c1c9780..d52955e27a6 100644 --- a/apps/files/l10n/ja.js +++ b/apps/files/l10n/ja.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "キャンセルされた移動またはコピー操作", "Open folder {displayName}" : "フォルダ {displayName} を開く", "Open in Files" : "ファイルアプリで開く", + "Open locally" : "ローカルで開く", + "Failed to redirect to client" : "クライアントへリダイレクトできませんでした", "Open file locally" : "ローカルでファイルを開く", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "ファイルがデバイス上で開くはずです。開かない場合は、デスクトップアプリがインストールされているかご確認ください。", "Retry and close" : "再試行して閉じる", "Open online" : "オンラインで開く", - "Failed to redirect to client" : "クライアントへリダイレクトできませんでした", - "Open locally" : "ローカルで開く", "Rename" : "名前の変更", "Open details" : "詳細を開く", "View in folder" : "フォルダー内で表示", @@ -455,6 +455,8 @@ OC.L10N.register( "Personal Files" : "個人ファイル", "Text file" : "テキストファイル", "New text file.txt" : "新規のテキストファイル作成", + "%1$s (renamed)" : "%1$s (リネーム済み)", + "renamed file" : "リネーム済みファイル", "{count} files could not be converted" : "{count}個のファイルが変換できませんでした", "{count} files successfully converted" : "{count}個のファイルの変換に成功しました" }, diff --git a/apps/files/l10n/ja.json b/apps/files/l10n/ja.json index d8d803191db..e63921f177a 100644 --- a/apps/files/l10n/ja.json +++ b/apps/files/l10n/ja.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "キャンセルされた移動またはコピー操作", "Open folder {displayName}" : "フォルダ {displayName} を開く", "Open in Files" : "ファイルアプリで開く", + "Open locally" : "ローカルで開く", + "Failed to redirect to client" : "クライアントへリダイレクトできませんでした", "Open file locally" : "ローカルでファイルを開く", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "ファイルがデバイス上で開くはずです。開かない場合は、デスクトップアプリがインストールされているかご確認ください。", "Retry and close" : "再試行して閉じる", "Open online" : "オンラインで開く", - "Failed to redirect to client" : "クライアントへリダイレクトできませんでした", - "Open locally" : "ローカルで開く", "Rename" : "名前の変更", "Open details" : "詳細を開く", "View in folder" : "フォルダー内で表示", @@ -453,6 +453,8 @@ "Personal Files" : "個人ファイル", "Text file" : "テキストファイル", "New text file.txt" : "新規のテキストファイル作成", + "%1$s (renamed)" : "%1$s (リネーム済み)", + "renamed file" : "リネーム済みファイル", "{count} files could not be converted" : "{count}個のファイルが変換できませんでした", "{count} files successfully converted" : "{count}個のファイルの変換に成功しました" },"pluralForm" :"nplurals=1; plural=0;" diff --git a/apps/files/l10n/ka.js b/apps/files/l10n/ka.js index 70aa60fc292..550819832fc 100644 --- a/apps/files/l10n/ka.js +++ b/apps/files/l10n/ka.js @@ -170,9 +170,9 @@ OC.L10N.register( "Cancelled move or copy operation" : "Cancelled move or copy operation", "Open folder {displayName}" : "Open folder {displayName}", "Open in Files" : "Open in Files", - "Open file locally" : "Open file locally", - "Failed to redirect to client" : "Failed to redirect to client", "Open locally" : "Open locally", + "Failed to redirect to client" : "Failed to redirect to client", + "Open file locally" : "Open file locally", "Rename" : "Rename", "Open details" : "Open details", "View in folder" : "View in folder", diff --git a/apps/files/l10n/ka.json b/apps/files/l10n/ka.json index afd9e6386d7..b9120314895 100644 --- a/apps/files/l10n/ka.json +++ b/apps/files/l10n/ka.json @@ -168,9 +168,9 @@ "Cancelled move or copy operation" : "Cancelled move or copy operation", "Open folder {displayName}" : "Open folder {displayName}", "Open in Files" : "Open in Files", - "Open file locally" : "Open file locally", - "Failed to redirect to client" : "Failed to redirect to client", "Open locally" : "Open locally", + "Failed to redirect to client" : "Failed to redirect to client", + "Open file locally" : "Open file locally", "Rename" : "Rename", "Open details" : "Open details", "View in folder" : "View in folder", diff --git a/apps/files/l10n/ko.js b/apps/files/l10n/ko.js index a91f928294e..296322c3a90 100644 --- a/apps/files/l10n/ko.js +++ b/apps/files/l10n/ko.js @@ -267,11 +267,11 @@ OC.L10N.register( "Cancelled move or copy operation" : "이동 또는 복사 작업을 취소함", "Open folder {displayName}" : "{displayName} 폴더 열기", "Open in Files" : "파일에서 열기", + "Open locally" : "로컬에서 열기", + "Failed to redirect to client" : "클라이언트로 리디렉션 하는데 실패함", "Open file locally" : "로컬에서 파일 열기", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "이제 이 파일이 당신의 기기에서 열려야 합니다. 그렇지 않다면, 데스크톱 앱이 설치되어 있는지 확인하세요.", "Retry and close" : "재시도 후 닫기", - "Failed to redirect to client" : "클라이언트로 리디렉션 하는데 실패함", - "Open locally" : "로컬에서 열기", "Rename" : "이름 바꾸기", "Open details" : "자세한 정보 열기", "View in folder" : "폴더에서 보기", diff --git a/apps/files/l10n/ko.json b/apps/files/l10n/ko.json index d40c82e850e..94f0888b200 100644 --- a/apps/files/l10n/ko.json +++ b/apps/files/l10n/ko.json @@ -265,11 +265,11 @@ "Cancelled move or copy operation" : "이동 또는 복사 작업을 취소함", "Open folder {displayName}" : "{displayName} 폴더 열기", "Open in Files" : "파일에서 열기", + "Open locally" : "로컬에서 열기", + "Failed to redirect to client" : "클라이언트로 리디렉션 하는데 실패함", "Open file locally" : "로컬에서 파일 열기", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "이제 이 파일이 당신의 기기에서 열려야 합니다. 그렇지 않다면, 데스크톱 앱이 설치되어 있는지 확인하세요.", "Retry and close" : "재시도 후 닫기", - "Failed to redirect to client" : "클라이언트로 리디렉션 하는데 실패함", - "Open locally" : "로컬에서 열기", "Rename" : "이름 바꾸기", "Open details" : "자세한 정보 열기", "View in folder" : "폴더에서 보기", diff --git a/apps/files/l10n/lt_LT.js b/apps/files/l10n/lt_LT.js index 9f5a301df9e..e977378b33b 100644 --- a/apps/files/l10n/lt_LT.js +++ b/apps/files/l10n/lt_LT.js @@ -185,8 +185,8 @@ OC.L10N.register( "Move or copy operation failed" : "Perkėlimo ar kopijavimo operacija patyrė nesėkmę", "Move or copy" : "Perkelti ar kopijuoti", "Open folder {displayName}" : "Atverti aplanką {displayName}", - "Retry and close" : "Bandyti dar kartą ir užverti", "Failed to redirect to client" : "Nepavyko peradresuoti į klientą", + "Retry and close" : "Bandyti dar kartą ir užverti", "Rename" : "Pervadinti", "Open details" : "Atverti išsamesnę informaciją", "View in folder" : "Rodyti aplanke", diff --git a/apps/files/l10n/lt_LT.json b/apps/files/l10n/lt_LT.json index ca5618e0f08..a2495e4f0f5 100644 --- a/apps/files/l10n/lt_LT.json +++ b/apps/files/l10n/lt_LT.json @@ -183,8 +183,8 @@ "Move or copy operation failed" : "Perkėlimo ar kopijavimo operacija patyrė nesėkmę", "Move or copy" : "Perkelti ar kopijuoti", "Open folder {displayName}" : "Atverti aplanką {displayName}", - "Retry and close" : "Bandyti dar kartą ir užverti", "Failed to redirect to client" : "Nepavyko peradresuoti į klientą", + "Retry and close" : "Bandyti dar kartą ir užverti", "Rename" : "Pervadinti", "Open details" : "Atverti išsamesnę informaciją", "View in folder" : "Rodyti aplanke", diff --git a/apps/files/l10n/mk.js b/apps/files/l10n/mk.js index 3f2259cc908..213f0f96325 100644 --- a/apps/files/l10n/mk.js +++ b/apps/files/l10n/mk.js @@ -201,9 +201,9 @@ OC.L10N.register( "Cancelled move or copy operation" : "Откажана операција на копирање или преместување", "Open folder {displayName}" : "Отвори папка {displayName}", "Open in Files" : "Отвори во датотеките", - "Open file locally" : "Отвори ја датотеката локално", - "Failed to redirect to client" : "Неуспешно пренасочување кон клиентот", "Open locally" : "Отвори локално", + "Failed to redirect to client" : "Неуспешно пренасочување кон клиентот", + "Open file locally" : "Отвори ја датотеката локално", "Rename" : "Преименувај", "Open details" : "Отвори детали", "View in folder" : "Погледни во папката", @@ -218,6 +218,7 @@ OC.L10N.register( "Videos" : "Видеа", "Created new folder \"{name}\"" : "Креирана нова папка \"{name}\"", "Unable to initialize the templates directory" : "Не може да се иницијализира папка за шаблони", + "Create templates folder" : "Креирај папка за шаблони", "Templates" : "Шаблони", "One of the dropped files could not be processed" : "Една од испуштените датотеки неможе да се процесоира", "Some files could not be moved" : "Некои датотеки не можат да се преместат", diff --git a/apps/files/l10n/mk.json b/apps/files/l10n/mk.json index f3a3a4f32dc..bfb0df09b99 100644 --- a/apps/files/l10n/mk.json +++ b/apps/files/l10n/mk.json @@ -199,9 +199,9 @@ "Cancelled move or copy operation" : "Откажана операција на копирање или преместување", "Open folder {displayName}" : "Отвори папка {displayName}", "Open in Files" : "Отвори во датотеките", - "Open file locally" : "Отвори ја датотеката локално", - "Failed to redirect to client" : "Неуспешно пренасочување кон клиентот", "Open locally" : "Отвори локално", + "Failed to redirect to client" : "Неуспешно пренасочување кон клиентот", + "Open file locally" : "Отвори ја датотеката локално", "Rename" : "Преименувај", "Open details" : "Отвори детали", "View in folder" : "Погледни во папката", @@ -216,6 +216,7 @@ "Videos" : "Видеа", "Created new folder \"{name}\"" : "Креирана нова папка \"{name}\"", "Unable to initialize the templates directory" : "Не може да се иницијализира папка за шаблони", + "Create templates folder" : "Креирај папка за шаблони", "Templates" : "Шаблони", "One of the dropped files could not be processed" : "Една од испуштените датотеки неможе да се процесоира", "Some files could not be moved" : "Некои датотеки не можат да се преместат", diff --git a/apps/files/l10n/nb.js b/apps/files/l10n/nb.js index e87b6544890..e7972e34eef 100644 --- a/apps/files/l10n/nb.js +++ b/apps/files/l10n/nb.js @@ -248,11 +248,11 @@ OC.L10N.register( "Cancelled move or copy operation" : "Kansellert flytte- eller kopieroperasjon", "Open folder {displayName}" : "Åpne mappe {displayName}", "Open in Files" : "Åpne i Filer", + "Open locally" : "Åpne lokalt", + "Failed to redirect to client" : "Kunne ikke omdirigere til klienten", "Open file locally" : "Åpne fil lokalt", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Filen skal nå åpnes på enheten din. Om ikke, vennligst sjekk at du har skrivebordsprogrammet installert.", "Retry and close" : "Prøv igjen og lukk", - "Failed to redirect to client" : "Kunne ikke omdirigere til klienten", - "Open locally" : "Åpne lokalt", "Rename" : "Gi nytt navn", "Open details" : "Åpne detaljer", "View in folder" : "Vis i mappe", diff --git a/apps/files/l10n/nb.json b/apps/files/l10n/nb.json index 877330c4ebc..3da228e2da7 100644 --- a/apps/files/l10n/nb.json +++ b/apps/files/l10n/nb.json @@ -246,11 +246,11 @@ "Cancelled move or copy operation" : "Kansellert flytte- eller kopieroperasjon", "Open folder {displayName}" : "Åpne mappe {displayName}", "Open in Files" : "Åpne i Filer", + "Open locally" : "Åpne lokalt", + "Failed to redirect to client" : "Kunne ikke omdirigere til klienten", "Open file locally" : "Åpne fil lokalt", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Filen skal nå åpnes på enheten din. Om ikke, vennligst sjekk at du har skrivebordsprogrammet installert.", "Retry and close" : "Prøv igjen og lukk", - "Failed to redirect to client" : "Kunne ikke omdirigere til klienten", - "Open locally" : "Åpne lokalt", "Rename" : "Gi nytt navn", "Open details" : "Åpne detaljer", "View in folder" : "Vis i mappe", diff --git a/apps/files/l10n/nl.js b/apps/files/l10n/nl.js index e0563aaac3c..fcf1ea0ab6e 100644 --- a/apps/files/l10n/nl.js +++ b/apps/files/l10n/nl.js @@ -277,12 +277,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Verplaatsen of kopiëren geannuleerd.", "Open folder {displayName}" : "Open map {displayName}", "Open in Files" : "Open in Bestanden", + "Open locally" : "Lokaal openen", + "Failed to redirect to client" : "Omleiden naar cliënt mislukt", "Open file locally" : "Bestand lokaal openen", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Het bestand zou nu moeten openen op je apparaat. Als dat niet het geval is, controleer dan of je de desktop app geïnstalleerd hebt.", "Retry and close" : "Probeer opnieuw en sluiten", "Open online" : "Open online", - "Failed to redirect to client" : "Omleiden naar cliënt mislukt", - "Open locally" : "Lokaal openen", "Rename" : "Naam wijzigen", "Open details" : "Details openen", "View in folder" : "Bekijken in map", diff --git a/apps/files/l10n/nl.json b/apps/files/l10n/nl.json index d7fc7f09003..ae41b7c1376 100644 --- a/apps/files/l10n/nl.json +++ b/apps/files/l10n/nl.json @@ -275,12 +275,12 @@ "Cancelled move or copy operation" : "Verplaatsen of kopiëren geannuleerd.", "Open folder {displayName}" : "Open map {displayName}", "Open in Files" : "Open in Bestanden", + "Open locally" : "Lokaal openen", + "Failed to redirect to client" : "Omleiden naar cliënt mislukt", "Open file locally" : "Bestand lokaal openen", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Het bestand zou nu moeten openen op je apparaat. Als dat niet het geval is, controleer dan of je de desktop app geïnstalleerd hebt.", "Retry and close" : "Probeer opnieuw en sluiten", "Open online" : "Open online", - "Failed to redirect to client" : "Omleiden naar cliënt mislukt", - "Open locally" : "Lokaal openen", "Rename" : "Naam wijzigen", "Open details" : "Details openen", "View in folder" : "Bekijken in map", diff --git a/apps/files/l10n/pl.js b/apps/files/l10n/pl.js index 2e652ce1683..05c5ed0ce51 100644 --- a/apps/files/l10n/pl.js +++ b/apps/files/l10n/pl.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Anulowano operację przenoszenia lub kopiowania", "Open folder {displayName}" : "Otwórz katalog {displayName}", "Open in Files" : "Otwórz w Plikach", + "Open locally" : "Otwórz lokalnie", + "Failed to redirect to client" : "Nie udało się przekierować do klienta", "Open file locally" : "Otwórz plik lokalnie", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Plik powinien teraz otworzyć się na Twoim urządzeniu. Jeśli tak się nie stanie, sprawdź, czy masz zainstalowaną aplikację komputerową.", "Retry and close" : "Spróbuj ponownie i zamknij", "Open online" : "Otwórz online", - "Failed to redirect to client" : "Nie udało się przekierować do klienta", - "Open locally" : "Otwórz lokalnie", "Rename" : "Zmień nazwę", "Open details" : "Otwórz szczegóły", "View in folder" : "Zobacz w katalogu", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "Pliki osobiste", "Text file" : "Plik tekstowy", "New text file.txt" : "Nowy plik tekstowy.txt", + "%1$s (renamed)" : "%1$s (zmieniona nazwa)", + "renamed file" : "zmieniona nazwa pliku", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Po włączeniu nazw plików zgodnych z systemem Windows, istniejących plików nie można już modyfikować, ale ich właściciel może zmienić ich nazwy na nowe, prawidłowe.", "{count} files could not be converted" : "Nie można przekonwertować {count} plików", "{count} files successfully converted" : "Zostały pomyślnie przekonwertowane{count} plików" }, diff --git a/apps/files/l10n/pl.json b/apps/files/l10n/pl.json index 24c20660260..8cd71406922 100644 --- a/apps/files/l10n/pl.json +++ b/apps/files/l10n/pl.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Anulowano operację przenoszenia lub kopiowania", "Open folder {displayName}" : "Otwórz katalog {displayName}", "Open in Files" : "Otwórz w Plikach", + "Open locally" : "Otwórz lokalnie", + "Failed to redirect to client" : "Nie udało się przekierować do klienta", "Open file locally" : "Otwórz plik lokalnie", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Plik powinien teraz otworzyć się na Twoim urządzeniu. Jeśli tak się nie stanie, sprawdź, czy masz zainstalowaną aplikację komputerową.", "Retry and close" : "Spróbuj ponownie i zamknij", "Open online" : "Otwórz online", - "Failed to redirect to client" : "Nie udało się przekierować do klienta", - "Open locally" : "Otwórz lokalnie", "Rename" : "Zmień nazwę", "Open details" : "Otwórz szczegóły", "View in folder" : "Zobacz w katalogu", @@ -453,6 +453,9 @@ "Personal Files" : "Pliki osobiste", "Text file" : "Plik tekstowy", "New text file.txt" : "Nowy plik tekstowy.txt", + "%1$s (renamed)" : "%1$s (zmieniona nazwa)", + "renamed file" : "zmieniona nazwa pliku", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Po włączeniu nazw plików zgodnych z systemem Windows, istniejących plików nie można już modyfikować, ale ich właściciel może zmienić ich nazwy na nowe, prawidłowe.", "{count} files could not be converted" : "Nie można przekonwertować {count} plików", "{count} files successfully converted" : "Zostały pomyślnie przekonwertowane{count} 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);" diff --git a/apps/files/l10n/pt_BR.js b/apps/files/l10n/pt_BR.js index 091fe73d2f6..1a81b4afd01 100644 --- a/apps/files/l10n/pt_BR.js +++ b/apps/files/l10n/pt_BR.js @@ -244,8 +244,8 @@ OC.L10N.register( "Failed to convert files: {message}" : "Falha ao converter arquivos: {message}", "All files failed to be converted" : "Todos os arquivos falharam na conversão", "One file could not be converted: {message}" : "Um arquivo não pôde ser convertido: {message}", - "_One file could not be converted_::_%n files could not be converted_" : ["Não foi possível converter um arquivo","Não foi possível converter %n arquivos","Não foi possível converter %n arquivos"], - "_One file successfully converted_::_%n files successfully converted_" : ["Um arquivo convertido com sucesso","%n arquivos convertidos com sucesso","%n arquivos convertidos com sucesso"], + "_One file could not be converted_::_%n files could not be converted_" : ["Não foi possível converter um arquivo","Não foi possível converter %n de arquivos","Não foi possível converter %n arquivos"], + "_One file successfully converted_::_%n files successfully converted_" : ["Um arquivo convertido com sucesso","%n de arquivos convertidos com sucesso","%n arquivos convertidos com sucesso"], "Files successfully converted" : "Arquivos convertidos com sucesso", "Failed to convert files" : "Falha ao converter arquivos", "Converting file …" : "Convertendo arquivo …", @@ -264,8 +264,8 @@ OC.L10N.register( "Delete folder" : "Excluir pasta", "Delete folders" : "Excluir pastas", "Delete" : "Excluir", - "_You are about to permanently delete {count} item_::_You are about to permanently delete {count} items_" : ["Você está prestes a excluir permanentemente {count} item","Você está prestes a excluir permanentemente {count} itens","Você está prestes a excluir permanentemente {count} itens"], - "_You are about to delete {count} item_::_You are about to delete {count} items_" : ["Você está prestes a excluir {count} item","Você está prestes a excluir {count} itens","Você está prestes a excluir {count} itens"], + "_You are about to permanently delete {count} item_::_You are about to permanently delete {count} items_" : ["Você está prestes a excluir permanentemente {count} item","Você está prestes a excluir permanentemente {count} de itens","Você está prestes a excluir permanentemente {count} itens"], + "_You are about to delete {count} item_::_You are about to delete {count} items_" : ["Você está prestes a excluir {count} item","Você está prestes a excluir {count} de itens","Você está prestes a excluir {count} itens"], "Confirm deletion" : "Confirmar exclusão", "Cancel" : "Cancelar", "Moving \"{source}\" to \"{destination}\" …" : "Movendo \"{source}\" para \"{destination}\" …", @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Operação de mover ou copiar cancelada", "Open folder {displayName}" : "Abrir a pasta {displayName}", "Open in Files" : "Abrir em Arquivos", + "Open locally" : "Abrir localmente", + "Failed to redirect to client" : "Falha ao redirecionar para o cliente", "Open file locally" : "Abrir o arquivo localmente", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "O arquivo agora deve abrir no seu dispositivo. Caso contrário, verifique se você tem o aplicativo para desktop instalado.", "Retry and close" : "Repetir e fechar", "Open online" : "Abrir on-line", - "Failed to redirect to client" : "Falha ao redirecionar para o cliente", - "Open locally" : "Abrir localmente", "Rename" : "Renomear", "Open details" : "Abrir detalhes", "View in folder" : "Exibir na pasta", @@ -335,9 +335,9 @@ OC.L10N.register( "This directory is unavailable, please check the logs or contact the administrator" : "Este diretório não está disponível, por favor verifique os logs ou contacte o administrador", "Storage is temporarily not available" : "O armazenamento está temporariamente indisponível", "Unexpected error: {error}" : "Erro inesperado: {error}", - "_%n file_::_%n files_" : ["%n arquivo","%n arquivos","%n arquivos"], - "_%n folder_::_%n folders_" : ["%n pasta","%n pastas","%n pastas"], - "_%n hidden_::_%n hidden_" : ["%n oculto","%n ocultos","%n ocultos"], + "_%n file_::_%n files_" : ["%n arquivo","%n de arquivos","%n arquivos"], + "_%n folder_::_%n folders_" : ["%n pasta","%n de pastas","%n pastas"], + "_%n hidden_::_%n hidden_" : ["%n oculto","%n de ocultos","%n ocultos"], "Filename must not be empty." : "O nome do arquivo não pode estar vazio.", "\"{char}\" is not allowed inside a filename." : "\"{char}\" não é permitido dentro de um nome de arquivo.", "\"{segment}\" is a reserved name and not allowed for filenames." : "\"{segment}\" é um nome reservado e não é permitido para nomes de arquivos.", @@ -412,9 +412,9 @@ OC.L10N.register( "No search results in other folders for {tag}{filter}{endtag}" : "Sem resultados de pesquisa em outras pastas para {tag}{filter}{endtag}", "Enter more than two characters to search in other folders" : "Digite mais de dois caracteres para pesquisar em outras pastas", "{dirs} and {files}" : "{dirs} e {files}", - "_including %n hidden_::_including %n hidden_" : ["incluindo %n oculto","incluindo %n ocultos","incluindo %n ocultos"], + "_including %n hidden_::_including %n hidden_" : ["incluindo %n oculto","incluindo %n de ocultos","incluindo %n ocultos"], "You do not have permission to upload or create files here" : "Você não tem permissão para carregar ou criar arquivos aqui", - "_Uploading %n file_::_Uploading %n files_" : ["Enviando %n arquivo","Enviando %n arquivos","Enviando %n arquivos"], + "_Uploading %n file_::_Uploading %n files_" : ["Enviando %n arquivo","Enviando %n de arquivos","Enviando %n arquivos"], "New" : "Novo", "New file/folder menu" : "Menu de novo arquivo/pasta", "Select file range" : "Selecionar o intervalo de arquivos", @@ -432,7 +432,7 @@ OC.L10N.register( "Group folder \"{mountPoint}\" is almost full ({usedSpacePercent}%)." : "A pasta de grupo \"{mountPoint}\" está quase cheia ({usedSpacePercent}%).", "External storage \"{mountPoint}\" is almost full ({usedSpacePercent}%)." : "O armazenamento externo \"{mountPoint}\" está quase cheio ({usedSpacePercent}%).", "Your storage is almost full ({usedSpacePercent}%)." : "Seu armazenamento está quase cheio ({usedSpacePercent}%).", - "_matches \"{filter}\"_::_match \"{filter}\"_" : ["coincide \"{filter}\"","coincide \"{filter}\"","coincide \"{filter}\""], + "_matches \"{filter}\"_::_match \"{filter}\"_" : ["corresponde a \"{filter}\"","correspondem a \"{filter}\"","correspondem a \"{filter}\""], "Direct link was copied (only works for people who have access to this file/folder)" : "Link direto foi copiado (funciona apenas para pessoas que têm acesso a este arquivo/pasta)", "Path" : "Caminho", "_%n byte_::_%n bytes_" : ["%n byte","%n bytes","%n bytes"], @@ -447,14 +447,17 @@ OC.L10N.register( "Filter filenames…" : "Filtrar nomes de arquivos…", "Edit file locally" : "Editar arquivo localmente", "Edit online" : "Editar on-line", - "_{folderCount} folder_::_{folderCount} folders_" : ["{folderCount} pasta","{folderCount} pastas","{folderCount} pastas"], - "_{fileCount} file_::_{fileCount} files_" : ["{fileCount} arquivo","{fileCount} arquivos","{fileCount} arquivos"], - "_1 file and {folderCount} folder_::_1 file and {folderCount} folders_" : ["1 arquivo e {folderCount} pasta","1 arquivo e {folderCount} pastas","1 arquivo e {folderCount} pastas"], - "_{fileCount} file and 1 folder_::_{fileCount} files and 1 folder_" : ["{fileCount} arquivo e 1 pasta","{fileCount} arquivos e 1 pasta","{fileCount} arquivos e 1 pasta"], + "_{folderCount} folder_::_{folderCount} folders_" : ["{folderCount} pasta","{folderCount} de pastas","{folderCount} pastas"], + "_{fileCount} file_::_{fileCount} files_" : ["{fileCount} arquivo","{fileCount} de arquivos","{fileCount} arquivos"], + "_1 file and {folderCount} folder_::_1 file and {folderCount} folders_" : ["1 arquivo e {folderCount} pasta","1 arquivo e {folderCount} de pastas","1 arquivo e {folderCount} pastas"], + "_{fileCount} file and 1 folder_::_{fileCount} files and 1 folder_" : ["{fileCount} arquivo e 1 pasta","{fileCount} de arquivos e 1 pasta","{fileCount} arquivos e 1 pasta"], "{fileCount} files and {folderCount} folders" : "{fileCount} arquivos e {folderCount} pastas", "Personal Files" : "Arquivos pessoais", "Text file" : "Arquivo texto", "New text file.txt" : "Novo arquivo de texto.txt", + "%1$s (renamed)" : "%1$s (renomeado)", + "renamed file" : "arquivo renomeado", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Depois de ativar os nomes de arquivos compatíveis com o Windows, os arquivos existentes não podem mais ser modificados, mas podem ser renomeados para novos nomes válidos pelo proprietário.", "{count} files could not be converted" : "{count} arquivos não puderam ser convertidos", "{count} files successfully converted" : "{count} arquivos convertidos com sucesso" }, diff --git a/apps/files/l10n/pt_BR.json b/apps/files/l10n/pt_BR.json index a1a8a55396b..1c53429cdeb 100644 --- a/apps/files/l10n/pt_BR.json +++ b/apps/files/l10n/pt_BR.json @@ -242,8 +242,8 @@ "Failed to convert files: {message}" : "Falha ao converter arquivos: {message}", "All files failed to be converted" : "Todos os arquivos falharam na conversão", "One file could not be converted: {message}" : "Um arquivo não pôde ser convertido: {message}", - "_One file could not be converted_::_%n files could not be converted_" : ["Não foi possível converter um arquivo","Não foi possível converter %n arquivos","Não foi possível converter %n arquivos"], - "_One file successfully converted_::_%n files successfully converted_" : ["Um arquivo convertido com sucesso","%n arquivos convertidos com sucesso","%n arquivos convertidos com sucesso"], + "_One file could not be converted_::_%n files could not be converted_" : ["Não foi possível converter um arquivo","Não foi possível converter %n de arquivos","Não foi possível converter %n arquivos"], + "_One file successfully converted_::_%n files successfully converted_" : ["Um arquivo convertido com sucesso","%n de arquivos convertidos com sucesso","%n arquivos convertidos com sucesso"], "Files successfully converted" : "Arquivos convertidos com sucesso", "Failed to convert files" : "Falha ao converter arquivos", "Converting file …" : "Convertendo arquivo …", @@ -262,8 +262,8 @@ "Delete folder" : "Excluir pasta", "Delete folders" : "Excluir pastas", "Delete" : "Excluir", - "_You are about to permanently delete {count} item_::_You are about to permanently delete {count} items_" : ["Você está prestes a excluir permanentemente {count} item","Você está prestes a excluir permanentemente {count} itens","Você está prestes a excluir permanentemente {count} itens"], - "_You are about to delete {count} item_::_You are about to delete {count} items_" : ["Você está prestes a excluir {count} item","Você está prestes a excluir {count} itens","Você está prestes a excluir {count} itens"], + "_You are about to permanently delete {count} item_::_You are about to permanently delete {count} items_" : ["Você está prestes a excluir permanentemente {count} item","Você está prestes a excluir permanentemente {count} de itens","Você está prestes a excluir permanentemente {count} itens"], + "_You are about to delete {count} item_::_You are about to delete {count} items_" : ["Você está prestes a excluir {count} item","Você está prestes a excluir {count} de itens","Você está prestes a excluir {count} itens"], "Confirm deletion" : "Confirmar exclusão", "Cancel" : "Cancelar", "Moving \"{source}\" to \"{destination}\" …" : "Movendo \"{source}\" para \"{destination}\" …", @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Operação de mover ou copiar cancelada", "Open folder {displayName}" : "Abrir a pasta {displayName}", "Open in Files" : "Abrir em Arquivos", + "Open locally" : "Abrir localmente", + "Failed to redirect to client" : "Falha ao redirecionar para o cliente", "Open file locally" : "Abrir o arquivo localmente", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "O arquivo agora deve abrir no seu dispositivo. Caso contrário, verifique se você tem o aplicativo para desktop instalado.", "Retry and close" : "Repetir e fechar", "Open online" : "Abrir on-line", - "Failed to redirect to client" : "Falha ao redirecionar para o cliente", - "Open locally" : "Abrir localmente", "Rename" : "Renomear", "Open details" : "Abrir detalhes", "View in folder" : "Exibir na pasta", @@ -333,9 +333,9 @@ "This directory is unavailable, please check the logs or contact the administrator" : "Este diretório não está disponível, por favor verifique os logs ou contacte o administrador", "Storage is temporarily not available" : "O armazenamento está temporariamente indisponível", "Unexpected error: {error}" : "Erro inesperado: {error}", - "_%n file_::_%n files_" : ["%n arquivo","%n arquivos","%n arquivos"], - "_%n folder_::_%n folders_" : ["%n pasta","%n pastas","%n pastas"], - "_%n hidden_::_%n hidden_" : ["%n oculto","%n ocultos","%n ocultos"], + "_%n file_::_%n files_" : ["%n arquivo","%n de arquivos","%n arquivos"], + "_%n folder_::_%n folders_" : ["%n pasta","%n de pastas","%n pastas"], + "_%n hidden_::_%n hidden_" : ["%n oculto","%n de ocultos","%n ocultos"], "Filename must not be empty." : "O nome do arquivo não pode estar vazio.", "\"{char}\" is not allowed inside a filename." : "\"{char}\" não é permitido dentro de um nome de arquivo.", "\"{segment}\" is a reserved name and not allowed for filenames." : "\"{segment}\" é um nome reservado e não é permitido para nomes de arquivos.", @@ -410,9 +410,9 @@ "No search results in other folders for {tag}{filter}{endtag}" : "Sem resultados de pesquisa em outras pastas para {tag}{filter}{endtag}", "Enter more than two characters to search in other folders" : "Digite mais de dois caracteres para pesquisar em outras pastas", "{dirs} and {files}" : "{dirs} e {files}", - "_including %n hidden_::_including %n hidden_" : ["incluindo %n oculto","incluindo %n ocultos","incluindo %n ocultos"], + "_including %n hidden_::_including %n hidden_" : ["incluindo %n oculto","incluindo %n de ocultos","incluindo %n ocultos"], "You do not have permission to upload or create files here" : "Você não tem permissão para carregar ou criar arquivos aqui", - "_Uploading %n file_::_Uploading %n files_" : ["Enviando %n arquivo","Enviando %n arquivos","Enviando %n arquivos"], + "_Uploading %n file_::_Uploading %n files_" : ["Enviando %n arquivo","Enviando %n de arquivos","Enviando %n arquivos"], "New" : "Novo", "New file/folder menu" : "Menu de novo arquivo/pasta", "Select file range" : "Selecionar o intervalo de arquivos", @@ -430,7 +430,7 @@ "Group folder \"{mountPoint}\" is almost full ({usedSpacePercent}%)." : "A pasta de grupo \"{mountPoint}\" está quase cheia ({usedSpacePercent}%).", "External storage \"{mountPoint}\" is almost full ({usedSpacePercent}%)." : "O armazenamento externo \"{mountPoint}\" está quase cheio ({usedSpacePercent}%).", "Your storage is almost full ({usedSpacePercent}%)." : "Seu armazenamento está quase cheio ({usedSpacePercent}%).", - "_matches \"{filter}\"_::_match \"{filter}\"_" : ["coincide \"{filter}\"","coincide \"{filter}\"","coincide \"{filter}\""], + "_matches \"{filter}\"_::_match \"{filter}\"_" : ["corresponde a \"{filter}\"","correspondem a \"{filter}\"","correspondem a \"{filter}\""], "Direct link was copied (only works for people who have access to this file/folder)" : "Link direto foi copiado (funciona apenas para pessoas que têm acesso a este arquivo/pasta)", "Path" : "Caminho", "_%n byte_::_%n bytes_" : ["%n byte","%n bytes","%n bytes"], @@ -445,14 +445,17 @@ "Filter filenames…" : "Filtrar nomes de arquivos…", "Edit file locally" : "Editar arquivo localmente", "Edit online" : "Editar on-line", - "_{folderCount} folder_::_{folderCount} folders_" : ["{folderCount} pasta","{folderCount} pastas","{folderCount} pastas"], - "_{fileCount} file_::_{fileCount} files_" : ["{fileCount} arquivo","{fileCount} arquivos","{fileCount} arquivos"], - "_1 file and {folderCount} folder_::_1 file and {folderCount} folders_" : ["1 arquivo e {folderCount} pasta","1 arquivo e {folderCount} pastas","1 arquivo e {folderCount} pastas"], - "_{fileCount} file and 1 folder_::_{fileCount} files and 1 folder_" : ["{fileCount} arquivo e 1 pasta","{fileCount} arquivos e 1 pasta","{fileCount} arquivos e 1 pasta"], + "_{folderCount} folder_::_{folderCount} folders_" : ["{folderCount} pasta","{folderCount} de pastas","{folderCount} pastas"], + "_{fileCount} file_::_{fileCount} files_" : ["{fileCount} arquivo","{fileCount} de arquivos","{fileCount} arquivos"], + "_1 file and {folderCount} folder_::_1 file and {folderCount} folders_" : ["1 arquivo e {folderCount} pasta","1 arquivo e {folderCount} de pastas","1 arquivo e {folderCount} pastas"], + "_{fileCount} file and 1 folder_::_{fileCount} files and 1 folder_" : ["{fileCount} arquivo e 1 pasta","{fileCount} de arquivos e 1 pasta","{fileCount} arquivos e 1 pasta"], "{fileCount} files and {folderCount} folders" : "{fileCount} arquivos e {folderCount} pastas", "Personal Files" : "Arquivos pessoais", "Text file" : "Arquivo texto", "New text file.txt" : "Novo arquivo de texto.txt", + "%1$s (renamed)" : "%1$s (renomeado)", + "renamed file" : "arquivo renomeado", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Depois de ativar os nomes de arquivos compatíveis com o Windows, os arquivos existentes não podem mais ser modificados, mas podem ser renomeados para novos nomes válidos pelo proprietário.", "{count} files could not be converted" : "{count} arquivos não puderam ser convertidos", "{count} files successfully converted" : "{count} arquivos convertidos com sucesso" },"pluralForm" :"nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" diff --git a/apps/files/l10n/ru.js b/apps/files/l10n/ru.js index 8aaaccd14ed..18fd0305ef7 100644 --- a/apps/files/l10n/ru.js +++ b/apps/files/l10n/ru.js @@ -279,12 +279,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Копирование или перемещение отменено", "Open folder {displayName}" : "Открыть папку «{displayName}»", "Open in Files" : "Открыть в приложении «Файлы»", + "Open locally" : "Открыть локально", + "Failed to redirect to client" : "Ошибка перенаправления в клиент", "Open file locally" : "Открыть файл локально", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Теперь файл должен открыться на вашем устройстве. Если это не произошло, пожалуйста, убедитесь, что у вас установлено настольное приложение.", "Retry and close" : "Повторить попытку и закрыть", "Open online" : "Открыть онлайн", - "Failed to redirect to client" : "Ошибка перенаправления в клиент", - "Open locally" : "Открыть локально", "Rename" : "Переименовать", "Open details" : "Открыть подробности", "View in folder" : "Посмотреть в каталоге", diff --git a/apps/files/l10n/ru.json b/apps/files/l10n/ru.json index 990e8624982..67706042b9e 100644 --- a/apps/files/l10n/ru.json +++ b/apps/files/l10n/ru.json @@ -277,12 +277,12 @@ "Cancelled move or copy operation" : "Копирование или перемещение отменено", "Open folder {displayName}" : "Открыть папку «{displayName}»", "Open in Files" : "Открыть в приложении «Файлы»", + "Open locally" : "Открыть локально", + "Failed to redirect to client" : "Ошибка перенаправления в клиент", "Open file locally" : "Открыть файл локально", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Теперь файл должен открыться на вашем устройстве. Если это не произошло, пожалуйста, убедитесь, что у вас установлено настольное приложение.", "Retry and close" : "Повторить попытку и закрыть", "Open online" : "Открыть онлайн", - "Failed to redirect to client" : "Ошибка перенаправления в клиент", - "Open locally" : "Открыть локально", "Rename" : "Переименовать", "Open details" : "Открыть подробности", "View in folder" : "Посмотреть в каталоге", diff --git a/apps/files/l10n/sc.js b/apps/files/l10n/sc.js index 4eaf13b42c3..90722be0e4c 100644 --- a/apps/files/l10n/sc.js +++ b/apps/files/l10n/sc.js @@ -160,8 +160,8 @@ OC.L10N.register( "Cancelled move or copy operation" : "Operatzione de tràmuda o còpia annullada", "Open folder {displayName}" : "Aberi sa cartella {displayName}", "Open in Files" : "Aberi in Archìvios", - "Open file locally" : "Aberi s'archìviu in locale", "Open locally" : "Aberi in locale", + "Open file locally" : "Aberi s'archìviu in locale", "Rename" : "Torra a numenare", "Open details" : "Aberi is detàllios", "View in folder" : "Visualiza in sa cartella", diff --git a/apps/files/l10n/sc.json b/apps/files/l10n/sc.json index aabefe1451a..0bdada5e8a7 100644 --- a/apps/files/l10n/sc.json +++ b/apps/files/l10n/sc.json @@ -158,8 +158,8 @@ "Cancelled move or copy operation" : "Operatzione de tràmuda o còpia annullada", "Open folder {displayName}" : "Aberi sa cartella {displayName}", "Open in Files" : "Aberi in Archìvios", - "Open file locally" : "Aberi s'archìviu in locale", "Open locally" : "Aberi in locale", + "Open file locally" : "Aberi s'archìviu in locale", "Rename" : "Torra a numenare", "Open details" : "Aberi is detàllios", "View in folder" : "Visualiza in sa cartella", diff --git a/apps/files/l10n/sk.js b/apps/files/l10n/sk.js index 62343002fb7..d15bd7dd00e 100644 --- a/apps/files/l10n/sk.js +++ b/apps/files/l10n/sk.js @@ -279,12 +279,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Zrušená operácia kopírovania alebo presunu", "Open folder {displayName}" : "Otvoriť priečinok {displayName}", "Open in Files" : "Otvoriť v súboroch", + "Open locally" : "Otvoriť lokálne", + "Failed to redirect to client" : "Nepodarilo sa presmerovať na klienta", "Open file locally" : "Otvoriť súbor lokálne", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Súbor by sa mal teraz otvoriť v zariadení. Ak sa tak nestane, skontrolujte, či máte nainštalovanú aplikáciu pre počítače.", "Retry and close" : "Skúsiť znova a zatvoriť", "Open online" : "Otvoriť online", - "Failed to redirect to client" : "Nepodarilo sa presmerovať na klienta", - "Open locally" : "Otvoriť lokálne", "Rename" : "Premenovať", "Open details" : "Otvoriť detaily", "View in folder" : "Zobraziť v priečinku", diff --git a/apps/files/l10n/sk.json b/apps/files/l10n/sk.json index 30343cf97db..1fe5202ad50 100644 --- a/apps/files/l10n/sk.json +++ b/apps/files/l10n/sk.json @@ -277,12 +277,12 @@ "Cancelled move or copy operation" : "Zrušená operácia kopírovania alebo presunu", "Open folder {displayName}" : "Otvoriť priečinok {displayName}", "Open in Files" : "Otvoriť v súboroch", + "Open locally" : "Otvoriť lokálne", + "Failed to redirect to client" : "Nepodarilo sa presmerovať na klienta", "Open file locally" : "Otvoriť súbor lokálne", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Súbor by sa mal teraz otvoriť v zariadení. Ak sa tak nestane, skontrolujte, či máte nainštalovanú aplikáciu pre počítače.", "Retry and close" : "Skúsiť znova a zatvoriť", "Open online" : "Otvoriť online", - "Failed to redirect to client" : "Nepodarilo sa presmerovať na klienta", - "Open locally" : "Otvoriť lokálne", "Rename" : "Premenovať", "Open details" : "Otvoriť detaily", "View in folder" : "Zobraziť v priečinku", diff --git a/apps/files/l10n/sl.js b/apps/files/l10n/sl.js index e9f36fa49e3..527f11c03d2 100644 --- a/apps/files/l10n/sl.js +++ b/apps/files/l10n/sl.js @@ -281,12 +281,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Opravilo kopiranje in premikanja je preklicano", "Open folder {displayName}" : "Odpri mapo {displayName}", "Open in Files" : "Open in Files", + "Open locally" : "Odpri krajevno", + "Failed to redirect to client" : "Preusmerjanje odjemalca je spodletelo", "Open file locally" : "Odpri datoteko krajevno", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Datoteka bi se sedaj morala odpreti z vaše naprave. Če se to ne zgodi, preverite namestitev namizne aplikacije.", "Retry and close" : "Ponovno poskusi in zapri", "Open online" : "Odpri v brskalniku", - "Failed to redirect to client" : "Preusmerjanje odjemalca je spodletelo", - "Open locally" : "Odpri krajevno", "Rename" : "Preimenuj", "Open details" : "Odpri podrobnosti", "View in folder" : "Pokaži v mapi", diff --git a/apps/files/l10n/sl.json b/apps/files/l10n/sl.json index d7cbd0e10e1..2dece4209a8 100644 --- a/apps/files/l10n/sl.json +++ b/apps/files/l10n/sl.json @@ -279,12 +279,12 @@ "Cancelled move or copy operation" : "Opravilo kopiranje in premikanja je preklicano", "Open folder {displayName}" : "Odpri mapo {displayName}", "Open in Files" : "Open in Files", + "Open locally" : "Odpri krajevno", + "Failed to redirect to client" : "Preusmerjanje odjemalca je spodletelo", "Open file locally" : "Odpri datoteko krajevno", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Datoteka bi se sedaj morala odpreti z vaše naprave. Če se to ne zgodi, preverite namestitev namizne aplikacije.", "Retry and close" : "Ponovno poskusi in zapri", "Open online" : "Odpri v brskalniku", - "Failed to redirect to client" : "Preusmerjanje odjemalca je spodletelo", - "Open locally" : "Odpri krajevno", "Rename" : "Preimenuj", "Open details" : "Odpri podrobnosti", "View in folder" : "Pokaži v mapi", diff --git a/apps/files/l10n/sr.js b/apps/files/l10n/sr.js index aac16577263..f4eb40db0f5 100644 --- a/apps/files/l10n/sr.js +++ b/apps/files/l10n/sr.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Операција премештања или копирања је отказана", "Open folder {displayName}" : "Отвори фолдер {displayName}", "Open in Files" : "Отвори у Фајловима", + "Open locally" : "Отвори локално", + "Failed to redirect to client" : "Преусмеравање на клијента није успело", "Open file locally" : "Отвори фајл локално", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Фајл би сада требало да се отвори на вашем уређају. Ако се не отвори, проверите да ли сте инсталирали декстоп апликацију.", "Retry and close" : "Покушај поново и затвори", "Open online" : "Отвори на мрежи", - "Failed to redirect to client" : "Преусмеравање на клијента није успело", - "Open locally" : "Отвори локално", "Rename" : "Преименуј", "Open details" : "Отвори детаље", "View in folder" : "Види у фасцикли", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "Лични фајлови", "Text file" : "Tекстуални фајл", "New text file.txt" : "Нов текстуални фајл.txt", + "%1$s (renamed)" : "%1$s (преименован)", + "renamed file" : "преименован фајл", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Када се укључе windows компатибилна имена фајлова, постојећи фајлови се више неће моћи мењати, али њихов власник може да им промени име на исправно ново име.", "{count} files could not be converted" : "Није могло да се конвертује {count} фајлова", "{count} files successfully converted" : "Успешно је конвертовано {count} фајлова" }, diff --git a/apps/files/l10n/sr.json b/apps/files/l10n/sr.json index b2d6b3cb257..b5582f24e88 100644 --- a/apps/files/l10n/sr.json +++ b/apps/files/l10n/sr.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Операција премештања или копирања је отказана", "Open folder {displayName}" : "Отвори фолдер {displayName}", "Open in Files" : "Отвори у Фајловима", + "Open locally" : "Отвори локално", + "Failed to redirect to client" : "Преусмеравање на клијента није успело", "Open file locally" : "Отвори фајл локално", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Фајл би сада требало да се отвори на вашем уређају. Ако се не отвори, проверите да ли сте инсталирали декстоп апликацију.", "Retry and close" : "Покушај поново и затвори", "Open online" : "Отвори на мрежи", - "Failed to redirect to client" : "Преусмеравање на клијента није успело", - "Open locally" : "Отвори локално", "Rename" : "Преименуј", "Open details" : "Отвори детаље", "View in folder" : "Види у фасцикли", @@ -453,6 +453,9 @@ "Personal Files" : "Лични фајлови", "Text file" : "Tекстуални фајл", "New text file.txt" : "Нов текстуални фајл.txt", + "%1$s (renamed)" : "%1$s (преименован)", + "renamed file" : "преименован фајл", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Када се укључе windows компатибилна имена фајлова, постојећи фајлови се више неће моћи мењати, али њихов власник може да им промени име на исправно ново име.", "{count} files could not be converted" : "Није могло да се конвертује {count} фајлова", "{count} files successfully converted" : "Успешно је конвертовано {count} фајлова" },"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" diff --git a/apps/files/l10n/sv.js b/apps/files/l10n/sv.js index d4428ac84de..58c04d50834 100644 --- a/apps/files/l10n/sv.js +++ b/apps/files/l10n/sv.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Flytta eller kopiera avbröts", "Open folder {displayName}" : "Öppna mappen {displayName}", "Open in Files" : "Öppna i Filer", + "Open locally" : "Öppna lokalt", + "Failed to redirect to client" : "Det gick inte att omdirigera till klienten", "Open file locally" : "Öppna filen lokalt", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Filen bör nu öppnas på din enhet. Om den inte gör det, kontrollera att du har installerat skrivbordsappen.", "Retry and close" : "Försök igen och stäng", "Open online" : "Öppna online", - "Failed to redirect to client" : "Det gick inte att omdirigera till klienten", - "Open locally" : "Öppna lokalt", "Rename" : "Byt namn", "Open details" : "Öppna detaljer", "View in folder" : "Utforska i mapp", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "Personliga filer", "Text file" : "Textfil", "New text file.txt" : "Ny textfil.txt", + "%1$s (renamed)" : "%1$s (omdöpt)", + "renamed file" : "omdöpt fil", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "När Windows-kompatibla filnamn har aktiverats kan befintliga filer inte längre ändras, men de kan byta namn till giltiga nya namn av sin ägare.", "{count} files could not be converted" : "{count} filer kunde inte konverteras", "{count} files successfully converted" : "{count} filer har konverterats" }, diff --git a/apps/files/l10n/sv.json b/apps/files/l10n/sv.json index e56bc427e48..07063208aa4 100644 --- a/apps/files/l10n/sv.json +++ b/apps/files/l10n/sv.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "Flytta eller kopiera avbröts", "Open folder {displayName}" : "Öppna mappen {displayName}", "Open in Files" : "Öppna i Filer", + "Open locally" : "Öppna lokalt", + "Failed to redirect to client" : "Det gick inte att omdirigera till klienten", "Open file locally" : "Öppna filen lokalt", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Filen bör nu öppnas på din enhet. Om den inte gör det, kontrollera att du har installerat skrivbordsappen.", "Retry and close" : "Försök igen och stäng", "Open online" : "Öppna online", - "Failed to redirect to client" : "Det gick inte att omdirigera till klienten", - "Open locally" : "Öppna lokalt", "Rename" : "Byt namn", "Open details" : "Öppna detaljer", "View in folder" : "Utforska i mapp", @@ -453,6 +453,9 @@ "Personal Files" : "Personliga filer", "Text file" : "Textfil", "New text file.txt" : "Ny textfil.txt", + "%1$s (renamed)" : "%1$s (omdöpt)", + "renamed file" : "omdöpt fil", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "När Windows-kompatibla filnamn har aktiverats kan befintliga filer inte längre ändras, men de kan byta namn till giltiga nya namn av sin ägare.", "{count} files could not be converted" : "{count} filer kunde inte konverteras", "{count} files successfully converted" : "{count} filer har konverterats" },"pluralForm" :"nplurals=2; plural=(n != 1);" diff --git a/apps/files/l10n/tr.js b/apps/files/l10n/tr.js index f15d99f1ed7..7772be56ed8 100644 --- a/apps/files/l10n/tr.js +++ b/apps/files/l10n/tr.js @@ -279,12 +279,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Taşıma ya da kopyalama işlemi iptal edildi", "Open folder {displayName}" : "{displayName} klasörünü aç", "Open in Files" : "Dosyalar uygulamasında aç", + "Open locally" : "Yerel olarak aç", + "Failed to redirect to client" : "İstemciye yönlendirilemedi", "Open file locally" : "Dosyayı yerel olarak aç", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Dosya artık aygıtınızda açılmalıdır. Açılmazsa lütfen masaüstü uygulamasının kurulu olduğundan emin olun.", "Retry and close" : "Yeniden deneyip kapat", "Open online" : "Çevrim içi aç", - "Failed to redirect to client" : "İstemciye yönlendirilemedi", - "Open locally" : "Yerel olarak aç", "Rename" : "Yeniden adlandır", "Open details" : "Ayrıntıları aç", "View in folder" : "Klasörde görüntüle", diff --git a/apps/files/l10n/tr.json b/apps/files/l10n/tr.json index 91591db8821..84185475ce1 100644 --- a/apps/files/l10n/tr.json +++ b/apps/files/l10n/tr.json @@ -277,12 +277,12 @@ "Cancelled move or copy operation" : "Taşıma ya da kopyalama işlemi iptal edildi", "Open folder {displayName}" : "{displayName} klasörünü aç", "Open in Files" : "Dosyalar uygulamasında aç", + "Open locally" : "Yerel olarak aç", + "Failed to redirect to client" : "İstemciye yönlendirilemedi", "Open file locally" : "Dosyayı yerel olarak aç", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Dosya artık aygıtınızda açılmalıdır. Açılmazsa lütfen masaüstü uygulamasının kurulu olduğundan emin olun.", "Retry and close" : "Yeniden deneyip kapat", "Open online" : "Çevrim içi aç", - "Failed to redirect to client" : "İstemciye yönlendirilemedi", - "Open locally" : "Yerel olarak aç", "Rename" : "Yeniden adlandır", "Open details" : "Ayrıntıları aç", "View in folder" : "Klasörde görüntüle", diff --git a/apps/files/l10n/ug.js b/apps/files/l10n/ug.js index 5c828bb4c51..77deefc5a0f 100644 --- a/apps/files/l10n/ug.js +++ b/apps/files/l10n/ug.js @@ -218,9 +218,9 @@ OC.L10N.register( "Cancelled move or copy operation" : "يۆتكەش ياكى كۆچۈرۈش مەشغۇلاتى ئەمەلدىن قالدۇرۇلدى", "Open folder {displayName}" : "ھۆججەت قىسقۇچ {displayName}", "Open in Files" : "ھۆججەتلەرنى ئېچىڭ", - "Open file locally" : "ھۆججەتنى يەرلىكتە ئېچىڭ", - "Failed to redirect to client" : "خېرىدارغا قايتا نىشانلاش مەغلۇپ بولدى", "Open locally" : "يەرلىكتە ئېچىڭ", + "Failed to redirect to client" : "خېرىدارغا قايتا نىشانلاش مەغلۇپ بولدى", + "Open file locally" : "ھۆججەتنى يەرلىكتە ئېچىڭ", "Rename" : "ئات ئۆزگەرت", "Open details" : "تەپسىلاتلارنى ئېچىڭ", "View in folder" : "قىسقۇچتا كۆرۈش", diff --git a/apps/files/l10n/ug.json b/apps/files/l10n/ug.json index bd7dae0388f..e8cf0bf212a 100644 --- a/apps/files/l10n/ug.json +++ b/apps/files/l10n/ug.json @@ -216,9 +216,9 @@ "Cancelled move or copy operation" : "يۆتكەش ياكى كۆچۈرۈش مەشغۇلاتى ئەمەلدىن قالدۇرۇلدى", "Open folder {displayName}" : "ھۆججەت قىسقۇچ {displayName}", "Open in Files" : "ھۆججەتلەرنى ئېچىڭ", - "Open file locally" : "ھۆججەتنى يەرلىكتە ئېچىڭ", - "Failed to redirect to client" : "خېرىدارغا قايتا نىشانلاش مەغلۇپ بولدى", "Open locally" : "يەرلىكتە ئېچىڭ", + "Failed to redirect to client" : "خېرىدارغا قايتا نىشانلاش مەغلۇپ بولدى", + "Open file locally" : "ھۆججەتنى يەرلىكتە ئېچىڭ", "Rename" : "ئات ئۆزگەرت", "Open details" : "تەپسىلاتلارنى ئېچىڭ", "View in folder" : "قىسقۇچتا كۆرۈش", diff --git a/apps/files/l10n/uk.js b/apps/files/l10n/uk.js index e565adfc9de..991e9aef5a1 100644 --- a/apps/files/l10n/uk.js +++ b/apps/files/l10n/uk.js @@ -279,12 +279,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "Переміщення або копіювання скасовано", "Open folder {displayName}" : "Відкрити каталог {displayName}", "Open in Files" : "Відкрити у Файлах", + "Open locally" : "Відкрити локально", + "Failed to redirect to client" : "Не вдалося перенаправити на клієнта", "Open file locally" : "Відкрити файл локально", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Тепер файл можна відкрити на вашому пристрої. Якщо він не відкривається, перевірте, що у вас встановлено настільний клієнт синхронізації.", "Retry and close" : "Спробувати ще раз", "Open online" : "Відкрити віддалено", - "Failed to redirect to client" : "Не вдалося перенаправити на клієнта", - "Open locally" : "Відкрити локально", "Rename" : "Перейменувати", "Open details" : "Показати деталі", "View in folder" : "Переглянути у каталозі", diff --git a/apps/files/l10n/uk.json b/apps/files/l10n/uk.json index e133f666763..d0b104bac89 100644 --- a/apps/files/l10n/uk.json +++ b/apps/files/l10n/uk.json @@ -277,12 +277,12 @@ "Cancelled move or copy operation" : "Переміщення або копіювання скасовано", "Open folder {displayName}" : "Відкрити каталог {displayName}", "Open in Files" : "Відкрити у Файлах", + "Open locally" : "Відкрити локально", + "Failed to redirect to client" : "Не вдалося перенаправити на клієнта", "Open file locally" : "Відкрити файл локально", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "Тепер файл можна відкрити на вашому пристрої. Якщо він не відкривається, перевірте, що у вас встановлено настільний клієнт синхронізації.", "Retry and close" : "Спробувати ще раз", "Open online" : "Відкрити віддалено", - "Failed to redirect to client" : "Не вдалося перенаправити на клієнта", - "Open locally" : "Відкрити локально", "Rename" : "Перейменувати", "Open details" : "Показати деталі", "View in folder" : "Переглянути у каталозі", diff --git a/apps/files/l10n/vi.js b/apps/files/l10n/vi.js index 475bafe02f5..a2504192d8d 100644 --- a/apps/files/l10n/vi.js +++ b/apps/files/l10n/vi.js @@ -219,9 +219,9 @@ OC.L10N.register( "Cancelled move or copy operation" : "Đã hủy thao tác di chuyển hoặc sao chép", "Open folder {displayName}" : "Mở thư mục {displayName}", "Open in Files" : "Mở trong Tệp", - "Open file locally" : "Mở tệp cục bộ (local)/ ngoại tuyến", - "Failed to redirect to client" : "Không thể chuyển hướng đến ứng dụng khách", "Open locally" : "Mở cục bộ (local)/ ngoại tuyến", + "Failed to redirect to client" : "Không thể chuyển hướng đến ứng dụng khách", + "Open file locally" : "Mở tệp cục bộ (local)/ ngoại tuyến", "Rename" : "Đổi tên", "Open details" : "Mở chi tiết", "View in folder" : "Xem trong thư mục", diff --git a/apps/files/l10n/vi.json b/apps/files/l10n/vi.json index 0e11bbac94d..9ea384d4147 100644 --- a/apps/files/l10n/vi.json +++ b/apps/files/l10n/vi.json @@ -217,9 +217,9 @@ "Cancelled move or copy operation" : "Đã hủy thao tác di chuyển hoặc sao chép", "Open folder {displayName}" : "Mở thư mục {displayName}", "Open in Files" : "Mở trong Tệp", - "Open file locally" : "Mở tệp cục bộ (local)/ ngoại tuyến", - "Failed to redirect to client" : "Không thể chuyển hướng đến ứng dụng khách", "Open locally" : "Mở cục bộ (local)/ ngoại tuyến", + "Failed to redirect to client" : "Không thể chuyển hướng đến ứng dụng khách", + "Open file locally" : "Mở tệp cục bộ (local)/ ngoại tuyến", "Rename" : "Đổi tên", "Open details" : "Mở chi tiết", "View in folder" : "Xem trong thư mục", diff --git a/apps/files/l10n/zh_CN.js b/apps/files/l10n/zh_CN.js index 1bbbdb18e88..36816fb1814 100644 --- a/apps/files/l10n/zh_CN.js +++ b/apps/files/l10n/zh_CN.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "已取消移动或复制操作", "Open folder {displayName}" : "打开文件夹{displayName}", "Open in Files" : "在文件中打开", + "Open locally" : "本地打开", + "Failed to redirect to client" : "重定向到客户端失败", "Open file locally" : "在本地打开文件", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "该文件现在应该在你的设备上打开。如果没有,请检查你是否安装了桌面应用程序。", "Retry and close" : "重试并关闭", "Open online" : "在线打开", - "Failed to redirect to client" : "重定向到客户端失败", - "Open locally" : "本地打开", "Rename" : "重命名", "Open details" : "打开详情", "View in folder" : "在文件夹中查看", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "个人文件", "Text file" : "文本文件", "New text file.txt" : "新建文本文件.txt", + "%1$s (renamed)" : "%1$s(已重命名)", + "renamed file" : "已重命名文件", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "启用与 Windows 兼容的文件名后,无法再修改现有文件,但可以由其所有者重命名为有效的新名称。", "{count} files could not be converted" : "{count} 个文件无法转换", "{count} files successfully converted" : "{count} 个文件已成功转换" }, diff --git a/apps/files/l10n/zh_CN.json b/apps/files/l10n/zh_CN.json index dd225ef638a..fbd76bc8be9 100644 --- a/apps/files/l10n/zh_CN.json +++ b/apps/files/l10n/zh_CN.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "已取消移动或复制操作", "Open folder {displayName}" : "打开文件夹{displayName}", "Open in Files" : "在文件中打开", + "Open locally" : "本地打开", + "Failed to redirect to client" : "重定向到客户端失败", "Open file locally" : "在本地打开文件", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "该文件现在应该在你的设备上打开。如果没有,请检查你是否安装了桌面应用程序。", "Retry and close" : "重试并关闭", "Open online" : "在线打开", - "Failed to redirect to client" : "重定向到客户端失败", - "Open locally" : "本地打开", "Rename" : "重命名", "Open details" : "打开详情", "View in folder" : "在文件夹中查看", @@ -453,6 +453,9 @@ "Personal Files" : "个人文件", "Text file" : "文本文件", "New text file.txt" : "新建文本文件.txt", + "%1$s (renamed)" : "%1$s(已重命名)", + "renamed file" : "已重命名文件", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "启用与 Windows 兼容的文件名后,无法再修改现有文件,但可以由其所有者重命名为有效的新名称。", "{count} files could not be converted" : "{count} 个文件无法转换", "{count} files successfully converted" : "{count} 个文件已成功转换" },"pluralForm" :"nplurals=1; plural=0;" diff --git a/apps/files/l10n/zh_HK.js b/apps/files/l10n/zh_HK.js index 4c279ff809a..e4cef2fa393 100644 --- a/apps/files/l10n/zh_HK.js +++ b/apps/files/l10n/zh_HK.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "已取消移動或複製操作", "Open folder {displayName}" : "打開資料夾 {displayName}", "Open in Files" : "在「檔案」應用程式中打開", + "Open locally" : "在近端打開", + "Failed to redirect to client" : "無法重定向到客戶端", "Open file locally" : "在近端打開檔案", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "檔案現在應該在您的裝置上打開。如果沒有,請檢查您是否已安裝桌面應用程式。", "Retry and close" : "重試和關閉", "Open online" : "線上開啟", - "Failed to redirect to client" : "無法重定向到客戶端", - "Open locally" : "在近端打開", "Rename" : "重新命名", "Open details" : "開啟細節", "View in folder" : "在資料夾中檢視", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "個人檔案", "Text file" : "文字檔", "New text file.txt" : "新文字檔.txt", + "%1$s (renamed)" : "%1$s(已重新命名)", + "renamed file" : "已重新命名的檔案", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "啟用 Windows 兼容檔案名後,現有的檔案無法再被修改,但其擁有者可以將其重新命名為有效的新名稱。", "{count} files could not be converted" : "{count} 個檔案無法轉換", "{count} files successfully converted" : "{count} 個檔案成功轉換" }, diff --git a/apps/files/l10n/zh_HK.json b/apps/files/l10n/zh_HK.json index 39825088806..f3cb90bc6d3 100644 --- a/apps/files/l10n/zh_HK.json +++ b/apps/files/l10n/zh_HK.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "已取消移動或複製操作", "Open folder {displayName}" : "打開資料夾 {displayName}", "Open in Files" : "在「檔案」應用程式中打開", + "Open locally" : "在近端打開", + "Failed to redirect to client" : "無法重定向到客戶端", "Open file locally" : "在近端打開檔案", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "檔案現在應該在您的裝置上打開。如果沒有,請檢查您是否已安裝桌面應用程式。", "Retry and close" : "重試和關閉", "Open online" : "線上開啟", - "Failed to redirect to client" : "無法重定向到客戶端", - "Open locally" : "在近端打開", "Rename" : "重新命名", "Open details" : "開啟細節", "View in folder" : "在資料夾中檢視", @@ -453,6 +453,9 @@ "Personal Files" : "個人檔案", "Text file" : "文字檔", "New text file.txt" : "新文字檔.txt", + "%1$s (renamed)" : "%1$s(已重新命名)", + "renamed file" : "已重新命名的檔案", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "啟用 Windows 兼容檔案名後,現有的檔案無法再被修改,但其擁有者可以將其重新命名為有效的新名稱。", "{count} files could not be converted" : "{count} 個檔案無法轉換", "{count} files successfully converted" : "{count} 個檔案成功轉換" },"pluralForm" :"nplurals=1; plural=0;" diff --git a/apps/files/l10n/zh_TW.js b/apps/files/l10n/zh_TW.js index 808a21a8f2a..20c0848d1e8 100644 --- a/apps/files/l10n/zh_TW.js +++ b/apps/files/l10n/zh_TW.js @@ -288,12 +288,12 @@ OC.L10N.register( "Cancelled move or copy operation" : "已取消移動或複製操作", "Open folder {displayName}" : "開啟資料夾 {displayName}", "Open in Files" : "以「檔案」開啟", + "Open locally" : "在本機開啟", + "Failed to redirect to client" : "重新導向到客戶端失敗", "Open file locally" : "在本機開啟檔案", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "檔案現在應該可以在您的裝置上開啟。如果打不開,請檢查您是否有安裝桌面應用程式。", "Retry and close" : "重試並關閉", "Open online" : "線上開啟", - "Failed to redirect to client" : "重新導向到客戶端失敗", - "Open locally" : "在本機開啟", "Rename" : "重新命名", "Open details" : "開啟詳細資訊", "View in folder" : "在資料夾中檢視", @@ -455,6 +455,9 @@ OC.L10N.register( "Personal Files" : "個人檔案", "Text file" : "文字檔案", "New text file.txt" : "新文字檔案.txt", + "%1$s (renamed)" : "%1$s(已重新命名)", + "renamed file" : "已重新命名檔案", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "啟用與 Windows 相容的檔案名稱後,無法再修改現有檔案,但可以由其擁有者重新命名為有效的新名稱。", "{count} files could not be converted" : "{count} 個檔案無法轉換", "{count} files successfully converted" : "{count} 個檔案成功轉換" }, diff --git a/apps/files/l10n/zh_TW.json b/apps/files/l10n/zh_TW.json index 4037307ffa6..1a129a968b9 100644 --- a/apps/files/l10n/zh_TW.json +++ b/apps/files/l10n/zh_TW.json @@ -286,12 +286,12 @@ "Cancelled move or copy operation" : "已取消移動或複製操作", "Open folder {displayName}" : "開啟資料夾 {displayName}", "Open in Files" : "以「檔案」開啟", + "Open locally" : "在本機開啟", + "Failed to redirect to client" : "重新導向到客戶端失敗", "Open file locally" : "在本機開啟檔案", "The file should now open on your device. If it doesn't, please check that you have the desktop app installed." : "檔案現在應該可以在您的裝置上開啟。如果打不開,請檢查您是否有安裝桌面應用程式。", "Retry and close" : "重試並關閉", "Open online" : "線上開啟", - "Failed to redirect to client" : "重新導向到客戶端失敗", - "Open locally" : "在本機開啟", "Rename" : "重新命名", "Open details" : "開啟詳細資訊", "View in folder" : "在資料夾中檢視", @@ -453,6 +453,9 @@ "Personal Files" : "個人檔案", "Text file" : "文字檔案", "New text file.txt" : "新文字檔案.txt", + "%1$s (renamed)" : "%1$s(已重新命名)", + "renamed file" : "已重新命名檔案", + "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "啟用與 Windows 相容的檔案名稱後,無法再修改現有檔案,但可以由其擁有者重新命名為有效的新名稱。", "{count} files could not be converted" : "{count} 個檔案無法轉換", "{count} files successfully converted" : "{count} 個檔案成功轉換" },"pluralForm" :"nplurals=1; plural=0;" diff --git a/apps/files/lib/BackgroundJob/ScanFiles.php b/apps/files/lib/BackgroundJob/ScanFiles.php index 3a39382d0b4..f3f9093d648 100644 --- a/apps/files/lib/BackgroundJob/ScanFiles.php +++ b/apps/files/lib/BackgroundJob/ScanFiles.php @@ -69,7 +69,7 @@ class ScanFiles extends TimedJob { $query->select('m.user_id') ->from('filecache', 'f') ->leftJoin('f', 'mounts', 'm', $query->expr()->eq('m.storage_id', 'f.storage')) - ->where($query->expr()->lt('f.size', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))) + ->where($query->expr()->eq('f.size', $query->createNamedParameter(-1, IQueryBuilder::PARAM_INT))) ->andWhere($query->expr()->gt('f.parent', $query->createNamedParameter(-1, IQueryBuilder::PARAM_INT))) ->setMaxResults(10) ->groupBy('f.storage') @@ -90,7 +90,7 @@ class ScanFiles extends TimedJob { $query->select('m.user_id') ->from('filecache', 'f') ->leftJoin('f', 'mounts', 'm', $query->expr()->eq('m.storage_id', 'f.storage')) - ->where($query->expr()->lt('f.size', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))) + ->where($query->expr()->eq('f.size', $query->createNamedParameter(-1, IQueryBuilder::PARAM_INT))) ->andWhere($query->expr()->gt('f.parent', $query->createNamedParameter(-1, IQueryBuilder::PARAM_INT))) ->andWhere($query->expr()->in('f.storage', $query->createNamedParameter($storages, IQueryBuilder::PARAM_INT_ARRAY))) ->setMaxResults(1) @@ -101,7 +101,7 @@ class ScanFiles extends TimedJob { $query->select('m.user_id') ->from('filecache', 'f') ->innerJoin('f', 'mounts', 'm', $query->expr()->eq('m.storage_id', 'f.storage')) - ->where($query->expr()->lt('f.size', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))) + ->where($query->expr()->eq('f.size', $query->createNamedParameter(-1, IQueryBuilder::PARAM_INT))) ->andWhere($query->expr()->gt('f.parent', $query->createNamedParameter(-1, IQueryBuilder::PARAM_INT))) ->setMaxResults(1) ->runAcrossAllShards(); diff --git a/apps/files/lib/Listener/SyncLivePhotosListener.php b/apps/files/lib/Listener/SyncLivePhotosListener.php index 6334e5d16a6..b6773e8c452 100644 --- a/apps/files/lib/Listener/SyncLivePhotosListener.php +++ b/apps/files/lib/Listener/SyncLivePhotosListener.php @@ -37,6 +37,8 @@ class SyncLivePhotosListener implements IEventListener { private array $pendingRenames = []; /** @var Array<int, bool> */ private array $pendingDeletion = []; + /** @var Array<int> */ + private array $pendingCopies = []; public function __construct( private ?Folder $userFolder, @@ -153,7 +155,6 @@ class SyncLivePhotosListener implements IEventListener { $targetName = $targetFile->getName(); $peerTargetName = substr($targetName, 0, -strlen($sourceExtension)) . $peerFileExtension; - if ($targetParent->nodeExists($peerTargetName)) { // If the copy was a folder copy, then the peer file already exists. $targetPeerFile = $targetParent->get($peerTargetName); @@ -225,6 +226,11 @@ class SyncLivePhotosListener implements IEventListener { $this->handleCopyRecursive($event, $sourceChild, $targetChild); } } elseif ($sourceNode instanceof File && $targetNode instanceof File) { + // in case the copy was initiated from this listener, we stop right now + if (in_array($sourceNode->getId(), $this->pendingCopies)) { + return; + } + $peerFileId = $this->livePhotosService->getLivePhotoPeerId($sourceNode->getId()); if ($peerFileId === null) { return; @@ -234,11 +240,13 @@ class SyncLivePhotosListener implements IEventListener { return; } + $this->pendingCopies[] = $peerFileId; if ($event instanceof BeforeNodeCopiedEvent) { $this->runMoveOrCopyChecks($sourceNode, $targetNode, $peerFile); } elseif ($event instanceof NodeCopiedEvent) { $this->handleCopy($sourceNode, $targetNode, $peerFile); } + $this->pendingCopies = array_diff($this->pendingCopies, [$peerFileId]); } else { throw new Exception('Source and target type are not matching'); } diff --git a/apps/files/src/actions/openLocallyAction.ts b/apps/files/src/actions/openLocallyAction.ts index a80cf0cbeed..986b304210c 100644 --- a/apps/files/src/actions/openLocallyAction.ts +++ b/apps/files/src/actions/openLocallyAction.ts @@ -13,71 +13,6 @@ import LaptopSvg from '@mdi/svg/svg/laptop.svg?raw' import IconWeb from '@mdi/svg/svg/web.svg?raw' import { isPublicShare } from '@nextcloud/sharing/public' -const confirmLocalEditDialog = ( - localEditCallback: (openingLocally: boolean) => void = () => {}, -) => { - let callbackCalled = false - - return (new DialogBuilder()) - .setName(t('files', 'Open file locally')) - .setText(t('files', 'The file should now open on your device. If it doesn\'t, please check that you have the desktop app installed.')) - .setButtons([ - { - label: t('files', 'Retry and close'), - type: 'secondary', - callback: () => { - callbackCalled = true - localEditCallback(true) - }, - }, - { - label: t('files', 'Open online'), - icon: IconWeb, - type: 'primary', - callback: () => { - callbackCalled = true - localEditCallback(false) - }, - }, - ]) - .build() - .show() - .then(() => { - // Ensure the callback is called even if the dialog is dismissed in other ways - if (!callbackCalled) { - localEditCallback(false) - } - }) -} - -const attemptOpenLocalClient = async (path: string) => { - openLocalClient(path) - confirmLocalEditDialog( - (openLocally: boolean) => { - if (!openLocally) { - window.OCA.Viewer.open({ path }) - return - } - openLocalClient(path) - }, - ) -} - -const openLocalClient = async function(path: string) { - const link = generateOcsUrl('apps/files/api/v1') + '/openlocaleditor?format=json' - - try { - const result = await axios.post(link, { path }) - const uid = getCurrentUser()?.uid - let url = `nc://open/${uid}@` + window.location.host + encodePath(path) - url += '?token=' + result.data.ocs.data.token - - window.open(url, '_self') - } catch (error) { - showError(t('files', 'Failed to redirect to client')) - } -} - export const action = new FileAction({ id: 'edit-locally', displayName: () => t('files', 'Open locally'), @@ -99,9 +34,81 @@ export const action = new FileAction({ }, async exec(node: Node) { - attemptOpenLocalClient(node.path) + await attemptOpenLocalClient(node.path) return null }, order: 25, }) + +/** + * Try to open the path in the Nextcloud client. + * + * If this fails a dialog is shown with 3 options: + * 1. Retry: If it fails no further dialog is shown. + * 2. Open online: The viewer is used to open the file. + * 3. Close the dialog and nothing happens (abort). + * + * @param path - The path to open + */ +async function attemptOpenLocalClient(path: string) { + await openLocalClient(path) + const result = await confirmLocalEditDialog() + if (result === 'local') { + await openLocalClient(path) + } else if (result === 'online') { + window.OCA.Viewer.open({ path }) + } +} + +/** + * Try to open a file in the Nextcloud client. + * There is no way to get notified if this action was successfull. + * + * @param path - Path to open + */ +async function openLocalClient(path: string): Promise<void> { + const link = generateOcsUrl('apps/files/api/v1') + '/openlocaleditor?format=json' + + try { + const result = await axios.post(link, { path }) + const uid = getCurrentUser()?.uid + let url = `nc://open/${uid}@` + window.location.host + encodePath(path) + url += '?token=' + result.data.ocs.data.token + + window.open(url, '_self') + } catch (error) { + showError(t('files', 'Failed to redirect to client')) + } +} + +/** + * Open the confirmation dialog. + */ +async function confirmLocalEditDialog(): Promise<'online'|'local'|false> { + let result: 'online'|'local'|false = false + const dialog = (new DialogBuilder()) + .setName(t('files', 'Open file locally')) + .setText(t('files', 'The file should now open on your device. If it doesn\'t, please check that you have the desktop app installed.')) + .setButtons([ + { + label: t('files', 'Retry and close'), + type: 'secondary', + callback: () => { + result = 'local' + }, + }, + { + label: t('files', 'Open online'), + icon: IconWeb, + type: 'primary', + callback: () => { + result = 'online' + }, + }, + ]) + .build() + + await dialog.show() + return result +} diff --git a/apps/files_sharing/l10n/cs.js b/apps/files_sharing/l10n/cs.js index ddd9f9e9319..97cb49425d6 100644 --- a/apps/files_sharing/l10n/cs.js +++ b/apps/files_sharing/l10n/cs.js @@ -257,6 +257,7 @@ OC.L10N.register( "File drop" : "Předání souboru", "Upload files to {foldername}." : "Nahrát soubory do {foldername}", "By uploading files, you agree to the terms of service." : "Nahráním souborů souhlasíte s podmínkami služby.", + "Successfully uploaded files" : "Soubory úspěšně nahrány", "View terms of service" : "Zobrazit smluvní podmínky", "Terms of service" : "Všeobecné podmínky", "Upload files to {folder}" : "Nahrát soubory do {folder}", diff --git a/apps/files_sharing/l10n/cs.json b/apps/files_sharing/l10n/cs.json index b135d8e9e9e..b5f512d20e7 100644 --- a/apps/files_sharing/l10n/cs.json +++ b/apps/files_sharing/l10n/cs.json @@ -255,6 +255,7 @@ "File drop" : "Předání souboru", "Upload files to {foldername}." : "Nahrát soubory do {foldername}", "By uploading files, you agree to the terms of service." : "Nahráním souborů souhlasíte s podmínkami služby.", + "Successfully uploaded files" : "Soubory úspěšně nahrány", "View terms of service" : "Zobrazit smluvní podmínky", "Terms of service" : "Všeobecné podmínky", "Upload files to {folder}" : "Nahrát soubory do {folder}", diff --git a/apps/files_sharing/l10n/de.js b/apps/files_sharing/l10n/de.js index ce2b7c73e3f..b2fb1dc3159 100644 --- a/apps/files_sharing/l10n/de.js +++ b/apps/files_sharing/l10n/de.js @@ -257,6 +257,7 @@ OC.L10N.register( "File drop" : "Dateiablage", "Upload files to {foldername}." : "Dateien hochladen nach {foldername}.", "By uploading files, you agree to the terms of service." : "Durch das Hochladen von Dateien stimmst du den Nutzungsbedingungen zu.", + "Successfully uploaded files" : "Dateien wurden hochgeladen", "View terms of service" : "Nutzungsbedingungen anzeigen", "Terms of service" : "Nutzungsbedingungen", "Upload files to {folder}" : "Dateien hochladen nach {folder}", diff --git a/apps/files_sharing/l10n/de.json b/apps/files_sharing/l10n/de.json index 0dbe6cc8141..5edc31fe79c 100644 --- a/apps/files_sharing/l10n/de.json +++ b/apps/files_sharing/l10n/de.json @@ -255,6 +255,7 @@ "File drop" : "Dateiablage", "Upload files to {foldername}." : "Dateien hochladen nach {foldername}.", "By uploading files, you agree to the terms of service." : "Durch das Hochladen von Dateien stimmst du den Nutzungsbedingungen zu.", + "Successfully uploaded files" : "Dateien wurden hochgeladen", "View terms of service" : "Nutzungsbedingungen anzeigen", "Terms of service" : "Nutzungsbedingungen", "Upload files to {folder}" : "Dateien hochladen nach {folder}", diff --git a/apps/files_sharing/l10n/de_DE.js b/apps/files_sharing/l10n/de_DE.js index c825e4c948f..69abf34bd75 100644 --- a/apps/files_sharing/l10n/de_DE.js +++ b/apps/files_sharing/l10n/de_DE.js @@ -257,6 +257,7 @@ OC.L10N.register( "File drop" : "Dateiablage", "Upload files to {foldername}." : "Dateien hochladen nach {foldername}.", "By uploading files, you agree to the terms of service." : "Durch das Hochladen von Dateien stimmen Sie den Nutzungsbedingungen zu.", + "Successfully uploaded files" : "Dateien wurden hochgeladen", "View terms of service" : "Nutzungsbedingungen anzeigen", "Terms of service" : "Nutzungsbedingungen", "Upload files to {folder}" : "Dateien hochladen nach {folder}", diff --git a/apps/files_sharing/l10n/de_DE.json b/apps/files_sharing/l10n/de_DE.json index 19c796cfd66..33b5d08bade 100644 --- a/apps/files_sharing/l10n/de_DE.json +++ b/apps/files_sharing/l10n/de_DE.json @@ -255,6 +255,7 @@ "File drop" : "Dateiablage", "Upload files to {foldername}." : "Dateien hochladen nach {foldername}.", "By uploading files, you agree to the terms of service." : "Durch das Hochladen von Dateien stimmen Sie den Nutzungsbedingungen zu.", + "Successfully uploaded files" : "Dateien wurden hochgeladen", "View terms of service" : "Nutzungsbedingungen anzeigen", "Terms of service" : "Nutzungsbedingungen", "Upload files to {folder}" : "Dateien hochladen nach {folder}", diff --git a/apps/files_sharing/l10n/en_GB.js b/apps/files_sharing/l10n/en_GB.js index dc48e5526ee..bfef88bf61a 100644 --- a/apps/files_sharing/l10n/en_GB.js +++ b/apps/files_sharing/l10n/en_GB.js @@ -257,6 +257,7 @@ OC.L10N.register( "File drop" : "File drop", "Upload files to {foldername}." : "Upload files to {foldername}.", "By uploading files, you agree to the terms of service." : "By uploading files, you agree to the terms of service.", + "Successfully uploaded files" : "Successfully uploaded files", "View terms of service" : "View terms of service", "Terms of service" : "Terms of service", "Upload files to {folder}" : "Upload files to {folder}", diff --git a/apps/files_sharing/l10n/en_GB.json b/apps/files_sharing/l10n/en_GB.json index ae93f32a6b2..202aa25d2ad 100644 --- a/apps/files_sharing/l10n/en_GB.json +++ b/apps/files_sharing/l10n/en_GB.json @@ -255,6 +255,7 @@ "File drop" : "File drop", "Upload files to {foldername}." : "Upload files to {foldername}.", "By uploading files, you agree to the terms of service." : "By uploading files, you agree to the terms of service.", + "Successfully uploaded files" : "Successfully uploaded files", "View terms of service" : "View terms of service", "Terms of service" : "Terms of service", "Upload files to {folder}" : "Upload files to {folder}", diff --git a/apps/files_sharing/l10n/fr.js b/apps/files_sharing/l10n/fr.js index 53adc1f132c..f99ebfc1530 100644 --- a/apps/files_sharing/l10n/fr.js +++ b/apps/files_sharing/l10n/fr.js @@ -257,6 +257,7 @@ OC.L10N.register( "File drop" : "Dépôt de fichier", "Upload files to {foldername}." : "Téléverser les fichiers vers {foldername}.", "By uploading files, you agree to the terms of service." : "En téléversant des fichiers, vous acceptez les conditions d'utilisation du service.", + "Successfully uploaded files" : "Fichiers téléversés avec succès", "View terms of service" : "Voir les conditions d'utilisation du service", "Terms of service" : "Conditions d'utilisation", "Upload files to {folder}" : "Téléverser les fichiers dans {folder}", diff --git a/apps/files_sharing/l10n/fr.json b/apps/files_sharing/l10n/fr.json index 58055c96295..ecec9e15f07 100644 --- a/apps/files_sharing/l10n/fr.json +++ b/apps/files_sharing/l10n/fr.json @@ -255,6 +255,7 @@ "File drop" : "Dépôt de fichier", "Upload files to {foldername}." : "Téléverser les fichiers vers {foldername}.", "By uploading files, you agree to the terms of service." : "En téléversant des fichiers, vous acceptez les conditions d'utilisation du service.", + "Successfully uploaded files" : "Fichiers téléversés avec succès", "View terms of service" : "Voir les conditions d'utilisation du service", "Terms of service" : "Conditions d'utilisation", "Upload files to {folder}" : "Téléverser les fichiers dans {folder}", diff --git a/apps/files_sharing/l10n/pt_BR.js b/apps/files_sharing/l10n/pt_BR.js index f75b225aae5..b8c05daa750 100644 --- a/apps/files_sharing/l10n/pt_BR.js +++ b/apps/files_sharing/l10n/pt_BR.js @@ -257,6 +257,7 @@ OC.L10N.register( "File drop" : "Depósito de arquivos", "Upload files to {foldername}." : "Subir arquivos para {foldername}.", "By uploading files, you agree to the terms of service." : "Ao enviar arquivos, você concorda com os termos de serviço.", + "Successfully uploaded files" : "Arquivos carregados com sucesso", "View terms of service" : "Ver os termos de serviço", "Terms of service" : "Termos de serviço", "Upload files to {folder}" : "Enviar arquivos para {folder}", diff --git a/apps/files_sharing/l10n/pt_BR.json b/apps/files_sharing/l10n/pt_BR.json index d1b9e77d278..827e07c452b 100644 --- a/apps/files_sharing/l10n/pt_BR.json +++ b/apps/files_sharing/l10n/pt_BR.json @@ -255,6 +255,7 @@ "File drop" : "Depósito de arquivos", "Upload files to {foldername}." : "Subir arquivos para {foldername}.", "By uploading files, you agree to the terms of service." : "Ao enviar arquivos, você concorda com os termos de serviço.", + "Successfully uploaded files" : "Arquivos carregados com sucesso", "View terms of service" : "Ver os termos de serviço", "Terms of service" : "Termos de serviço", "Upload files to {folder}" : "Enviar arquivos para {folder}", diff --git a/apps/files_sharing/l10n/zh_CN.js b/apps/files_sharing/l10n/zh_CN.js index 404be9f7ab4..5d051eb9950 100644 --- a/apps/files_sharing/l10n/zh_CN.js +++ b/apps/files_sharing/l10n/zh_CN.js @@ -257,6 +257,7 @@ OC.L10N.register( "File drop" : "文件拖放", "Upload files to {foldername}." : "将文件上传到 {foldername}。", "By uploading files, you agree to the terms of service." : "上传文件即表示您同意服务条款。", + "Successfully uploaded files" : "已成功上传文件", "View terms of service" : "查看服务条款", "Terms of service" : "服务条款", "Upload files to {folder}" : "将文件上传到 {folder}", diff --git a/apps/files_sharing/l10n/zh_CN.json b/apps/files_sharing/l10n/zh_CN.json index 2ea3efde3bb..5cd693a66be 100644 --- a/apps/files_sharing/l10n/zh_CN.json +++ b/apps/files_sharing/l10n/zh_CN.json @@ -255,6 +255,7 @@ "File drop" : "文件拖放", "Upload files to {foldername}." : "将文件上传到 {foldername}。", "By uploading files, you agree to the terms of service." : "上传文件即表示您同意服务条款。", + "Successfully uploaded files" : "已成功上传文件", "View terms of service" : "查看服务条款", "Terms of service" : "服务条款", "Upload files to {folder}" : "将文件上传到 {folder}", diff --git a/apps/files_sharing/l10n/zh_HK.js b/apps/files_sharing/l10n/zh_HK.js index dd435890210..b06485d52ae 100644 --- a/apps/files_sharing/l10n/zh_HK.js +++ b/apps/files_sharing/l10n/zh_HK.js @@ -257,6 +257,7 @@ OC.L10N.register( "File drop" : "檔案拖放", "Upload files to {foldername}." : "上傳檔案至 {foldername}。", "By uploading files, you agree to the terms of service." : "上傳檔案即表示您同意服務條款。", + "Successfully uploaded files" : "檔案上傳成功", "View terms of service" : "檢視服務條款", "Terms of service" : "服務條款", "Upload files to {folder}" : "上傳檔案到 {folder}", diff --git a/apps/files_sharing/l10n/zh_HK.json b/apps/files_sharing/l10n/zh_HK.json index 4f6fe38e858..67d1f31894f 100644 --- a/apps/files_sharing/l10n/zh_HK.json +++ b/apps/files_sharing/l10n/zh_HK.json @@ -255,6 +255,7 @@ "File drop" : "檔案拖放", "Upload files to {foldername}." : "上傳檔案至 {foldername}。", "By uploading files, you agree to the terms of service." : "上傳檔案即表示您同意服務條款。", + "Successfully uploaded files" : "檔案上傳成功", "View terms of service" : "檢視服務條款", "Terms of service" : "服務條款", "Upload files to {folder}" : "上傳檔案到 {folder}", diff --git a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php index 910d00a5972..645250ab2b5 100644 --- a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php +++ b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php @@ -91,6 +91,9 @@ class DefaultPublicShareTemplateProvider implements IPublicShareTemplateProvider 'disclaimer', $this->appConfig->getValueString('core', 'shareapi_public_link_disclaimertext'), ); + // file drops do not request the root folder so we need to provide label and note if available + $this->initialState->provideInitialState('label', $share->getLabel()); + $this->initialState->provideInitialState('note', $share->getNote()); } // Set up initial state $this->initialState->provideInitialState('isPublic', true); diff --git a/apps/files_sharing/src/files_views/publicFileDrop.ts b/apps/files_sharing/src/files_views/publicFileDrop.ts index 0d782d48fc7..65756e83c74 100644 --- a/apps/files_sharing/src/files_views/publicFileDrop.ts +++ b/apps/files_sharing/src/files_views/publicFileDrop.ts @@ -4,7 +4,8 @@ */ import type { VueConstructor } from 'vue' -import { Folder, Permission, View, davRemoteURL, davRootPath, getNavigation } from '@nextcloud/files' +import { Folder, Permission, View, getNavigation } from '@nextcloud/files' +import { defaultRemoteURL, defaultRootPath } from '@nextcloud/files/dav' import { loadState } from '@nextcloud/initial-state' import { translate as t } from '@nextcloud/l10n' import svgCloudUpload from '@mdi/svg/svg/cloud-upload.svg?raw' @@ -45,8 +46,8 @@ export default () => { // Fake a writeonly folder as root folder: new Folder({ id: 0, - source: `${davRemoteURL}${davRootPath}`, - root: davRootPath, + source: `${defaultRemoteURL}${defaultRootPath}`, + root: defaultRootPath, owner: null, permissions: Permission.CREATE, }), diff --git a/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue b/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue index 5571e5e9f5d..33fec9af028 100644 --- a/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue +++ b/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue @@ -5,13 +5,29 @@ <template> <NcEmptyContent class="file-drop-empty-content" data-cy-files-sharing-file-drop - :name="t('files_sharing', 'File drop')"> + :name="name"> <template #icon> <NcIconSvgWrapper :svg="svgCloudUpload" /> </template> <template #description> - {{ t('files_sharing', 'Upload files to {foldername}.', { foldername }) }} - {{ disclaimer === '' ? '' : t('files_sharing', 'By uploading files, you agree to the terms of service.') }} + <p> + {{ shareNote || t('files_sharing', 'Upload files to {foldername}.', { foldername }) }} + </p> + <p v-if="disclaimer"> + {{ t('files_sharing', 'By uploading files, you agree to the terms of service.') }} + </p> + <NcNoteCard v-if="getSortedUploads().length" + class="file-drop-empty-content__note-card" + type="success"> + <h2 id="file-drop-empty-content__heading"> + {{ t('files_sharing', 'Successfully uploaded files') }} + </h2> + <ul aria-labelledby="file-drop-empty-content__heading" class="file-drop-empty-content__list"> + <li v-for="file in getSortedUploads()" :key="file"> + {{ file }} + </li> + </ul> + </NcNoteCard> </template> <template #action> <template v-if="disclaimer"> @@ -34,16 +50,24 @@ </NcEmptyContent> </template> +<script lang="ts"> +/* eslint-disable import/first */ + +// We need this on module level rather than on the instance as view will be refreshed by the files app after uploading +const uploads = new Set<string>() +</script> + <script setup lang="ts"> import { loadState } from '@nextcloud/initial-state' import { translate as t } from '@nextcloud/l10n' -import { getUploader, UploadPicker } from '@nextcloud/upload' +import { getUploader, UploadPicker, UploadStatus } from '@nextcloud/upload' import { ref } from 'vue' import NcButton from '@nextcloud/vue/components/NcButton' import NcDialog from '@nextcloud/vue/components/NcDialog' import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent' import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper' +import NcNoteCard from '@nextcloud/vue/components/NcNoteCard' import svgCloudUpload from '@mdi/svg/svg/cloud-upload.svg?raw' defineProps<{ @@ -51,17 +75,62 @@ defineProps<{ }>() const disclaimer = loadState<string>('files_sharing', 'disclaimer', '') +const shareLabel = loadState<string>('files_sharing', 'label', '') +const shareNote = loadState<string>('files_sharing', 'note', '') + +const name = shareLabel || t('files_sharing', 'File drop') + const showDialog = ref(false) const uploadDestination = getUploader().destination -</script> -<style scoped> -:deep(.terms-of-service-dialog) { - min-height: min(100px, 20vh); +getUploader() + .addNotifier((upload) => { + if (upload.status === UploadStatus.FINISHED && upload.file.name) { + // if a upload is finished and is not a meta upload (name is set) + // then we add the upload to the list of finished uploads to be shown to the user + uploads.add(upload.file.name) + } + }) + +/** + * Get the previous uploads as sorted list + */ +function getSortedUploads() { + return [...uploads].sort((a, b) => a.localeCompare(b)) } -/* TODO fix in library */ -.file-drop-empty-content :deep(.empty-content__action) { - display: flex; - gap: var(--default-grid-baseline); +</script> + +<style scoped lang="scss"> +.file-drop-empty-content { + margin: auto; + max-width: max(50vw, 300px); + + .file-drop-empty-content__note-card { + width: fit-content; + margin-inline: auto; + } + + #file-drop-empty-content__heading { + margin-block: 0 10px; + font-weight: bold; + font-size: 20px; + } + + .file-drop-empty-content__list { + list-style: inside; + max-height: min(350px, 33vh); + overflow-y: scroll; + padding-inline-end: calc(2 * var(--default-grid-baseline)); + } + + :deep(.terms-of-service-dialog) { + min-height: min(100px, 20vh); + } + + /* TODO fix in library */ + :deep(.empty-content__action) { + display: flex; + gap: var(--default-grid-baseline); + } } </style> diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php index 524336787cb..a6bef1bed56 100644 --- a/apps/files_sharing/tests/Controller/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php @@ -399,6 +399,8 @@ class ShareControllerTest extends \Test\TestCase { ->setPassword('password') ->setShareOwner('ownerUID') ->setSharedBy('initiatorUID') + ->setNote('The note') + ->setLabel('A label') ->setNode($file) ->setTarget("/$filename") ->setToken('token'); @@ -478,6 +480,8 @@ class ShareControllerTest extends \Test\TestCase { 'disclaimer' => 'My disclaimer text', 'owner' => 'ownerUID', 'ownerDisplayName' => 'ownerDisplay', + 'note' => 'The note', + 'label' => 'A label', ]; $response = $this->shareController->showShare(); @@ -487,9 +491,9 @@ class ShareControllerTest extends \Test\TestCase { $csp = new ContentSecurityPolicy(); $csp->addAllowedFrameDomain('\'self\''); $expectedResponse = new PublicTemplateResponse('files', 'index'); - $expectedResponse->setParams(['pageTitle' => $filename]); + $expectedResponse->setParams(['pageTitle' => 'A label']); $expectedResponse->setContentSecurityPolicy($csp); - $expectedResponse->setHeaderTitle($filename); + $expectedResponse->setHeaderTitle('A label'); $expectedResponse->setHeaderDetails('shared by ownerDisplay'); $expectedResponse->setHeaderActions([ new LinkMenuAction($this->l10n->t('Direct link'), 'icon-public', 'shareUrl'), diff --git a/apps/files_trashbin/l10n/cs.js b/apps/files_trashbin/l10n/cs.js index de43bf97faf..48eabc39b81 100644 --- a/apps/files_trashbin/l10n/cs.js +++ b/apps/files_trashbin/l10n/cs.js @@ -7,6 +7,7 @@ OC.L10N.register( "This application enables people to restore files that were deleted from the system." : "Tato aplikace umožňuje lidem obnovovat soubory, které byly ze systému vymazány.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Tato aplikace lidem umožňuje obnovovat soubory, které byly ze systému vymazány. Ve webovém rozhraní zobrazuje seznam smazaných souborů a má volby pro obnovení těchto souborů zpět do složek se soubory lidí nebo jejich trvalé odebrání. Obnovení souboru také obnoví jeho související verze (pokud je zapnutá aplikace pro správu verzí). Když je soubor smazán ze sdílení, je možné ho obnovit stejným způsobem, ačkoli už nebude sdílený. Ve výchozím stavu, tyto soubory jsou ponechávány v koši po dobu 30 dnů.\nAby lidé nezaplnili celý disk, aplikace Smazané soubory pro ně nevyužije více než 50% kvóty. Pokud smazané soubory přesahují tento limit, aplikace maže nejstarší soubory, dokud se nedostane pod limit. Další informace jsou k dispozici v dokumentaci ke Smazané soubory.", "Restore" : "Obnovit", + "Not enough free space to restore the file/folder" : "Nedostatek volného místa pro obnovení souboru/složky", "Empty deleted files" : "Vyprázdnit smazané soubory", "Confirm permanent deletion" : "Potvrdit nevratné smazání", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Opravdu chcete nevratně smazat veškeré soubory a složky v koši? Toto nelze vzít zpět!", diff --git a/apps/files_trashbin/l10n/cs.json b/apps/files_trashbin/l10n/cs.json index 791bdf1d481..cc0e06dab41 100644 --- a/apps/files_trashbin/l10n/cs.json +++ b/apps/files_trashbin/l10n/cs.json @@ -5,6 +5,7 @@ "This application enables people to restore files that were deleted from the system." : "Tato aplikace umožňuje lidem obnovovat soubory, které byly ze systému vymazány.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Tato aplikace lidem umožňuje obnovovat soubory, které byly ze systému vymazány. Ve webovém rozhraní zobrazuje seznam smazaných souborů a má volby pro obnovení těchto souborů zpět do složek se soubory lidí nebo jejich trvalé odebrání. Obnovení souboru také obnoví jeho související verze (pokud je zapnutá aplikace pro správu verzí). Když je soubor smazán ze sdílení, je možné ho obnovit stejným způsobem, ačkoli už nebude sdílený. Ve výchozím stavu, tyto soubory jsou ponechávány v koši po dobu 30 dnů.\nAby lidé nezaplnili celý disk, aplikace Smazané soubory pro ně nevyužije více než 50% kvóty. Pokud smazané soubory přesahují tento limit, aplikace maže nejstarší soubory, dokud se nedostane pod limit. Další informace jsou k dispozici v dokumentaci ke Smazané soubory.", "Restore" : "Obnovit", + "Not enough free space to restore the file/folder" : "Nedostatek volného místa pro obnovení souboru/složky", "Empty deleted files" : "Vyprázdnit smazané soubory", "Confirm permanent deletion" : "Potvrdit nevratné smazání", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Opravdu chcete nevratně smazat veškeré soubory a složky v koši? Toto nelze vzít zpět!", diff --git a/apps/files_trashbin/l10n/de.js b/apps/files_trashbin/l10n/de.js index 30f503f52d9..75a7ce7d443 100644 --- a/apps/files_trashbin/l10n/de.js +++ b/apps/files_trashbin/l10n/de.js @@ -7,6 +7,7 @@ OC.L10N.register( "This application enables people to restore files that were deleted from the system." : "Diese Anwendung ermöglicht es Personen, Dateien wiederherzustellen, die vom System gelöscht wurden.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Diese Anwendung ermöglicht es Personen, Dateien wiederherzustellen, die aus dem System gelöscht wurden. Es zeigt eine Liste der gelöschten Dateien in der Web-Oberfläche an und bietet die Möglichkeit, diese gelöschten Dateien in die Verzeichnisse der Personen wiederherzustellen oder sie dauerhaft aus dem System zu entfernen. Beim Wiederherstellen einer Datei werden auch die zugehörigen Dateiversionen wiederhergestellt, sofern die Versionsanwendung aktiviert ist. Wenn eine Datei aus einer Freigabe gelöscht wird, kann sie auf dem gleichen Weg wiederhergestellt werden, ist jedoch nicht mehr geteilt. Standardmäßig verbleiben gelöschte Dateien 30 Tage lang im Papierkorb.\nUm zu verhindern, dass einem Konto der Speicherplatz ausgeht, nutzt die Anwendung für gelöschte Dateien maximal 50 % des aktuell verfügbaren freien Kontingents. Wenn die gelöschten Dateien dieses Limit überschreiten, löscht die Anwendung die ältesten Dateien, bis sie unter dieses Limit fällt. Weitere Informationen findest du in der Dokumentation zu gelöschten Dateien.", "Restore" : "Wiederherstellen", + "Not enough free space to restore the file/folder" : "Nicht genügend freier Speicherplatz zum Wiederherstellen der Datei/des Ordners", "Empty deleted files" : "Gelöschte Dateien leeren", "Confirm permanent deletion" : "Endgültiges Löschen bestätigen", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Möchtest du wirklich alle Dateien und Ordner im Papierkorb endgültig löschen? Dies kann nicht rückgängig gemacht werden.", diff --git a/apps/files_trashbin/l10n/de.json b/apps/files_trashbin/l10n/de.json index 9017b23b0ca..6085c3ba2ee 100644 --- a/apps/files_trashbin/l10n/de.json +++ b/apps/files_trashbin/l10n/de.json @@ -5,6 +5,7 @@ "This application enables people to restore files that were deleted from the system." : "Diese Anwendung ermöglicht es Personen, Dateien wiederherzustellen, die vom System gelöscht wurden.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Diese Anwendung ermöglicht es Personen, Dateien wiederherzustellen, die aus dem System gelöscht wurden. Es zeigt eine Liste der gelöschten Dateien in der Web-Oberfläche an und bietet die Möglichkeit, diese gelöschten Dateien in die Verzeichnisse der Personen wiederherzustellen oder sie dauerhaft aus dem System zu entfernen. Beim Wiederherstellen einer Datei werden auch die zugehörigen Dateiversionen wiederhergestellt, sofern die Versionsanwendung aktiviert ist. Wenn eine Datei aus einer Freigabe gelöscht wird, kann sie auf dem gleichen Weg wiederhergestellt werden, ist jedoch nicht mehr geteilt. Standardmäßig verbleiben gelöschte Dateien 30 Tage lang im Papierkorb.\nUm zu verhindern, dass einem Konto der Speicherplatz ausgeht, nutzt die Anwendung für gelöschte Dateien maximal 50 % des aktuell verfügbaren freien Kontingents. Wenn die gelöschten Dateien dieses Limit überschreiten, löscht die Anwendung die ältesten Dateien, bis sie unter dieses Limit fällt. Weitere Informationen findest du in der Dokumentation zu gelöschten Dateien.", "Restore" : "Wiederherstellen", + "Not enough free space to restore the file/folder" : "Nicht genügend freier Speicherplatz zum Wiederherstellen der Datei/des Ordners", "Empty deleted files" : "Gelöschte Dateien leeren", "Confirm permanent deletion" : "Endgültiges Löschen bestätigen", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Möchtest du wirklich alle Dateien und Ordner im Papierkorb endgültig löschen? Dies kann nicht rückgängig gemacht werden.", diff --git a/apps/files_trashbin/l10n/de_DE.js b/apps/files_trashbin/l10n/de_DE.js index 291f3733b02..179a3689d7e 100644 --- a/apps/files_trashbin/l10n/de_DE.js +++ b/apps/files_trashbin/l10n/de_DE.js @@ -7,6 +7,7 @@ OC.L10N.register( "This application enables people to restore files that were deleted from the system." : "Diese Anwendung ermöglicht es Personen, Dateien wiederherzustellen, die vom System gelöscht wurden.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Diese Anwendung ermöglicht es Personen, Dateien wiederherzustellen, die aus dem System gelöscht wurden. Es zeigt eine Liste der gelöschten Dateien in der Web-Oberfläche an und bietet die Möglichkeit, diese gelöschten Dateien in die Verzeichnisse der Personen wiederherzustellen oder sie dauerhaft aus dem System zu entfernen. Beim Wiederherstellen einer Datei werden auch die zugehörigen Dateiversionen wiederhergestellt, sofern die Versionsanwendung aktiviert ist. Wenn eine Datei aus einer Freigabe gelöscht wird, kann sie auf dem gleichen Weg wiederhergestellt werden, ist jedoch nicht mehr geteilt. Standardmäßig verbleiben gelöschte Dateien 30 Tage lang im Papierkorb.\nUm zu verhindern, dass einem Konto der Speicherplatz ausgeht, nutzt die Anwendung für gelöschte Dateien maximal 50 % des aktuell verfügbaren freien Kontingents. Wenn die gelöschten Dateien dieses Limit überschreiten, löscht die Anwendung die ältesten Dateien, bis sie unter dieses Limit fällt. Weitere Informationen finden Sie in der Dokumentation zu gelöschten Dateien.", "Restore" : "Wiederherstellen", + "Not enough free space to restore the file/folder" : "Nicht genügend freier Speicherplatz zum Wiederherstellen der Datei/des Ordners", "Empty deleted files" : "Gelöschte Dateien leeren", "Confirm permanent deletion" : "Endgültiges Löschen bestätigen", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Möchten Sie wirklich alle Dateien und Ordner im Papierkorb endgültig löschen? Dies kann nicht rückgängig gemacht werden.", diff --git a/apps/files_trashbin/l10n/de_DE.json b/apps/files_trashbin/l10n/de_DE.json index 645f7a146a0..974d0a02b90 100644 --- a/apps/files_trashbin/l10n/de_DE.json +++ b/apps/files_trashbin/l10n/de_DE.json @@ -5,6 +5,7 @@ "This application enables people to restore files that were deleted from the system." : "Diese Anwendung ermöglicht es Personen, Dateien wiederherzustellen, die vom System gelöscht wurden.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Diese Anwendung ermöglicht es Personen, Dateien wiederherzustellen, die aus dem System gelöscht wurden. Es zeigt eine Liste der gelöschten Dateien in der Web-Oberfläche an und bietet die Möglichkeit, diese gelöschten Dateien in die Verzeichnisse der Personen wiederherzustellen oder sie dauerhaft aus dem System zu entfernen. Beim Wiederherstellen einer Datei werden auch die zugehörigen Dateiversionen wiederhergestellt, sofern die Versionsanwendung aktiviert ist. Wenn eine Datei aus einer Freigabe gelöscht wird, kann sie auf dem gleichen Weg wiederhergestellt werden, ist jedoch nicht mehr geteilt. Standardmäßig verbleiben gelöschte Dateien 30 Tage lang im Papierkorb.\nUm zu verhindern, dass einem Konto der Speicherplatz ausgeht, nutzt die Anwendung für gelöschte Dateien maximal 50 % des aktuell verfügbaren freien Kontingents. Wenn die gelöschten Dateien dieses Limit überschreiten, löscht die Anwendung die ältesten Dateien, bis sie unter dieses Limit fällt. Weitere Informationen finden Sie in der Dokumentation zu gelöschten Dateien.", "Restore" : "Wiederherstellen", + "Not enough free space to restore the file/folder" : "Nicht genügend freier Speicherplatz zum Wiederherstellen der Datei/des Ordners", "Empty deleted files" : "Gelöschte Dateien leeren", "Confirm permanent deletion" : "Endgültiges Löschen bestätigen", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Möchten Sie wirklich alle Dateien und Ordner im Papierkorb endgültig löschen? Dies kann nicht rückgängig gemacht werden.", diff --git a/apps/files_trashbin/l10n/en_GB.js b/apps/files_trashbin/l10n/en_GB.js index 6a42b161815..6f450e00473 100644 --- a/apps/files_trashbin/l10n/en_GB.js +++ b/apps/files_trashbin/l10n/en_GB.js @@ -7,6 +7,7 @@ OC.L10N.register( "This application enables people to restore files that were deleted from the system." : "This application enables people to restore files that were deleted from the system.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation.", "Restore" : "Restore", + "Not enough free space to restore the file/folder" : "Not enough free space to restore the file/folder", "Empty deleted files" : "Empty deleted files", "Confirm permanent deletion" : "Confirm permanent deletion", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone.", diff --git a/apps/files_trashbin/l10n/en_GB.json b/apps/files_trashbin/l10n/en_GB.json index b4f372b73ca..d48e62ffc1b 100644 --- a/apps/files_trashbin/l10n/en_GB.json +++ b/apps/files_trashbin/l10n/en_GB.json @@ -5,6 +5,7 @@ "This application enables people to restore files that were deleted from the system." : "This application enables people to restore files that were deleted from the system.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation.", "Restore" : "Restore", + "Not enough free space to restore the file/folder" : "Not enough free space to restore the file/folder", "Empty deleted files" : "Empty deleted files", "Confirm permanent deletion" : "Confirm permanent deletion", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone.", diff --git a/apps/files_trashbin/l10n/et_EE.js b/apps/files_trashbin/l10n/et_EE.js index a91297dee6c..1ff6f43e96f 100644 --- a/apps/files_trashbin/l10n/et_EE.js +++ b/apps/files_trashbin/l10n/et_EE.js @@ -7,6 +7,7 @@ OC.L10N.register( "This application enables people to restore files that were deleted from the system." : "See rakendus võimaldab inimestel taastada faile mis nad süsteemist kustutasid.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "See rakendus võimaldab inimestel taastada süsteemist kustutatud faile. See kuvab veebiliideses kustutatud failide loendi ja pakub võimalusi kustutatud failide taastamiseks inimeste failikataloogidesse või süsteemist jäädavalt eemaldamiseks. Faili taastamine taastab ka seotud failiversioonid, kui versioonirakendus on lubatud. Kui fail ühiskasutusest kustutatakse, saab selle taastada samal viisil, kuigi seda enam ei jagata. Vaikimisi jäävad need failid prügikasti 30 päevaks.\nKonto kettaruumi tühjenemise vältimiseks ei kasuta rakendus Kustutatud failid rohkem kui 50% praegu saadaolevast kustutatud failide tasuta kvoodist. Kui kustutatud failid ületavad selle limiidi, kustutab rakendus vanimad failid, kuni need jäävad sellest limiidist allapoole. Lisateavet leiate kustutatud failide dokumentatsioonist.", "Restore" : "Taasta", + "Not enough free space to restore the file/folder" : "Faili või kausta taastamiseks pole piisavalt vaba ruumi", "Empty deleted files" : "Tühjenda kustutatud failid", "Confirm permanent deletion" : "Kinnita lõplik kustutamine", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Kas oled kindel, et tahad lõplikult kustutada kõik prügikastis olevad failid ja kaustad? Seda ei saa tagasi keerata.", diff --git a/apps/files_trashbin/l10n/et_EE.json b/apps/files_trashbin/l10n/et_EE.json index 5b5f3804b26..b678a274fa3 100644 --- a/apps/files_trashbin/l10n/et_EE.json +++ b/apps/files_trashbin/l10n/et_EE.json @@ -5,6 +5,7 @@ "This application enables people to restore files that were deleted from the system." : "See rakendus võimaldab inimestel taastada faile mis nad süsteemist kustutasid.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "See rakendus võimaldab inimestel taastada süsteemist kustutatud faile. See kuvab veebiliideses kustutatud failide loendi ja pakub võimalusi kustutatud failide taastamiseks inimeste failikataloogidesse või süsteemist jäädavalt eemaldamiseks. Faili taastamine taastab ka seotud failiversioonid, kui versioonirakendus on lubatud. Kui fail ühiskasutusest kustutatakse, saab selle taastada samal viisil, kuigi seda enam ei jagata. Vaikimisi jäävad need failid prügikasti 30 päevaks.\nKonto kettaruumi tühjenemise vältimiseks ei kasuta rakendus Kustutatud failid rohkem kui 50% praegu saadaolevast kustutatud failide tasuta kvoodist. Kui kustutatud failid ületavad selle limiidi, kustutab rakendus vanimad failid, kuni need jäävad sellest limiidist allapoole. Lisateavet leiate kustutatud failide dokumentatsioonist.", "Restore" : "Taasta", + "Not enough free space to restore the file/folder" : "Faili või kausta taastamiseks pole piisavalt vaba ruumi", "Empty deleted files" : "Tühjenda kustutatud failid", "Confirm permanent deletion" : "Kinnita lõplik kustutamine", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Kas oled kindel, et tahad lõplikult kustutada kõik prügikastis olevad failid ja kaustad? Seda ei saa tagasi keerata.", diff --git a/apps/files_trashbin/l10n/fr.js b/apps/files_trashbin/l10n/fr.js index db2e6d58272..80f31b30437 100644 --- a/apps/files_trashbin/l10n/fr.js +++ b/apps/files_trashbin/l10n/fr.js @@ -7,6 +7,7 @@ OC.L10N.register( "This application enables people to restore files that were deleted from the system." : "Cette application permet aux personnes de restaurer des fichiers qui ont été supprimés du système.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Cette application permet aux personnes de restaurer les fichiers qui ont été supprimés du système. Il affiche une liste de fichiers supprimés dans l'interface Web et dispose d'options pour restaurer ces fichiers supprimés dans les dossiers de fichiers des personnes ou les supprimer définitivement du système. La restauration d'un fichier restaure également les versions de fichiers associées, si l'application de versions est activée. Lorsqu'un fichier est supprimé d'un partage, il peut être restauré de la même manière, bien qu'il ne soit plus partagé. Par défaut, ces fichiers restent dans la corbeille pendant 30 jours.\n\nPour empêcher un compte de manquer d'espace disque, l'application \"Fichiers supprimés\" n'utilisera pas plus de 50 % du quota actuellement disponible pour les fichiers supprimés. Si les fichiers supprimés dépassent cette limite, l'application supprime les fichiers les plus anciens jusqu'à ce qu'elle soit inférieure à cette limite. Plus d'informations sont disponibles dans la documentation Fichiers supprimés.", "Restore" : "Restaurer", + "Not enough free space to restore the file/folder" : "Espace libre insuffisant pour restaurer le fichier/dossier", "Empty deleted files" : "Vider les fichiers supprimés", "Confirm permanent deletion" : "Confirmer la suppression définitive", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Êtes-vous sûr de vouloir supprimer définitivement tous les fichiers et dossiers dans la corbeille ? Cette action est irréversible.", diff --git a/apps/files_trashbin/l10n/fr.json b/apps/files_trashbin/l10n/fr.json index 2c27f497191..d1de6ea7032 100644 --- a/apps/files_trashbin/l10n/fr.json +++ b/apps/files_trashbin/l10n/fr.json @@ -5,6 +5,7 @@ "This application enables people to restore files that were deleted from the system." : "Cette application permet aux personnes de restaurer des fichiers qui ont été supprimés du système.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Cette application permet aux personnes de restaurer les fichiers qui ont été supprimés du système. Il affiche une liste de fichiers supprimés dans l'interface Web et dispose d'options pour restaurer ces fichiers supprimés dans les dossiers de fichiers des personnes ou les supprimer définitivement du système. La restauration d'un fichier restaure également les versions de fichiers associées, si l'application de versions est activée. Lorsqu'un fichier est supprimé d'un partage, il peut être restauré de la même manière, bien qu'il ne soit plus partagé. Par défaut, ces fichiers restent dans la corbeille pendant 30 jours.\n\nPour empêcher un compte de manquer d'espace disque, l'application \"Fichiers supprimés\" n'utilisera pas plus de 50 % du quota actuellement disponible pour les fichiers supprimés. Si les fichiers supprimés dépassent cette limite, l'application supprime les fichiers les plus anciens jusqu'à ce qu'elle soit inférieure à cette limite. Plus d'informations sont disponibles dans la documentation Fichiers supprimés.", "Restore" : "Restaurer", + "Not enough free space to restore the file/folder" : "Espace libre insuffisant pour restaurer le fichier/dossier", "Empty deleted files" : "Vider les fichiers supprimés", "Confirm permanent deletion" : "Confirmer la suppression définitive", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Êtes-vous sûr de vouloir supprimer définitivement tous les fichiers et dossiers dans la corbeille ? Cette action est irréversible.", diff --git a/apps/files_trashbin/l10n/pt_BR.js b/apps/files_trashbin/l10n/pt_BR.js index 59a67c33b48..6b13836148f 100644 --- a/apps/files_trashbin/l10n/pt_BR.js +++ b/apps/files_trashbin/l10n/pt_BR.js @@ -7,6 +7,7 @@ OC.L10N.register( "This application enables people to restore files that were deleted from the system." : "Este aplicativo permite que as pessoas restaurem arquivos que foram excluídos do sistema.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Este aplicativo permite que as pessoas restaurem arquivos que foram excluídos do sistema. Ele exibe uma lista de arquivos excluídos na interface da web e tem opções para restaurar esses arquivos excluídos de volta aos diretórios de arquivos de pessoas ou removê-los permanentemente do sistema. A restauração de um arquivo também restaura versões de arquivos relacionadas, se o aplicativo de versões estiver ativado. Quando um arquivo é excluído de um compartilhamento, ele pode ser restaurado da mesma maneira, embora não seja mais compartilhado. Por padrão, esses arquivos permanecem na lixeira por 30 dias. \nPara evitar que uma conta fique sem espaço em disco, o aplicativo Arquivos excluídos não utilizará mais de 50% da cota livre atualmente disponível para arquivos excluídos. Se os arquivos excluídos excederem esse limite, o aplicativo excluirá os arquivos mais antigos até ficarem abaixo desse limite. Mais informações estão disponíveis na documentação Arquivos Excluídos.", "Restore" : "Restaurar", + "Not enough free space to restore the file/folder" : "Não há espaço livre suficiente para restaurar o arquivo/pasta", "Empty deleted files" : "Esvaziar arquivos excluídos", "Confirm permanent deletion" : "Confirme exclusão permanente", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Tem certeza de que deseja excluir permanentemente todos os arquivos e pastas na lixeira? Isso não pode ser desfeito.", diff --git a/apps/files_trashbin/l10n/pt_BR.json b/apps/files_trashbin/l10n/pt_BR.json index 3cdbaad0f17..c2f8ba9a033 100644 --- a/apps/files_trashbin/l10n/pt_BR.json +++ b/apps/files_trashbin/l10n/pt_BR.json @@ -5,6 +5,7 @@ "This application enables people to restore files that were deleted from the system." : "Este aplicativo permite que as pessoas restaurem arquivos que foram excluídos do sistema.", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Este aplicativo permite que as pessoas restaurem arquivos que foram excluídos do sistema. Ele exibe uma lista de arquivos excluídos na interface da web e tem opções para restaurar esses arquivos excluídos de volta aos diretórios de arquivos de pessoas ou removê-los permanentemente do sistema. A restauração de um arquivo também restaura versões de arquivos relacionadas, se o aplicativo de versões estiver ativado. Quando um arquivo é excluído de um compartilhamento, ele pode ser restaurado da mesma maneira, embora não seja mais compartilhado. Por padrão, esses arquivos permanecem na lixeira por 30 dias. \nPara evitar que uma conta fique sem espaço em disco, o aplicativo Arquivos excluídos não utilizará mais de 50% da cota livre atualmente disponível para arquivos excluídos. Se os arquivos excluídos excederem esse limite, o aplicativo excluirá os arquivos mais antigos até ficarem abaixo desse limite. Mais informações estão disponíveis na documentação Arquivos Excluídos.", "Restore" : "Restaurar", + "Not enough free space to restore the file/folder" : "Não há espaço livre suficiente para restaurar o arquivo/pasta", "Empty deleted files" : "Esvaziar arquivos excluídos", "Confirm permanent deletion" : "Confirme exclusão permanente", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "Tem certeza de que deseja excluir permanentemente todos os arquivos e pastas na lixeira? Isso não pode ser desfeito.", diff --git a/apps/files_trashbin/l10n/zh_CN.js b/apps/files_trashbin/l10n/zh_CN.js index 83cdeb467d4..01d38f9b146 100644 --- a/apps/files_trashbin/l10n/zh_CN.js +++ b/apps/files_trashbin/l10n/zh_CN.js @@ -7,6 +7,7 @@ OC.L10N.register( "This application enables people to restore files that were deleted from the system." : "此应用程序使人们能够恢复从系统中删除的文件。", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "此应用程序使人们能够恢复从系统中删除的文件。它在web界面中显示已删除文件的列表,并可以选择将这些已删除的文件还原回人员文件目录或从系统中永久删除这些文件。如果启用了版本应用程序,恢复文件也会恢复相关的文件版本。当文件从共享中删除时,可以以相同的方式恢复,尽管不再共享。默认情况下,这些文件将在垃圾桶中保留30天。\n为了防止帐户磁盘空间不足,“已删除文件”应用程序将不会为已删除文件使用超过当前可用可用配额的50%。如果删除的文件超过此限制,应用程序将删除最旧的文件,直到其低于此限制。有关详细信息,请参阅“已删除的文件”文档。", "Restore" : "恢复", + "Not enough free space to restore the file/folder" : "空间不足,无法恢复文件/文件夹", "Empty deleted files" : "清空已删除的文件", "Confirm permanent deletion" : "确认永久删除", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "是否确定要永久删除回收站中的所有文件和文件夹?此操作无法撤销。", diff --git a/apps/files_trashbin/l10n/zh_CN.json b/apps/files_trashbin/l10n/zh_CN.json index a1f624394cc..6e6f307f2f6 100644 --- a/apps/files_trashbin/l10n/zh_CN.json +++ b/apps/files_trashbin/l10n/zh_CN.json @@ -5,6 +5,7 @@ "This application enables people to restore files that were deleted from the system." : "此应用程序使人们能够恢复从系统中删除的文件。", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "此应用程序使人们能够恢复从系统中删除的文件。它在web界面中显示已删除文件的列表,并可以选择将这些已删除的文件还原回人员文件目录或从系统中永久删除这些文件。如果启用了版本应用程序,恢复文件也会恢复相关的文件版本。当文件从共享中删除时,可以以相同的方式恢复,尽管不再共享。默认情况下,这些文件将在垃圾桶中保留30天。\n为了防止帐户磁盘空间不足,“已删除文件”应用程序将不会为已删除文件使用超过当前可用可用配额的50%。如果删除的文件超过此限制,应用程序将删除最旧的文件,直到其低于此限制。有关详细信息,请参阅“已删除的文件”文档。", "Restore" : "恢复", + "Not enough free space to restore the file/folder" : "空间不足,无法恢复文件/文件夹", "Empty deleted files" : "清空已删除的文件", "Confirm permanent deletion" : "确认永久删除", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "是否确定要永久删除回收站中的所有文件和文件夹?此操作无法撤销。", diff --git a/apps/files_trashbin/l10n/zh_HK.js b/apps/files_trashbin/l10n/zh_HK.js index 9a13dce5326..b42546937ab 100644 --- a/apps/files_trashbin/l10n/zh_HK.js +++ b/apps/files_trashbin/l10n/zh_HK.js @@ -7,6 +7,7 @@ OC.L10N.register( "This application enables people to restore files that were deleted from the system." : "此應用程式讓人仕可以還原他們在系統當中刪除的檔案", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "此應用程式讓使用可以還原從系統中刪除的檔案。其會在網路界面中顯示已刪除的檔案列表,並有選項可以復原那些檔案到用戶的檔案目錄,或是將它們從系統中永久移除。若啟用了版本應用程式,復原檔案也會復原相關的檔案版本。當檔案從分享中刪除時,雖然不再共享,但可以用相同的方式來還原。預設情況下,這些檔案會在回收桶中保留30天。\n為了避免帳戶耗盡磁碟空間,「已刪除檔案」應用程式將不會用於超過目前可用配額 50% 的已刪除檔案。如果已刪除的檔案超過此限制,應用程式將會刪除最舊的檔案,直到低於此限制為止。更多資訊在「已刪除檔案」的說明書中提供。", "Restore" : "還原", + "Not enough free space to restore the file/folder" : "空間不足,不能還原檔案/資料夾", "Empty deleted files" : "清空已刪除的檔案", "Confirm permanent deletion" : "確認永久刪除", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "您確定要永久刪除回收桶中的所有檔案與資料夾嗎?這無法還原。", diff --git a/apps/files_trashbin/l10n/zh_HK.json b/apps/files_trashbin/l10n/zh_HK.json index d45a562fcb2..2c0fc46bb03 100644 --- a/apps/files_trashbin/l10n/zh_HK.json +++ b/apps/files_trashbin/l10n/zh_HK.json @@ -5,6 +5,7 @@ "This application enables people to restore files that were deleted from the system." : "此應用程式讓人仕可以還原他們在系統當中刪除的檔案", "This application enables people to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the people file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent an account from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "此應用程式讓使用可以還原從系統中刪除的檔案。其會在網路界面中顯示已刪除的檔案列表,並有選項可以復原那些檔案到用戶的檔案目錄,或是將它們從系統中永久移除。若啟用了版本應用程式,復原檔案也會復原相關的檔案版本。當檔案從分享中刪除時,雖然不再共享,但可以用相同的方式來還原。預設情況下,這些檔案會在回收桶中保留30天。\n為了避免帳戶耗盡磁碟空間,「已刪除檔案」應用程式將不會用於超過目前可用配額 50% 的已刪除檔案。如果已刪除的檔案超過此限制,應用程式將會刪除最舊的檔案,直到低於此限制為止。更多資訊在「已刪除檔案」的說明書中提供。", "Restore" : "還原", + "Not enough free space to restore the file/folder" : "空間不足,不能還原檔案/資料夾", "Empty deleted files" : "清空已刪除的檔案", "Confirm permanent deletion" : "確認永久刪除", "Are you sure you want to permanently delete all files and folders in the trash? This cannot be undone." : "您確定要永久刪除回收桶中的所有檔案與資料夾嗎?這無法還原。", diff --git a/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php b/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php index 2a2e3a141dc..e9213882804 100644 --- a/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php +++ b/apps/files_trashbin/lib/Sabre/TrashbinPlugin.php @@ -8,9 +8,12 @@ declare(strict_types=1); */ namespace OCA\Files_Trashbin\Sabre; +use OC\Files\FileInfo; +use OC\Files\View; use OCA\DAV\Connector\Sabre\FilesPlugin; use OCA\Files_Trashbin\Trash\ITrashItem; use OCP\IPreview; +use Psr\Log\LoggerInterface; use Sabre\DAV\INode; use Sabre\DAV\PropFind; use Sabre\DAV\Server; @@ -32,6 +35,7 @@ class TrashbinPlugin extends ServerPlugin { public function __construct( private IPreview $previewManager, + private View $view, ) { } @@ -40,6 +44,7 @@ class TrashbinPlugin extends ServerPlugin { $this->server->on('propFind', [$this, 'propFind']); $this->server->on('afterMethod:GET', [$this,'httpGet']); + $this->server->on('beforeMove', [$this, 'beforeMove']); } @@ -129,4 +134,47 @@ class TrashbinPlugin extends ServerPlugin { $response->addHeader('Content-Disposition', 'attachment; filename="' . $node->getFilename() . '"'); } } + + /** + * Check if a user has available space before attempting to + * restore from trashbin unless they have unlimited quota. + * + * @param string $sourcePath + * @param string $destinationPath + * @return bool + */ + public function beforeMove(string $sourcePath, string $destinationPath): bool { + try { + $node = $this->server->tree->getNodeForPath($sourcePath); + $destinationNodeParent = $this->server->tree->getNodeForPath(dirname($destinationPath)); + } catch (\Sabre\DAV\Exception $e) { + \OCP\Server::get(LoggerInterface::class) + ->error($e->getMessage(), ['app' => 'files_trashbin', 'exception' => $e]); + return true; + } + + // Check if a file is being restored before proceeding + if (!$node instanceof ITrash || !$destinationNodeParent instanceof RestoreFolder) { + return true; + } + + $fileInfo = $node->getFileInfo(); + if (!$fileInfo instanceof ITrashItem) { + return true; + } + $restoreFolder = dirname($fileInfo->getOriginalLocation()); + $freeSpace = $this->view->free_space($restoreFolder); + if ($freeSpace === FileInfo::SPACE_NOT_COMPUTED || + $freeSpace === FileInfo::SPACE_UNKNOWN || + $freeSpace === FileInfo::SPACE_UNLIMITED) { + return true; + } + $filesize = $fileInfo->getSize(); + if ($freeSpace < $filesize) { + $this->server->httpResponse->setStatus(507); + return false; + } + + return true; + } } diff --git a/apps/files_trashbin/src/files_actions/restoreAction.ts b/apps/files_trashbin/src/files_actions/restoreAction.ts index 9af0a13a2b0..3aeeceea7b3 100644 --- a/apps/files_trashbin/src/files_actions/restoreAction.ts +++ b/apps/files_trashbin/src/files_actions/restoreAction.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ import { getCurrentUser } from '@nextcloud/auth' +import { showError } from '@nextcloud/dialogs' import { emit } from '@nextcloud/event-bus' import { Permission, Node, View, FileAction } from '@nextcloud/files' import { t } from '@nextcloud/l10n' @@ -52,6 +53,9 @@ export const restoreAction = new FileAction({ emit('files:node:deleted', node) return true } catch (error) { + if (error.response?.status === 507) { + showError(t('files_trashbin', 'Not enough free space to restore the file/folder')) + } logger.error('Failed to restore node', { error, node }) return false } diff --git a/apps/files_trashbin/tests/Sabre/TrashbinPluginTest.php b/apps/files_trashbin/tests/Sabre/TrashbinPluginTest.php new file mode 100644 index 00000000000..60cc69ba09d --- /dev/null +++ b/apps/files_trashbin/tests/Sabre/TrashbinPluginTest.php @@ -0,0 +1,67 @@ +<?php + +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +namespace OCA\Files_Trashbin\Tests\Sabre; + +use OC\Files\FileInfo; +use OC\Files\View; +use OCA\Files_Trashbin\Sabre\ITrash; +use OCA\Files_Trashbin\Sabre\RestoreFolder; +use OCA\Files_Trashbin\Sabre\TrashbinPlugin; +use OCA\Files_Trashbin\Trash\ITrashItem; +use OCP\IPreview; +use Sabre\DAV\Server; +use Sabre\DAV\Tree; +use Test\TestCase; + +class TrashbinPluginTest extends TestCase { + private Server $server; + + protected function setUp(): void { + parent::setUp(); + + $tree = $this->createMock(Tree::class); + $this->server = new Server($tree); + } + + /** + * @dataProvider quotaProvider + */ + public function testQuota(int $quota, int $fileSize, bool $expectedResult): void { + $fileInfo = $this->createMock(ITrashItem::class); + $fileInfo->method('getSize')->willReturn($fileSize); + + $trashNode = $this->createMock(ITrash::class); + $trashNode->method('getFileInfo')->willReturn($fileInfo); + + $restoreNode = $this->createMock(RestoreFolder::class); + + $this->server->tree->method('getNodeForPath')->willReturn($trashNode, $restoreNode); + + $previewManager = $this->createMock(IPreview::class); + + $view = $this->createMock(View::class); + $view->method('free_space')->willReturn($quota); + + $plugin = new TrashbinPlugin($previewManager, $view); + $plugin->initialize($this->server); + + $sourcePath = 'trashbin/test/trash/file1'; + $destinationPath = 'trashbin/test/restore/file1'; + $this->assertEquals($expectedResult, $plugin->beforeMove($sourcePath, $destinationPath)); + } + + public function quotaProvider(): array { + return [ + [ 1024, 512, true ], + [ 512, 513, false ], + [ FileInfo::SPACE_NOT_COMPUTED, 1024, true ], + [ FileInfo::SPACE_UNKNOWN, 1024, true ], + [ FileInfo::SPACE_UNLIMITED, 1024, true ] + ]; + } +} diff --git a/apps/settings/appinfo/routes.php b/apps/settings/appinfo/routes.php index 5038cf33348..b0ce73113f4 100644 --- a/apps/settings/appinfo/routes.php +++ b/apps/settings/appinfo/routes.php @@ -67,6 +67,7 @@ return [ ], 'ocs' => [ ['name' => 'DeclarativeSettings#setValue', 'url' => '/settings/api/declarative/value', 'verb' => 'POST', 'root' => ''], + ['name' => 'DeclarativeSettings#setSensitiveValue', 'url' => '/settings/api/declarative/value-sensitive', 'verb' => 'POST', 'root' => ''], ['name' => 'DeclarativeSettings#getForms', 'url' => '/settings/api/declarative/forms', 'verb' => 'GET', 'root' => ''], ], ]; diff --git a/apps/settings/l10n/ar.js b/apps/settings/l10n/ar.js index e9526abeba4..0a9d06a2801 100644 --- a/apps/settings/l10n/ar.js +++ b/apps/settings/l10n/ar.js @@ -561,6 +561,7 @@ OC.L10N.register( "Unable to update profile default setting" : "تعذّر تحديث الإعدادات التلقائية لملف التعريف الشخصي profile", "Profile" : "الملف الشخصي", "Enable or disable profile by default for new accounts." : "تمكين أو تعطيل الملف الشخصي بشكل افتراضي للحسابات الجديدة.", + "Password confirmation is required" : "مِن الواجب تأكيد كلمة السر", "Failed to save setting" : "فشل في حفظ الإعداد", "{app}'s declarative setting field: {name}" : "حقل الإعدادات التصريحي للتطبيق {app} : {name}", "Unable to update server side encryption config" : "تعذر تحديث تهيئة التشفير من جانب الخادم", @@ -893,9 +894,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "للدخول بدون كلمة مرور passwordless login في WebAuthn، و وحدات تخزين SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "تمّ اكتشاف الإصدار \"%s\" من PostgreSQL. الإصدارات الموصى بها لأفضل أداء و للثبات و لاكتمال الوظائف مع هذا الإصدار من نكست كلاود هي من 12 إلى 16. ", "Set default expiration date for shares" : "تعيين تاريخ إنتهاء الصلاحية للمشاركات", - "Failed to remove group \"{group}\"" : "تعذّر حذف المجموعة \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "أنت على وشك إزالة المجموعة \"{group}\". لن يتم حذف الحسابات.", - "Remove group" : "حذف مجموعة", "Your biography" : "سيرتك الذاتية", "You are using <strong>{usage}</strong>" : "أنت تستعمل <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "أنت تستعمل <strong>{usage}</strong> من <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/ar.json b/apps/settings/l10n/ar.json index 955f5a49f95..a4dc6b6f069 100644 --- a/apps/settings/l10n/ar.json +++ b/apps/settings/l10n/ar.json @@ -559,6 +559,7 @@ "Unable to update profile default setting" : "تعذّر تحديث الإعدادات التلقائية لملف التعريف الشخصي profile", "Profile" : "الملف الشخصي", "Enable or disable profile by default for new accounts." : "تمكين أو تعطيل الملف الشخصي بشكل افتراضي للحسابات الجديدة.", + "Password confirmation is required" : "مِن الواجب تأكيد كلمة السر", "Failed to save setting" : "فشل في حفظ الإعداد", "{app}'s declarative setting field: {name}" : "حقل الإعدادات التصريحي للتطبيق {app} : {name}", "Unable to update server side encryption config" : "تعذر تحديث تهيئة التشفير من جانب الخادم", @@ -891,9 +892,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "للدخول بدون كلمة مرور passwordless login في WebAuthn، و وحدات تخزين SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "تمّ اكتشاف الإصدار \"%s\" من PostgreSQL. الإصدارات الموصى بها لأفضل أداء و للثبات و لاكتمال الوظائف مع هذا الإصدار من نكست كلاود هي من 12 إلى 16. ", "Set default expiration date for shares" : "تعيين تاريخ إنتهاء الصلاحية للمشاركات", - "Failed to remove group \"{group}\"" : "تعذّر حذف المجموعة \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "أنت على وشك إزالة المجموعة \"{group}\". لن يتم حذف الحسابات.", - "Remove group" : "حذف مجموعة", "Your biography" : "سيرتك الذاتية", "You are using <strong>{usage}</strong>" : "أنت تستعمل <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "أنت تستعمل <strong>{usage}</strong> من <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/ast.js b/apps/settings/l10n/ast.js index 98b745f5e14..b907cc087a2 100644 --- a/apps/settings/l10n/ast.js +++ b/apps/settings/l10n/ast.js @@ -317,6 +317,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Nun ye posible anovar la opción predeterminada del sirvidor", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Des/activa'l perfil predetermináu pa les cuentes nueves.", + "Password confirmation is required" : "Ríquese la contraseña de confirmación", "Failed to save setting" : "Nun se pue guardar la opción", "Unable to update server side encryption config" : "Nun ye posible anovar la configuración del cifráu del sirvidor", "Server-side encryption" : "Cifráu de llau del sirvidor", @@ -531,8 +532,6 @@ OC.L10N.register( "File locking" : "Bloquéu de ficheros", "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "El bloquéu de ficheros transaicional ta desactiváu y esto quiciabes produza problemes con condiciones de carrera. Activa «filelocking.enabled» nel ficheru config.php pa evitar estos problemes.", "The PHP memory limit is below the recommended value of %s." : "La llende de memoria de PHP ye inferior al valor aconseyáu de %s.", - "Failed to remove group \"{group}\"" : "Nun se pue quitar el grupu «{group}»", - "Remove group" : "Quitar el grupu", "Your biography" : "Biografía", "You are using <strong>{usage}</strong>" : "Tas usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Tas usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/ast.json b/apps/settings/l10n/ast.json index 02f6d8c3fc5..0c193d60c9e 100644 --- a/apps/settings/l10n/ast.json +++ b/apps/settings/l10n/ast.json @@ -315,6 +315,7 @@ "Unable to update profile default setting" : "Nun ye posible anovar la opción predeterminada del sirvidor", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Des/activa'l perfil predetermináu pa les cuentes nueves.", + "Password confirmation is required" : "Ríquese la contraseña de confirmación", "Failed to save setting" : "Nun se pue guardar la opción", "Unable to update server side encryption config" : "Nun ye posible anovar la configuración del cifráu del sirvidor", "Server-side encryption" : "Cifráu de llau del sirvidor", @@ -529,8 +530,6 @@ "File locking" : "Bloquéu de ficheros", "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "El bloquéu de ficheros transaicional ta desactiváu y esto quiciabes produza problemes con condiciones de carrera. Activa «filelocking.enabled» nel ficheru config.php pa evitar estos problemes.", "The PHP memory limit is below the recommended value of %s." : "La llende de memoria de PHP ye inferior al valor aconseyáu de %s.", - "Failed to remove group \"{group}\"" : "Nun se pue quitar el grupu «{group}»", - "Remove group" : "Quitar el grupu", "Your biography" : "Biografía", "You are using <strong>{usage}</strong>" : "Tas usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Tas usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/bg.js b/apps/settings/l10n/bg.js index 13bc0d59e24..43bd5f090f4 100644 --- a/apps/settings/l10n/bg.js +++ b/apps/settings/l10n/bg.js @@ -440,7 +440,6 @@ OC.L10N.register( "Use a second factor besides your password to increase security for your account." : "Ползвайте двустепенно удостоверяване за да повишите сигурността на профила си.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Ако използвате приложения на трети страни, за да се свържете с Nextcloud, моля, не забравяйте да създадете и конфигурирате парола за приложение за всяко едно от тях, преди да активирате удостоверяване на втория фактор.", "Set default expiration date for shares" : "Задай дата за изтичане по подразбиране за споделянията", - "Remove group" : "Премахване на групата", "Your biography" : "Вашата биография", "You are using <strong>{usage}</strong>" : "Използвате <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Използвате <strong>{usage}</strong> от <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/bg.json b/apps/settings/l10n/bg.json index f981b90e759..666f4c93972 100644 --- a/apps/settings/l10n/bg.json +++ b/apps/settings/l10n/bg.json @@ -438,7 +438,6 @@ "Use a second factor besides your password to increase security for your account." : "Ползвайте двустепенно удостоверяване за да повишите сигурността на профила си.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Ако използвате приложения на трети страни, за да се свържете с Nextcloud, моля, не забравяйте да създадете и конфигурирате парола за приложение за всяко едно от тях, преди да активирате удостоверяване на втория фактор.", "Set default expiration date for shares" : "Задай дата за изтичане по подразбиране за споделянията", - "Remove group" : "Премахване на групата", "Your biography" : "Вашата биография", "You are using <strong>{usage}</strong>" : "Използвате <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Използвате <strong>{usage}</strong> от <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/br.js b/apps/settings/l10n/br.js index b3408c95f48..8c0dcdcc6a1 100644 --- a/apps/settings/l10n/br.js +++ b/apps/settings/l10n/br.js @@ -312,7 +312,6 @@ OC.L10N.register( "Check out our blog" : "Sellit ouzh hon vlog", "Subscribe to our newsletter" : "Koumannantit d'hon kemenadennoù nevesadur", "Use a second factor besides your password to increase security for your account." : "Implijour un eil-elfenn d'ho ger-tremen a gwella urentez o c'hont.", - "Set default expiration date for shares" : "Lakaat un deizat termen dre ziouer evit ar rannañ", - "Remove group" : "Lemel strollad" + "Set default expiration date for shares" : "Lakaat un deizat termen dre ziouer evit ar rannañ" }, "nplurals=5; plural=((n%10 == 1) && (n%100 != 11) && (n%100 !=71) && (n%100 !=91) ? 0 :(n%10 == 2) && (n%100 != 12) && (n%100 !=72) && (n%100 !=92) ? 1 :(n%10 ==3 || n%10==4 || n%10==9) && (n%100 < 10 || n% 100 > 19) && (n%100 < 70 || n%100 > 79) && (n%100 < 90 || n%100 > 99) ? 2 :(n != 0 && n % 1000000 == 0) ? 3 : 4);"); diff --git a/apps/settings/l10n/br.json b/apps/settings/l10n/br.json index 74b70e28b0e..ec6a68e42fc 100644 --- a/apps/settings/l10n/br.json +++ b/apps/settings/l10n/br.json @@ -310,7 +310,6 @@ "Check out our blog" : "Sellit ouzh hon vlog", "Subscribe to our newsletter" : "Koumannantit d'hon kemenadennoù nevesadur", "Use a second factor besides your password to increase security for your account." : "Implijour un eil-elfenn d'ho ger-tremen a gwella urentez o c'hont.", - "Set default expiration date for shares" : "Lakaat un deizat termen dre ziouer evit ar rannañ", - "Remove group" : "Lemel strollad" + "Set default expiration date for shares" : "Lakaat un deizat termen dre ziouer evit ar rannañ" },"pluralForm" :"nplurals=5; plural=((n%10 == 1) && (n%100 != 11) && (n%100 !=71) && (n%100 !=91) ? 0 :(n%10 == 2) && (n%100 != 12) && (n%100 !=72) && (n%100 !=92) ? 1 :(n%10 ==3 || n%10==4 || n%10==9) && (n%100 < 10 || n% 100 > 19) && (n%100 < 70 || n%100 > 79) && (n%100 < 90 || n%100 > 99) ? 2 :(n != 0 && n % 1000000 == 0) ? 3 : 4);" }
\ No newline at end of file diff --git a/apps/settings/l10n/ca.js b/apps/settings/l10n/ca.js index 8c211833d08..78317fdb107 100644 --- a/apps/settings/l10n/ca.js +++ b/apps/settings/l10n/ca.js @@ -556,6 +556,7 @@ OC.L10N.register( "Unable to update profile default setting" : "No s'ha pogut actualitzar els paràmetres predeterminats del perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Habilita o deshabilita el perfil de manera predeterminada per als comptes nous.", + "Password confirmation is required" : "Cal una confirmació de la contrasenya", "Failed to save setting" : "No s'ha pogut desar el paràmetre", "{app}'s declarative setting field: {name}" : "Camp de paràmetre declaratiu de {app}: {name}", "Unable to update server side encryption config" : "No es pot actualitzar la configuració del xifratge de la banda del servidor", @@ -884,9 +885,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "per a l'inici de sessió sense contrasenya de WebAuthn i emmagatzematge SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "S'ha detectat la versió de PostgreSQL \"%s\". Es recomana PostgreSQL >=12 i <=16 per obtenir el millor rendiment, estabilitat i funcionalitat amb aquesta versió de Nextcloud.", "Set default expiration date for shares" : "Estableix la data de caducitat per defecte per comparticions", - "Failed to remove group \"{group}\"" : "No s'ha pogut suprimir el grup \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Esteu a punt d'eliminar el grup \"{group}\". Els comptes NO es suprimiràn.", - "Remove group" : "Suprimir el grup", "Your biography" : "La vostra biografia", "You are using <strong>{usage}</strong>" : "Esteu utilitzant <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Esteu utilitzant <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/ca.json b/apps/settings/l10n/ca.json index bea1c6769e1..7115c52cd4f 100644 --- a/apps/settings/l10n/ca.json +++ b/apps/settings/l10n/ca.json @@ -554,6 +554,7 @@ "Unable to update profile default setting" : "No s'ha pogut actualitzar els paràmetres predeterminats del perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Habilita o deshabilita el perfil de manera predeterminada per als comptes nous.", + "Password confirmation is required" : "Cal una confirmació de la contrasenya", "Failed to save setting" : "No s'ha pogut desar el paràmetre", "{app}'s declarative setting field: {name}" : "Camp de paràmetre declaratiu de {app}: {name}", "Unable to update server side encryption config" : "No es pot actualitzar la configuració del xifratge de la banda del servidor", @@ -882,9 +883,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "per a l'inici de sessió sense contrasenya de WebAuthn i emmagatzematge SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "S'ha detectat la versió de PostgreSQL \"%s\". Es recomana PostgreSQL >=12 i <=16 per obtenir el millor rendiment, estabilitat i funcionalitat amb aquesta versió de Nextcloud.", "Set default expiration date for shares" : "Estableix la data de caducitat per defecte per comparticions", - "Failed to remove group \"{group}\"" : "No s'ha pogut suprimir el grup \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Esteu a punt d'eliminar el grup \"{group}\". Els comptes NO es suprimiràn.", - "Remove group" : "Suprimir el grup", "Your biography" : "La vostra biografia", "You are using <strong>{usage}</strong>" : "Esteu utilitzant <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Esteu utilitzant <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/cs.js b/apps/settings/l10n/cs.js index a5b4f621c80..a39adab6030 100644 --- a/apps/settings/l10n/cs.js +++ b/apps/settings/l10n/cs.js @@ -316,6 +316,9 @@ OC.L10N.register( "64-bit" : "64bit", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "Zdá se, že provozujete 32bitovou verzi PHP. Aby správně fungoval, potřebuje Nextcloud 64bit. Přejděte na 64bit instalaci operačního systému a PHP!", "Task Processing pickup speed" : "Rychlost vyzvedávání zpracovávání úkolů", + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["Žádné naplánované úkoly v uplynulé %n hodině.","Žádné naplánované úkoly v uplynulých %n hodinách.","Žádné naplánované úkoly v uplynulých %n hodinách.","Žádné naplánované úkoly v uplynulých %n hodinách."], + "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["Rychlost vyzvedávání úkolů byla ok za uplynulou %n hodinu.","Rychlost vyzvedávání úkolů byla ok za uplynulých %n hodin.","Rychlost vyzvedávání úkolů byla ok za uplynulých %n hodin.","Rychlost vyzvedávání úkolů byla ok za uplynulých %n hodin."], + "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["Rychlost vyzvedávání byla nízká za uplynulou %n hodinu. U mnoha úkolů trvalo více než 4 minuty, než byly vyzvednuty. Zvažte nastavení zpracovávajícího procesu na pozadí.","Rychlost vyzvedávání byla nízká za uplynulé %n hodiny. U mnoha úkolů trvalo více než 4 minuty, než byly vyzvednuty. Zvažte nastavení zpracovávajícího procesu na pozadí.","Rychlost vyzvedávání byla nízká za uplynulých %n hodin. U mnoha úkolů trvalo více než 4 minuty, než byly vyzvednuty. Zvažte nastavení zpracovávajícího procesu na pozadí.","Rychlost vyzvedávání byla nízká za uplynulé %n hodiny. U mnoha úkolů trvalo více než 4 minuty, než byly vyzvednuty. Zvažte nastavení zpracovávajícího procesu na pozadí."], "Temporary space available" : "Dočasný prostor k dispozici", "Error while checking the temporary PHP path - it was not properly set to a directory. Returned value: %s" : "Chyba při kontrole popisu umístění dočasných souborů PHP – nebylo správně nastaveno na složku. Vrácená hodnota: %s", "The PHP function \"disk_free_space\" is disabled, which prevents the check for enough space in the temporary directories." : "PHP funkce „disk_free_space“ je vypnutá, což brání v kontrolách zda je k dispozici dostatek místa ve složkách pro dočasná data.", @@ -562,6 +565,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Nedaří se aktualizovat výchozí nastavení pro profily", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Profily nově vytvářených účtů ve výchozím stavu zpřístupňovat nebo nezpřístupňovat.", + "Password confirmation is required" : "Je vyžadováno potvrzení hesla", "Failed to save setting" : "Nastavení se nepodařilo uložit", "{app}'s declarative setting field: {name}" : "Kolonka deklarativního nastavení {app}: {name}", "Unable to update server side encryption config" : "Nedaří se zaktualizovat nastavení šifrování na straně serveru", @@ -584,9 +588,12 @@ OC.L10N.register( "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Je vždy dobré vytvářet pravidelné zálohy svých dat. V případě zapnutého šifrování také společně s daty zajistěte zálohu šifrovacích klíčů k nim.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Ohledně toho, jak ručně zašifrovat také existující soubory, nahlédněte do dokumentace pro správce.", "This is the final warning: Do you really want to enable encryption?" : "Toto je poslední varování: Opravdu chcete zapnout šifrování?", + "Failed to delete group \"{group}\"" : "Nepodařilo se vytvořit skupinu „{group}“", "Please confirm the group removal" : "Potvrďte odstranění skupiny", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "Chystáte se smazat skupinu „{group}“. Účty k ní přiřazené nebudou smazány.", "Submit" : "Odeslat", "Rename group" : "Přejmenovat skupinu", + "Delete group" : "Smazat skupinu", "Current password" : "Stávající heslo", "New password" : "Nové heslo", "Change password" : "Změnit heslo", @@ -894,9 +901,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "pro WebAuthn přihlášení bez hesla a SFTP úložiště", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Zjištěna verze PostgreSQL „%s“. Pro nejlepší výkon, stabilitu a funkčnost s touto verzí Nextcloud je doporučeno PostgreSQL >=12 a <=16.", "Set default expiration date for shares" : "Nastavit výchozí datum skončení platnosti pro sdílení", - "Failed to remove group \"{group}\"" : "Nepodařilo se odebrat skupinu „{group}“", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Chystáte se smazat skupinu „{group}“. Účty NEbudou smazány.", - "Remove group" : "Odebrat skupinu", "Your biography" : "Váš životopis", "You are using <strong>{usage}</strong>" : "Využíváte <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Využíváte <strong>{usage}</strong> z <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/cs.json b/apps/settings/l10n/cs.json index 56ead44f428..7f9ab60d49f 100644 --- a/apps/settings/l10n/cs.json +++ b/apps/settings/l10n/cs.json @@ -314,6 +314,9 @@ "64-bit" : "64bit", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "Zdá se, že provozujete 32bitovou verzi PHP. Aby správně fungoval, potřebuje Nextcloud 64bit. Přejděte na 64bit instalaci operačního systému a PHP!", "Task Processing pickup speed" : "Rychlost vyzvedávání zpracovávání úkolů", + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["Žádné naplánované úkoly v uplynulé %n hodině.","Žádné naplánované úkoly v uplynulých %n hodinách.","Žádné naplánované úkoly v uplynulých %n hodinách.","Žádné naplánované úkoly v uplynulých %n hodinách."], + "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["Rychlost vyzvedávání úkolů byla ok za uplynulou %n hodinu.","Rychlost vyzvedávání úkolů byla ok za uplynulých %n hodin.","Rychlost vyzvedávání úkolů byla ok za uplynulých %n hodin.","Rychlost vyzvedávání úkolů byla ok za uplynulých %n hodin."], + "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["Rychlost vyzvedávání byla nízká za uplynulou %n hodinu. U mnoha úkolů trvalo více než 4 minuty, než byly vyzvednuty. Zvažte nastavení zpracovávajícího procesu na pozadí.","Rychlost vyzvedávání byla nízká za uplynulé %n hodiny. U mnoha úkolů trvalo více než 4 minuty, než byly vyzvednuty. Zvažte nastavení zpracovávajícího procesu na pozadí.","Rychlost vyzvedávání byla nízká za uplynulých %n hodin. U mnoha úkolů trvalo více než 4 minuty, než byly vyzvednuty. Zvažte nastavení zpracovávajícího procesu na pozadí.","Rychlost vyzvedávání byla nízká za uplynulé %n hodiny. U mnoha úkolů trvalo více než 4 minuty, než byly vyzvednuty. Zvažte nastavení zpracovávajícího procesu na pozadí."], "Temporary space available" : "Dočasný prostor k dispozici", "Error while checking the temporary PHP path - it was not properly set to a directory. Returned value: %s" : "Chyba při kontrole popisu umístění dočasných souborů PHP – nebylo správně nastaveno na složku. Vrácená hodnota: %s", "The PHP function \"disk_free_space\" is disabled, which prevents the check for enough space in the temporary directories." : "PHP funkce „disk_free_space“ je vypnutá, což brání v kontrolách zda je k dispozici dostatek místa ve složkách pro dočasná data.", @@ -560,6 +563,7 @@ "Unable to update profile default setting" : "Nedaří se aktualizovat výchozí nastavení pro profily", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Profily nově vytvářených účtů ve výchozím stavu zpřístupňovat nebo nezpřístupňovat.", + "Password confirmation is required" : "Je vyžadováno potvrzení hesla", "Failed to save setting" : "Nastavení se nepodařilo uložit", "{app}'s declarative setting field: {name}" : "Kolonka deklarativního nastavení {app}: {name}", "Unable to update server side encryption config" : "Nedaří se zaktualizovat nastavení šifrování na straně serveru", @@ -582,9 +586,12 @@ "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Je vždy dobré vytvářet pravidelné zálohy svých dat. V případě zapnutého šifrování také společně s daty zajistěte zálohu šifrovacích klíčů k nim.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Ohledně toho, jak ručně zašifrovat také existující soubory, nahlédněte do dokumentace pro správce.", "This is the final warning: Do you really want to enable encryption?" : "Toto je poslední varování: Opravdu chcete zapnout šifrování?", + "Failed to delete group \"{group}\"" : "Nepodařilo se vytvořit skupinu „{group}“", "Please confirm the group removal" : "Potvrďte odstranění skupiny", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "Chystáte se smazat skupinu „{group}“. Účty k ní přiřazené nebudou smazány.", "Submit" : "Odeslat", "Rename group" : "Přejmenovat skupinu", + "Delete group" : "Smazat skupinu", "Current password" : "Stávající heslo", "New password" : "Nové heslo", "Change password" : "Změnit heslo", @@ -892,9 +899,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "pro WebAuthn přihlášení bez hesla a SFTP úložiště", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Zjištěna verze PostgreSQL „%s“. Pro nejlepší výkon, stabilitu a funkčnost s touto verzí Nextcloud je doporučeno PostgreSQL >=12 a <=16.", "Set default expiration date for shares" : "Nastavit výchozí datum skončení platnosti pro sdílení", - "Failed to remove group \"{group}\"" : "Nepodařilo se odebrat skupinu „{group}“", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Chystáte se smazat skupinu „{group}“. Účty NEbudou smazány.", - "Remove group" : "Odebrat skupinu", "Your biography" : "Váš životopis", "You are using <strong>{usage}</strong>" : "Využíváte <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Využíváte <strong>{usage}</strong> z <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/da.js b/apps/settings/l10n/da.js index 6e097e8b7a0..69c8621816f 100644 --- a/apps/settings/l10n/da.js +++ b/apps/settings/l10n/da.js @@ -561,6 +561,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Kan ikke opdatere profilens standardindstilling", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Aktiver eller deaktiver profil som standard for nye konti.", + "Password confirmation is required" : "Password beskæftigelse er påkrævet", "Failed to save setting" : "Kunne ikke gemme indstillingerne", "{app}'s declarative setting field: {name}" : "{app}'s deklarative indstillingsfelt: {name}", "Unable to update server side encryption config" : "Kan ikke opdatere krypteringskonfigurationen på serversiden", @@ -893,9 +894,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "til WebAuthn adgangskodeløst login, og SFTP lagring", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL- version \"%s\" fundet. PostgreSQL > = 12 og < = 16 er foreslået for bedste ydeevne, stabilitet og funktionalitet med denne version af Nextcloud.", "Set default expiration date for shares" : "Indstil standardudløbsdato for delinger", - "Failed to remove group \"{group}\"" : "Kunne ikke slette gruppen \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Du er ved at fjerne gruppen \"{group}\". Konti indeholdt i gruppen vil IKKE blive slettet.", - "Remove group" : "Fjern gruppe", "Your biography" : "Din biografi", "You are using <strong>{usage}</strong>" : "Forbrug: <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Forbrug: <strong>{usage}</strong> af <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/da.json b/apps/settings/l10n/da.json index f8786bfb725..95c703ca492 100644 --- a/apps/settings/l10n/da.json +++ b/apps/settings/l10n/da.json @@ -559,6 +559,7 @@ "Unable to update profile default setting" : "Kan ikke opdatere profilens standardindstilling", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Aktiver eller deaktiver profil som standard for nye konti.", + "Password confirmation is required" : "Password beskæftigelse er påkrævet", "Failed to save setting" : "Kunne ikke gemme indstillingerne", "{app}'s declarative setting field: {name}" : "{app}'s deklarative indstillingsfelt: {name}", "Unable to update server side encryption config" : "Kan ikke opdatere krypteringskonfigurationen på serversiden", @@ -891,9 +892,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "til WebAuthn adgangskodeløst login, og SFTP lagring", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL- version \"%s\" fundet. PostgreSQL > = 12 og < = 16 er foreslået for bedste ydeevne, stabilitet og funktionalitet med denne version af Nextcloud.", "Set default expiration date for shares" : "Indstil standardudløbsdato for delinger", - "Failed to remove group \"{group}\"" : "Kunne ikke slette gruppen \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Du er ved at fjerne gruppen \"{group}\". Konti indeholdt i gruppen vil IKKE blive slettet.", - "Remove group" : "Fjern gruppe", "Your biography" : "Din biografi", "You are using <strong>{usage}</strong>" : "Forbrug: <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Forbrug: <strong>{usage}</strong> af <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/de.js b/apps/settings/l10n/de.js index 154c87eb5b4..91e260f30d2 100644 --- a/apps/settings/l10n/de.js +++ b/apps/settings/l10n/de.js @@ -316,7 +316,7 @@ OC.L10N.register( "64-bit" : "64-bit", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "Anscheinend wird eine 32-Bit-PHP-Version verwendet. Nextcloud benötigt 64-Bit, um gut zu laufen. Bitte Betriebssystem und PHP auf 64-Bit aktualisieren!", "Task Processing pickup speed" : "Abholgeschwindigkeit für Aufgabenverarbeitung", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["Keine geplanten Aufgaben in der letzten %n Stunde.","Keine geplanten Aufgaben in den letzten %n Stunden."], + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["Keine geplanten Aufgaben in der letzten %n Stunde.","Keine geplanten Aufgaben in den letzten %n Stunden."], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["Die Geschwindigkeit der Aufgabenübernahme war in der letzten %n Stunde in Ordnung.","Die Geschwindigkeit der Aufgabenübernahme war in den letzten %n Stunden in Ordnung."], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["Die Aufgabenabholgeschwindigkeit war in der letzten %n Stunde langsam. Viele Aufgaben benötigten länger als 4 Minuten, um abgeholt zu werden. Erwäge die Einrichtung eines Workers, der Aufgaben im Hintergrund verarbeitet.","Die Aufgabenabholgeschwindigkeit war in den letzten %n Stunden langsam. Viele Aufgaben benötigten länger als 4 Minuten, um abgeholt zu werden. Erwägen Sie die Einrichtung eines Workers, der Aufgaben im Hintergrund verarbeitet."], "Temporary space available" : "Temporärer Platz verfügbar", @@ -565,6 +565,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Standardeinstellung des Profils kann nicht aktualisiert werden", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Profil für neue Konten standardmäßig aktivieren oder deaktivieren.", + "Password confirmation is required" : "Passwortbestätigung erforderlich", "Failed to save setting" : "Einstellung konnte nicht gespeichert werden", "{app}'s declarative setting field: {name}" : "Deklaratives Einstellungsfeld von {app}: {name}", "Unable to update server side encryption config" : "Die Serverseitige Verschlüsselungskonfiguration kann nicht aktualisiert werden.", @@ -587,9 +588,12 @@ OC.L10N.register( "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Es ist immer gut, regelmäßig Datensicherungen zu erstellen. Sofern die Verschlüsselung genutzt wird, sollte auch eine Sicherung der Verschlüsselungsschlüssel zusammen mit den Daten durchgeführt werden.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Informationen zum manuellen Verschlüsseln vorhandener Dateien finden sich in der Administrationsdokumentation.", "This is the final warning: Do you really want to enable encryption?" : "Dies ist die letzte Warnung: Soll die Verschlüsselung wirklich aktiviert werden?", + "Failed to delete group \"{group}\"" : "Die Gruppe \"{group}\" konnte nicht gelöscht werden", "Please confirm the group removal" : "Bitte die Löschung der Gruppe bestätigen", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "Du bist im Begriff, die Gruppe \"{group}\" zu löschen. Die Konten werden NICHT gelöscht.", "Submit" : "Übermitteln", "Rename group" : "Gruppe umbenennen", + "Delete group" : "Gruppe löschen", "Current password" : "Aktuelles Passwort", "New password" : "Neues Passwort", "Change password" : "Passwort ändern", @@ -897,9 +901,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "für WebAuthn passwortlose Anmeldung und SFTP-Speicher", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL-Version \"%s\" erkannt. Für optimale Leistung, Stabilität und Funktionalität mit dieser Version von Nextcloud wird PostgreSQL >=12 und <=16 empfohlen.", "Set default expiration date for shares" : "Lege das Standardablaufdatum für Freigaben fest", - "Failed to remove group \"{group}\"" : "Die Gruppe \"{group}\" konnte nicht entfernt werden.", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Du bist im Begriff, die Gruppe \"{group}\" zu entfernen. Die Konten werden NICHT gelöscht.", - "Remove group" : "Gruppe entfernen", "Your biography" : "Deine Biografie", "You are using <strong>{usage}</strong>" : "Du benutzt <strong>{usage}</strong>.", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Du benutzt <strong>{usage}</strong> von <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>).", diff --git a/apps/settings/l10n/de.json b/apps/settings/l10n/de.json index 24705692a16..b16e4a100ca 100644 --- a/apps/settings/l10n/de.json +++ b/apps/settings/l10n/de.json @@ -314,7 +314,7 @@ "64-bit" : "64-bit", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "Anscheinend wird eine 32-Bit-PHP-Version verwendet. Nextcloud benötigt 64-Bit, um gut zu laufen. Bitte Betriebssystem und PHP auf 64-Bit aktualisieren!", "Task Processing pickup speed" : "Abholgeschwindigkeit für Aufgabenverarbeitung", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["Keine geplanten Aufgaben in der letzten %n Stunde.","Keine geplanten Aufgaben in den letzten %n Stunden."], + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["Keine geplanten Aufgaben in der letzten %n Stunde.","Keine geplanten Aufgaben in den letzten %n Stunden."], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["Die Geschwindigkeit der Aufgabenübernahme war in der letzten %n Stunde in Ordnung.","Die Geschwindigkeit der Aufgabenübernahme war in den letzten %n Stunden in Ordnung."], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["Die Aufgabenabholgeschwindigkeit war in der letzten %n Stunde langsam. Viele Aufgaben benötigten länger als 4 Minuten, um abgeholt zu werden. Erwäge die Einrichtung eines Workers, der Aufgaben im Hintergrund verarbeitet.","Die Aufgabenabholgeschwindigkeit war in den letzten %n Stunden langsam. Viele Aufgaben benötigten länger als 4 Minuten, um abgeholt zu werden. Erwägen Sie die Einrichtung eines Workers, der Aufgaben im Hintergrund verarbeitet."], "Temporary space available" : "Temporärer Platz verfügbar", @@ -563,6 +563,7 @@ "Unable to update profile default setting" : "Standardeinstellung des Profils kann nicht aktualisiert werden", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Profil für neue Konten standardmäßig aktivieren oder deaktivieren.", + "Password confirmation is required" : "Passwortbestätigung erforderlich", "Failed to save setting" : "Einstellung konnte nicht gespeichert werden", "{app}'s declarative setting field: {name}" : "Deklaratives Einstellungsfeld von {app}: {name}", "Unable to update server side encryption config" : "Die Serverseitige Verschlüsselungskonfiguration kann nicht aktualisiert werden.", @@ -585,9 +586,12 @@ "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Es ist immer gut, regelmäßig Datensicherungen zu erstellen. Sofern die Verschlüsselung genutzt wird, sollte auch eine Sicherung der Verschlüsselungsschlüssel zusammen mit den Daten durchgeführt werden.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Informationen zum manuellen Verschlüsseln vorhandener Dateien finden sich in der Administrationsdokumentation.", "This is the final warning: Do you really want to enable encryption?" : "Dies ist die letzte Warnung: Soll die Verschlüsselung wirklich aktiviert werden?", + "Failed to delete group \"{group}\"" : "Die Gruppe \"{group}\" konnte nicht gelöscht werden", "Please confirm the group removal" : "Bitte die Löschung der Gruppe bestätigen", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "Du bist im Begriff, die Gruppe \"{group}\" zu löschen. Die Konten werden NICHT gelöscht.", "Submit" : "Übermitteln", "Rename group" : "Gruppe umbenennen", + "Delete group" : "Gruppe löschen", "Current password" : "Aktuelles Passwort", "New password" : "Neues Passwort", "Change password" : "Passwort ändern", @@ -895,9 +899,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "für WebAuthn passwortlose Anmeldung und SFTP-Speicher", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL-Version \"%s\" erkannt. Für optimale Leistung, Stabilität und Funktionalität mit dieser Version von Nextcloud wird PostgreSQL >=12 und <=16 empfohlen.", "Set default expiration date for shares" : "Lege das Standardablaufdatum für Freigaben fest", - "Failed to remove group \"{group}\"" : "Die Gruppe \"{group}\" konnte nicht entfernt werden.", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Du bist im Begriff, die Gruppe \"{group}\" zu entfernen. Die Konten werden NICHT gelöscht.", - "Remove group" : "Gruppe entfernen", "Your biography" : "Deine Biografie", "You are using <strong>{usage}</strong>" : "Du benutzt <strong>{usage}</strong>.", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Du benutzt <strong>{usage}</strong> von <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>).", diff --git a/apps/settings/l10n/de_DE.js b/apps/settings/l10n/de_DE.js index 0544ac934c1..70a2c10b712 100644 --- a/apps/settings/l10n/de_DE.js +++ b/apps/settings/l10n/de_DE.js @@ -316,7 +316,7 @@ OC.L10N.register( "64-bit" : "64-bit", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "Anscheinend verwenden Sie eine 32-Bit-PHP-Version. Nextcloud benötigt 64-Bit, um gut zu laufen. Bitte aktualisieren Sie Ihr Betriebssystem und PHP auf 64-Bit!", "Task Processing pickup speed" : "Abholgeschwindigkeit für Aufgabenverarbeitung", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["Keine geplanten Aufgaben in der letzten %n Stunde.","Keine geplanten Aufgaben in den letzten %n Stunden."], + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["Keine geplanten Aufgaben in der letzten %n Stunde.","Keine geplanten Aufgaben in den letzten %n Stunden."], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["Die Geschwindigkeit der Aufgabenübernahme war in der letzten %n Stunde in Ordnung.","Die Geschwindigkeit der Aufgabenübernahme war in den letzten %n Stunden in Ordnung."], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["Die Aufgabenabholgeschwindigkeit war in der letzten %n Stunde langsam. Viele Aufgaben benötigten länger als 4 Minuten, um abgeholt zu werden. Erwägen Sie die Einrichtung eines Workers, der Aufgaben im Hintergrund verarbeitet.","Die Aufgabenabholgeschwindigkeit war in den letzten %n Stunden langsam. Viele Aufgaben benötigten länger als 4 Minuten, um abgeholt zu werden. Erwägen Sie die Einrichtung eines Workers, der Aufgaben im Hintergrund verarbeitet."], "Temporary space available" : "Temporärer Platz verfügbar", @@ -565,6 +565,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Standardeinstellung des Profils kann nicht aktualisiert werden", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Profil für neue Konten standardmäßig aktivieren oder deaktivieren.", + "Password confirmation is required" : "Passwortbestätigung erforderlich", "Failed to save setting" : "Einstellung konnte nicht gespeichert werden", "{app}'s declarative setting field: {name}" : "Deklaratives Einstellungsfeld von {app}: {name}", "Unable to update server side encryption config" : "Serverseitige Verschlüsselungskonfiguration kann nicht aktualisiert werden", @@ -587,9 +588,12 @@ OC.L10N.register( "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Es ist immer gut, regelmäßig Sicherungskopien von ihren Daten zu machen. Falls Sie die Verschlüsselung nutzen, sollten Sie auch eine Sicherung der Verschlüsselungsschlüssel zusammen mit Ihren Daten machen.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Informationen zum manuellen Verschlüsseln vorhandener Dateien finden Sie in der Administrationsdokumentation.", "This is the final warning: Do you really want to enable encryption?" : "Dies ist die letzte Warnung: Möchten Sie die Verschlüsselung wirklich aktivieren?", + "Failed to delete group \"{group}\"" : "Die Gruppe \"{group}\" konnte nicht gelöscht werden", "Please confirm the group removal" : "Bitte die Löschung der Gruppe bestätigen", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "Sie sind im Begriff, die Gruppe \"{group}\" zu löschen. Die Konten werden NICHT gelöscht.", "Submit" : "Übermitteln", "Rename group" : "Gruppe umbenennen", + "Delete group" : "Gruppe löschen", "Current password" : "Aktuelles Passwort", "New password" : "Neues Passwort", "Change password" : "Passwort ändern", @@ -897,9 +901,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "für WebAuthn passwortlose Anmeldung und SFTP-Speicher", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL-Version \"%s\" erkannt. Für optimale Leistung, Stabilität und Funktionalität mit dieser Version von Nextcloud wird PostgreSQL >=12 und <=16 empfohlen.", "Set default expiration date for shares" : "Legen Sie das Standardablaufdatum für Freigaben fest", - "Failed to remove group \"{group}\"" : "Die Gruppe \"{group}\" konnte nicht entfernt werden.", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Sie sind im Begriff, die Gruppe \"{group}\" zu entfernen. Die Konten werden NICHT gelöscht.", - "Remove group" : "Gruppe entfernen", "Your biography" : "Ihre Biografie", "You are using <strong>{usage}</strong>" : "Sie benutzen <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Sie benutzen <strong>{usage}</strong> von <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/de_DE.json b/apps/settings/l10n/de_DE.json index 6a708d37f75..3f18effb1af 100644 --- a/apps/settings/l10n/de_DE.json +++ b/apps/settings/l10n/de_DE.json @@ -314,7 +314,7 @@ "64-bit" : "64-bit", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "Anscheinend verwenden Sie eine 32-Bit-PHP-Version. Nextcloud benötigt 64-Bit, um gut zu laufen. Bitte aktualisieren Sie Ihr Betriebssystem und PHP auf 64-Bit!", "Task Processing pickup speed" : "Abholgeschwindigkeit für Aufgabenverarbeitung", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["Keine geplanten Aufgaben in der letzten %n Stunde.","Keine geplanten Aufgaben in den letzten %n Stunden."], + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["Keine geplanten Aufgaben in der letzten %n Stunde.","Keine geplanten Aufgaben in den letzten %n Stunden."], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["Die Geschwindigkeit der Aufgabenübernahme war in der letzten %n Stunde in Ordnung.","Die Geschwindigkeit der Aufgabenübernahme war in den letzten %n Stunden in Ordnung."], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["Die Aufgabenabholgeschwindigkeit war in der letzten %n Stunde langsam. Viele Aufgaben benötigten länger als 4 Minuten, um abgeholt zu werden. Erwägen Sie die Einrichtung eines Workers, der Aufgaben im Hintergrund verarbeitet.","Die Aufgabenabholgeschwindigkeit war in den letzten %n Stunden langsam. Viele Aufgaben benötigten länger als 4 Minuten, um abgeholt zu werden. Erwägen Sie die Einrichtung eines Workers, der Aufgaben im Hintergrund verarbeitet."], "Temporary space available" : "Temporärer Platz verfügbar", @@ -563,6 +563,7 @@ "Unable to update profile default setting" : "Standardeinstellung des Profils kann nicht aktualisiert werden", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Profil für neue Konten standardmäßig aktivieren oder deaktivieren.", + "Password confirmation is required" : "Passwortbestätigung erforderlich", "Failed to save setting" : "Einstellung konnte nicht gespeichert werden", "{app}'s declarative setting field: {name}" : "Deklaratives Einstellungsfeld von {app}: {name}", "Unable to update server side encryption config" : "Serverseitige Verschlüsselungskonfiguration kann nicht aktualisiert werden", @@ -585,9 +586,12 @@ "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Es ist immer gut, regelmäßig Sicherungskopien von ihren Daten zu machen. Falls Sie die Verschlüsselung nutzen, sollten Sie auch eine Sicherung der Verschlüsselungsschlüssel zusammen mit Ihren Daten machen.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Informationen zum manuellen Verschlüsseln vorhandener Dateien finden Sie in der Administrationsdokumentation.", "This is the final warning: Do you really want to enable encryption?" : "Dies ist die letzte Warnung: Möchten Sie die Verschlüsselung wirklich aktivieren?", + "Failed to delete group \"{group}\"" : "Die Gruppe \"{group}\" konnte nicht gelöscht werden", "Please confirm the group removal" : "Bitte die Löschung der Gruppe bestätigen", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "Sie sind im Begriff, die Gruppe \"{group}\" zu löschen. Die Konten werden NICHT gelöscht.", "Submit" : "Übermitteln", "Rename group" : "Gruppe umbenennen", + "Delete group" : "Gruppe löschen", "Current password" : "Aktuelles Passwort", "New password" : "Neues Passwort", "Change password" : "Passwort ändern", @@ -895,9 +899,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "für WebAuthn passwortlose Anmeldung und SFTP-Speicher", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL-Version \"%s\" erkannt. Für optimale Leistung, Stabilität und Funktionalität mit dieser Version von Nextcloud wird PostgreSQL >=12 und <=16 empfohlen.", "Set default expiration date for shares" : "Legen Sie das Standardablaufdatum für Freigaben fest", - "Failed to remove group \"{group}\"" : "Die Gruppe \"{group}\" konnte nicht entfernt werden.", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Sie sind im Begriff, die Gruppe \"{group}\" zu entfernen. Die Konten werden NICHT gelöscht.", - "Remove group" : "Gruppe entfernen", "Your biography" : "Ihre Biografie", "You are using <strong>{usage}</strong>" : "Sie benutzen <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Sie benutzen <strong>{usage}</strong> von <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/el.js b/apps/settings/l10n/el.js index 98fe02c1a57..cb72e8d87e8 100644 --- a/apps/settings/l10n/el.js +++ b/apps/settings/l10n/el.js @@ -556,6 +556,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Δεν είναι δυνατή η ενημέρωση της προεπιλεγμένης ρύθμισης προφίλ", "Profile" : "Προφίλ", "Enable or disable profile by default for new accounts." : "Ενεργοποίηση ή απενεργοποίηση του προφίλ από προεπιλογή για νέους λογαριασμούς.", + "Password confirmation is required" : "Απαιτείται επιβεβαίωση συνθηματικού", "Failed to save setting" : "Αποτυχία αποθήκευσης ρύθμισης", "{app}'s declarative setting field: {name}" : "Δηλωτικό πεδίο ρύθμισης της {app}: {name}", "Unable to update server side encryption config" : "Δεν είναι δυνατή η ενημέρωση της διαμόρφωσης κρυπτογράφησης από τον διακομιστή", @@ -883,9 +884,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "για σύνδεση χωρίς συνθηματικό με WebAuthn και αποθήκευση SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Ανιχνεύθηκε η έκδοση PostgreSQL \"%s\". Προτείνεται PostgreSQL >=12 και <=16 για την καλύτερη απόδοση, σταθερότητα και λειτουργικότητα με αυτήν την έκδοση του Nextcloud.", "Set default expiration date for shares" : "Ορισμός προεπιλεγμένης ημερομηνίας λήξης για τα κοινόχρηστα", - "Failed to remove group \"{group}\"" : "Αποτυχία κατά την αφαίρεση της ομάδας \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Πρόκειται να αφαιρέσετε την ομάδα \"{group}\". Οι λογαριασμοί ΔΕΝ θα διαγραφούν.", - "Remove group" : "Αφαίρεση ομάδας", "Your biography" : "Το βιογραφικό σας", "You are using <strong>{usage}</strong>" : "Χρησιμοποιείτε <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Χρησιμοποιείτε <strong>{usage}</strong> από <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/el.json b/apps/settings/l10n/el.json index b04cca5b96e..3ed97a9b0d2 100644 --- a/apps/settings/l10n/el.json +++ b/apps/settings/l10n/el.json @@ -554,6 +554,7 @@ "Unable to update profile default setting" : "Δεν είναι δυνατή η ενημέρωση της προεπιλεγμένης ρύθμισης προφίλ", "Profile" : "Προφίλ", "Enable or disable profile by default for new accounts." : "Ενεργοποίηση ή απενεργοποίηση του προφίλ από προεπιλογή για νέους λογαριασμούς.", + "Password confirmation is required" : "Απαιτείται επιβεβαίωση συνθηματικού", "Failed to save setting" : "Αποτυχία αποθήκευσης ρύθμισης", "{app}'s declarative setting field: {name}" : "Δηλωτικό πεδίο ρύθμισης της {app}: {name}", "Unable to update server side encryption config" : "Δεν είναι δυνατή η ενημέρωση της διαμόρφωσης κρυπτογράφησης από τον διακομιστή", @@ -881,9 +882,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "για σύνδεση χωρίς συνθηματικό με WebAuthn και αποθήκευση SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Ανιχνεύθηκε η έκδοση PostgreSQL \"%s\". Προτείνεται PostgreSQL >=12 και <=16 για την καλύτερη απόδοση, σταθερότητα και λειτουργικότητα με αυτήν την έκδοση του Nextcloud.", "Set default expiration date for shares" : "Ορισμός προεπιλεγμένης ημερομηνίας λήξης για τα κοινόχρηστα", - "Failed to remove group \"{group}\"" : "Αποτυχία κατά την αφαίρεση της ομάδας \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Πρόκειται να αφαιρέσετε την ομάδα \"{group}\". Οι λογαριασμοί ΔΕΝ θα διαγραφούν.", - "Remove group" : "Αφαίρεση ομάδας", "Your biography" : "Το βιογραφικό σας", "You are using <strong>{usage}</strong>" : "Χρησιμοποιείτε <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Χρησιμοποιείτε <strong>{usage}</strong> από <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/en_GB.js b/apps/settings/l10n/en_GB.js index 02c54dea0fc..6d127073390 100644 --- a/apps/settings/l10n/en_GB.js +++ b/apps/settings/l10n/en_GB.js @@ -316,7 +316,7 @@ OC.L10N.register( "64-bit" : "64-bit", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!", "Task Processing pickup speed" : "Task Processing pickup speed", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["No scheduled tasks in the last %n hours.","No scheduled tasks in the last %n hours."], + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["No scheduled tasks in the last %n hour.","No scheduled tasks in the last %n hours."], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["The task pickup speed has been ok in the last %n hour.","The task pickup speed has been ok in the last %n hours."], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background.","The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background."], "Temporary space available" : "Temporary space available", @@ -565,6 +565,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Unable to update profile default setting", "Profile" : "Profile", "Enable or disable profile by default for new accounts." : "Enable or disable profile by default for new accounts.", + "Password confirmation is required" : "Password confirmation is required", "Failed to save setting" : "Failed to save setting", "{app}'s declarative setting field: {name}" : "{app}'s declarative setting field: {name}", "Unable to update server side encryption config" : "Unable to update server side encryption config", @@ -587,9 +588,12 @@ OC.L10N.register( "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Refer to the admin documentation on how to manually also encrypt existing files.", "This is the final warning: Do you really want to enable encryption?" : "This is the final warning: Do you really want to enable encryption?", + "Failed to delete group \"{group}\"" : "Failed to delete group \"{group}\"", "Please confirm the group removal" : "Please confirm the group removal", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "You are about to delete the group \"{group}\". The accounts will NOT be deleted.", "Submit" : "Submit", "Rename group" : "Rename group", + "Delete group" : "Delete group", "Current password" : "Current password", "New password" : "New password", "Change password" : "Change password", @@ -897,9 +901,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "for WebAuthn passwordless login, and SFTP storage", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud.", "Set default expiration date for shares" : "Set default expiration date for shares", - "Failed to remove group \"{group}\"" : "Failed to remove group \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "You are about to remove the group \"{group}\". The accounts will NOT be deleted.", - "Remove group" : "Remove group", "Your biography" : "Your biography", "You are using <strong>{usage}</strong>" : "You are using <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/en_GB.json b/apps/settings/l10n/en_GB.json index b3e8cc4ae91..43c5bd06674 100644 --- a/apps/settings/l10n/en_GB.json +++ b/apps/settings/l10n/en_GB.json @@ -314,7 +314,7 @@ "64-bit" : "64-bit", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!", "Task Processing pickup speed" : "Task Processing pickup speed", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["No scheduled tasks in the last %n hours.","No scheduled tasks in the last %n hours."], + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["No scheduled tasks in the last %n hour.","No scheduled tasks in the last %n hours."], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["The task pickup speed has been ok in the last %n hour.","The task pickup speed has been ok in the last %n hours."], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background.","The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background."], "Temporary space available" : "Temporary space available", @@ -563,6 +563,7 @@ "Unable to update profile default setting" : "Unable to update profile default setting", "Profile" : "Profile", "Enable or disable profile by default for new accounts." : "Enable or disable profile by default for new accounts.", + "Password confirmation is required" : "Password confirmation is required", "Failed to save setting" : "Failed to save setting", "{app}'s declarative setting field: {name}" : "{app}'s declarative setting field: {name}", "Unable to update server side encryption config" : "Unable to update server side encryption config", @@ -585,9 +586,12 @@ "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Refer to the admin documentation on how to manually also encrypt existing files.", "This is the final warning: Do you really want to enable encryption?" : "This is the final warning: Do you really want to enable encryption?", + "Failed to delete group \"{group}\"" : "Failed to delete group \"{group}\"", "Please confirm the group removal" : "Please confirm the group removal", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "You are about to delete the group \"{group}\". The accounts will NOT be deleted.", "Submit" : "Submit", "Rename group" : "Rename group", + "Delete group" : "Delete group", "Current password" : "Current password", "New password" : "New password", "Change password" : "Change password", @@ -895,9 +899,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "for WebAuthn passwordless login, and SFTP storage", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud.", "Set default expiration date for shares" : "Set default expiration date for shares", - "Failed to remove group \"{group}\"" : "Failed to remove group \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "You are about to remove the group \"{group}\". The accounts will NOT be deleted.", - "Remove group" : "Remove group", "Your biography" : "Your biography", "You are using <strong>{usage}</strong>" : "You are using <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/eo.js b/apps/settings/l10n/eo.js index 0d09f226b7a..06e28ba9947 100644 --- a/apps/settings/l10n/eo.js +++ b/apps/settings/l10n/eo.js @@ -184,6 +184,7 @@ OC.L10N.register( "Password" : "Pasvorto", "Show QR code for mobile apps" : "Montri rapidrespondan (QR) kodon por porteblaj aplikaĵoj", "Use system cron service to call the cron.php file every 5 minutes." : "Uzu la sisteman „cron“-servon por voki cron.php ĉiujn 5 minutojn.", + "Password confirmation is required" : "Konfirmo per pasvorto estas bezonata", "Server-side encryption" : "Ĉeservila ĉifrado", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "Ĉeservila ĉifrado elbigas ĉifri ĉiujn alŝutitajn dosierojn al la servilo. Tio havas kelkajn limigojn kiel pli malbonan rendimenton, do ŝaltu tion nur se necese.", "Enable server-side encryption" : "Ŝalti ĉeservilan ĉifradon", @@ -299,7 +300,6 @@ OC.L10N.register( "Check out our blog" : "Vizitu nian blogon", "Subscribe to our newsletter" : "Aboni nian retan bultenon", "This community release of Nextcloud is unsupported and instant notifications are unavailable." : "Tiu elkomunuma eldono de Nextcloud ne estas subtenata, kaj tuj-sciigoj ne disponeblas.", - "Use a second factor besides your password to increase security for your account." : "Uzu duan fazon krom via pasvorto por plisekurigi vian konton.", - "Remove group" : "Forigi grupon" + "Use a second factor besides your password to increase security for your account." : "Uzu duan fazon krom via pasvorto por plisekurigi vian konton." }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/settings/l10n/eo.json b/apps/settings/l10n/eo.json index 493ce1c92d6..69066da132a 100644 --- a/apps/settings/l10n/eo.json +++ b/apps/settings/l10n/eo.json @@ -182,6 +182,7 @@ "Password" : "Pasvorto", "Show QR code for mobile apps" : "Montri rapidrespondan (QR) kodon por porteblaj aplikaĵoj", "Use system cron service to call the cron.php file every 5 minutes." : "Uzu la sisteman „cron“-servon por voki cron.php ĉiujn 5 minutojn.", + "Password confirmation is required" : "Konfirmo per pasvorto estas bezonata", "Server-side encryption" : "Ĉeservila ĉifrado", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "Ĉeservila ĉifrado elbigas ĉifri ĉiujn alŝutitajn dosierojn al la servilo. Tio havas kelkajn limigojn kiel pli malbonan rendimenton, do ŝaltu tion nur se necese.", "Enable server-side encryption" : "Ŝalti ĉeservilan ĉifradon", @@ -297,7 +298,6 @@ "Check out our blog" : "Vizitu nian blogon", "Subscribe to our newsletter" : "Aboni nian retan bultenon", "This community release of Nextcloud is unsupported and instant notifications are unavailable." : "Tiu elkomunuma eldono de Nextcloud ne estas subtenata, kaj tuj-sciigoj ne disponeblas.", - "Use a second factor besides your password to increase security for your account." : "Uzu duan fazon krom via pasvorto por plisekurigi vian konton.", - "Remove group" : "Forigi grupon" + "Use a second factor besides your password to increase security for your account." : "Uzu duan fazon krom via pasvorto por plisekurigi vian konton." },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/settings/l10n/es.js b/apps/settings/l10n/es.js index 33a941ad165..a3fa87392a5 100644 --- a/apps/settings/l10n/es.js +++ b/apps/settings/l10n/es.js @@ -561,6 +561,7 @@ OC.L10N.register( "Unable to update profile default setting" : "No se pudo actualizar la configuración por defecto del perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Habilitar o deshabilitar el perfil por defecto para nuevas cuentas.", + "Password confirmation is required" : "Se requiere confirmar la contraseña", "Failed to save setting" : "No se pudo guardar la configuración", "{app}'s declarative setting field: {name}" : "Campo de configuración declarativa de {app}: {name}", "Unable to update server side encryption config" : "No ha sido posible actualizar la configuración de cifrado del lado del servidor", @@ -893,9 +894,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "para inicio de sesión sin contraseña de WebAuthn, y almacenamiento SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Se detectó la versión PostgreSQL \"%s\". Se sugiere utilizar PostgreSQL >=12 y <=16 para el mejor rendimiento, estabilidad y funcionalidad con esta versión de Nextcloud.", "Set default expiration date for shares" : "Establecer fecha de caducidad predeterminada para recursos compartidos", - "Failed to remove group \"{group}\"" : "Fallo al eliminar el grupo \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Está a punto de eliminar el grupo \"{group}\". Las cuentas NO serán eliminadas.", - "Remove group" : "Eliminar grupo", "Your biography" : "Tu biografía", "You are using <strong>{usage}</strong>" : "Estás usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Estás usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/es.json b/apps/settings/l10n/es.json index a7d5f2cc940..5eef24dc6d8 100644 --- a/apps/settings/l10n/es.json +++ b/apps/settings/l10n/es.json @@ -559,6 +559,7 @@ "Unable to update profile default setting" : "No se pudo actualizar la configuración por defecto del perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Habilitar o deshabilitar el perfil por defecto para nuevas cuentas.", + "Password confirmation is required" : "Se requiere confirmar la contraseña", "Failed to save setting" : "No se pudo guardar la configuración", "{app}'s declarative setting field: {name}" : "Campo de configuración declarativa de {app}: {name}", "Unable to update server side encryption config" : "No ha sido posible actualizar la configuración de cifrado del lado del servidor", @@ -891,9 +892,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "para inicio de sesión sin contraseña de WebAuthn, y almacenamiento SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Se detectó la versión PostgreSQL \"%s\". Se sugiere utilizar PostgreSQL >=12 y <=16 para el mejor rendimiento, estabilidad y funcionalidad con esta versión de Nextcloud.", "Set default expiration date for shares" : "Establecer fecha de caducidad predeterminada para recursos compartidos", - "Failed to remove group \"{group}\"" : "Fallo al eliminar el grupo \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Está a punto de eliminar el grupo \"{group}\". Las cuentas NO serán eliminadas.", - "Remove group" : "Eliminar grupo", "Your biography" : "Tu biografía", "You are using <strong>{usage}</strong>" : "Estás usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Estás usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/es_419.js b/apps/settings/l10n/es_419.js index 060169db3c5..3c98bd49c67 100644 --- a/apps/settings/l10n/es_419.js +++ b/apps/settings/l10n/es_419.js @@ -141,6 +141,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_419.json b/apps/settings/l10n/es_419.json index 7e9807a489e..b12d7325c09 100644 --- a/apps/settings/l10n/es_419.json +++ b/apps/settings/l10n/es_419.json @@ -139,6 +139,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_AR.js b/apps/settings/l10n/es_AR.js index c18bd286085..d59ef68822e 100644 --- a/apps/settings/l10n/es_AR.js +++ b/apps/settings/l10n/es_AR.js @@ -321,6 +321,7 @@ OC.L10N.register( "Unable to update profile default setting" : "No se pudo actualizar la configuración por defecto del perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Habilitar o deshabilitar el perfil por defecto para cuentas nuevas.", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Failed to save setting" : "No se pudo guardar la configuración", "{app}'s declarative setting field: {name}" : "Campo de configuración declarativa de {app}: {name}", "Unable to update server side encryption config" : "No se pudo actualizar la configuración de cifrado en el servidor", @@ -609,9 +610,6 @@ OC.L10N.register( "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "El bloqueo transaccional de archivos está desactivado, lo que podría ocasionar problemas de race conditions. Habilitá \"filelocking.enabled\" en config.php para evitar estos problemas.", "for WebAuthn passwordless login" : "para el inicio de sesión sin contraseña de WebAuthn", "for WebAuthn passwordless login, and SFTP storage" : "para el inicio de sesión sin contraseña de WebAuthn y el almacenamiento SFTP", - "Failed to remove group \"{group}\"" : "No se pudo eliminar el grupo \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Vas a eliminar el grupo {group}. Los usuarios NO serán eliminados.", - "Remove group" : "Eliminar grupo", "Your biography" : "Tu biografía", "You are using <strong>{usage}</strong>" : "Estás usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Estás usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/es_AR.json b/apps/settings/l10n/es_AR.json index 5bfef6aa0fe..fcde0dc6f29 100644 --- a/apps/settings/l10n/es_AR.json +++ b/apps/settings/l10n/es_AR.json @@ -319,6 +319,7 @@ "Unable to update profile default setting" : "No se pudo actualizar la configuración por defecto del perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Habilitar o deshabilitar el perfil por defecto para cuentas nuevas.", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Failed to save setting" : "No se pudo guardar la configuración", "{app}'s declarative setting field: {name}" : "Campo de configuración declarativa de {app}: {name}", "Unable to update server side encryption config" : "No se pudo actualizar la configuración de cifrado en el servidor", @@ -607,9 +608,6 @@ "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "El bloqueo transaccional de archivos está desactivado, lo que podría ocasionar problemas de race conditions. Habilitá \"filelocking.enabled\" en config.php para evitar estos problemas.", "for WebAuthn passwordless login" : "para el inicio de sesión sin contraseña de WebAuthn", "for WebAuthn passwordless login, and SFTP storage" : "para el inicio de sesión sin contraseña de WebAuthn y el almacenamiento SFTP", - "Failed to remove group \"{group}\"" : "No se pudo eliminar el grupo \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Vas a eliminar el grupo {group}. Los usuarios NO serán eliminados.", - "Remove group" : "Eliminar grupo", "Your biography" : "Tu biografía", "You are using <strong>{usage}</strong>" : "Estás usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Estás usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/es_CL.js b/apps/settings/l10n/es_CL.js index 6c7dd7dc07b..1d8832fb00c 100644 --- a/apps/settings/l10n/es_CL.js +++ b/apps/settings/l10n/es_CL.js @@ -146,6 +146,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_CL.json b/apps/settings/l10n/es_CL.json index f2d5ffcc24b..e677524d91f 100644 --- a/apps/settings/l10n/es_CL.json +++ b/apps/settings/l10n/es_CL.json @@ -144,6 +144,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_CO.js b/apps/settings/l10n/es_CO.js index 1cdef45ea23..6ebc01eed9b 100644 --- a/apps/settings/l10n/es_CO.js +++ b/apps/settings/l10n/es_CO.js @@ -145,6 +145,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_CO.json b/apps/settings/l10n/es_CO.json index 5b848033331..bcfd961d441 100644 --- a/apps/settings/l10n/es_CO.json +++ b/apps/settings/l10n/es_CO.json @@ -143,6 +143,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_CR.js b/apps/settings/l10n/es_CR.js index afd38b6a676..05e8a04a4e4 100644 --- a/apps/settings/l10n/es_CR.js +++ b/apps/settings/l10n/es_CR.js @@ -145,6 +145,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_CR.json b/apps/settings/l10n/es_CR.json index 29af8abae99..ec1cf0e5c10 100644 --- a/apps/settings/l10n/es_CR.json +++ b/apps/settings/l10n/es_CR.json @@ -143,6 +143,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_DO.js b/apps/settings/l10n/es_DO.js index 01f57aaff73..59ebda24f9f 100644 --- a/apps/settings/l10n/es_DO.js +++ b/apps/settings/l10n/es_DO.js @@ -144,6 +144,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_DO.json b/apps/settings/l10n/es_DO.json index 49339aeba6b..3efba9cb8dd 100644 --- a/apps/settings/l10n/es_DO.json +++ b/apps/settings/l10n/es_DO.json @@ -142,6 +142,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_EC.js b/apps/settings/l10n/es_EC.js index 28f50733390..b59d456ffe7 100644 --- a/apps/settings/l10n/es_EC.js +++ b/apps/settings/l10n/es_EC.js @@ -242,6 +242,7 @@ OC.L10N.register( "Cron (Recommended)" : "Cron (recomendado)", "Unable to update profile default setting" : "No se pudo actualizar la configuración predeterminada del perfil", "Profile" : "Perfil", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Unable to update server side encryption config" : "No se pudo actualizar la configuración de cifrado en el servidor", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", @@ -457,7 +458,6 @@ OC.L10N.register( "Use a second factor besides your password to increase security for your account." : "Utiliza un segundo factor además de tu contraseña para aumentar la seguridad de tu cuenta.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Si utilizas aplicaciones de terceros para conectarte a Nextcloud, asegúrate de crear y configurar una contraseña de aplicación para cada una antes de habilitar la autenticación de segundo factor.", "Set default expiration date for shares" : "Establecer fecha de vencimiento predeterminada para los compartidos", - "Remove group" : "Eliminar grupo", "Your biography" : "Tu biografía", "You are using <strong>{usage}</strong>" : "Estás usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Estás usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/es_EC.json b/apps/settings/l10n/es_EC.json index 0fbedab9ca0..3de1fd6a3d7 100644 --- a/apps/settings/l10n/es_EC.json +++ b/apps/settings/l10n/es_EC.json @@ -240,6 +240,7 @@ "Cron (Recommended)" : "Cron (recomendado)", "Unable to update profile default setting" : "No se pudo actualizar la configuración predeterminada del perfil", "Profile" : "Perfil", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Unable to update server side encryption config" : "No se pudo actualizar la configuración de cifrado en el servidor", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", @@ -455,7 +456,6 @@ "Use a second factor besides your password to increase security for your account." : "Utiliza un segundo factor además de tu contraseña para aumentar la seguridad de tu cuenta.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Si utilizas aplicaciones de terceros para conectarte a Nextcloud, asegúrate de crear y configurar una contraseña de aplicación para cada una antes de habilitar la autenticación de segundo factor.", "Set default expiration date for shares" : "Establecer fecha de vencimiento predeterminada para los compartidos", - "Remove group" : "Eliminar grupo", "Your biography" : "Tu biografía", "You are using <strong>{usage}</strong>" : "Estás usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Estás usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/es_GT.js b/apps/settings/l10n/es_GT.js index 1cb624e5b2a..2b01a8a4322 100644 --- a/apps/settings/l10n/es_GT.js +++ b/apps/settings/l10n/es_GT.js @@ -146,6 +146,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_GT.json b/apps/settings/l10n/es_GT.json index bf18aa594c3..bf45aa94919 100644 --- a/apps/settings/l10n/es_GT.json +++ b/apps/settings/l10n/es_GT.json @@ -144,6 +144,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_HN.js b/apps/settings/l10n/es_HN.js index 89f96aafe91..36887b920bc 100644 --- a/apps/settings/l10n/es_HN.js +++ b/apps/settings/l10n/es_HN.js @@ -140,6 +140,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_HN.json b/apps/settings/l10n/es_HN.json index b3dd690d60f..8218f1cd3eb 100644 --- a/apps/settings/l10n/es_HN.json +++ b/apps/settings/l10n/es_HN.json @@ -138,6 +138,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_MX.js b/apps/settings/l10n/es_MX.js index 061a28e31e7..89c92147826 100644 --- a/apps/settings/l10n/es_MX.js +++ b/apps/settings/l10n/es_MX.js @@ -452,6 +452,7 @@ OC.L10N.register( "Unable to update profile default setting" : "No se pudo actualizar la configuración predeterminada del perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Habilitar o deshabilitar el perfil por defecto para nuevos usuarios.", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Failed to save setting" : "No se pudo guardar la configuración", "{app}'s declarative setting field: {name}" : "Campo de configuración declarativa de {app}: {name}", "Unable to update server side encryption config" : "No se pudo actualizar la configuración de cifrado del lado del servidor", @@ -761,9 +762,6 @@ OC.L10N.register( "for WebAuthn passwordless login" : "para el inicio de sesión sin contraseña de WebAuthn", "for WebAuthn passwordless login, and SFTP storage" : "para el inicio de sesión sin contraseña de WebAuthn y el almacenamiento SFTP", "Set default expiration date for shares" : "Establecer fecha de caducidad predeterminada para compartidos", - "Failed to remove group \"{group}\"" : "No se pudo eliminar el grupo \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Está a punto de eliminar el grupo \"{group}\". Los usuarios NO serán eliminados.", - "Remove group" : "Eliminar grupo", "Your biography" : "Su biografía", "You are using <strong>{usage}</strong>" : "Está usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Está usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/es_MX.json b/apps/settings/l10n/es_MX.json index 5bfd2add25a..c078d42a628 100644 --- a/apps/settings/l10n/es_MX.json +++ b/apps/settings/l10n/es_MX.json @@ -450,6 +450,7 @@ "Unable to update profile default setting" : "No se pudo actualizar la configuración predeterminada del perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Habilitar o deshabilitar el perfil por defecto para nuevos usuarios.", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Failed to save setting" : "No se pudo guardar la configuración", "{app}'s declarative setting field: {name}" : "Campo de configuración declarativa de {app}: {name}", "Unable to update server side encryption config" : "No se pudo actualizar la configuración de cifrado del lado del servidor", @@ -759,9 +760,6 @@ "for WebAuthn passwordless login" : "para el inicio de sesión sin contraseña de WebAuthn", "for WebAuthn passwordless login, and SFTP storage" : "para el inicio de sesión sin contraseña de WebAuthn y el almacenamiento SFTP", "Set default expiration date for shares" : "Establecer fecha de caducidad predeterminada para compartidos", - "Failed to remove group \"{group}\"" : "No se pudo eliminar el grupo \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Está a punto de eliminar el grupo \"{group}\". Los usuarios NO serán eliminados.", - "Remove group" : "Eliminar grupo", "Your biography" : "Su biografía", "You are using <strong>{usage}</strong>" : "Está usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Está usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/es_NI.js b/apps/settings/l10n/es_NI.js index 1f2eb8600bc..a079e9af242 100644 --- a/apps/settings/l10n/es_NI.js +++ b/apps/settings/l10n/es_NI.js @@ -139,6 +139,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_NI.json b/apps/settings/l10n/es_NI.json index 42050e0f282..53aee7c602f 100644 --- a/apps/settings/l10n/es_NI.json +++ b/apps/settings/l10n/es_NI.json @@ -137,6 +137,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_PA.js b/apps/settings/l10n/es_PA.js index 8f4f7bc1c4c..3f2e760215b 100644 --- a/apps/settings/l10n/es_PA.js +++ b/apps/settings/l10n/es_PA.js @@ -139,6 +139,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_PA.json b/apps/settings/l10n/es_PA.json index b65f1115a57..4919eccf8ee 100644 --- a/apps/settings/l10n/es_PA.json +++ b/apps/settings/l10n/es_PA.json @@ -137,6 +137,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_PE.js b/apps/settings/l10n/es_PE.js index ba80293df17..492f10fe19f 100644 --- a/apps/settings/l10n/es_PE.js +++ b/apps/settings/l10n/es_PE.js @@ -138,6 +138,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_PE.json b/apps/settings/l10n/es_PE.json index 72e7f2ef6ad..7fc994c1cd5 100644 --- a/apps/settings/l10n/es_PE.json +++ b/apps/settings/l10n/es_PE.json @@ -136,6 +136,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_PR.js b/apps/settings/l10n/es_PR.js index 8f4f7bc1c4c..3f2e760215b 100644 --- a/apps/settings/l10n/es_PR.js +++ b/apps/settings/l10n/es_PR.js @@ -139,6 +139,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_PR.json b/apps/settings/l10n/es_PR.json index b65f1115a57..4919eccf8ee 100644 --- a/apps/settings/l10n/es_PR.json +++ b/apps/settings/l10n/es_PR.json @@ -137,6 +137,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_PY.js b/apps/settings/l10n/es_PY.js index bbffec9fd0c..77b625b06cf 100644 --- a/apps/settings/l10n/es_PY.js +++ b/apps/settings/l10n/es_PY.js @@ -139,6 +139,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_PY.json b/apps/settings/l10n/es_PY.json index cf3c5d477bf..d1d464dc2fa 100644 --- a/apps/settings/l10n/es_PY.json +++ b/apps/settings/l10n/es_PY.json @@ -137,6 +137,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_SV.js b/apps/settings/l10n/es_SV.js index 1cb624e5b2a..2b01a8a4322 100644 --- a/apps/settings/l10n/es_SV.js +++ b/apps/settings/l10n/es_SV.js @@ -146,6 +146,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_SV.json b/apps/settings/l10n/es_SV.json index bf18aa594c3..bf45aa94919 100644 --- a/apps/settings/l10n/es_SV.json +++ b/apps/settings/l10n/es_SV.json @@ -144,6 +144,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_UY.js b/apps/settings/l10n/es_UY.js index a980eaf2c04..6da1a34b7c8 100644 --- a/apps/settings/l10n/es_UY.js +++ b/apps/settings/l10n/es_UY.js @@ -138,6 +138,7 @@ OC.L10N.register( "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/es_UY.json b/apps/settings/l10n/es_UY.json index e9c33a86cc9..5ce26032a55 100644 --- a/apps/settings/l10n/es_UY.json +++ b/apps/settings/l10n/es_UY.json @@ -136,6 +136,7 @@ "Create new app password" : "Crear una nueva contraseña de aplicación", "Login" : "Iniciar sesión", "Password" : "Contraseña", + "Password confirmation is required" : "Se requiere la confirmación de la contraseña", "Server-side encryption" : "Encripción del lado del servidor", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La encripción del lado del servidor hace posible encriptar archivos que serán cargados a este servidor. Esto trae consigo algunas limitaciónes como penalizaciones en el desemeño, asi que habilítalo sólo si es necesario. ", "Enable server-side encryption" : "Habilitar encripción del lado del servidor", diff --git a/apps/settings/l10n/et_EE.js b/apps/settings/l10n/et_EE.js index 21dc0b713f4..e7298146395 100644 --- a/apps/settings/l10n/et_EE.js +++ b/apps/settings/l10n/et_EE.js @@ -186,7 +186,7 @@ OC.L10N.register( "64-bit" : "64-bitine", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "Tundub, et kasutad PHP 32-bitist versiooni. Tõhusaks toimimiseks eeldab Nextcloud 64-bitist keskkonda. Palun uuenda oma serveri operatsioonisüsteem ja PHP 64-bitiseks versiooniks!", "Task Processing pickup speed" : "Ülesannete töötlemise kiirus", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["Viimase %n tunni jooksul pole olnud ühtegi ajastatud ülesannet.","Viimase %n tunni jooksul pole olnud ühtegi ajastatud ülesannet."], + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["Viimase %n tunni jooksul pole olnud ühtegi ajastatud ülesannet.","Viimase %n tunni jooksul pole olnud ühtegi ajastatud ülesannet."], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["Ülesannete töötlemise kiirus on viimase %n tunni jooksul olnud mõistlik.","Ülesannete töötlemise kiirus on viimase %n tunni jooksul olnud mõistlik."], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["Ülesannete töötlemise kiirus on viimase %n tunni jooksul olnud aeglane. Paljude ülesannete töölepanekuks kulus enam, kui 4 minutit. Palun kaalu võimalust, et ülesannete töötlemiseks seadistad taustal töötava protsessihalduri.","Ülesannete töötlemise kiirus on viimase %n tunni jooksul olnud aeglane. Paljude ülesannete töölepanekuks kulus enam, kui 4 minutit. Palun kaalu võimalust, et ülesannete töötlemiseks seadistad taustal töötava protsessihalduri."], "The PHP function \"disk_free_space\" is disabled, which prevents the check for enough space in the temporary directories." : "PHP funktsioon „disk_free_space“ pole kasutusel. Selle puudumine takistab ajutiste kaustade jaoks vajaliku andmeruumi kontrollimist.", @@ -220,6 +220,11 @@ OC.L10N.register( "Enforce expiration date" : "Sunnitud aegumise kuupäev", "Default expiration time of new shares in days" : "Uue jaosmeedia vaikimisi aegumine päevades", "Expire shares after x days" : "Jaosmeedia aegub x päeva möödudes", + "Enforce expiration date for remote shares" : "Määra lingi kaugserverid asuva jaosmeedia vaikimisi aegumiskuupäev ", + "Default expiration time of remote shares in days" : "Kaugserveris asuva jaosmeedia vaikimisi aegumine päevades", + "Expire remote shares after x days" : "Jaosmeedia aegub x päeva möödudes", + "Set default expiration date for shares via link or mail" : "Määra lingi või e-kirjaga jagatava jaosmeedia vaikimisi aegumiskuupäev", + "Default expiration time of shares in days" : "Jaosmeedia vaikimisi aegumine päevades", "Privacy settings for sharing" : "Jagamise privaatsusseadistused", "Show disclaimer text on the public link upload page (only shown when the file list is hidden)" : "Kuva avaliku lingiga üleslaadimise lehel lahtiütluste tekst (vaid siis, kui failide loend on peidetud)", "Disclaimer text" : "Vastutusest lahtiütluse tekst", @@ -360,6 +365,7 @@ OC.L10N.register( "Last job ran {relativeTime}." : "Viimane käivitus kestis {relativeTime}.", "Unable to update profile default setting" : "Profiili vaikimisi seadistuste uuendamine ei õnnestu", "Profile" : "Profiil", + "Password confirmation is required" : "Parooli kinnitus on vajalik", "Failed to save setting" : "Seadistuse salvestamine ei õnnestunud", "Unable to update server side encryption config" : "Serveripoolse krüptimise seadistusi ei õnnestu uuendada", "Server-side encryption" : "Serveripoolne krüptimine", @@ -380,9 +386,12 @@ OC.L10N.register( "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Alati on hea mõte, kui varundad oma andmeid. Kui aga kasutusel on krüptimine, siis palun kontrolli, et lisaks andmetele on varundatud ka krüptovõtmed.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Süsteemihalduse juhendist leiad teavet kuidas saad käsitsi krüptida juba olemasolevaid faile.", "This is the final warning: Do you really want to enable encryption?" : "See on viimane hoiatus: Kas oled kindel, et soovid krüptimise sisse lülitada?", + "Failed to delete group \"{group}\"" : "„{group}“ grupi eemaldamine ei õnnestunud", "Please confirm the group removal" : "Palun kinnita grupi eemaldamine", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "Sa oled eemaldamas gruppi „{group}“. Selles grupis olevad kasutajad aga JÄÄVAD kustutamata.", "Submit" : "Saada", "Rename group" : "Muuda grupi nime", + "Delete group" : "Kustuta grupp", "Current password" : "Praegune salasõna", "New password" : "Uus salasõna", "Change password" : "Muuda salasõna", @@ -642,9 +651,6 @@ OC.L10N.register( "for WebAuthn passwordless login" : "WebAuthn salasõnata sisselogimise jaoks", "for WebAuthn passwordless login, and SFTP storage" : "WebAuthn salasõnata sisselogimise ja SFTP andmeruumi jaoks", "Set default expiration date for shares" : "Määra jaosmeedia vaikimisi aegumiskuupäev", - "Failed to remove group \"{group}\"" : "„{group}“ grupi eemaldamine ei õnnestunud", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Sa oled eemaldamas gruppi „{group}“. Selles grupis olevad kasutajad aga JÄÄVAD kustutamata.", - "Remove group" : "Eemalda grupp", "Your biography" : "Sinu elulugu", "You are using <strong>{usage}</strong>" : "Sa kasutad: <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Sa kasutad: <strong>{usage}</strong> / <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/et_EE.json b/apps/settings/l10n/et_EE.json index c23efdb510a..389f372023b 100644 --- a/apps/settings/l10n/et_EE.json +++ b/apps/settings/l10n/et_EE.json @@ -184,7 +184,7 @@ "64-bit" : "64-bitine", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "Tundub, et kasutad PHP 32-bitist versiooni. Tõhusaks toimimiseks eeldab Nextcloud 64-bitist keskkonda. Palun uuenda oma serveri operatsioonisüsteem ja PHP 64-bitiseks versiooniks!", "Task Processing pickup speed" : "Ülesannete töötlemise kiirus", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["Viimase %n tunni jooksul pole olnud ühtegi ajastatud ülesannet.","Viimase %n tunni jooksul pole olnud ühtegi ajastatud ülesannet."], + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["Viimase %n tunni jooksul pole olnud ühtegi ajastatud ülesannet.","Viimase %n tunni jooksul pole olnud ühtegi ajastatud ülesannet."], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["Ülesannete töötlemise kiirus on viimase %n tunni jooksul olnud mõistlik.","Ülesannete töötlemise kiirus on viimase %n tunni jooksul olnud mõistlik."], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["Ülesannete töötlemise kiirus on viimase %n tunni jooksul olnud aeglane. Paljude ülesannete töölepanekuks kulus enam, kui 4 minutit. Palun kaalu võimalust, et ülesannete töötlemiseks seadistad taustal töötava protsessihalduri.","Ülesannete töötlemise kiirus on viimase %n tunni jooksul olnud aeglane. Paljude ülesannete töölepanekuks kulus enam, kui 4 minutit. Palun kaalu võimalust, et ülesannete töötlemiseks seadistad taustal töötava protsessihalduri."], "The PHP function \"disk_free_space\" is disabled, which prevents the check for enough space in the temporary directories." : "PHP funktsioon „disk_free_space“ pole kasutusel. Selle puudumine takistab ajutiste kaustade jaoks vajaliku andmeruumi kontrollimist.", @@ -218,6 +218,11 @@ "Enforce expiration date" : "Sunnitud aegumise kuupäev", "Default expiration time of new shares in days" : "Uue jaosmeedia vaikimisi aegumine päevades", "Expire shares after x days" : "Jaosmeedia aegub x päeva möödudes", + "Enforce expiration date for remote shares" : "Määra lingi kaugserverid asuva jaosmeedia vaikimisi aegumiskuupäev ", + "Default expiration time of remote shares in days" : "Kaugserveris asuva jaosmeedia vaikimisi aegumine päevades", + "Expire remote shares after x days" : "Jaosmeedia aegub x päeva möödudes", + "Set default expiration date for shares via link or mail" : "Määra lingi või e-kirjaga jagatava jaosmeedia vaikimisi aegumiskuupäev", + "Default expiration time of shares in days" : "Jaosmeedia vaikimisi aegumine päevades", "Privacy settings for sharing" : "Jagamise privaatsusseadistused", "Show disclaimer text on the public link upload page (only shown when the file list is hidden)" : "Kuva avaliku lingiga üleslaadimise lehel lahtiütluste tekst (vaid siis, kui failide loend on peidetud)", "Disclaimer text" : "Vastutusest lahtiütluse tekst", @@ -358,6 +363,7 @@ "Last job ran {relativeTime}." : "Viimane käivitus kestis {relativeTime}.", "Unable to update profile default setting" : "Profiili vaikimisi seadistuste uuendamine ei õnnestu", "Profile" : "Profiil", + "Password confirmation is required" : "Parooli kinnitus on vajalik", "Failed to save setting" : "Seadistuse salvestamine ei õnnestunud", "Unable to update server side encryption config" : "Serveripoolse krüptimise seadistusi ei õnnestu uuendada", "Server-side encryption" : "Serveripoolne krüptimine", @@ -378,9 +384,12 @@ "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Alati on hea mõte, kui varundad oma andmeid. Kui aga kasutusel on krüptimine, siis palun kontrolli, et lisaks andmetele on varundatud ka krüptovõtmed.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Süsteemihalduse juhendist leiad teavet kuidas saad käsitsi krüptida juba olemasolevaid faile.", "This is the final warning: Do you really want to enable encryption?" : "See on viimane hoiatus: Kas oled kindel, et soovid krüptimise sisse lülitada?", + "Failed to delete group \"{group}\"" : "„{group}“ grupi eemaldamine ei õnnestunud", "Please confirm the group removal" : "Palun kinnita grupi eemaldamine", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "Sa oled eemaldamas gruppi „{group}“. Selles grupis olevad kasutajad aga JÄÄVAD kustutamata.", "Submit" : "Saada", "Rename group" : "Muuda grupi nime", + "Delete group" : "Kustuta grupp", "Current password" : "Praegune salasõna", "New password" : "Uus salasõna", "Change password" : "Muuda salasõna", @@ -640,9 +649,6 @@ "for WebAuthn passwordless login" : "WebAuthn salasõnata sisselogimise jaoks", "for WebAuthn passwordless login, and SFTP storage" : "WebAuthn salasõnata sisselogimise ja SFTP andmeruumi jaoks", "Set default expiration date for shares" : "Määra jaosmeedia vaikimisi aegumiskuupäev", - "Failed to remove group \"{group}\"" : "„{group}“ grupi eemaldamine ei õnnestunud", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Sa oled eemaldamas gruppi „{group}“. Selles grupis olevad kasutajad aga JÄÄVAD kustutamata.", - "Remove group" : "Eemalda grupp", "Your biography" : "Sinu elulugu", "You are using <strong>{usage}</strong>" : "Sa kasutad: <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Sa kasutad: <strong>{usage}</strong> / <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/eu.js b/apps/settings/l10n/eu.js index e148c984252..3f16da14521 100644 --- a/apps/settings/l10n/eu.js +++ b/apps/settings/l10n/eu.js @@ -522,6 +522,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Ezin izan da eguneratu profilaren ezarpen lehenetsia", "Profile" : "Profila", "Enable or disable profile by default for new accounts." : "Gaitu edo desgaitu profila lehenespenez kontu berrientzat.", + "Password confirmation is required" : "Pasahitza konfirmatzea beharrezkoa da", "Failed to save setting" : "Ezarpena gordetzeak huts egin du", "{app}'s declarative setting field: {name}" : "{app}-ren ezarpen deklaratiboaren eremua: {name}", "Unable to update server side encryption config" : "Ezin izan da zerbitzariaren aldeko zifratzearen konfigurazioa eguneratu", @@ -839,9 +840,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "WebAuthn pasahitzik gabeko saio-hasiera eta SFTP biltegiratzerako", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL \"%s\" bertsioa detektatu da. PostgreSQL >=12 eta <=16 iradokitzen da Nextcloud-en bertsio honekin errendimendu, egonkortasun eta funtzionalitate onena lortzeko.", "Set default expiration date for shares" : "Partekatzeei iraungitze data lehenetsia ezarri", - "Failed to remove group \"{group}\"" : "Ezin izan da \"{group}\" taldea kendu", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "\"{group}\" taldea ezabatzera zoaz. Kontuak EZ dira ezabatuko.", - "Remove group" : "Ezabatu taldea", "Your biography" : "Zure biografia", "You are using <strong>{usage}</strong>" : "<strong>{usage}</strong> erabiltzen ari zara", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "<strong>{usage}</strong>/<strong>{totalSpace}</strong> erabiltzen ari zara (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/eu.json b/apps/settings/l10n/eu.json index 06ab25559fe..85ca513ce05 100644 --- a/apps/settings/l10n/eu.json +++ b/apps/settings/l10n/eu.json @@ -520,6 +520,7 @@ "Unable to update profile default setting" : "Ezin izan da eguneratu profilaren ezarpen lehenetsia", "Profile" : "Profila", "Enable or disable profile by default for new accounts." : "Gaitu edo desgaitu profila lehenespenez kontu berrientzat.", + "Password confirmation is required" : "Pasahitza konfirmatzea beharrezkoa da", "Failed to save setting" : "Ezarpena gordetzeak huts egin du", "{app}'s declarative setting field: {name}" : "{app}-ren ezarpen deklaratiboaren eremua: {name}", "Unable to update server side encryption config" : "Ezin izan da zerbitzariaren aldeko zifratzearen konfigurazioa eguneratu", @@ -837,9 +838,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "WebAuthn pasahitzik gabeko saio-hasiera eta SFTP biltegiratzerako", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL \"%s\" bertsioa detektatu da. PostgreSQL >=12 eta <=16 iradokitzen da Nextcloud-en bertsio honekin errendimendu, egonkortasun eta funtzionalitate onena lortzeko.", "Set default expiration date for shares" : "Partekatzeei iraungitze data lehenetsia ezarri", - "Failed to remove group \"{group}\"" : "Ezin izan da \"{group}\" taldea kendu", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "\"{group}\" taldea ezabatzera zoaz. Kontuak EZ dira ezabatuko.", - "Remove group" : "Ezabatu taldea", "Your biography" : "Zure biografia", "You are using <strong>{usage}</strong>" : "<strong>{usage}</strong> erabiltzen ari zara", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "<strong>{usage}</strong>/<strong>{totalSpace}</strong> erabiltzen ari zara (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/fa.js b/apps/settings/l10n/fa.js index e8ecc1ebaa2..2d2fd8a8f02 100644 --- a/apps/settings/l10n/fa.js +++ b/apps/settings/l10n/fa.js @@ -472,7 +472,6 @@ OC.L10N.register( "Use a second factor besides your password to increase security for your account." : "برای افزایش امنیت حساب کاربری خود ، از یک عامل دوم علاوه بر رمز عبور خود استفاده کنید.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication.", "Set default expiration date for shares" : "تاریخ انقضا پیش فرض را برای اشتراک گذاری تعیین کنید", - "Remove group" : "برداشتن گروه", "Your biography" : "بیوگرافی شما", "You are using <strong>{usage}</strong>" : "فضای مورد استفاده: <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "شما در حال استفادهٔ <strong>{usage}</strong> از <strong>{totalSpace}</strong> (<strong>{usageRelative}٪</strong>) فضا هستید" diff --git a/apps/settings/l10n/fa.json b/apps/settings/l10n/fa.json index 0184eaf71c3..acb5746def6 100644 --- a/apps/settings/l10n/fa.json +++ b/apps/settings/l10n/fa.json @@ -470,7 +470,6 @@ "Use a second factor besides your password to increase security for your account." : "برای افزایش امنیت حساب کاربری خود ، از یک عامل دوم علاوه بر رمز عبور خود استفاده کنید.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication.", "Set default expiration date for shares" : "تاریخ انقضا پیش فرض را برای اشتراک گذاری تعیین کنید", - "Remove group" : "برداشتن گروه", "Your biography" : "بیوگرافی شما", "You are using <strong>{usage}</strong>" : "فضای مورد استفاده: <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "شما در حال استفادهٔ <strong>{usage}</strong> از <strong>{totalSpace}</strong> (<strong>{usageRelative}٪</strong>) فضا هستید" diff --git a/apps/settings/l10n/fi.js b/apps/settings/l10n/fi.js index 1f3f2800f21..dd838928d3c 100644 --- a/apps/settings/l10n/fi.js +++ b/apps/settings/l10n/fi.js @@ -289,6 +289,7 @@ OC.L10N.register( "Cron (Recommended)" : "Cron (suositeltu)", "Unable to update profile default setting" : "Profiilin oletusasetuksen päivittäminen ei onnistunut", "Profile" : "Profiili", + "Password confirmation is required" : "Salasanavahvistus vaaditaan", "Server-side encryption" : "Palvelinpään salaus", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "Palvelimelle ladatut tiedostot voidaan salata. Salaus aiheuttaa muun muassa palvelimen suorituskyvyn laskua, joten ota salaus käyttöön vain tarvittaessa.", "Enable server-side encryption" : "Käytä palvelinpään salausta", @@ -528,9 +529,6 @@ OC.L10N.register( "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Jos yhdistät kolmannen osapuolen ohjelmia Nextcloudiin, määritä niille sovellussalasanat ennen kaksiosaisen todentamismenetelmän käyttöönottoa.", "File locking" : "Tiedostolukitus", "Set default expiration date for shares" : "Aseta oletusarvoinen vanhenemispäivä jaoille", - "Failed to remove group \"{group}\"" : "Ryhmän \"{group}\" poistaminen epäonnistui", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Olet aikeissa poistaa ryhmän \"{group}\". Tilejä EI poisteta.", - "Remove group" : "Poista ryhmä", "Your biography" : "Sinun elämäkertasi", "You are using <strong>{usage}</strong>" : "Käytössäsi on <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Käytössäsi on <strong>{usage}</strong>/<strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/fi.json b/apps/settings/l10n/fi.json index a54ef6b6e22..6ce239de38d 100644 --- a/apps/settings/l10n/fi.json +++ b/apps/settings/l10n/fi.json @@ -287,6 +287,7 @@ "Cron (Recommended)" : "Cron (suositeltu)", "Unable to update profile default setting" : "Profiilin oletusasetuksen päivittäminen ei onnistunut", "Profile" : "Profiili", + "Password confirmation is required" : "Salasanavahvistus vaaditaan", "Server-side encryption" : "Palvelinpään salaus", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "Palvelimelle ladatut tiedostot voidaan salata. Salaus aiheuttaa muun muassa palvelimen suorituskyvyn laskua, joten ota salaus käyttöön vain tarvittaessa.", "Enable server-side encryption" : "Käytä palvelinpään salausta", @@ -526,9 +527,6 @@ "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Jos yhdistät kolmannen osapuolen ohjelmia Nextcloudiin, määritä niille sovellussalasanat ennen kaksiosaisen todentamismenetelmän käyttöönottoa.", "File locking" : "Tiedostolukitus", "Set default expiration date for shares" : "Aseta oletusarvoinen vanhenemispäivä jaoille", - "Failed to remove group \"{group}\"" : "Ryhmän \"{group}\" poistaminen epäonnistui", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Olet aikeissa poistaa ryhmän \"{group}\". Tilejä EI poisteta.", - "Remove group" : "Poista ryhmä", "Your biography" : "Sinun elämäkertasi", "You are using <strong>{usage}</strong>" : "Käytössäsi on <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Käytössäsi on <strong>{usage}</strong>/<strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/fr.js b/apps/settings/l10n/fr.js index f4850644282..451d1ffc42f 100644 --- a/apps/settings/l10n/fr.js +++ b/apps/settings/l10n/fr.js @@ -558,6 +558,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Impossible de mettre à jour les paramètres par défaut du profil", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Active ou désactive le profil par défaut pour les nouveaux comptes.", + "Password confirmation is required" : "Confirmation par mot de passe est requise", "Failed to save setting" : "Échec de la sauvegarde des paramètres", "{app}'s declarative setting field: {name}" : "champ de paramètre déclaratif de l'{app}: {name}", "Unable to update server side encryption config" : "Impossible de mettre à jour la configuration du chiffrement côté serveur", @@ -579,9 +580,11 @@ OC.L10N.register( "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Il est opportun de sauvegarder régulièrement vos données. Si ces données sont chiffrées, n’oubliez pas de sauvegarder aussi les clés de chiffrement.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Reportez-vous à la documentation d'administration pour savoir comment chiffrer manuellement les fichiers existants.", "This is the final warning: Do you really want to enable encryption?" : "Dernier avertissement : Voulez-vous vraiment activer le chiffrement ?", + "Failed to delete group \"{group}\"" : "Échec de la suppression du groupe \"{group}\"", "Please confirm the group removal" : "Merci de confirmer la suppression du groupe", "Submit" : "Soumettre", "Rename group" : "Renommer le groupe", + "Delete group" : "Supprimer le groupe", "Current password" : "Mot de passe actuel", "New password" : "Nouveau mot de passe", "Change password" : "Changer de mot de passe", @@ -886,9 +889,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "pour WebAuthn pour la connexion sans mot de passe, et le stockage SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Version PostgreSQL \"%s\" détectée. PostgreSQL >= 12 et <= 16 sont recommandés pour de meilleures performances, stabilité et fonctionnalités avec cette version de Nextcloud.", "Set default expiration date for shares" : "Définir par défaut une date d’expiration pour les partages", - "Failed to remove group \"{group}\"" : "Erreur à la suppression de « {group} »", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Vous êtes sur le point de supprimer le groupe « {group} ». Les comptes qui en font partie ne seront PAS supprimés.", - "Remove group" : "Retirer le groupe", "Your biography" : "Votre biographie", "You are using <strong>{usage}</strong>" : "Vous utilisez <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Vous utilisez <strong>{usage}</strong> sur <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/fr.json b/apps/settings/l10n/fr.json index 165b62d1ddc..1c4d36bd04e 100644 --- a/apps/settings/l10n/fr.json +++ b/apps/settings/l10n/fr.json @@ -556,6 +556,7 @@ "Unable to update profile default setting" : "Impossible de mettre à jour les paramètres par défaut du profil", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Active ou désactive le profil par défaut pour les nouveaux comptes.", + "Password confirmation is required" : "Confirmation par mot de passe est requise", "Failed to save setting" : "Échec de la sauvegarde des paramètres", "{app}'s declarative setting field: {name}" : "champ de paramètre déclaratif de l'{app}: {name}", "Unable to update server side encryption config" : "Impossible de mettre à jour la configuration du chiffrement côté serveur", @@ -577,9 +578,11 @@ "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Il est opportun de sauvegarder régulièrement vos données. Si ces données sont chiffrées, n’oubliez pas de sauvegarder aussi les clés de chiffrement.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Reportez-vous à la documentation d'administration pour savoir comment chiffrer manuellement les fichiers existants.", "This is the final warning: Do you really want to enable encryption?" : "Dernier avertissement : Voulez-vous vraiment activer le chiffrement ?", + "Failed to delete group \"{group}\"" : "Échec de la suppression du groupe \"{group}\"", "Please confirm the group removal" : "Merci de confirmer la suppression du groupe", "Submit" : "Soumettre", "Rename group" : "Renommer le groupe", + "Delete group" : "Supprimer le groupe", "Current password" : "Mot de passe actuel", "New password" : "Nouveau mot de passe", "Change password" : "Changer de mot de passe", @@ -884,9 +887,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "pour WebAuthn pour la connexion sans mot de passe, et le stockage SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Version PostgreSQL \"%s\" détectée. PostgreSQL >= 12 et <= 16 sont recommandés pour de meilleures performances, stabilité et fonctionnalités avec cette version de Nextcloud.", "Set default expiration date for shares" : "Définir par défaut une date d’expiration pour les partages", - "Failed to remove group \"{group}\"" : "Erreur à la suppression de « {group} »", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Vous êtes sur le point de supprimer le groupe « {group} ». Les comptes qui en font partie ne seront PAS supprimés.", - "Remove group" : "Retirer le groupe", "Your biography" : "Votre biographie", "You are using <strong>{usage}</strong>" : "Vous utilisez <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Vous utilisez <strong>{usage}</strong> sur <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/ga.js b/apps/settings/l10n/ga.js index 9cbd3ebc88e..6459d2a0218 100644 --- a/apps/settings/l10n/ga.js +++ b/apps/settings/l10n/ga.js @@ -316,7 +316,6 @@ OC.L10N.register( "64-bit" : "64-giotán", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "Is cosúil go bhfuil leagan PHP 32-giotán á rith agat. Tá 64-giotán ag teastáil ó Nextcloud chun go n-éireoidh go maith. Uasghrádaigh do OS agus PHP go 64-giotán le do thoil!", "Task Processing pickup speed" : "Luas bailithe Próiseála Tascanna", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["Gan aon tascanna sceidealaithe le %n uair an chloig anuas.","Gan aon tascanna sceidealaithe le %n uair an chloig anuas.","Gan aon tascanna sceidealaithe le %n uair an chloig anuas.","Gan aon tascanna sceidealaithe le %n uair an chloig anuas.","Gan aon tascanna sceidealaithe le %n uair an chloig anuas."], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["Tá luas bailithe na dtascanna ceart go leor le %n uair an chloig anuas.","Tá luas bailithe na dtascanna ceart go leor le %n uair an chloig anuas.","Tá luas bailithe na dtascanna ceart go leor le %n uair an chloig anuas.","Tá luas bailithe na dtascanna ceart go leor le %n uair an chloig anuas.","Tá luas bailithe na dtascanna ceart go leor le %n uair an chloig anuas."], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["Tá luas bailithe na dtascanna mall le %n uair an chloig anuas. Thóg sé níos mó ná 4 nóiméad go leor tascanna a bhailiú. Smaoinigh ar oibrí a shocrú chun tascanna a phróiseáil sa chúlra.","Tá luas bailithe na dtascanna mall le %n uair an chloig anuas. Thóg sé níos mó ná 4 nóiméad go leor tascanna a bhailiú. Smaoinigh ar oibrí a shocrú chun tascanna a phróiseáil sa chúlra.","Tá luas bailithe na dtascanna mall le %n uair an chloig anuas. Thóg sé níos mó ná 4 nóiméad go leor tascanna a bhailiú. Smaoinigh ar oibrí a shocrú chun tascanna a phróiseáil sa chúlra.","Tá luas bailithe na dtascanna mall le %n uair an chloig anuas. Thóg sé níos mó ná 4 nóiméad go leor tascanna a bhailiú. Smaoinigh ar oibrí a shocrú chun tascanna a phróiseáil sa chúlra.","Tá luas bailithe na dtascanna mall le %n uair an chloig anuas. Thóg sé níos mó ná 4 nóiméad go leor tascanna a bhailiú. Smaoinigh ar oibrí a shocrú chun tascanna a phróiseáil sa chúlra."], "Temporary space available" : "Spás sealadach ar fáil", @@ -897,9 +896,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "le haghaidh logáil isteach WebAuthn gan phasfhocal, agus stóráil SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Braitheadh leagan PostgreSQL \"%s\". Moltar PostgreSQL >=12 agus <=16 don fheidhmíocht is fearr, don chobhsaíocht agus don fheidhmiúlacht leis an leagan seo de Nextcloud.", "Set default expiration date for shares" : "Socraigh dáta éaga réamhshocraithe le haghaidh scaireanna", - "Failed to remove group \"{group}\"" : "Theip ar an ngrúpa \"{group}\" a bhaint", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Tá tú ar tí an grúpa \"{group}\" a bhaint. NÍ scriosfar na cuntais.", - "Remove group" : "Bain an grúpa", "Your biography" : "Do bheathaisnéis", "You are using <strong>{usage}</strong>" : "Tá tú ag úsáid <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Tá tú ag úsáid<strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/ga.json b/apps/settings/l10n/ga.json index 12e39146b72..da9d8291ba6 100644 --- a/apps/settings/l10n/ga.json +++ b/apps/settings/l10n/ga.json @@ -314,7 +314,6 @@ "64-bit" : "64-giotán", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "Is cosúil go bhfuil leagan PHP 32-giotán á rith agat. Tá 64-giotán ag teastáil ó Nextcloud chun go n-éireoidh go maith. Uasghrádaigh do OS agus PHP go 64-giotán le do thoil!", "Task Processing pickup speed" : "Luas bailithe Próiseála Tascanna", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["Gan aon tascanna sceidealaithe le %n uair an chloig anuas.","Gan aon tascanna sceidealaithe le %n uair an chloig anuas.","Gan aon tascanna sceidealaithe le %n uair an chloig anuas.","Gan aon tascanna sceidealaithe le %n uair an chloig anuas.","Gan aon tascanna sceidealaithe le %n uair an chloig anuas."], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["Tá luas bailithe na dtascanna ceart go leor le %n uair an chloig anuas.","Tá luas bailithe na dtascanna ceart go leor le %n uair an chloig anuas.","Tá luas bailithe na dtascanna ceart go leor le %n uair an chloig anuas.","Tá luas bailithe na dtascanna ceart go leor le %n uair an chloig anuas.","Tá luas bailithe na dtascanna ceart go leor le %n uair an chloig anuas."], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["Tá luas bailithe na dtascanna mall le %n uair an chloig anuas. Thóg sé níos mó ná 4 nóiméad go leor tascanna a bhailiú. Smaoinigh ar oibrí a shocrú chun tascanna a phróiseáil sa chúlra.","Tá luas bailithe na dtascanna mall le %n uair an chloig anuas. Thóg sé níos mó ná 4 nóiméad go leor tascanna a bhailiú. Smaoinigh ar oibrí a shocrú chun tascanna a phróiseáil sa chúlra.","Tá luas bailithe na dtascanna mall le %n uair an chloig anuas. Thóg sé níos mó ná 4 nóiméad go leor tascanna a bhailiú. Smaoinigh ar oibrí a shocrú chun tascanna a phróiseáil sa chúlra.","Tá luas bailithe na dtascanna mall le %n uair an chloig anuas. Thóg sé níos mó ná 4 nóiméad go leor tascanna a bhailiú. Smaoinigh ar oibrí a shocrú chun tascanna a phróiseáil sa chúlra.","Tá luas bailithe na dtascanna mall le %n uair an chloig anuas. Thóg sé níos mó ná 4 nóiméad go leor tascanna a bhailiú. Smaoinigh ar oibrí a shocrú chun tascanna a phróiseáil sa chúlra."], "Temporary space available" : "Spás sealadach ar fáil", @@ -895,9 +894,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "le haghaidh logáil isteach WebAuthn gan phasfhocal, agus stóráil SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Braitheadh leagan PostgreSQL \"%s\". Moltar PostgreSQL >=12 agus <=16 don fheidhmíocht is fearr, don chobhsaíocht agus don fheidhmiúlacht leis an leagan seo de Nextcloud.", "Set default expiration date for shares" : "Socraigh dáta éaga réamhshocraithe le haghaidh scaireanna", - "Failed to remove group \"{group}\"" : "Theip ar an ngrúpa \"{group}\" a bhaint", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Tá tú ar tí an grúpa \"{group}\" a bhaint. NÍ scriosfar na cuntais.", - "Remove group" : "Bain an grúpa", "Your biography" : "Do bheathaisnéis", "You are using <strong>{usage}</strong>" : "Tá tú ag úsáid <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Tá tú ag úsáid<strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/gl.js b/apps/settings/l10n/gl.js index 3b4fed6b877..74038c39895 100644 --- a/apps/settings/l10n/gl.js +++ b/apps/settings/l10n/gl.js @@ -556,6 +556,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Non é posíbel actualizar a configuración predeterminada do perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Activar ou desactivar o perfil predeterminado para as novas contas.", + "Password confirmation is required" : "Requírese a confirmación do contrasinal", "Failed to save setting" : "Produciuse un fallo ao gardar o axuste", "{app}'s declarative setting field: {name}" : "Campo de axuste declarativo de {app}: {name}", "Unable to update server side encryption config" : "Non é posíbel actualizar a configuración de cifrado do servidor", @@ -884,9 +885,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "para acceso sen contrasinal de WebAuthn, e almacenamento SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Detectouse a versión «%s» de PostgreSQL. Suxírese PostgreSQL >=12 e <=16 para un mellor rendemento, estabilidade e funcionalidade con esta versión de Nextcloud.", "Set default expiration date for shares" : "Definir a data de caducidade predeterminada das comparticións", - "Failed to remove group \"{group}\"" : "Produciuse un fallo ao retirar o grupo «{group}»", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Está a piques de retirar o grupo «{group}». As contas NON van ser eliminadas.", - "Remove group" : "Retirar o grupo", "Your biography" : "A súa biografía", "You are using <strong>{usage}</strong>" : "Está a usar <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Está a usar <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/gl.json b/apps/settings/l10n/gl.json index 808d291eecb..bfc2f16171e 100644 --- a/apps/settings/l10n/gl.json +++ b/apps/settings/l10n/gl.json @@ -554,6 +554,7 @@ "Unable to update profile default setting" : "Non é posíbel actualizar a configuración predeterminada do perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Activar ou desactivar o perfil predeterminado para as novas contas.", + "Password confirmation is required" : "Requírese a confirmación do contrasinal", "Failed to save setting" : "Produciuse un fallo ao gardar o axuste", "{app}'s declarative setting field: {name}" : "Campo de axuste declarativo de {app}: {name}", "Unable to update server side encryption config" : "Non é posíbel actualizar a configuración de cifrado do servidor", @@ -882,9 +883,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "para acceso sen contrasinal de WebAuthn, e almacenamento SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Detectouse a versión «%s» de PostgreSQL. Suxírese PostgreSQL >=12 e <=16 para un mellor rendemento, estabilidade e funcionalidade con esta versión de Nextcloud.", "Set default expiration date for shares" : "Definir a data de caducidade predeterminada das comparticións", - "Failed to remove group \"{group}\"" : "Produciuse un fallo ao retirar o grupo «{group}»", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Está a piques de retirar o grupo «{group}». As contas NON van ser eliminadas.", - "Remove group" : "Retirar o grupo", "Your biography" : "A súa biografía", "You are using <strong>{usage}</strong>" : "Está a usar <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Está a usar <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/he.js b/apps/settings/l10n/he.js index f28226ffad1..298c1e232d7 100644 --- a/apps/settings/l10n/he.js +++ b/apps/settings/l10n/he.js @@ -200,6 +200,7 @@ OC.L10N.register( "Show QR code for mobile apps" : "הצגת קוד QR ליישומונים לניידים", "Use system cron service to call the cron.php file every 5 minutes." : "להשתמש בשירות ה־cron של המערכת כדי לקרוא לקובץ cron.php כל 5 דקות.", "Profile" : "פרופיל", + "Password confirmation is required" : "נדרש אימות ססמה", "Server-side encryption" : "הצפנת צד שרת", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "הצפנה בצד השרת מאפשרת להצפין קבצים שנשלחים לשרת. לתכונה זו יש מגבלות כגון ירידה בביצועים, מומלץ להפעיל רק אם יש צורך.", "Enable server-side encryption" : "הפעלת הצפנה בצד שרת", @@ -333,7 +334,6 @@ OC.L10N.register( "Subscribe to our newsletter" : "הרשמה לרשימת הדיוור שלנו", "Use a second factor besides your password to increase security for your account." : "ניתן להשתמש בגורם נוסף מלבד הססמה שלך כדי להגביר את אבטחת החשבון שלך.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "אם משמשים אותך יישומי צד־שלישי להתחברות אל Nextcloud, נא לוודא יצירת והגדרת ססמה ליישומון לכל אחד מהם בטרם הפעלת אימות דו־שלבי.", - "Set default expiration date for shares" : "הגדרת תאריך תפוגה כבררת מחדל לשיתופים", - "Remove group" : "הסרת קבוצה" + "Set default expiration date for shares" : "הגדרת תאריך תפוגה כבררת מחדל לשיתופים" }, "nplurals=3; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: 2;"); diff --git a/apps/settings/l10n/he.json b/apps/settings/l10n/he.json index 2b9fee74beb..596aee779ac 100644 --- a/apps/settings/l10n/he.json +++ b/apps/settings/l10n/he.json @@ -198,6 +198,7 @@ "Show QR code for mobile apps" : "הצגת קוד QR ליישומונים לניידים", "Use system cron service to call the cron.php file every 5 minutes." : "להשתמש בשירות ה־cron של המערכת כדי לקרוא לקובץ cron.php כל 5 דקות.", "Profile" : "פרופיל", + "Password confirmation is required" : "נדרש אימות ססמה", "Server-side encryption" : "הצפנת צד שרת", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "הצפנה בצד השרת מאפשרת להצפין קבצים שנשלחים לשרת. לתכונה זו יש מגבלות כגון ירידה בביצועים, מומלץ להפעיל רק אם יש צורך.", "Enable server-side encryption" : "הפעלת הצפנה בצד שרת", @@ -331,7 +332,6 @@ "Subscribe to our newsletter" : "הרשמה לרשימת הדיוור שלנו", "Use a second factor besides your password to increase security for your account." : "ניתן להשתמש בגורם נוסף מלבד הססמה שלך כדי להגביר את אבטחת החשבון שלך.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "אם משמשים אותך יישומי צד־שלישי להתחברות אל Nextcloud, נא לוודא יצירת והגדרת ססמה ליישומון לכל אחד מהם בטרם הפעלת אימות דו־שלבי.", - "Set default expiration date for shares" : "הגדרת תאריך תפוגה כבררת מחדל לשיתופים", - "Remove group" : "הסרת קבוצה" + "Set default expiration date for shares" : "הגדרת תאריך תפוגה כבררת מחדל לשיתופים" },"pluralForm" :"nplurals=3; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: 2;" }
\ No newline at end of file diff --git a/apps/settings/l10n/hr.js b/apps/settings/l10n/hr.js index 4aad392de2e..de5cf954a77 100644 --- a/apps/settings/l10n/hr.js +++ b/apps/settings/l10n/hr.js @@ -383,7 +383,6 @@ OC.L10N.register( "Use a second factor besides your password to increase security for your account." : "Koristite se i drugim faktorom pored zaporke kako biste povećali sigurnost svog računa.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Ako se za povezivanje s Nextcloudom koristite aplikacijama treće strane, stvorite i konfigurirajte lozinku za svaku aplikaciju prije omogućavanja drugog faktora za provođenje autentifikacije.", "Set default expiration date for shares" : "Postavi zadani datum isteka dijeljenja", - "Remove group" : "Ukloni grupu", "Your biography" : "Vaša biografija" }, "nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;"); diff --git a/apps/settings/l10n/hr.json b/apps/settings/l10n/hr.json index a0425cc0d13..c4930239dc8 100644 --- a/apps/settings/l10n/hr.json +++ b/apps/settings/l10n/hr.json @@ -381,7 +381,6 @@ "Use a second factor besides your password to increase security for your account." : "Koristite se i drugim faktorom pored zaporke kako biste povećali sigurnost svog računa.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Ako se za povezivanje s Nextcloudom koristite aplikacijama treće strane, stvorite i konfigurirajte lozinku za svaku aplikaciju prije omogućavanja drugog faktora za provođenje autentifikacije.", "Set default expiration date for shares" : "Postavi zadani datum isteka dijeljenja", - "Remove group" : "Ukloni grupu", "Your biography" : "Vaša biografija" },"pluralForm" :"nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;" }
\ No newline at end of file diff --git a/apps/settings/l10n/hu.js b/apps/settings/l10n/hu.js index 795100b6626..b7ddd874edb 100644 --- a/apps/settings/l10n/hu.js +++ b/apps/settings/l10n/hu.js @@ -385,6 +385,7 @@ OC.L10N.register( "Cron (Recommended)" : "Cron (ajánlott)", "Unable to update profile default setting" : "A profil alapértelmezett beállítása nem frissíthető", "Profile" : "Profil", + "Password confirmation is required" : "Jelszó megerősítés szükséges", "Unable to update server side encryption config" : "A kiszolgálóoldali titkosítás beállításai nem frissíthetők", "Server-side encryption" : "Kiszolgálóoldali titkosítás", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "A kiszolgálóoldali titkosítás segítségével a tárolt fájlok titkosítva lesznek tárolva a kiszolgálón. Ez korlátozásokkal jár, például teljesítménycsökkenést okoz, így csak akkor kapcsolja be, ha szükséges.", @@ -650,8 +651,6 @@ OC.L10N.register( "Logged in account must be a subadmin" : "A belépett felhasználónak al-adminnak kell lennie", "File locking" : "Fájlzárolás", "Set default expiration date for shares" : "A megosztások alapértelmezett lejárati idejének beállítása", - "Failed to remove group \"{group}\"" : "Nem sikerült a(z) „{group}” csoport törlése", - "Remove group" : "Csoport eltávolítása", "Your biography" : "Az Ön életrajza", "You are using <strong>{usage}</strong>" : "Ezt használja: <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Jelenleg <strong>{usage}</strong>-ot használ ennyiből: <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/hu.json b/apps/settings/l10n/hu.json index 45f09c8d96b..e18c4deff92 100644 --- a/apps/settings/l10n/hu.json +++ b/apps/settings/l10n/hu.json @@ -383,6 +383,7 @@ "Cron (Recommended)" : "Cron (ajánlott)", "Unable to update profile default setting" : "A profil alapértelmezett beállítása nem frissíthető", "Profile" : "Profil", + "Password confirmation is required" : "Jelszó megerősítés szükséges", "Unable to update server side encryption config" : "A kiszolgálóoldali titkosítás beállításai nem frissíthetők", "Server-side encryption" : "Kiszolgálóoldali titkosítás", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "A kiszolgálóoldali titkosítás segítségével a tárolt fájlok titkosítva lesznek tárolva a kiszolgálón. Ez korlátozásokkal jár, például teljesítménycsökkenést okoz, így csak akkor kapcsolja be, ha szükséges.", @@ -648,8 +649,6 @@ "Logged in account must be a subadmin" : "A belépett felhasználónak al-adminnak kell lennie", "File locking" : "Fájlzárolás", "Set default expiration date for shares" : "A megosztások alapértelmezett lejárati idejének beállítása", - "Failed to remove group \"{group}\"" : "Nem sikerült a(z) „{group}” csoport törlése", - "Remove group" : "Csoport eltávolítása", "Your biography" : "Az Ön életrajza", "You are using <strong>{usage}</strong>" : "Ezt használja: <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Jelenleg <strong>{usage}</strong>-ot használ ennyiből: <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/id.js b/apps/settings/l10n/id.js index e560dbab756..33d57471e83 100644 --- a/apps/settings/l10n/id.js +++ b/apps/settings/l10n/id.js @@ -322,7 +322,6 @@ OC.L10N.register( "Check out our blog" : "Cek blog kami", "Subscribe to our newsletter" : "Berlangganan surat berita kami", "This community release of Nextcloud is unsupported and instant notifications are unavailable." : "Rilis komunitas Nextcloud ini tidak didukung dan pemberitahuan instan tidak tersedia.", - "Remove group" : "Hapus grup", "Your biography" : "Biografi Anda" }, "nplurals=1; plural=0;"); diff --git a/apps/settings/l10n/id.json b/apps/settings/l10n/id.json index ea747feb75b..da357f5a569 100644 --- a/apps/settings/l10n/id.json +++ b/apps/settings/l10n/id.json @@ -320,7 +320,6 @@ "Check out our blog" : "Cek blog kami", "Subscribe to our newsletter" : "Berlangganan surat berita kami", "This community release of Nextcloud is unsupported and instant notifications are unavailable." : "Rilis komunitas Nextcloud ini tidak didukung dan pemberitahuan instan tidak tersedia.", - "Remove group" : "Hapus grup", "Your biography" : "Biografi Anda" },"pluralForm" :"nplurals=1; plural=0;" }
\ No newline at end of file diff --git a/apps/settings/l10n/is.js b/apps/settings/l10n/is.js index dd496d7b6e4..44a73887399 100644 --- a/apps/settings/l10n/is.js +++ b/apps/settings/l10n/is.js @@ -399,6 +399,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Tókst ekki að uppfæra sjálfgefna stillingu notandasniðs", "Profile" : "Notandasnið", "Enable or disable profile by default for new accounts." : "Virkja eða gera notandasnið óvirkt sjálfgefið fyrir nýja notendaaðganga.", + "Password confirmation is required" : "Þörf á staðfestingu lykilorðs", "Failed to save setting" : "Mistókst að vista stillingu", "Unable to update server side encryption config" : " Get ekki uppfært uppsetningu fyrir dulritun á þjóni", "Server-side encryption" : "Dulritun á þjóni", @@ -698,9 +699,6 @@ OC.L10N.register( "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Færslulæsing skráa (transactional file locking) er óvirk, þetta gæti leitt til vandamála út frá forgangsskilyrðum (race conditions). Virkjaðu 'filelocking.enabled' í config.php til að forðast slík vandamál.", "The PHP memory limit is below the recommended value of %s." : "Minnismörk PHP eru lægri en gildið sem mælt er með; %s.", "Set default expiration date for shares" : "Setja sjálfgefinn gildistíma fyrir sameignir", - "Failed to remove group \"{group}\"" : "Mistókst að fjarlægja hópinn \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Þú er í þann mund að fara að fjarlægja hópinn \"{group}\". Notendaaðgöngunum verður EKKI eytt.", - "Remove group" : "Fjarlægja hóp", "Your biography" : "Æviágrip þitt", "You are using <strong>{usage}</strong>" : "Þú ert að nota <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Þú ert að nota <strong>{usage}</strong> af <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/is.json b/apps/settings/l10n/is.json index 0801cf4fcee..534c9c2c0b2 100644 --- a/apps/settings/l10n/is.json +++ b/apps/settings/l10n/is.json @@ -397,6 +397,7 @@ "Unable to update profile default setting" : "Tókst ekki að uppfæra sjálfgefna stillingu notandasniðs", "Profile" : "Notandasnið", "Enable or disable profile by default for new accounts." : "Virkja eða gera notandasnið óvirkt sjálfgefið fyrir nýja notendaaðganga.", + "Password confirmation is required" : "Þörf á staðfestingu lykilorðs", "Failed to save setting" : "Mistókst að vista stillingu", "Unable to update server side encryption config" : " Get ekki uppfært uppsetningu fyrir dulritun á þjóni", "Server-side encryption" : "Dulritun á þjóni", @@ -696,9 +697,6 @@ "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Færslulæsing skráa (transactional file locking) er óvirk, þetta gæti leitt til vandamála út frá forgangsskilyrðum (race conditions). Virkjaðu 'filelocking.enabled' í config.php til að forðast slík vandamál.", "The PHP memory limit is below the recommended value of %s." : "Minnismörk PHP eru lægri en gildið sem mælt er með; %s.", "Set default expiration date for shares" : "Setja sjálfgefinn gildistíma fyrir sameignir", - "Failed to remove group \"{group}\"" : "Mistókst að fjarlægja hópinn \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Þú er í þann mund að fara að fjarlægja hópinn \"{group}\". Notendaaðgöngunum verður EKKI eytt.", - "Remove group" : "Fjarlægja hóp", "Your biography" : "Æviágrip þitt", "You are using <strong>{usage}</strong>" : "Þú ert að nota <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Þú ert að nota <strong>{usage}</strong> af <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/it.js b/apps/settings/l10n/it.js index 4ce7be436e5..c1db5c0be0c 100644 --- a/apps/settings/l10n/it.js +++ b/apps/settings/l10n/it.js @@ -447,6 +447,7 @@ OC.L10N.register( "Cron (Recommended)" : "Cron (Consigliato)", "Unable to update profile default setting" : "Impossibile aggiornare l'impostazione predefinita del profilo", "Profile" : "Profilo", + "Password confirmation is required" : "La conferma della password è richiesta", "Unable to update server side encryption config" : "Impossibile aggiornare la configurazione della crittografia lato server", "Server-side encryption" : "Cifratura lato server", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La cifratura lato server rende possibile cifrare i file caricati sul server. Ciò presenta dei limiti, come una riduzione delle prestazioni, perciò abilita questa funzione solo se necessario.", @@ -693,8 +694,6 @@ OC.L10N.register( "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Il blocco di file transazionale è disattivato, ciò potrebbe comportare problemi di race condition. Attiva \"filelocking.enabled\" nel config.php per evitare questi problemi.", "The PHP memory limit is below the recommended value of %s." : "Il limite di memoria di PHP è inferiore al valore consigliato di %s.", "Set default expiration date for shares" : "Imposta data di scadenza predefinita per le condivisioni", - "Failed to remove group \"{group}\"" : "Rimozione del gruppo \"{group}\" fallita", - "Remove group" : "Rimuovi gruppo", "Your biography" : "La tua biografia", "You are using <strong>{usage}</strong>" : "Stai utilizzando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Stai utilizzando <strong>{usage}</strong> di <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/it.json b/apps/settings/l10n/it.json index ae9949f2948..dbe163f0346 100644 --- a/apps/settings/l10n/it.json +++ b/apps/settings/l10n/it.json @@ -445,6 +445,7 @@ "Cron (Recommended)" : "Cron (Consigliato)", "Unable to update profile default setting" : "Impossibile aggiornare l'impostazione predefinita del profilo", "Profile" : "Profilo", + "Password confirmation is required" : "La conferma della password è richiesta", "Unable to update server side encryption config" : "Impossibile aggiornare la configurazione della crittografia lato server", "Server-side encryption" : "Cifratura lato server", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "La cifratura lato server rende possibile cifrare i file caricati sul server. Ciò presenta dei limiti, come una riduzione delle prestazioni, perciò abilita questa funzione solo se necessario.", @@ -691,8 +692,6 @@ "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Il blocco di file transazionale è disattivato, ciò potrebbe comportare problemi di race condition. Attiva \"filelocking.enabled\" nel config.php per evitare questi problemi.", "The PHP memory limit is below the recommended value of %s." : "Il limite di memoria di PHP è inferiore al valore consigliato di %s.", "Set default expiration date for shares" : "Imposta data di scadenza predefinita per le condivisioni", - "Failed to remove group \"{group}\"" : "Rimozione del gruppo \"{group}\" fallita", - "Remove group" : "Rimuovi gruppo", "Your biography" : "La tua biografia", "You are using <strong>{usage}</strong>" : "Stai utilizzando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Stai utilizzando <strong>{usage}</strong> di <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/ja.js b/apps/settings/l10n/ja.js index ca76e256b47..513687841b3 100644 --- a/apps/settings/l10n/ja.js +++ b/apps/settings/l10n/ja.js @@ -562,6 +562,7 @@ OC.L10N.register( "Unable to update profile default setting" : "プロフィールのデフォルト設定を更新できませんでした", "Profile" : "プロフィール", "Enable or disable profile by default for new accounts." : "新しいアカウントの場合、デフォルトでプロフィールを有効または無効にします。", + "Password confirmation is required" : "パスワードの確認が必要です", "Failed to save setting" : "設定の保存に失敗しました", "{app}'s declarative setting field: {name}" : "{app}の宣言的設定フィールド: {name}", "Unable to update server side encryption config" : "サーバー側暗号化の設定を更新できませんでした", @@ -894,9 +895,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "WebAuthn パスワードレスログインと、SFTPストレージ用", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQLのバージョン \"%s\"が検出されました。 このバージョンのNextcloudで最高のパフォーマンス、安定性、機能性を得るには、PostgreSQL >=12および<=16を推奨します。", "Set default expiration date for shares" : "共有のデフォルトの有効期限を設定する", - "Failed to remove group \"{group}\"" : "グループ \"{group}\" の削除に失敗しました", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "グループ \"{group}\" を削除しようとしています。アカウントは削除されません。", - "Remove group" : "グループを削除", "Your biography" : "あなたのプロファイル", "You are using <strong>{usage}</strong>" : "<strong>{usage}</strong>使用中です", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "<strong>{totalSpace}</strong> (<strong>{usageRelative}</strong>) のうち<strong>{usage}</strong>を使用しています", diff --git a/apps/settings/l10n/ja.json b/apps/settings/l10n/ja.json index de134a602e1..eb344496110 100644 --- a/apps/settings/l10n/ja.json +++ b/apps/settings/l10n/ja.json @@ -560,6 +560,7 @@ "Unable to update profile default setting" : "プロフィールのデフォルト設定を更新できませんでした", "Profile" : "プロフィール", "Enable or disable profile by default for new accounts." : "新しいアカウントの場合、デフォルトでプロフィールを有効または無効にします。", + "Password confirmation is required" : "パスワードの確認が必要です", "Failed to save setting" : "設定の保存に失敗しました", "{app}'s declarative setting field: {name}" : "{app}の宣言的設定フィールド: {name}", "Unable to update server side encryption config" : "サーバー側暗号化の設定を更新できませんでした", @@ -892,9 +893,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "WebAuthn パスワードレスログインと、SFTPストレージ用", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQLのバージョン \"%s\"が検出されました。 このバージョンのNextcloudで最高のパフォーマンス、安定性、機能性を得るには、PostgreSQL >=12および<=16を推奨します。", "Set default expiration date for shares" : "共有のデフォルトの有効期限を設定する", - "Failed to remove group \"{group}\"" : "グループ \"{group}\" の削除に失敗しました", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "グループ \"{group}\" を削除しようとしています。アカウントは削除されません。", - "Remove group" : "グループを削除", "Your biography" : "あなたのプロファイル", "You are using <strong>{usage}</strong>" : "<strong>{usage}</strong>使用中です", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "<strong>{totalSpace}</strong> (<strong>{usageRelative}</strong>) のうち<strong>{usage}</strong>を使用しています", diff --git a/apps/settings/l10n/ka.js b/apps/settings/l10n/ka.js index 15f0258a475..0c66cd9d6fd 100644 --- a/apps/settings/l10n/ka.js +++ b/apps/settings/l10n/ka.js @@ -567,8 +567,6 @@ OC.L10N.register( "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems.", "The PHP memory limit is below the recommended value of %s." : "The PHP memory limit is below the recommended value of %s.", "Set default expiration date for shares" : "Set default expiration date for shares", - "Failed to remove group \"{group}\"" : "Failed to remove group \"{group}\"", - "Remove group" : "Remove group", "Your biography" : "Your biography", "You are using <strong>{usage}</strong>" : "You are using <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/ka.json b/apps/settings/l10n/ka.json index c3a33e200c7..dafb5323388 100644 --- a/apps/settings/l10n/ka.json +++ b/apps/settings/l10n/ka.json @@ -565,8 +565,6 @@ "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems.", "The PHP memory limit is below the recommended value of %s." : "The PHP memory limit is below the recommended value of %s.", "Set default expiration date for shares" : "Set default expiration date for shares", - "Failed to remove group \"{group}\"" : "Failed to remove group \"{group}\"", - "Remove group" : "Remove group", "Your biography" : "Your biography", "You are using <strong>{usage}</strong>" : "You are using <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/ka_GE.js b/apps/settings/l10n/ka_GE.js index 2de4c3522a7..03e608f6ff2 100644 --- a/apps/settings/l10n/ka_GE.js +++ b/apps/settings/l10n/ka_GE.js @@ -143,6 +143,7 @@ OC.L10N.register( "Create new app password" : "ახალი აპლიკაციის პაროლის შექმნა", "Login" : "ლოგინი", "Password" : "პაროლი", + "Password confirmation is required" : "საჭიროა პაროლის დამოწმება", "Server-side encryption" : "სერვერული-მხარის შიფრაცია", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "სერვერული-მხარის შიფრაცია იძლევა სერვერზე ატვირთული ფაილების შიფრაციის საშუალებას. ეს ფუნქცია ლიმიტს აწესებს მოქმედებაზე, ასე რომ გააქტიურედ მხოლოდ აუცილებლობისას.", "Enable server-side encryption" : "სერვერული-მხარის შიფრაციის ამოქმედება", diff --git a/apps/settings/l10n/ka_GE.json b/apps/settings/l10n/ka_GE.json index e8ccd67dd94..723779ba198 100644 --- a/apps/settings/l10n/ka_GE.json +++ b/apps/settings/l10n/ka_GE.json @@ -141,6 +141,7 @@ "Create new app password" : "ახალი აპლიკაციის პაროლის შექმნა", "Login" : "ლოგინი", "Password" : "პაროლი", + "Password confirmation is required" : "საჭიროა პაროლის დამოწმება", "Server-side encryption" : "სერვერული-მხარის შიფრაცია", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "სერვერული-მხარის შიფრაცია იძლევა სერვერზე ატვირთული ფაილების შიფრაციის საშუალებას. ეს ფუნქცია ლიმიტს აწესებს მოქმედებაზე, ასე რომ გააქტიურედ მხოლოდ აუცილებლობისას.", "Enable server-side encryption" : "სერვერული-მხარის შიფრაციის ამოქმედება", diff --git a/apps/settings/l10n/ko.js b/apps/settings/l10n/ko.js index 248f352648a..a6c59849d7b 100644 --- a/apps/settings/l10n/ko.js +++ b/apps/settings/l10n/ko.js @@ -467,6 +467,7 @@ OC.L10N.register( "Unable to update profile default setting" : "프로필 기본 설정을 업데이트 할 수 없음", "Profile" : "프로필", "Enable or disable profile by default for new accounts." : "신규 계정에 대한 프로필 기본 사용 여부를 설정하십시오.", + "Password confirmation is required" : "암호 확인이 필요합니다", "Failed to save setting" : "설정 저장 실패", "Unable to update server side encryption config" : "서버 측 암호화 설정을 갱신할 수 없음", "Server-side encryption" : "서버 측 암호화", @@ -730,9 +731,6 @@ OC.L10N.register( "for WebAuthn passwordless login" : ": WebAuthn 무암호 인증을 위해 사용", "for WebAuthn passwordless login, and SFTP storage" : ": WebAuthn 무암호 인증 및 SFTP 저장소를 위해 사용", "Set default expiration date for shares" : "공유에 대한 기본 만료 날짜 설정", - "Failed to remove group \"{group}\"" : "그룹 \"{group}\"을(를) 삭제할 수 없음", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "그룹 \"{group}\"을(를) 지우려고 합니다. 그룹의 계정은 삭제되지 않습니다.", - "Remove group" : "그룹 지우기", "Your biography" : "내 소개문구", "You are using <strong>{usage}</strong>" : "<strong>{usage}</strong>를 사용하고 있습니다.", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "전체 <strong>{totalSpace}</strong> 중 <strong>{usage}</strong>(<strong>{usageRelative}%</strong>)를 사용하고 있습니다." diff --git a/apps/settings/l10n/ko.json b/apps/settings/l10n/ko.json index eea08b5745f..c017e41ad38 100644 --- a/apps/settings/l10n/ko.json +++ b/apps/settings/l10n/ko.json @@ -465,6 +465,7 @@ "Unable to update profile default setting" : "프로필 기본 설정을 업데이트 할 수 없음", "Profile" : "프로필", "Enable or disable profile by default for new accounts." : "신규 계정에 대한 프로필 기본 사용 여부를 설정하십시오.", + "Password confirmation is required" : "암호 확인이 필요합니다", "Failed to save setting" : "설정 저장 실패", "Unable to update server side encryption config" : "서버 측 암호화 설정을 갱신할 수 없음", "Server-side encryption" : "서버 측 암호화", @@ -728,9 +729,6 @@ "for WebAuthn passwordless login" : ": WebAuthn 무암호 인증을 위해 사용", "for WebAuthn passwordless login, and SFTP storage" : ": WebAuthn 무암호 인증 및 SFTP 저장소를 위해 사용", "Set default expiration date for shares" : "공유에 대한 기본 만료 날짜 설정", - "Failed to remove group \"{group}\"" : "그룹 \"{group}\"을(를) 삭제할 수 없음", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "그룹 \"{group}\"을(를) 지우려고 합니다. 그룹의 계정은 삭제되지 않습니다.", - "Remove group" : "그룹 지우기", "Your biography" : "내 소개문구", "You are using <strong>{usage}</strong>" : "<strong>{usage}</strong>를 사용하고 있습니다.", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "전체 <strong>{totalSpace}</strong> 중 <strong>{usage}</strong>(<strong>{usageRelative}%</strong>)를 사용하고 있습니다." diff --git a/apps/settings/l10n/lt_LT.js b/apps/settings/l10n/lt_LT.js index d8be45515be..cf411ff2897 100644 --- a/apps/settings/l10n/lt_LT.js +++ b/apps/settings/l10n/lt_LT.js @@ -257,6 +257,7 @@ OC.L10N.register( "Webcron" : "„Webcron“", "Cron (Recommended)" : "„Cron“ (Rekomenduojama)", "Profile" : "Profilis", + "Password confirmation is required" : "Reikalingas slaptažodžio patvirtinimas", "Failed to save setting" : "Nepavyko įrašyti nustatymo", "Server-side encryption" : "Šifravimas serverio pusėje", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "Šifravimas serverio pusėje leidžia užšifruoti failus, kurie yra įkelti į serverį. Įjungti tik ik būtinais atvejais.", @@ -475,9 +476,6 @@ OC.L10N.register( "Subscribe to our newsletter" : "Prenumeruokite mūsų naujienlaiškį", "Use a second factor besides your password to increase security for your account." : "Be savo slaptažodžio naudokite ir antrąjį faktorių, kad padidintumėte savo paskyros saugumą.", "Set default expiration date for shares" : "Nustatyti viešiniams numatytąją galiojimo pabaigos datą", - "Failed to remove group \"{group}\"" : "Nepavyko pašalinti grupės „{group}“", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Jūs ketinate pašalinti grupę „{group}“. Paskyros NEBUS ištrintos.", - "Remove group" : "Šalinti grupę", "Your biography" : "Jūsų biografija", "You are using <strong>{usage}</strong>" : "Jūs naudojate <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Jūs naudojate <strong>{usage}</strong> iš <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/lt_LT.json b/apps/settings/l10n/lt_LT.json index c3b15550f8a..c0651ac3054 100644 --- a/apps/settings/l10n/lt_LT.json +++ b/apps/settings/l10n/lt_LT.json @@ -255,6 +255,7 @@ "Webcron" : "„Webcron“", "Cron (Recommended)" : "„Cron“ (Rekomenduojama)", "Profile" : "Profilis", + "Password confirmation is required" : "Reikalingas slaptažodžio patvirtinimas", "Failed to save setting" : "Nepavyko įrašyti nustatymo", "Server-side encryption" : "Šifravimas serverio pusėje", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "Šifravimas serverio pusėje leidžia užšifruoti failus, kurie yra įkelti į serverį. Įjungti tik ik būtinais atvejais.", @@ -473,9 +474,6 @@ "Subscribe to our newsletter" : "Prenumeruokite mūsų naujienlaiškį", "Use a second factor besides your password to increase security for your account." : "Be savo slaptažodžio naudokite ir antrąjį faktorių, kad padidintumėte savo paskyros saugumą.", "Set default expiration date for shares" : "Nustatyti viešiniams numatytąją galiojimo pabaigos datą", - "Failed to remove group \"{group}\"" : "Nepavyko pašalinti grupės „{group}“", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Jūs ketinate pašalinti grupę „{group}“. Paskyros NEBUS ištrintos.", - "Remove group" : "Šalinti grupę", "Your biography" : "Jūsų biografija", "You are using <strong>{usage}</strong>" : "Jūs naudojate <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Jūs naudojate <strong>{usage}</strong> iš <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/lv.js b/apps/settings/l10n/lv.js index 7c88dacbbb9..f22d5e9ac96 100644 --- a/apps/settings/l10n/lv.js +++ b/apps/settings/l10n/lv.js @@ -34,7 +34,7 @@ OC.L10N.register( "Invalid account" : "Nederīgs konts", "Invalid mail address" : "Nepareiza e-pasta adrese", "Settings saved" : "Iestatījumi saglabāti", - "Unable to change full name" : "Nav iespējams nomainīt jūsu pilno vārdu", + "Unable to change full name" : "Nevar nomainīt pilno vārdu", "Unable to change email address" : "Nevar mainīt e-pasta adresi", "In order to verify your Website, store the following content in your web-root at '.well-known/CloudIdVerificationCode.txt' (please make sure that the complete text is in one line):" : "Lai apliecinātu savu tīmekļvietni, zemāk esošais saturs ir jāglabā tīmekļvietnes pamatmapē kā `.well-known/CloudIdVerificationCode.txt` (lūgums pārliecināties, ka viss teksts ir vienā rindiņā):", "Your %s account was created" : "Konts %s ir izveidots", @@ -60,7 +60,7 @@ OC.L10N.register( "This server has no working internet connection: Multiple endpoints could not be reached. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. Establish a connection from this server to the internet to enjoy all features." : "Šim serverim nav strādājoša savienojuma ar internetu: vairākus galamērķus nevarēja sasniegt. Tas nozīmē, ka dažas no iespējām, piemēram, ārējas krātuves piemontēšana, paziņojumi par atjauninājumiem vai trešo pušu lietotņu uzstādīšana, nedarbosies. Varētu nedarboties arī attālā piekļūšana datnēm paziņojumu e-pasta ziņojumu nosūtīšana. Šim serverim jānodrošina savienojums ar internetu, lai izmantotu visas iespējas.", "Disabled" : "Atspējots", "PHP does not seem to be setup properly to query system environment variables. The test with getenv(\"PATH\") only returns an empty response." : "PHP nešķiet pareizi uzstādīts lai veiktu sistēmas vides mainīgo vaicājumus. Tests ar getenv(\"PATH\") atgriež tikai tukšu atbildi.", - "The read-only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update." : "Ir iespējots tikai lasāma konfigurācija. Tas neatļauj iestatīt un mainīt dažas konfigurācijas caur tīmekļa interfeisu. Šī datne būs manuāli jāpārveido par rakstāmu, pirms katra atjauninājuma instalēšanas.", + "The read-only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update." : "Ir iespējota tikai lasāma konfigurācija. Tas neatļauj iestatīt atsevišķu konfigurāciju tīmekļa saskarnē. Turklāt šī datne pašrocīgi jāpadara par rakstāmu katram atjauninājumam.", "Your database does not run with \"READ COMMITTED\" transaction isolation level. This can cause problems when multiple actions are executed in parallel." : "Datubāze nedarbojas ar \"READ COMMITED\" transakciju izolācijas līmeni. Tas var radīt sarežģījumus, kad vienlaicīgi tiek veiktas vairākas darbības.", "Nextcloud settings" : "Nextcloud iestatījumi", "Enable" : "Aktivēt", @@ -71,6 +71,7 @@ OC.L10N.register( "Restrict users to only share with users in their groups" : "Ierobežot lietotājiem koplietot tikai ar lietotājiem savās grupās", "Allow public uploads" : "Atļaut publisko augšupielādi", "Enforce password protection" : "Ieviest paroles aizsardzību", + "Set default expiration date for internal shares" : "Iestatīt noklusējuma beigu datumu iekšējiem koplietojumiem", "Enforce expiration date" : "Uzspiest beigu datumu", "Privacy settings for sharing" : "Kopīgošanas privātuma iestatījumi", "Two-Factor Authentication" : "Divpakāpju pieteikšanās", @@ -125,6 +126,7 @@ OC.L10N.register( "Password" : "Parole", "Show QR code for mobile apps" : "Parādīt kvadrātkodu tālruņa lietotnēm", "Profile" : "Profils", + "Password confirmation is required" : "Nepieciešams paroles apstiprinājums", "Server-side encryption" : "Servera šifrēšana", "Enable server-side encryption" : "Ieslēgt servera šifrēšanu", "No encryption module loaded, please enable an encryption module in the app menu." : "Nav ielādēts šifrēšanas moduļis, lūdzu, aktivizējiet šifrēšanas moduli lietotņu izvēlnē.", @@ -134,6 +136,7 @@ OC.L10N.register( "Be aware that encryption always increases the file size." : "Jāapzinās, ka šifrēšanas vienmēr palielina datnes lielumu.", "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Vienmēr ir ieteicams regulāri veidot datu rezerves kopijas, un šifrēšanas gadījumā jāpārliecinās, ka līdz ar datiem rezerves kopijas ir izveidotas arī šifrēšanas atslēgām.", "This is the final warning: Do you really want to enable encryption?" : "Šis ir pēdējais brīdinājums: vai tiešām iespējot šifrēšanu?", + "Failed to delete group \"{group}\"" : "Neizdevās izdzēst kopu \"{group}\"", "Submit" : "Iesniegt", "Rename group" : "Pārdēvēt kopu", "Current password" : "Pašreizējā parole", @@ -141,9 +144,9 @@ OC.L10N.register( "Change password" : "Mainīt paroli", "The file must be a PNG or JPG" : "Datnei jābūt PNG vai JPG", "Unable to update date of birth" : "Nevarēja atjaunināt dzimšanas datumu", - "Enter your date of birth" : "Ievadiet Jūsu dzimšanas datumu", - "You are using {s}{usage}{/s}" : "Jūs izmantojat {s}{usage}{/s}", - "You are using {s}{usage}{/s} of {s}{totalSpace}{/s} ({s}{usageRelative}%{/s})" : "Jūs izmantojat {s}{usage}{/s} no {s}{totalSpace}{/s} ({s}{usageRelative}%{/s})", + "Enter your date of birth" : "Ievadi savu dzimšanas datumu", + "You are using {s}{usage}{/s}" : "Tu izmanto {s}{usage}{/s}", + "You are using {s}{usage}{/s} of {s}{totalSpace}{/s} ({s}{usageRelative}%{/s})" : "Tu izmanto {s}{usage}{/s} no {s}{totalSpace}{/s} ({s}{usageRelative}%{/s})", "You are a member of the following groups:" : "Tu esi zemāk uzskaitīto kopu dalībnieks:", "This address is not confirmed" : "Šī adrese nav apstiprināta", "Primary email for password reset and notifications" : "Primārā e-pasta adrese paroles atjaunošanai un paziņojumiem", @@ -153,10 +156,10 @@ OC.L10N.register( "Locales" : "Lokalizācijas", "Week starts on {firstDayOfWeek}" : "Nedēļa sākas {firstDayOfWeek}", "No locale set" : "Lokalizācija nav iestatīta", - "Your phone number" : "Jūsu tālruņa numurs", - "Edit your Profile visibility" : "Labot Jūsu profila redzamību", - "Your role" : "Jūsu loma", - "Your website" : "Jūsu mājaslapa", + "Your phone number" : "Tavs tālruņa numurs", + "Edit your Profile visibility" : "Labot sava profila redzamību", + "Your role" : "Tava loma", + "Your website" : "Tava tīmekļvietne", "Add" : "Pievienot", "Create" : "Izveidot", "Change" : "Mainīt", @@ -182,6 +185,7 @@ OC.L10N.register( "Visibility" : "Redzamība", "Show last login" : "Rādīt pēdējo autorizāciju", "Send email" : "Nosūtīt e-pasta ziņojumu", + "Send welcome email to new accounts" : "Nosūtīt sasveicināšanās e-pasta ziņojumu jauniem lietotājiem", "Default quota" : "Apjoms pēc noklusējuma", "Admins" : "Pārvaldītāji", "Sending…" : "Sūta …", @@ -224,9 +228,8 @@ OC.L10N.register( "Developed by the {communityopen}Nextcloud community{linkclose}, the {githubopen}source code{linkclose} is licensed under the {licenseopen}AGPL{linkclose}." : "Izstrādātās {communityopen}Nextcloud kopiena {linkclose}, {githubopen} avota kods {linkclose} licencēts saskaņā ar {licenseopen}AGPL{linkclose}.", "Use a second factor besides your password to increase security for your account." : "Vēl viena apliecināšanas līdzekļa izmantošana papildus parolei, lai palielinātu sava konta drošību.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Ja izmanto trešo pušu lietotnes, lai savienotos ar Nextcloud, lūgums ņemt vērā, ka pirms divpakāpju pieteikšanās iespējošanas katrai no tām ir nepieciešams izveidot un izmantot lietotnes paroli.", - "Remove group" : "Noņemt grupu", - "Your biography" : "Jūsu biogrāfija", - "You are using <strong>{usage}</strong>" : "Jūs izmantojat <strong>{usage}</strong>", - "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Jūs izmantojat <strong>{usage}</strong> no <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" + "Your biography" : "Apraksts par sevi", + "You are using <strong>{usage}</strong>" : "Tu izmanto <strong>{usage}</strong>", + "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Tu izmanto <strong>{usage}</strong> no <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" }, "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"); diff --git a/apps/settings/l10n/lv.json b/apps/settings/l10n/lv.json index 956a7648b15..5c87992b05b 100644 --- a/apps/settings/l10n/lv.json +++ b/apps/settings/l10n/lv.json @@ -32,7 +32,7 @@ "Invalid account" : "Nederīgs konts", "Invalid mail address" : "Nepareiza e-pasta adrese", "Settings saved" : "Iestatījumi saglabāti", - "Unable to change full name" : "Nav iespējams nomainīt jūsu pilno vārdu", + "Unable to change full name" : "Nevar nomainīt pilno vārdu", "Unable to change email address" : "Nevar mainīt e-pasta adresi", "In order to verify your Website, store the following content in your web-root at '.well-known/CloudIdVerificationCode.txt' (please make sure that the complete text is in one line):" : "Lai apliecinātu savu tīmekļvietni, zemāk esošais saturs ir jāglabā tīmekļvietnes pamatmapē kā `.well-known/CloudIdVerificationCode.txt` (lūgums pārliecināties, ka viss teksts ir vienā rindiņā):", "Your %s account was created" : "Konts %s ir izveidots", @@ -58,7 +58,7 @@ "This server has no working internet connection: Multiple endpoints could not be reached. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. Establish a connection from this server to the internet to enjoy all features." : "Šim serverim nav strādājoša savienojuma ar internetu: vairākus galamērķus nevarēja sasniegt. Tas nozīmē, ka dažas no iespējām, piemēram, ārējas krātuves piemontēšana, paziņojumi par atjauninājumiem vai trešo pušu lietotņu uzstādīšana, nedarbosies. Varētu nedarboties arī attālā piekļūšana datnēm paziņojumu e-pasta ziņojumu nosūtīšana. Šim serverim jānodrošina savienojums ar internetu, lai izmantotu visas iespējas.", "Disabled" : "Atspējots", "PHP does not seem to be setup properly to query system environment variables. The test with getenv(\"PATH\") only returns an empty response." : "PHP nešķiet pareizi uzstādīts lai veiktu sistēmas vides mainīgo vaicājumus. Tests ar getenv(\"PATH\") atgriež tikai tukšu atbildi.", - "The read-only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update." : "Ir iespējots tikai lasāma konfigurācija. Tas neatļauj iestatīt un mainīt dažas konfigurācijas caur tīmekļa interfeisu. Šī datne būs manuāli jāpārveido par rakstāmu, pirms katra atjauninājuma instalēšanas.", + "The read-only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update." : "Ir iespējota tikai lasāma konfigurācija. Tas neatļauj iestatīt atsevišķu konfigurāciju tīmekļa saskarnē. Turklāt šī datne pašrocīgi jāpadara par rakstāmu katram atjauninājumam.", "Your database does not run with \"READ COMMITTED\" transaction isolation level. This can cause problems when multiple actions are executed in parallel." : "Datubāze nedarbojas ar \"READ COMMITED\" transakciju izolācijas līmeni. Tas var radīt sarežģījumus, kad vienlaicīgi tiek veiktas vairākas darbības.", "Nextcloud settings" : "Nextcloud iestatījumi", "Enable" : "Aktivēt", @@ -69,6 +69,7 @@ "Restrict users to only share with users in their groups" : "Ierobežot lietotājiem koplietot tikai ar lietotājiem savās grupās", "Allow public uploads" : "Atļaut publisko augšupielādi", "Enforce password protection" : "Ieviest paroles aizsardzību", + "Set default expiration date for internal shares" : "Iestatīt noklusējuma beigu datumu iekšējiem koplietojumiem", "Enforce expiration date" : "Uzspiest beigu datumu", "Privacy settings for sharing" : "Kopīgošanas privātuma iestatījumi", "Two-Factor Authentication" : "Divpakāpju pieteikšanās", @@ -123,6 +124,7 @@ "Password" : "Parole", "Show QR code for mobile apps" : "Parādīt kvadrātkodu tālruņa lietotnēm", "Profile" : "Profils", + "Password confirmation is required" : "Nepieciešams paroles apstiprinājums", "Server-side encryption" : "Servera šifrēšana", "Enable server-side encryption" : "Ieslēgt servera šifrēšanu", "No encryption module loaded, please enable an encryption module in the app menu." : "Nav ielādēts šifrēšanas moduļis, lūdzu, aktivizējiet šifrēšanas moduli lietotņu izvēlnē.", @@ -132,6 +134,7 @@ "Be aware that encryption always increases the file size." : "Jāapzinās, ka šifrēšanas vienmēr palielina datnes lielumu.", "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Vienmēr ir ieteicams regulāri veidot datu rezerves kopijas, un šifrēšanas gadījumā jāpārliecinās, ka līdz ar datiem rezerves kopijas ir izveidotas arī šifrēšanas atslēgām.", "This is the final warning: Do you really want to enable encryption?" : "Šis ir pēdējais brīdinājums: vai tiešām iespējot šifrēšanu?", + "Failed to delete group \"{group}\"" : "Neizdevās izdzēst kopu \"{group}\"", "Submit" : "Iesniegt", "Rename group" : "Pārdēvēt kopu", "Current password" : "Pašreizējā parole", @@ -139,9 +142,9 @@ "Change password" : "Mainīt paroli", "The file must be a PNG or JPG" : "Datnei jābūt PNG vai JPG", "Unable to update date of birth" : "Nevarēja atjaunināt dzimšanas datumu", - "Enter your date of birth" : "Ievadiet Jūsu dzimšanas datumu", - "You are using {s}{usage}{/s}" : "Jūs izmantojat {s}{usage}{/s}", - "You are using {s}{usage}{/s} of {s}{totalSpace}{/s} ({s}{usageRelative}%{/s})" : "Jūs izmantojat {s}{usage}{/s} no {s}{totalSpace}{/s} ({s}{usageRelative}%{/s})", + "Enter your date of birth" : "Ievadi savu dzimšanas datumu", + "You are using {s}{usage}{/s}" : "Tu izmanto {s}{usage}{/s}", + "You are using {s}{usage}{/s} of {s}{totalSpace}{/s} ({s}{usageRelative}%{/s})" : "Tu izmanto {s}{usage}{/s} no {s}{totalSpace}{/s} ({s}{usageRelative}%{/s})", "You are a member of the following groups:" : "Tu esi zemāk uzskaitīto kopu dalībnieks:", "This address is not confirmed" : "Šī adrese nav apstiprināta", "Primary email for password reset and notifications" : "Primārā e-pasta adrese paroles atjaunošanai un paziņojumiem", @@ -151,10 +154,10 @@ "Locales" : "Lokalizācijas", "Week starts on {firstDayOfWeek}" : "Nedēļa sākas {firstDayOfWeek}", "No locale set" : "Lokalizācija nav iestatīta", - "Your phone number" : "Jūsu tālruņa numurs", - "Edit your Profile visibility" : "Labot Jūsu profila redzamību", - "Your role" : "Jūsu loma", - "Your website" : "Jūsu mājaslapa", + "Your phone number" : "Tavs tālruņa numurs", + "Edit your Profile visibility" : "Labot sava profila redzamību", + "Your role" : "Tava loma", + "Your website" : "Tava tīmekļvietne", "Add" : "Pievienot", "Create" : "Izveidot", "Change" : "Mainīt", @@ -180,6 +183,7 @@ "Visibility" : "Redzamība", "Show last login" : "Rādīt pēdējo autorizāciju", "Send email" : "Nosūtīt e-pasta ziņojumu", + "Send welcome email to new accounts" : "Nosūtīt sasveicināšanās e-pasta ziņojumu jauniem lietotājiem", "Default quota" : "Apjoms pēc noklusējuma", "Admins" : "Pārvaldītāji", "Sending…" : "Sūta …", @@ -222,9 +226,8 @@ "Developed by the {communityopen}Nextcloud community{linkclose}, the {githubopen}source code{linkclose} is licensed under the {licenseopen}AGPL{linkclose}." : "Izstrādātās {communityopen}Nextcloud kopiena {linkclose}, {githubopen} avota kods {linkclose} licencēts saskaņā ar {licenseopen}AGPL{linkclose}.", "Use a second factor besides your password to increase security for your account." : "Vēl viena apliecināšanas līdzekļa izmantošana papildus parolei, lai palielinātu sava konta drošību.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Ja izmanto trešo pušu lietotnes, lai savienotos ar Nextcloud, lūgums ņemt vērā, ka pirms divpakāpju pieteikšanās iespējošanas katrai no tām ir nepieciešams izveidot un izmantot lietotnes paroli.", - "Remove group" : "Noņemt grupu", - "Your biography" : "Jūsu biogrāfija", - "You are using <strong>{usage}</strong>" : "Jūs izmantojat <strong>{usage}</strong>", - "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Jūs izmantojat <strong>{usage}</strong> no <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" + "Your biography" : "Apraksts par sevi", + "You are using <strong>{usage}</strong>" : "Tu izmanto <strong>{usage}</strong>", + "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Tu izmanto <strong>{usage}</strong> no <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" },"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);" }
\ No newline at end of file diff --git a/apps/settings/l10n/mk.js b/apps/settings/l10n/mk.js index 46be5124340..bb21a77250c 100644 --- a/apps/settings/l10n/mk.js +++ b/apps/settings/l10n/mk.js @@ -457,7 +457,6 @@ OC.L10N.register( "Use a second factor besides your password to increase security for your account." : "Користете втор фактор и покрај вашата лозинка за да ја зголемите безбедноста на вашата сметка.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Доколку користите друга апликација за поврзување на Nextcloud, осигурајте се дека имате креирано лозинка за секоја апликација пред да овозможите втор фактор.", "Set default expiration date for shares" : "Постави основен рок на траење за споделувањата", - "Remove group" : "Отстрани група", "Your biography" : "Ваша биографија", "You are using <strong>{usage}</strong>" : "Користите <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Користите <strong>{usage}</strong> од <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/mk.json b/apps/settings/l10n/mk.json index 87220fe8137..8dc960d2b30 100644 --- a/apps/settings/l10n/mk.json +++ b/apps/settings/l10n/mk.json @@ -455,7 +455,6 @@ "Use a second factor besides your password to increase security for your account." : "Користете втор фактор и покрај вашата лозинка за да ја зголемите безбедноста на вашата сметка.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Доколку користите друга апликација за поврзување на Nextcloud, осигурајте се дека имате креирано лозинка за секоја апликација пред да овозможите втор фактор.", "Set default expiration date for shares" : "Постави основен рок на траење за споделувањата", - "Remove group" : "Отстрани група", "Your biography" : "Ваша биографија", "You are using <strong>{usage}</strong>" : "Користите <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Користите <strong>{usage}</strong> од <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/nb.js b/apps/settings/l10n/nb.js index eaf3ca4ea6f..eeb6c9e37ac 100644 --- a/apps/settings/l10n/nb.js +++ b/apps/settings/l10n/nb.js @@ -509,6 +509,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Kan ikke oppdatere profilens standardinnstilling", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Aktiver eller deaktiver profil som standard for nye kontoer.", + "Password confirmation is required" : "Passord bekreftelse er nødvendig", "Failed to save setting" : "Lagring av innstilling feilet", "{app}'s declarative setting field: {name}" : "{app}s deklarative innstillingsfelt: {name}", "Unable to update server side encryption config" : "Kan ikke oppdatere konfigurasjonen av server-side-kryptering", @@ -823,9 +824,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "for WebAuthn-passordfripålogging og SFTP-lagring", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL-versjon \"%s\" oppdaget. PostgreSQL >=12 og <=16 foreslås for best ytelse, stabilitet og funksjonalitet med denne versjonen av Nextcloud.", "Set default expiration date for shares" : "Angi standard utløpsdato for delinger", - "Failed to remove group \"{group}\"" : "Fjerning av gruppe \"{group}\" feilet", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Du er i ferd med å fjerne gruppen \"{group}\". Kontoene vil IKKE bli slettet.", - "Remove group" : "Fjern gruppe", "Your biography" : "Din biografi", "You are using <strong>{usage}</strong>" : "Du bruker <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Du bruker <strong>{usage}</strong> av <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/nb.json b/apps/settings/l10n/nb.json index c8a2ed433ed..7a55894aded 100644 --- a/apps/settings/l10n/nb.json +++ b/apps/settings/l10n/nb.json @@ -507,6 +507,7 @@ "Unable to update profile default setting" : "Kan ikke oppdatere profilens standardinnstilling", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Aktiver eller deaktiver profil som standard for nye kontoer.", + "Password confirmation is required" : "Passord bekreftelse er nødvendig", "Failed to save setting" : "Lagring av innstilling feilet", "{app}'s declarative setting field: {name}" : "{app}s deklarative innstillingsfelt: {name}", "Unable to update server side encryption config" : "Kan ikke oppdatere konfigurasjonen av server-side-kryptering", @@ -821,9 +822,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "for WebAuthn-passordfripålogging og SFTP-lagring", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL-versjon \"%s\" oppdaget. PostgreSQL >=12 og <=16 foreslås for best ytelse, stabilitet og funksjonalitet med denne versjonen av Nextcloud.", "Set default expiration date for shares" : "Angi standard utløpsdato for delinger", - "Failed to remove group \"{group}\"" : "Fjerning av gruppe \"{group}\" feilet", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Du er i ferd med å fjerne gruppen \"{group}\". Kontoene vil IKKE bli slettet.", - "Remove group" : "Fjern gruppe", "Your biography" : "Din biografi", "You are using <strong>{usage}</strong>" : "Du bruker <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Du bruker <strong>{usage}</strong> av <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/nl.js b/apps/settings/l10n/nl.js index 95ec2f2517b..fa192c83ba9 100644 --- a/apps/settings/l10n/nl.js +++ b/apps/settings/l10n/nl.js @@ -353,6 +353,7 @@ OC.L10N.register( "AJAX" : "AJAX", "Webcron" : "Webcron", "Profile" : "Profiel", + "Password confirmation is required" : "Wachtwoordbevestiging vereist", "Server-side encryption" : "Server-side versleuteling", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "Server-side versleuteling maakt het mogelijk om bestanden te versleutelen die worden geüploaded. Dit betekent wel enig prestatieverlies, dus schakel het alleen in als het nodig is.", "Enable server-side encryption" : "Server-side versleuteling inschakelen", @@ -634,7 +635,6 @@ OC.L10N.register( "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Als u toepassingen van derden gebruikt om met Nextcloud te verbinden, zorg er dan voor om voor elke app een wachtwoord te maken en te configureren voordat \"tweede factor authenticatie\" wordt geactiveerd.", "Logged in account must be a subadmin" : "Aangemeld account moet een subadmin zijn", "Set default expiration date for shares" : "Instellen standaard vervaldatum voor deellinks", - "Remove group" : "Groep verwijderen", "Your biography" : "Jouw biografie", "You are using <strong>{usage}</strong>" : "Je gebruikt <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Je gebruikt <strong>{usage}</strong> van <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/nl.json b/apps/settings/l10n/nl.json index 2a13fa81c0f..e1e5d2fdc3f 100644 --- a/apps/settings/l10n/nl.json +++ b/apps/settings/l10n/nl.json @@ -351,6 +351,7 @@ "AJAX" : "AJAX", "Webcron" : "Webcron", "Profile" : "Profiel", + "Password confirmation is required" : "Wachtwoordbevestiging vereist", "Server-side encryption" : "Server-side versleuteling", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "Server-side versleuteling maakt het mogelijk om bestanden te versleutelen die worden geüploaded. Dit betekent wel enig prestatieverlies, dus schakel het alleen in als het nodig is.", "Enable server-side encryption" : "Server-side versleuteling inschakelen", @@ -632,7 +633,6 @@ "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Als u toepassingen van derden gebruikt om met Nextcloud te verbinden, zorg er dan voor om voor elke app een wachtwoord te maken en te configureren voordat \"tweede factor authenticatie\" wordt geactiveerd.", "Logged in account must be a subadmin" : "Aangemeld account moet een subadmin zijn", "Set default expiration date for shares" : "Instellen standaard vervaldatum voor deellinks", - "Remove group" : "Groep verwijderen", "Your biography" : "Jouw biografie", "You are using <strong>{usage}</strong>" : "Je gebruikt <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Je gebruikt <strong>{usage}</strong> van <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/oc.js b/apps/settings/l10n/oc.js index 479a1d3e4fd..083d8703887 100644 --- a/apps/settings/l10n/oc.js +++ b/apps/settings/l10n/oc.js @@ -222,7 +222,6 @@ OC.L10N.register( "Check out our blog" : "Donar un còp d’uèlh a nòstre blòg", "Subscribe to our newsletter" : "S’abonar a l’infoletra", "Set default expiration date for shares" : "Definir una data d’expiracion per defaut pels partatges", - "Remove group" : "Suprimir lo grop", "Your biography" : "Vòstra biografia" }, "nplurals=2; plural=(n > 1);"); diff --git a/apps/settings/l10n/oc.json b/apps/settings/l10n/oc.json index 9e47fbb30d6..665d476d0a1 100644 --- a/apps/settings/l10n/oc.json +++ b/apps/settings/l10n/oc.json @@ -220,7 +220,6 @@ "Check out our blog" : "Donar un còp d’uèlh a nòstre blòg", "Subscribe to our newsletter" : "S’abonar a l’infoletra", "Set default expiration date for shares" : "Definir una data d’expiracion per defaut pels partatges", - "Remove group" : "Suprimir lo grop", "Your biography" : "Vòstra biografia" },"pluralForm" :"nplurals=2; plural=(n > 1);" }
\ No newline at end of file diff --git a/apps/settings/l10n/pl.js b/apps/settings/l10n/pl.js index f9c1efa5bb9..81751a36bd0 100644 --- a/apps/settings/l10n/pl.js +++ b/apps/settings/l10n/pl.js @@ -455,6 +455,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Nie można zaktualizować domyślnych ustawień profilu", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Włącz lub wyłącz profil domyślnie dla nowych kont.", + "Password confirmation is required" : "Wymagane jest potwierdzenie hasła", "Failed to save setting" : "Nie udało się zapisać ustawienia", "{app}'s declarative setting field: {name}" : "Pole ustawień deklaratywnych aplikacji {app}: {name}", "Unable to update server side encryption config" : "Nie można zaktualizować konfiguracji szyfrowania po stronie serwera", @@ -759,8 +760,6 @@ OC.L10N.register( "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Blokowanie plików transakcyjnych jest wyłączone, może to prowadzić do problemów z przepustowością. Włącz \"filelocking.enabled\" w config.php, aby uniknąć tych problemów.", "The PHP memory limit is below the recommended value of %s." : "Limit pamięci PHP jest poniżej zalecanej wartości %s", "Set default expiration date for shares" : "Ustaw domyślną datę ważności udostępnień", - "Failed to remove group \"{group}\"" : "Nie udało się usunąć grupy \"{group}\"", - "Remove group" : "Usuń grupę", "Your biography" : "Twoja biografia", "You are using <strong>{usage}</strong>" : "Używasz <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Używasz <strong>{usage}</strong> z <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/pl.json b/apps/settings/l10n/pl.json index 03e50d6234d..975d96f7654 100644 --- a/apps/settings/l10n/pl.json +++ b/apps/settings/l10n/pl.json @@ -453,6 +453,7 @@ "Unable to update profile default setting" : "Nie można zaktualizować domyślnych ustawień profilu", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Włącz lub wyłącz profil domyślnie dla nowych kont.", + "Password confirmation is required" : "Wymagane jest potwierdzenie hasła", "Failed to save setting" : "Nie udało się zapisać ustawienia", "{app}'s declarative setting field: {name}" : "Pole ustawień deklaratywnych aplikacji {app}: {name}", "Unable to update server side encryption config" : "Nie można zaktualizować konfiguracji szyfrowania po stronie serwera", @@ -757,8 +758,6 @@ "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Blokowanie plików transakcyjnych jest wyłączone, może to prowadzić do problemów z przepustowością. Włącz \"filelocking.enabled\" w config.php, aby uniknąć tych problemów.", "The PHP memory limit is below the recommended value of %s." : "Limit pamięci PHP jest poniżej zalecanej wartości %s", "Set default expiration date for shares" : "Ustaw domyślną datę ważności udostępnień", - "Failed to remove group \"{group}\"" : "Nie udało się usunąć grupy \"{group}\"", - "Remove group" : "Usuń grupę", "Your biography" : "Twoja biografia", "You are using <strong>{usage}</strong>" : "Używasz <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Używasz <strong>{usage}</strong> z <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/pt_BR.js b/apps/settings/l10n/pt_BR.js index ca63da31573..a8ff04cce27 100644 --- a/apps/settings/l10n/pt_BR.js +++ b/apps/settings/l10n/pt_BR.js @@ -426,7 +426,7 @@ OC.L10N.register( "Actions" : "Ações", "Results from other categories" : "Resultados de outras categorias", "No apps found for your version" : "Nenhum aplicativo encontrado para a sua versão", - "_%n app has an update available_::_%n apps have an update available_" : ["%n aplicativo tem atualização disponível","%n aplicativos tem atualização disponível","%n aplicativos tem atualização disponível"], + "_%n app has an update available_::_%n apps have an update available_" : ["%n aplicativo tem atualização disponível","%n de aplicativos tem atualização disponível","%n aplicativos tem atualização disponível"], "_Update_::_Update all_" : ["Atualizar","Atualizar todos","Atualizar todos"], "Failed to load groups" : "Falha ao carregar grupos", "Failed to create group" : "Falha ao criar grupo", @@ -561,6 +561,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Não foi possível atualizar a configuração padrão do perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Ativar ou desativar o perfil por padrão para novas contas.", + "Password confirmation is required" : "A confirmação da senha é necessária", "Failed to save setting" : "Falha ao salvar a configuração", "{app}'s declarative setting field: {name}" : "Campo de configuração declarativa de {app}: {name}", "Unable to update server side encryption config" : "Não foi possível atualizar a configuração de criptografia do lado do servidor", @@ -583,9 +584,12 @@ OC.L10N.register( "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "É sempre bom criar backups regulares dos seus dados. No caso de criptografia, certifique-se de fazer backup das chaves de criptografia juntamente com os seus dados.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Consulte a documentação do administrador para saber como criptografar manualmente também os arquivos existentes.", "This is the final warning: Do you really want to enable encryption?" : "Este é o aviso final: Você realmente quer ativar a criptografia?", + "Failed to delete group \"{group}\"" : "Falha ao excluir grupo \"{group}\"", "Please confirm the group removal" : "Por favor confirme a remoção do grupo", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "Você está prestes a excluir o grupo \"{group}\". As contas NÃO serão excluídas.", "Submit" : "Enviar", "Rename group" : "Renomear grupo", + "Delete group" : "Excluir grupo", "Current password" : "Senha atual", "New password" : "Nova senha", "Change password" : "Alterar senha", @@ -692,8 +696,8 @@ OC.L10N.register( "Language" : "Idioma", "Set default language" : "Definir idioma padrão", "Add new account" : "Adicionar nova conta", - "_{userCount} account …_::_{userCount} accounts …_" : ["{userCount} conta …","{userCount} contas …","{userCount} contas …"], - "_{userCount} account_::_{userCount} accounts_" : ["{userCount} conta","{userCount} contas","{userCount} contas"], + "_{userCount} account …_::_{userCount} accounts …_" : ["{userCount} conta …","{userCount} de contas …","{userCount} contas …"], + "_{userCount} account_::_{userCount} accounts_" : ["{userCount} conta","{userCount} de contas","{userCount} contas"], "Total rows summary" : "Resumo do total de linhas", "Scroll to load more rows" : "Role para carregar mais linhas", "Password or insufficient permissions message" : "Mensagem de senha ou permissões insuficientes", @@ -893,9 +897,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "para login sem senha via WebAuthn e armazenamento SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Versão do PostgreSQL \"%s\" detectada. PostgreSQL >=12 e <=16 é sugerido para melhor desempenho, estabilidade e funcionalidade com esta versão do Nextcloud.", "Set default expiration date for shares" : "Definir data de validade padrão para compartilhamentos", - "Failed to remove group \"{group}\"" : "Falha ao remover o grupo \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Você está prestes a remover o grupo \"{group}\". As contas NÃO serão excluídas.", - "Remove group" : "Excluir grupo", "Your biography" : "Sua biografia", "You are using <strong>{usage}</strong>" : "Você está usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Você está usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/pt_BR.json b/apps/settings/l10n/pt_BR.json index 39b2457137f..66db502eec3 100644 --- a/apps/settings/l10n/pt_BR.json +++ b/apps/settings/l10n/pt_BR.json @@ -424,7 +424,7 @@ "Actions" : "Ações", "Results from other categories" : "Resultados de outras categorias", "No apps found for your version" : "Nenhum aplicativo encontrado para a sua versão", - "_%n app has an update available_::_%n apps have an update available_" : ["%n aplicativo tem atualização disponível","%n aplicativos tem atualização disponível","%n aplicativos tem atualização disponível"], + "_%n app has an update available_::_%n apps have an update available_" : ["%n aplicativo tem atualização disponível","%n de aplicativos tem atualização disponível","%n aplicativos tem atualização disponível"], "_Update_::_Update all_" : ["Atualizar","Atualizar todos","Atualizar todos"], "Failed to load groups" : "Falha ao carregar grupos", "Failed to create group" : "Falha ao criar grupo", @@ -559,6 +559,7 @@ "Unable to update profile default setting" : "Não foi possível atualizar a configuração padrão do perfil", "Profile" : "Perfil", "Enable or disable profile by default for new accounts." : "Ativar ou desativar o perfil por padrão para novas contas.", + "Password confirmation is required" : "A confirmação da senha é necessária", "Failed to save setting" : "Falha ao salvar a configuração", "{app}'s declarative setting field: {name}" : "Campo de configuração declarativa de {app}: {name}", "Unable to update server side encryption config" : "Não foi possível atualizar a configuração de criptografia do lado do servidor", @@ -581,9 +582,12 @@ "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "É sempre bom criar backups regulares dos seus dados. No caso de criptografia, certifique-se de fazer backup das chaves de criptografia juntamente com os seus dados.", "Refer to the admin documentation on how to manually also encrypt existing files." : "Consulte a documentação do administrador para saber como criptografar manualmente também os arquivos existentes.", "This is the final warning: Do you really want to enable encryption?" : "Este é o aviso final: Você realmente quer ativar a criptografia?", + "Failed to delete group \"{group}\"" : "Falha ao excluir grupo \"{group}\"", "Please confirm the group removal" : "Por favor confirme a remoção do grupo", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "Você está prestes a excluir o grupo \"{group}\". As contas NÃO serão excluídas.", "Submit" : "Enviar", "Rename group" : "Renomear grupo", + "Delete group" : "Excluir grupo", "Current password" : "Senha atual", "New password" : "Nova senha", "Change password" : "Alterar senha", @@ -690,8 +694,8 @@ "Language" : "Idioma", "Set default language" : "Definir idioma padrão", "Add new account" : "Adicionar nova conta", - "_{userCount} account …_::_{userCount} accounts …_" : ["{userCount} conta …","{userCount} contas …","{userCount} contas …"], - "_{userCount} account_::_{userCount} accounts_" : ["{userCount} conta","{userCount} contas","{userCount} contas"], + "_{userCount} account …_::_{userCount} accounts …_" : ["{userCount} conta …","{userCount} de contas …","{userCount} contas …"], + "_{userCount} account_::_{userCount} accounts_" : ["{userCount} conta","{userCount} de contas","{userCount} contas"], "Total rows summary" : "Resumo do total de linhas", "Scroll to load more rows" : "Role para carregar mais linhas", "Password or insufficient permissions message" : "Mensagem de senha ou permissões insuficientes", @@ -891,9 +895,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "para login sem senha via WebAuthn e armazenamento SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Versão do PostgreSQL \"%s\" detectada. PostgreSQL >=12 e <=16 é sugerido para melhor desempenho, estabilidade e funcionalidade com esta versão do Nextcloud.", "Set default expiration date for shares" : "Definir data de validade padrão para compartilhamentos", - "Failed to remove group \"{group}\"" : "Falha ao remover o grupo \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Você está prestes a remover o grupo \"{group}\". As contas NÃO serão excluídas.", - "Remove group" : "Excluir grupo", "Your biography" : "Sua biografia", "You are using <strong>{usage}</strong>" : "Você está usando <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Você está usando <strong>{usage}</strong> de <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/pt_PT.js b/apps/settings/l10n/pt_PT.js index 89adb5c5e84..c0124eb9dda 100644 --- a/apps/settings/l10n/pt_PT.js +++ b/apps/settings/l10n/pt_PT.js @@ -179,6 +179,7 @@ OC.L10N.register( "Login" : "Iniciar Sessão", "Password" : "Palavra-passe", "Profile" : "Perfil", + "Password confirmation is required" : "Confirmação de senha necessária", "Server-side encryption" : "Atualizar App", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "A cifra do lado do servidor possibilita cifrar os ficheiros que serão enviados para este servidor. Isto implica um impacto no desempenho e só deverá ser ativo quando necessário.", "Enable server-side encryption" : "Ativar encriptação do lado do servidor", diff --git a/apps/settings/l10n/pt_PT.json b/apps/settings/l10n/pt_PT.json index 8cef2649872..13559db25fd 100644 --- a/apps/settings/l10n/pt_PT.json +++ b/apps/settings/l10n/pt_PT.json @@ -177,6 +177,7 @@ "Login" : "Iniciar Sessão", "Password" : "Palavra-passe", "Profile" : "Perfil", + "Password confirmation is required" : "Confirmação de senha necessária", "Server-side encryption" : "Atualizar App", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "A cifra do lado do servidor possibilita cifrar os ficheiros que serão enviados para este servidor. Isto implica um impacto no desempenho e só deverá ser ativo quando necessário.", "Enable server-side encryption" : "Ativar encriptação do lado do servidor", diff --git a/apps/settings/l10n/ro.js b/apps/settings/l10n/ro.js index e89abeba11e..0357adbac64 100644 --- a/apps/settings/l10n/ro.js +++ b/apps/settings/l10n/ro.js @@ -183,6 +183,7 @@ OC.L10N.register( "Create new app password" : "Crează o nouă parolă pentru aplicație", "Login" : "Autentificare", "Password" : "Parolă", + "Password confirmation is required" : "Confirmarea parolei este necesară", "Server-side encryption" : "Criptare la nivel de server", "Enable server-side encryption" : "Activează criptarea pe server", "Select default encryption module:" : "Selectează modulul implicit de criptare:", @@ -263,7 +264,6 @@ OC.L10N.register( "Save" : "Salvează", "Security & setup warnings" : "Alerte de securitate & configurare", "All checks passed." : "Toate verificările s-au terminat fără erori.", - "This community release of Nextcloud is unsupported and instant notifications are unavailable." : "Această versiune comunitară a Nextcloud nu este suportată, iar notificările instantanee nu sunt disponibile.", - "Remove group" : "Înlătură grupul" + "This community release of Nextcloud is unsupported and instant notifications are unavailable." : "Această versiune comunitară a Nextcloud nu este suportată, iar notificările instantanee nu sunt disponibile." }, "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"); diff --git a/apps/settings/l10n/ro.json b/apps/settings/l10n/ro.json index 916173d9eb7..04560361dbc 100644 --- a/apps/settings/l10n/ro.json +++ b/apps/settings/l10n/ro.json @@ -181,6 +181,7 @@ "Create new app password" : "Crează o nouă parolă pentru aplicație", "Login" : "Autentificare", "Password" : "Parolă", + "Password confirmation is required" : "Confirmarea parolei este necesară", "Server-side encryption" : "Criptare la nivel de server", "Enable server-side encryption" : "Activează criptarea pe server", "Select default encryption module:" : "Selectează modulul implicit de criptare:", @@ -261,7 +262,6 @@ "Save" : "Salvează", "Security & setup warnings" : "Alerte de securitate & configurare", "All checks passed." : "Toate verificările s-au terminat fără erori.", - "This community release of Nextcloud is unsupported and instant notifications are unavailable." : "Această versiune comunitară a Nextcloud nu este suportată, iar notificările instantanee nu sunt disponibile.", - "Remove group" : "Înlătură grupul" + "This community release of Nextcloud is unsupported and instant notifications are unavailable." : "Această versiune comunitară a Nextcloud nu este suportată, iar notificările instantanee nu sunt disponibile." },"pluralForm" :"nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));" }
\ No newline at end of file diff --git a/apps/settings/l10n/ru.js b/apps/settings/l10n/ru.js index b2eca3eccc6..6d52776f80b 100644 --- a/apps/settings/l10n/ru.js +++ b/apps/settings/l10n/ru.js @@ -561,6 +561,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Не удалось обновить состояние использования профилей по умолчанию", "Profile" : "Профиль", "Enable or disable profile by default for new accounts." : "Включите или отключите профиль по умолчанию для новых учетных записей.", + "Password confirmation is required" : "Требуется подтверждение пароля", "Failed to save setting" : "Не удалось сохранить параметры", "{app}'s declarative setting field: {name}" : "{app} поле декларативной настройки: {name}", "Unable to update server side encryption config" : "Не удалось обновить параметры шифрования на стороне сервера", @@ -893,9 +894,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "для входа в систему без пароля WebAuthn и хранения данных по протоколу SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Обнаружена версия PostgreSQL \"%s\". Для лучшей производительности, стабильности и функциональности с этой версией Nextcloud рекомендуется использовать PostgreSQL >=12 и <=16.", "Set default expiration date for shares" : "Установить срок действия общего доступа по умолчанию", - "Failed to remove group \"{group}\"" : "Не удалось удалить группу \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Группа «{group}» будет удалена. Это действие НЕ ПРИВОДИТ к удалению учётных записей, входящих в эту группу.", - "Remove group" : "Удалить группу", "Your biography" : "Ваша биография", "You are using <strong>{usage}</strong>" : "Вы используете <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Вы используете <strong>{usage}</strong> из <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/ru.json b/apps/settings/l10n/ru.json index c0e11d7e111..c44c2c68b59 100644 --- a/apps/settings/l10n/ru.json +++ b/apps/settings/l10n/ru.json @@ -559,6 +559,7 @@ "Unable to update profile default setting" : "Не удалось обновить состояние использования профилей по умолчанию", "Profile" : "Профиль", "Enable or disable profile by default for new accounts." : "Включите или отключите профиль по умолчанию для новых учетных записей.", + "Password confirmation is required" : "Требуется подтверждение пароля", "Failed to save setting" : "Не удалось сохранить параметры", "{app}'s declarative setting field: {name}" : "{app} поле декларативной настройки: {name}", "Unable to update server side encryption config" : "Не удалось обновить параметры шифрования на стороне сервера", @@ -891,9 +892,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "для входа в систему без пароля WebAuthn и хранения данных по протоколу SFTP", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Обнаружена версия PostgreSQL \"%s\". Для лучшей производительности, стабильности и функциональности с этой версией Nextcloud рекомендуется использовать PostgreSQL >=12 и <=16.", "Set default expiration date for shares" : "Установить срок действия общего доступа по умолчанию", - "Failed to remove group \"{group}\"" : "Не удалось удалить группу \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Группа «{group}» будет удалена. Это действие НЕ ПРИВОДИТ к удалению учётных записей, входящих в эту группу.", - "Remove group" : "Удалить группу", "Your biography" : "Ваша биография", "You are using <strong>{usage}</strong>" : "Вы используете <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Вы используете <strong>{usage}</strong> из <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/sc.js b/apps/settings/l10n/sc.js index 2f4b0acc312..d7a8345f3ae 100644 --- a/apps/settings/l10n/sc.js +++ b/apps/settings/l10n/sc.js @@ -376,7 +376,6 @@ OC.L10N.register( "Use a second factor besides your password to increase security for your account." : "Imprea unu segundu fatore a parte sa crae tua pro crèschere sa seguresa de su contu tuo.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Si impreas aplicatziones de sa de tres partes pro ti connètere a Nextcloud, assegura•ti de creare e cunfigurare una crae pro cada aplicatzione antis de ativare su segundu fatore de autenticatzione.", "Set default expiration date for shares" : "Cunfigura sa data de iscadèntzia predefinida pro is cumpartziduras", - "Remove group" : "Boga·nche grupu", "Your biography" : "Sa biografia tua" }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/settings/l10n/sc.json b/apps/settings/l10n/sc.json index cd1f2135485..f1ec7c6b3ab 100644 --- a/apps/settings/l10n/sc.json +++ b/apps/settings/l10n/sc.json @@ -374,7 +374,6 @@ "Use a second factor besides your password to increase security for your account." : "Imprea unu segundu fatore a parte sa crae tua pro crèschere sa seguresa de su contu tuo.", "If you use third party applications to connect to Nextcloud, please make sure to create and configure an app password for each before enabling second factor authentication." : "Si impreas aplicatziones de sa de tres partes pro ti connètere a Nextcloud, assegura•ti de creare e cunfigurare una crae pro cada aplicatzione antis de ativare su segundu fatore de autenticatzione.", "Set default expiration date for shares" : "Cunfigura sa data de iscadèntzia predefinida pro is cumpartziduras", - "Remove group" : "Boga·nche grupu", "Your biography" : "Sa biografia tua" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/settings/l10n/sk.js b/apps/settings/l10n/sk.js index 4a2842742a3..758bf38f889 100644 --- a/apps/settings/l10n/sk.js +++ b/apps/settings/l10n/sk.js @@ -560,6 +560,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Nie je možné aktualizovať predvolené nastavenie profilu", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Predvolene povoliť alebo zakázať profil pre nové účty.", + "Password confirmation is required" : "Vyžaduje sa overenie heslom", "Failed to save setting" : "Nepodarilo sa uložiť nastavenie", "{app}'s declarative setting field: {name}" : "Pole deklaratívneho nastavenia aplikácie {app}: {name}", "Unable to update server side encryption config" : "Nedá sa aktualizovať konfigurácia šifrovania na strane servera", @@ -891,9 +892,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "pre prihlásenie bez hesla WebAuthn a SFTP úložisko", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Bola zistená verzia \"%s\" PostgreSQL. Odporúča sa PostgreSQL >=12 a <=16 pre najlepší výkon, stabilitu a funkčnosť s touto verziou Nextcloud.", "Set default expiration date for shares" : "Nastaviť predvolený dátum expirácie pre sprístupnenia", - "Failed to remove group \"{group}\"" : "Nepodarilo sa odstrániť skupinu \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Chystáte sa odstrániť skupinu \"{group}\". Používatelia NEBUDÚ vymazaní.", - "Remove group" : "Odstrániť skupinu", "Your biography" : "Váš životopis", "You are using <strong>{usage}</strong>" : "Využívate <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Využívate <strong>{usage}</strong> z <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/sk.json b/apps/settings/l10n/sk.json index 626261f679e..264fcc0dc03 100644 --- a/apps/settings/l10n/sk.json +++ b/apps/settings/l10n/sk.json @@ -558,6 +558,7 @@ "Unable to update profile default setting" : "Nie je možné aktualizovať predvolené nastavenie profilu", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Predvolene povoliť alebo zakázať profil pre nové účty.", + "Password confirmation is required" : "Vyžaduje sa overenie heslom", "Failed to save setting" : "Nepodarilo sa uložiť nastavenie", "{app}'s declarative setting field: {name}" : "Pole deklaratívneho nastavenia aplikácie {app}: {name}", "Unable to update server side encryption config" : "Nedá sa aktualizovať konfigurácia šifrovania na strane servera", @@ -889,9 +890,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "pre prihlásenie bez hesla WebAuthn a SFTP úložisko", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Bola zistená verzia \"%s\" PostgreSQL. Odporúča sa PostgreSQL >=12 a <=16 pre najlepší výkon, stabilitu a funkčnosť s touto verziou Nextcloud.", "Set default expiration date for shares" : "Nastaviť predvolený dátum expirácie pre sprístupnenia", - "Failed to remove group \"{group}\"" : "Nepodarilo sa odstrániť skupinu \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Chystáte sa odstrániť skupinu \"{group}\". Používatelia NEBUDÚ vymazaní.", - "Remove group" : "Odstrániť skupinu", "Your biography" : "Váš životopis", "You are using <strong>{usage}</strong>" : "Využívate <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Využívate <strong>{usage}</strong> z <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/sl.js b/apps/settings/l10n/sl.js index 32c81a28088..5dd4503fa4f 100644 --- a/apps/settings/l10n/sl.js +++ b/apps/settings/l10n/sl.js @@ -692,9 +692,6 @@ OC.L10N.register( "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Zaklepanje datotek je onemogočeno, kar lahko privede do različnih težav. V izogib zapletom je priporočljivo omogočiti možnost »filelocking.enabled« v datoteki config.php.", "The PHP memory limit is below the recommended value of %s." : "Omejitev pomnilnika PHP je pod priporočeno mejo %s.", "Set default expiration date for shares" : "Nastavi privzeti datuma poteka za mesta souporabe", - "Failed to remove group \"{group}\"" : "Odstranjevanje skupine »{group}« je spodlotelo", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Odstranili boste skupino »{group}«. Računi ne bodo izbrisani.", - "Remove group" : "Odstrani skupino", "Your biography" : "Biografija", "You are using <strong>{usage}</strong>" : "Uporabljate <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Uporabljate <strong>{usage}</strong> od <strong>{totalSpace}</strong> (<strong>{usageRelative} %</strong>)" diff --git a/apps/settings/l10n/sl.json b/apps/settings/l10n/sl.json index 56c1e44043f..1b8237ec98d 100644 --- a/apps/settings/l10n/sl.json +++ b/apps/settings/l10n/sl.json @@ -690,9 +690,6 @@ "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Zaklepanje datotek je onemogočeno, kar lahko privede do različnih težav. V izogib zapletom je priporočljivo omogočiti možnost »filelocking.enabled« v datoteki config.php.", "The PHP memory limit is below the recommended value of %s." : "Omejitev pomnilnika PHP je pod priporočeno mejo %s.", "Set default expiration date for shares" : "Nastavi privzeti datuma poteka za mesta souporabe", - "Failed to remove group \"{group}\"" : "Odstranjevanje skupine »{group}« je spodlotelo", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Odstranili boste skupino »{group}«. Računi ne bodo izbrisani.", - "Remove group" : "Odstrani skupino", "Your biography" : "Biografija", "You are using <strong>{usage}</strong>" : "Uporabljate <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Uporabljate <strong>{usage}</strong> od <strong>{totalSpace}</strong> (<strong>{usageRelative} %</strong>)" diff --git a/apps/settings/l10n/sq.js b/apps/settings/l10n/sq.js index ebc632dffa0..51619af59c0 100644 --- a/apps/settings/l10n/sq.js +++ b/apps/settings/l10n/sq.js @@ -135,6 +135,7 @@ OC.L10N.register( "Create new app password" : "Krijoni fjalëkalim aplikacioni të ri", "Login" : "Hyrje", "Password" : "Fjalëkalim", + "Password confirmation is required" : "Kërkohet konfirmimi i fjalëkalimit", "Server-side encryption" : "Fshehtëzim më anë shërbyesi", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "Enkriptimi nga ana e serverit bën të mundur enkriptimin e skedarëve të ngarkuar në këtë server. Kjo vjen me kufizime si një ndëshkim për performancën, prandaj e lejoni këtë vetëm nëse është e nevojshme.", "Enable server-side encryption" : "Aktivizo fshehtëzim më anë të shërbyesit", @@ -217,7 +218,6 @@ OC.L10N.register( "Developed by the {communityopen}Nextcloud community{linkclose}, the {githubopen}source code{linkclose} is licensed under the {licenseopen}AGPL{linkclose}." : "Zhvilluar nga {communityopen}komuniteti Nextcloud {linkclose}, {githubopen}kodi i hapur{linkclose} iështë licensuar sipar {licenseopen}AGPL{linkclose}.", "Like our Facebook page" : "Pëlqeni faqen tonë në Facebook", "Check out our blog" : "Shikoni blogun tonë", - "Subscribe to our newsletter" : "Abonohu në gazeten tonë", - "Remove group" : "Hiq grupin" + "Subscribe to our newsletter" : "Abonohu në gazeten tonë" }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/settings/l10n/sq.json b/apps/settings/l10n/sq.json index cb3c836cee4..544389daab3 100644 --- a/apps/settings/l10n/sq.json +++ b/apps/settings/l10n/sq.json @@ -133,6 +133,7 @@ "Create new app password" : "Krijoni fjalëkalim aplikacioni të ri", "Login" : "Hyrje", "Password" : "Fjalëkalim", + "Password confirmation is required" : "Kërkohet konfirmimi i fjalëkalimit", "Server-side encryption" : "Fshehtëzim më anë shërbyesi", "Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed." : "Enkriptimi nga ana e serverit bën të mundur enkriptimin e skedarëve të ngarkuar në këtë server. Kjo vjen me kufizime si një ndëshkim për performancën, prandaj e lejoni këtë vetëm nëse është e nevojshme.", "Enable server-side encryption" : "Aktivizo fshehtëzim më anë të shërbyesit", @@ -215,7 +216,6 @@ "Developed by the {communityopen}Nextcloud community{linkclose}, the {githubopen}source code{linkclose} is licensed under the {licenseopen}AGPL{linkclose}." : "Zhvilluar nga {communityopen}komuniteti Nextcloud {linkclose}, {githubopen}kodi i hapur{linkclose} iështë licensuar sipar {licenseopen}AGPL{linkclose}.", "Like our Facebook page" : "Pëlqeni faqen tonë në Facebook", "Check out our blog" : "Shikoni blogun tonë", - "Subscribe to our newsletter" : "Abonohu në gazeten tonë", - "Remove group" : "Hiq grupin" + "Subscribe to our newsletter" : "Abonohu në gazeten tonë" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/settings/l10n/sr.js b/apps/settings/l10n/sr.js index 7742c17c877..0af1825bde1 100644 --- a/apps/settings/l10n/sr.js +++ b/apps/settings/l10n/sr.js @@ -561,6 +561,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Подразумевано подешавање профила не може да се ажурира", "Profile" : "Профил", "Enable or disable profile by default for new accounts." : "Профил нових налога се подразумевано укључује или искључује.", + "Password confirmation is required" : "Потребна је потврда лозинке", "Failed to save setting" : "Није успело чување подешавања", "{app}'s declarative setting field: {name}" : "поље декларативног подешавања апликације {app}: {name}", "Unable to update server side encryption config" : "Конфигурација енкрипције на страни сервера не може да се ажурира", @@ -893,9 +894,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "за WebAuthn пријаву без лозинке и за SFTP складиште", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Детектована је PostgreSQL верзија „%s”. За најбоље перформансе, стабилност и функционалност са овом Nextcloud верзијом, препоручује се PostgreSQL >=12 и <=16.", "Set default expiration date for shares" : "Постави подразумевано време истека дељења", - "Failed to remove group \"{group}\"" : "Није успело уклањање групе „{group}”", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Управо ћете уклонити групу „{group}”. Налози се НЕЋЕ обрисати.", - "Remove group" : "Уклони групу", "Your biography" : "Ваша биографија", "You are using <strong>{usage}</strong>" : "Користите <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Користите <strong>{usage}</strong> од <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/sr.json b/apps/settings/l10n/sr.json index 0beae9d14b5..147c4964243 100644 --- a/apps/settings/l10n/sr.json +++ b/apps/settings/l10n/sr.json @@ -559,6 +559,7 @@ "Unable to update profile default setting" : "Подразумевано подешавање профила не може да се ажурира", "Profile" : "Профил", "Enable or disable profile by default for new accounts." : "Профил нових налога се подразумевано укључује или искључује.", + "Password confirmation is required" : "Потребна је потврда лозинке", "Failed to save setting" : "Није успело чување подешавања", "{app}'s declarative setting field: {name}" : "поље декларативног подешавања апликације {app}: {name}", "Unable to update server side encryption config" : "Конфигурација енкрипције на страни сервера не може да се ажурира", @@ -891,9 +892,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "за WebAuthn пријаву без лозинке и за SFTP складиште", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "Детектована је PostgreSQL верзија „%s”. За најбоље перформансе, стабилност и функционалност са овом Nextcloud верзијом, препоручује се PostgreSQL >=12 и <=16.", "Set default expiration date for shares" : "Постави подразумевано време истека дељења", - "Failed to remove group \"{group}\"" : "Није успело уклањање групе „{group}”", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Управо ћете уклонити групу „{group}”. Налози се НЕЋЕ обрисати.", - "Remove group" : "Уклони групу", "Your biography" : "Ваша биографија", "You are using <strong>{usage}</strong>" : "Користите <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Користите <strong>{usage}</strong> од <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/sv.js b/apps/settings/l10n/sv.js index 337d0472113..3fa5b1f24d3 100644 --- a/apps/settings/l10n/sv.js +++ b/apps/settings/l10n/sv.js @@ -404,6 +404,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Det gick inte att uppdatera profilens standardinställning", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Aktivera eller inaktivera profil som standard för nya konton.", + "Password confirmation is required" : "Lösenordsbekräftelse krävs", "Failed to save setting" : "Kunde inte spara inställning", "Unable to update server side encryption config" : "Kunde inte uppdatera serversidans krypteringskonfiguration", "Server-side encryption" : "Serverkryptering", @@ -711,9 +712,6 @@ OC.L10N.register( "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Transaktionsbaserad fillåsning är inaktiverad, detta kan leda till problem med konflikter. Aktivera \"filelocking.enabled\" i config.php för att undvika dessa problem.", "The PHP memory limit is below the recommended value of %s." : "Minnesgränsen för PHP är under det rekommenderade värdet på %s.", "Set default expiration date for shares" : "Ställ in standardutgångsdatum för delningar", - "Failed to remove group \"{group}\"" : "Det gick inte att ta bort gruppen \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Du håller på att ta bort gruppen \"{group}\". Kontona kommer INTE att raderas.", - "Remove group" : "Ta bort grupp", "Your biography" : "Din biografi", "You are using <strong>{usage}</strong>" : "Du använder <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Du använder <strong>{usage}</strong> av <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/sv.json b/apps/settings/l10n/sv.json index bd4ce2eead0..7cffffd15f0 100644 --- a/apps/settings/l10n/sv.json +++ b/apps/settings/l10n/sv.json @@ -402,6 +402,7 @@ "Unable to update profile default setting" : "Det gick inte att uppdatera profilens standardinställning", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Aktivera eller inaktivera profil som standard för nya konton.", + "Password confirmation is required" : "Lösenordsbekräftelse krävs", "Failed to save setting" : "Kunde inte spara inställning", "Unable to update server side encryption config" : "Kunde inte uppdatera serversidans krypteringskonfiguration", "Server-side encryption" : "Serverkryptering", @@ -709,9 +710,6 @@ "Transactional file locking is disabled, this might lead to issues with race conditions. Enable \"filelocking.enabled\" in config.php to avoid these problems." : "Transaktionsbaserad fillåsning är inaktiverad, detta kan leda till problem med konflikter. Aktivera \"filelocking.enabled\" i config.php för att undvika dessa problem.", "The PHP memory limit is below the recommended value of %s." : "Minnesgränsen för PHP är under det rekommenderade värdet på %s.", "Set default expiration date for shares" : "Ställ in standardutgångsdatum för delningar", - "Failed to remove group \"{group}\"" : "Det gick inte att ta bort gruppen \"{group}\"", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "Du håller på att ta bort gruppen \"{group}\". Kontona kommer INTE att raderas.", - "Remove group" : "Ta bort grupp", "Your biography" : "Din biografi", "You are using <strong>{usage}</strong>" : "Du använder <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Du använder <strong>{usage}</strong> av <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/th.js b/apps/settings/l10n/th.js index 9ffa5dc31d4..b923d57537c 100644 --- a/apps/settings/l10n/th.js +++ b/apps/settings/l10n/th.js @@ -272,7 +272,6 @@ OC.L10N.register( "Check the security of your Nextcloud over <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"%s\">our security scan ↗</a>." : "ตรวจสอบความปลอดภัยของ Nextcloud ของคุณผ่าน<a target=\"_blank\" rel=\"noreferrer noopener\" href=\"%s\">การสแกนความปลอดภัยของเรา ↗</a>", "Reasons to use Nextcloud in your organization" : "เหตุผลที่ควรใช้ Nextcloud ในองค์กรของคุณ", "This community release of Nextcloud is unsupported and instant notifications are unavailable." : "รุ่นที่ออกโดยชุมชนของ Nextcloud นี้ไม่ได้รับการสนับสนุน และไม่สามารถใช้งานการแจ้งเตือนทันทีได้", - "Set default expiration date for shares" : "ตั้งวันหมดอายุค่าเริ่มต้นสำหรับการแชร์", - "Remove group" : "ลบกลุ่ม" + "Set default expiration date for shares" : "ตั้งวันหมดอายุค่าเริ่มต้นสำหรับการแชร์" }, "nplurals=1; plural=0;"); diff --git a/apps/settings/l10n/th.json b/apps/settings/l10n/th.json index b674c01d9fb..f20c0a8bcfc 100644 --- a/apps/settings/l10n/th.json +++ b/apps/settings/l10n/th.json @@ -270,7 +270,6 @@ "Check the security of your Nextcloud over <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"%s\">our security scan ↗</a>." : "ตรวจสอบความปลอดภัยของ Nextcloud ของคุณผ่าน<a target=\"_blank\" rel=\"noreferrer noopener\" href=\"%s\">การสแกนความปลอดภัยของเรา ↗</a>", "Reasons to use Nextcloud in your organization" : "เหตุผลที่ควรใช้ Nextcloud ในองค์กรของคุณ", "This community release of Nextcloud is unsupported and instant notifications are unavailable." : "รุ่นที่ออกโดยชุมชนของ Nextcloud นี้ไม่ได้รับการสนับสนุน และไม่สามารถใช้งานการแจ้งเตือนทันทีได้", - "Set default expiration date for shares" : "ตั้งวันหมดอายุค่าเริ่มต้นสำหรับการแชร์", - "Remove group" : "ลบกลุ่ม" + "Set default expiration date for shares" : "ตั้งวันหมดอายุค่าเริ่มต้นสำหรับการแชร์" },"pluralForm" :"nplurals=1; plural=0;" }
\ No newline at end of file diff --git a/apps/settings/l10n/tr.js b/apps/settings/l10n/tr.js index a80aa179f37..f1308a79a80 100644 --- a/apps/settings/l10n/tr.js +++ b/apps/settings/l10n/tr.js @@ -561,6 +561,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Profil varsayılan ayarı güncellenemedi", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Bu seçenek kullanıma alındığında, profil yeni hesaplar için varsayılan olur.", + "Password confirmation is required" : "Parola onayının yazılması zorunludur", "Failed to save setting" : "Ayar kaydedilemedi", "{app}'s declarative setting field: {name}" : "{app} uygulamasının bildirdiği ayar alanı: {name}", "Unable to update server side encryption config" : "Sunucu tarafı şifreleme yapılandırması güncellenemedi", @@ -893,9 +894,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "WebAuthn parolasız oturum açma ve SFTP depolama alanı için", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL \"%s\" sürümü bulundu. Bu Nextcloud sürümüyle en iyi başarım, kararlılık ve işlevsellik sağlamak için PostgreSQL sürümünün 12 ile 16 arasında olması önerilir.", "Set default expiration date for shares" : "Paylaşımlar için varsayılan geçerlilik süresi sonu ayarlansın", - "Failed to remove group \"{group}\"" : "\"{group}\" grubu silinemedi", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "\"{group}\" grubunu silmek üzeresiniz. Hesaplar SİLİNMEYECEK.", - "Remove group" : "Grubu sil", "Your biography" : "Özgeçmişiniz", "You are using <strong>{usage}</strong>" : "<strong>{usage}</strong> kullanıyorsunuz", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "<strong>{usage}</strong> / <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>) kullanıyorsunuz", diff --git a/apps/settings/l10n/tr.json b/apps/settings/l10n/tr.json index 8f0f248ca9d..740c010553e 100644 --- a/apps/settings/l10n/tr.json +++ b/apps/settings/l10n/tr.json @@ -559,6 +559,7 @@ "Unable to update profile default setting" : "Profil varsayılan ayarı güncellenemedi", "Profile" : "Profil", "Enable or disable profile by default for new accounts." : "Bu seçenek kullanıma alındığında, profil yeni hesaplar için varsayılan olur.", + "Password confirmation is required" : "Parola onayının yazılması zorunludur", "Failed to save setting" : "Ayar kaydedilemedi", "{app}'s declarative setting field: {name}" : "{app} uygulamasının bildirdiği ayar alanı: {name}", "Unable to update server side encryption config" : "Sunucu tarafı şifreleme yapılandırması güncellenemedi", @@ -891,9 +892,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "WebAuthn parolasız oturum açma ve SFTP depolama alanı için", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL \"%s\" sürümü bulundu. Bu Nextcloud sürümüyle en iyi başarım, kararlılık ve işlevsellik sağlamak için PostgreSQL sürümünün 12 ile 16 arasında olması önerilir.", "Set default expiration date for shares" : "Paylaşımlar için varsayılan geçerlilik süresi sonu ayarlansın", - "Failed to remove group \"{group}\"" : "\"{group}\" grubu silinemedi", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "\"{group}\" grubunu silmek üzeresiniz. Hesaplar SİLİNMEYECEK.", - "Remove group" : "Grubu sil", "Your biography" : "Özgeçmişiniz", "You are using <strong>{usage}</strong>" : "<strong>{usage}</strong> kullanıyorsunuz", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "<strong>{usage}</strong> / <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>) kullanıyorsunuz", diff --git a/apps/settings/l10n/ug.js b/apps/settings/l10n/ug.js index c85b852747a..e5150d0e730 100644 --- a/apps/settings/l10n/ug.js +++ b/apps/settings/l10n/ug.js @@ -813,9 +813,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "WebAuthn پارولسىز كىرىش ۋە SFTP ساقلاش ئۈچۈن", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL نەشرى \"% s\" بايقالدى. PostgreSQL> = 12 ۋە <= 16 Nextcloud نىڭ بۇ نەشرى بىلەن ئەڭ ياخشى ئىقتىدار ، مۇقىملىق ۋە ئىقتىدار ئۈچۈن تەۋسىيە قىلىنىدۇ.", "Set default expiration date for shares" : "پاي چېكىنىڭ سۈكۈتتىكى مۇددىتىنى بەلگىلەڭ", - "Failed to remove group \"{group}\"" : "«{group}» گۇرۇپپىسىنى ئۆچۈرەلمىدى", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "سىز «{group}» گۇرۇپپىسىنى ئۆچۈرمەكچى بولۇۋاتىسىز. ھېساباتلار ئۆچۈرۈلمەيدۇ.", - "Remove group" : "گۇرۇپپىنى ئۆچۈرۈڭ", "Your biography" : "تەرجىمىھالىڭىز", "You are using <strong>{usage}</strong>" : "سىز <strong> {usage} </strong> نى ئىشلىتىۋاتىسىز", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "سىز <strong> {usage} </strong> نىڭ <strong> {totalSpace} </strong> نى ئىشلىتىۋاتىسىز (<strong> {usageRelative}% </strong>)" diff --git a/apps/settings/l10n/ug.json b/apps/settings/l10n/ug.json index a1469885f2e..f773c4b3d6e 100644 --- a/apps/settings/l10n/ug.json +++ b/apps/settings/l10n/ug.json @@ -811,9 +811,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "WebAuthn پارولسىز كىرىش ۋە SFTP ساقلاش ئۈچۈن", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "PostgreSQL نەشرى \"% s\" بايقالدى. PostgreSQL> = 12 ۋە <= 16 Nextcloud نىڭ بۇ نەشرى بىلەن ئەڭ ياخشى ئىقتىدار ، مۇقىملىق ۋە ئىقتىدار ئۈچۈن تەۋسىيە قىلىنىدۇ.", "Set default expiration date for shares" : "پاي چېكىنىڭ سۈكۈتتىكى مۇددىتىنى بەلگىلەڭ", - "Failed to remove group \"{group}\"" : "«{group}» گۇرۇپپىسىنى ئۆچۈرەلمىدى", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "سىز «{group}» گۇرۇپپىسىنى ئۆچۈرمەكچى بولۇۋاتىسىز. ھېساباتلار ئۆچۈرۈلمەيدۇ.", - "Remove group" : "گۇرۇپپىنى ئۆچۈرۈڭ", "Your biography" : "تەرجىمىھالىڭىز", "You are using <strong>{usage}</strong>" : "سىز <strong> {usage} </strong> نى ئىشلىتىۋاتىسىز", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "سىز <strong> {usage} </strong> نىڭ <strong> {totalSpace} </strong> نى ئىشلىتىۋاتىسىز (<strong> {usageRelative}% </strong>)" diff --git a/apps/settings/l10n/uk.js b/apps/settings/l10n/uk.js index 25bfa4918a9..398369ee18d 100644 --- a/apps/settings/l10n/uk.js +++ b/apps/settings/l10n/uk.js @@ -457,6 +457,7 @@ OC.L10N.register( "Unable to update profile default setting" : "Не вдалося оновити стандартні налаштування профілю", "Profile" : "Профіль", "Enable or disable profile by default for new accounts." : "Увімкнути або вимкнути стандартний профіль для нових акаунтів.", + "Password confirmation is required" : "Необхідне підтвердження паролем", "Failed to save setting" : "Не вдалося зберегти налаштування", "Unable to update server side encryption config" : "Не вдалося оновити конфігурацію шифрування на стороні сервера", "Server-side encryption" : "Шифрування на сервері", @@ -758,8 +759,6 @@ OC.L10N.register( "for WebAuthn passwordless login" : "для безпарольного входу за допомогою WebAuthn", "for WebAuthn passwordless login, and SFTP storage" : "для безпарольного входу за допомогою WebAuthn та сховище SFTP", "Set default expiration date for shares" : "Встановити типовий термін дії для спільних ресурсів", - "Failed to remove group \"{group}\"" : "Не вдалося вилучити групу \"{group}\"", - "Remove group" : "Вилучити групу", "Your biography" : "Коротко про себе", "You are using <strong>{usage}</strong>" : "Ви використовуєте <strong>{usage}", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Ви використовуєте <strong>{usage}</strong> із <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/uk.json b/apps/settings/l10n/uk.json index 75b352aabce..03d59910e56 100644 --- a/apps/settings/l10n/uk.json +++ b/apps/settings/l10n/uk.json @@ -455,6 +455,7 @@ "Unable to update profile default setting" : "Не вдалося оновити стандартні налаштування профілю", "Profile" : "Профіль", "Enable or disable profile by default for new accounts." : "Увімкнути або вимкнути стандартний профіль для нових акаунтів.", + "Password confirmation is required" : "Необхідне підтвердження паролем", "Failed to save setting" : "Не вдалося зберегти налаштування", "Unable to update server side encryption config" : "Не вдалося оновити конфігурацію шифрування на стороні сервера", "Server-side encryption" : "Шифрування на сервері", @@ -756,8 +757,6 @@ "for WebAuthn passwordless login" : "для безпарольного входу за допомогою WebAuthn", "for WebAuthn passwordless login, and SFTP storage" : "для безпарольного входу за допомогою WebAuthn та сховище SFTP", "Set default expiration date for shares" : "Встановити типовий термін дії для спільних ресурсів", - "Failed to remove group \"{group}\"" : "Не вдалося вилучити групу \"{group}\"", - "Remove group" : "Вилучити групу", "Your biography" : "Коротко про себе", "You are using <strong>{usage}</strong>" : "Ви використовуєте <strong>{usage}", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Ви використовуєте <strong>{usage}</strong> із <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" diff --git a/apps/settings/l10n/vi.js b/apps/settings/l10n/vi.js index 53600787e84..62c7d6a527d 100644 --- a/apps/settings/l10n/vi.js +++ b/apps/settings/l10n/vi.js @@ -464,8 +464,6 @@ OC.L10N.register( "Checking for system and security issues." : "Kiểm tra các vấn đề về hệ thống và bảo mật.", "Use a second factor besides your password to increase security for your account." : "Sử dụng yếu tố thứ hai ngoài mật khẩu để tăng tính bảo mật cho tài khoản của bạn.", "Set default expiration date for shares" : "Đặt ngày hết hạn mặc định cho cổ phiếu", - "Failed to remove group \"{group}\"" : "Không xóa được nhóm \"{group}\"", - "Remove group" : "Xóa nhóm", "Your biography" : "Tiểu sử của bạn", "You are using <strong>{usage}</strong>" : "Bạn đang sử dụng {usage}", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Bạn đang sử dụng {usage} trên {totalSpace} ({usageRelative}%)" diff --git a/apps/settings/l10n/vi.json b/apps/settings/l10n/vi.json index e1492110d58..450ea619420 100644 --- a/apps/settings/l10n/vi.json +++ b/apps/settings/l10n/vi.json @@ -462,8 +462,6 @@ "Checking for system and security issues." : "Kiểm tra các vấn đề về hệ thống và bảo mật.", "Use a second factor besides your password to increase security for your account." : "Sử dụng yếu tố thứ hai ngoài mật khẩu để tăng tính bảo mật cho tài khoản của bạn.", "Set default expiration date for shares" : "Đặt ngày hết hạn mặc định cho cổ phiếu", - "Failed to remove group \"{group}\"" : "Không xóa được nhóm \"{group}\"", - "Remove group" : "Xóa nhóm", "Your biography" : "Tiểu sử của bạn", "You are using <strong>{usage}</strong>" : "Bạn đang sử dụng {usage}", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "Bạn đang sử dụng {usage} trên {totalSpace} ({usageRelative}%)" diff --git a/apps/settings/l10n/zh_CN.js b/apps/settings/l10n/zh_CN.js index a925f3f0682..4d1cb4663a5 100644 --- a/apps/settings/l10n/zh_CN.js +++ b/apps/settings/l10n/zh_CN.js @@ -316,6 +316,9 @@ OC.L10N.register( "64-bit" : "64位", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "您似乎正在使用32位的PHP版本。Nextcloud需要64位的PHP版本以便良好运行。请升级您的系统和PHP版本至64位!", "Task Processing pickup speed" : "任务处理拾取速度", + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["过去 %n 小时内没有安排任务。"], + "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["在过去的 %n 小时内,任务拾取速度正常。"], + "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["在过去的 %n 小时内,任务拾取速度缓慢。许多任务的处理时间超过 4 分钟。请考虑设置一个工作线程在后台处理任务。"], "Temporary space available" : "可用临时空间", "Error while checking the temporary PHP path - it was not properly set to a directory. Returned value: %s" : "检查临时 PHP 路径时出错 - 未正确设置为目录。 返回值: %s", "The PHP function \"disk_free_space\" is disabled, which prevents the check for enough space in the temporary directories." : "PHP 函数 \"disk_free_space\" 被禁用,这会阻止检查临时目录中是否有足够的空间。", @@ -562,6 +565,7 @@ OC.L10N.register( "Unable to update profile default setting" : "无法更新个人资料默认设置", "Profile" : "个人资料", "Enable or disable profile by default for new accounts." : "默认情况下为新账号启用或禁用配置文件。", + "Password confirmation is required" : "需要密码确认", "Failed to save setting" : "保存设置失败", "{app}'s declarative setting field: {name}" : "{app} 的声明性设置字段:{name}", "Unable to update server side encryption config" : "无法更新服务端加密设置", @@ -584,9 +588,12 @@ OC.L10N.register( "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "定期备份数据有助于保证数据完整,并且确保备份您的加密数据和加密密钥。", "Refer to the admin documentation on how to manually also encrypt existing files." : "请参阅管理员文档,了解如何手动加密现有文件。", "This is the final warning: Do you really want to enable encryption?" : "这是最后一次警告:您确定要启用加密?", + "Failed to delete group \"{group}\"" : "无法删除群组“{group}”", "Please confirm the group removal" : "请确认移除该群组", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "您即将删除群组“{group}”。账号将不会被删除。", "Submit" : "提交", "Rename group" : "重命名分组", + "Delete group" : "删除群组", "Current password" : "当前密码", "New password" : "新密码", "Change password" : "修改密码", @@ -894,9 +901,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "用于 WebAuthn 无密码登录和 SFTP 存储", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "检测到 PostgreSQL 版本\"%s\"。建议使用 PostgreSQL >=12 和 <=16,以获得此版本 Nextcloud 的最佳性能、稳定性和功能。", "Set default expiration date for shares" : "设置共享的默认截止日期", - "Failed to remove group \"{group}\"" : "删除群组 “{group}” 失败", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "您即将删除组 \"{group}\" 。 这些帐户不会被删除。", - "Remove group" : "删除分组", "Your biography" : "个人简介", "You are using <strong>{usage}</strong>" : "您已使用<strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "您已使用 <strong>{totalSpace}</strong> 中的 <strong>{usage}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/zh_CN.json b/apps/settings/l10n/zh_CN.json index 1eddc87407f..34ea100b230 100644 --- a/apps/settings/l10n/zh_CN.json +++ b/apps/settings/l10n/zh_CN.json @@ -314,6 +314,9 @@ "64-bit" : "64位", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "您似乎正在使用32位的PHP版本。Nextcloud需要64位的PHP版本以便良好运行。请升级您的系统和PHP版本至64位!", "Task Processing pickup speed" : "任务处理拾取速度", + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["过去 %n 小时内没有安排任务。"], + "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["在过去的 %n 小时内,任务拾取速度正常。"], + "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["在过去的 %n 小时内,任务拾取速度缓慢。许多任务的处理时间超过 4 分钟。请考虑设置一个工作线程在后台处理任务。"], "Temporary space available" : "可用临时空间", "Error while checking the temporary PHP path - it was not properly set to a directory. Returned value: %s" : "检查临时 PHP 路径时出错 - 未正确设置为目录。 返回值: %s", "The PHP function \"disk_free_space\" is disabled, which prevents the check for enough space in the temporary directories." : "PHP 函数 \"disk_free_space\" 被禁用,这会阻止检查临时目录中是否有足够的空间。", @@ -560,6 +563,7 @@ "Unable to update profile default setting" : "无法更新个人资料默认设置", "Profile" : "个人资料", "Enable or disable profile by default for new accounts." : "默认情况下为新账号启用或禁用配置文件。", + "Password confirmation is required" : "需要密码确认", "Failed to save setting" : "保存设置失败", "{app}'s declarative setting field: {name}" : "{app} 的声明性设置字段:{name}", "Unable to update server side encryption config" : "无法更新服务端加密设置", @@ -582,9 +586,12 @@ "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "定期备份数据有助于保证数据完整,并且确保备份您的加密数据和加密密钥。", "Refer to the admin documentation on how to manually also encrypt existing files." : "请参阅管理员文档,了解如何手动加密现有文件。", "This is the final warning: Do you really want to enable encryption?" : "这是最后一次警告:您确定要启用加密?", + "Failed to delete group \"{group}\"" : "无法删除群组“{group}”", "Please confirm the group removal" : "请确认移除该群组", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "您即将删除群组“{group}”。账号将不会被删除。", "Submit" : "提交", "Rename group" : "重命名分组", + "Delete group" : "删除群组", "Current password" : "当前密码", "New password" : "新密码", "Change password" : "修改密码", @@ -892,9 +899,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "用于 WebAuthn 无密码登录和 SFTP 存储", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "检测到 PostgreSQL 版本\"%s\"。建议使用 PostgreSQL >=12 和 <=16,以获得此版本 Nextcloud 的最佳性能、稳定性和功能。", "Set default expiration date for shares" : "设置共享的默认截止日期", - "Failed to remove group \"{group}\"" : "删除群组 “{group}” 失败", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "您即将删除组 \"{group}\" 。 这些帐户不会被删除。", - "Remove group" : "删除分组", "Your biography" : "个人简介", "You are using <strong>{usage}</strong>" : "您已使用<strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "您已使用 <strong>{totalSpace}</strong> 中的 <strong>{usage}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/zh_HK.js b/apps/settings/l10n/zh_HK.js index fca9341e8f5..e6e9d177ca4 100644 --- a/apps/settings/l10n/zh_HK.js +++ b/apps/settings/l10n/zh_HK.js @@ -316,7 +316,7 @@ OC.L10N.register( "64-bit" : "64 位元", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "您似乎正在執行 32 位元版本的 PHP。Nextcloud 需要 64 位元才能運作良好。請將您的作業系統與 PHP 升級至 64 位元!", "Task Processing pickup speed" : "任務處理提取速度", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["最近 %n 小時內沒有預先安排好的的任務。"], + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["最近 %n 小時內沒有預先安排好的的任務。"], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["在最近 %n 小時內,任務的提取速度正常。"], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["最近 %n 小時內,任務提取速度較慢。許多任務花了超過4分鐘才被提取。考慮設置一個工作人員在背景中處理任務。"], "Temporary space available" : "可用臨時空間", @@ -587,9 +587,12 @@ OC.L10N.register( "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "定時備份您的資料沒有壞處,若您有啟用加密,請確保您也有備份加密金鑰。", "Refer to the admin documentation on how to manually also encrypt existing files." : "請參考管理說明書,了解如何手動加密現有檔案。", "This is the final warning: Do you really want to enable encryption?" : "這是最後的警告:請問您真的要開啟加密模式?", + "Failed to delete group \"{group}\"" : "無法刪除群組「{group}」", "Please confirm the group removal" : "請確認移除群組", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "您將要刪除群組「{group}」。帳戶將不會被刪除。", "Submit" : "遞交", "Rename group" : "重新命名群組", + "Delete group" : "刪除群組", "Current password" : "目前密碼", "New password" : "新密碼", "Change password" : "更改密碼", @@ -897,9 +900,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "用於 WebAuthn 無密碼登入與 SFTP 儲存空間", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "偵測到 PostgreSQL 版本「%s」。建議使用 PostgreSQL >=12 且 <=16 以取得此版本 Nextcloud 的最佳效能、穩定性與功能。", "Set default expiration date for shares" : "設定分享的預設到期日", - "Failed to remove group \"{group}\"" : "移除群組「{group}」失敗", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "您將要移除群組「{group}」。帳戶將不會被刪除。", - "Remove group" : "移除群組", "Your biography" : "個人小傳", "You are using <strong>{usage}</strong>" : "您已使用了 <strong>{usage}</strong> 的存儲空間", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "您已使用了 <strong>{totalSpace}</strong> 中的 <strong>{usage}</strong>(<strong>{usageRelative} %</strong>)", diff --git a/apps/settings/l10n/zh_HK.json b/apps/settings/l10n/zh_HK.json index 4563ce6a158..398f2554973 100644 --- a/apps/settings/l10n/zh_HK.json +++ b/apps/settings/l10n/zh_HK.json @@ -314,7 +314,7 @@ "64-bit" : "64 位元", "It seems like you are running a 32-bit PHP version. Nextcloud needs 64-bit to run well. Please upgrade your OS and PHP to 64-bit!" : "您似乎正在執行 32 位元版本的 PHP。Nextcloud 需要 64 位元才能運作良好。請將您的作業系統與 PHP 升級至 64 位元!", "Task Processing pickup speed" : "任務處理提取速度", - "_No scheduled tasks in the last %n hours._::_No scheduled tasks in the last %n hours._" : ["最近 %n 小時內沒有預先安排好的的任務。"], + "_No scheduled tasks in the last %n hour._::_No scheduled tasks in the last %n hours._" : ["最近 %n 小時內沒有預先安排好的的任務。"], "_The task pickup speed has been ok in the last %n hour._::_The task pickup speed has been ok in the last %n hours._" : ["在最近 %n 小時內,任務的提取速度正常。"], "_The task pickup speed has been slow in the last %n hour. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._::_The task pickup speed has been slow in the last %n hours. Many tasks took longer than 4 minutes to be picked up. Consider setting up a worker to process tasks in the background._" : ["最近 %n 小時內,任務提取速度較慢。許多任務花了超過4分鐘才被提取。考慮設置一個工作人員在背景中處理任務。"], "Temporary space available" : "可用臨時空間", @@ -585,9 +585,12 @@ "It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "定時備份您的資料沒有壞處,若您有啟用加密,請確保您也有備份加密金鑰。", "Refer to the admin documentation on how to manually also encrypt existing files." : "請參考管理說明書,了解如何手動加密現有檔案。", "This is the final warning: Do you really want to enable encryption?" : "這是最後的警告:請問您真的要開啟加密模式?", + "Failed to delete group \"{group}\"" : "無法刪除群組「{group}」", "Please confirm the group removal" : "請確認移除群組", + "You are about to delete the group \"{group}\". The accounts will NOT be deleted." : "您將要刪除群組「{group}」。帳戶將不會被刪除。", "Submit" : "遞交", "Rename group" : "重新命名群組", + "Delete group" : "刪除群組", "Current password" : "目前密碼", "New password" : "新密碼", "Change password" : "更改密碼", @@ -895,9 +898,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "用於 WebAuthn 無密碼登入與 SFTP 儲存空間", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "偵測到 PostgreSQL 版本「%s」。建議使用 PostgreSQL >=12 且 <=16 以取得此版本 Nextcloud 的最佳效能、穩定性與功能。", "Set default expiration date for shares" : "設定分享的預設到期日", - "Failed to remove group \"{group}\"" : "移除群組「{group}」失敗", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "您將要移除群組「{group}」。帳戶將不會被刪除。", - "Remove group" : "移除群組", "Your biography" : "個人小傳", "You are using <strong>{usage}</strong>" : "您已使用了 <strong>{usage}</strong> 的存儲空間", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "您已使用了 <strong>{totalSpace}</strong> 中的 <strong>{usage}</strong>(<strong>{usageRelative} %</strong>)", diff --git a/apps/settings/l10n/zh_TW.js b/apps/settings/l10n/zh_TW.js index bd5896551ce..413ef1dc362 100644 --- a/apps/settings/l10n/zh_TW.js +++ b/apps/settings/l10n/zh_TW.js @@ -561,6 +561,7 @@ OC.L10N.register( "Unable to update profile default setting" : "無法更新個人檔案預設設定", "Profile" : "個人檔案", "Enable or disable profile by default for new accounts." : "預設情況下為新帳號啟用或停用個人檔案", + "Password confirmation is required" : "需要密碼確認", "Failed to save setting" : "儲存設定失敗", "{app}'s declarative setting field: {name}" : "{app} 的聲明性設定欄位:{name}", "Unable to update server side encryption config" : "無法更新伺服器端加密組態設定", @@ -893,9 +894,6 @@ OC.L10N.register( "for WebAuthn passwordless login, and SFTP storage" : "用於 WebAuthn 無密碼登入與 SFTP 儲存空間", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "偵測到 PostgreSQL 版本「%s」。建議使用 PostgreSQL >=12 且 <=16 以取得此版本 Nextcloud 的最佳效能、穩定性與功能。", "Set default expiration date for shares" : "設定分享的預設到期日", - "Failed to remove group \"{group}\"" : "移除群組「{group}」失敗", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "您將要移除群組「{group}」。帳號將不會被刪除。", - "Remove group" : "移除群組", "Your biography" : "您的自傳", "You are using <strong>{usage}</strong>" : "您已使用 <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "您已使用 <strong>{totalSpace}</strong> 中的 <strong>{usage}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/l10n/zh_TW.json b/apps/settings/l10n/zh_TW.json index 38e05d1ec85..b9b92bcd6c4 100644 --- a/apps/settings/l10n/zh_TW.json +++ b/apps/settings/l10n/zh_TW.json @@ -559,6 +559,7 @@ "Unable to update profile default setting" : "無法更新個人檔案預設設定", "Profile" : "個人檔案", "Enable or disable profile by default for new accounts." : "預設情況下為新帳號啟用或停用個人檔案", + "Password confirmation is required" : "需要密碼確認", "Failed to save setting" : "儲存設定失敗", "{app}'s declarative setting field: {name}" : "{app} 的聲明性設定欄位:{name}", "Unable to update server side encryption config" : "無法更新伺服器端加密組態設定", @@ -891,9 +892,6 @@ "for WebAuthn passwordless login, and SFTP storage" : "用於 WebAuthn 無密碼登入與 SFTP 儲存空間", "PostgreSQL version \"%s\" detected. PostgreSQL >=12 and <=16 is suggested for best performance, stability and functionality with this version of Nextcloud." : "偵測到 PostgreSQL 版本「%s」。建議使用 PostgreSQL >=12 且 <=16 以取得此版本 Nextcloud 的最佳效能、穩定性與功能。", "Set default expiration date for shares" : "設定分享的預設到期日", - "Failed to remove group \"{group}\"" : "移除群組「{group}」失敗", - "You are about to remove the group \"{group}\". The accounts will NOT be deleted." : "您將要移除群組「{group}」。帳號將不會被刪除。", - "Remove group" : "移除群組", "Your biography" : "您的自傳", "You are using <strong>{usage}</strong>" : "您已使用 <strong>{usage}</strong>", "You are using <strong>{usage}</strong> of <strong>{totalSpace}</strong> (<strong>{usageRelative}%</strong>)" : "您已使用 <strong>{totalSpace}</strong> 中的 <strong>{usage}</strong> (<strong>{usageRelative}%</strong>)", diff --git a/apps/settings/lib/Controller/CommonSettingsTrait.php b/apps/settings/lib/Controller/CommonSettingsTrait.php index 56760c10f81..67398d1357b 100644 --- a/apps/settings/lib/Controller/CommonSettingsTrait.php +++ b/apps/settings/lib/Controller/CommonSettingsTrait.php @@ -144,6 +144,14 @@ trait CommonSettingsTrait { $this->declarativeSettingsManager->loadSchemas(); $declarativeSettings = $this->declarativeSettingsManager->getFormsWithValues($user, $type, $section); + foreach ($declarativeSettings as &$form) { + foreach ($form['fields'] as &$field) { + if (isset($field['sensitive']) && $field['sensitive'] === true && !empty($field['value'])) { + $field['value'] = 'dummySecret'; + } + } + } + if ($type === 'personal') { $settings = array_values($this->settingsManager->getPersonalSettings($section)); if ($section === 'theming') { diff --git a/apps/settings/lib/Controller/DeclarativeSettingsController.php b/apps/settings/lib/Controller/DeclarativeSettingsController.php index eb9d45839de..4e4bee4043c 100644 --- a/apps/settings/lib/Controller/DeclarativeSettingsController.php +++ b/apps/settings/lib/Controller/DeclarativeSettingsController.php @@ -15,6 +15,7 @@ use OC\AppFramework\Middleware\Security\Exceptions\NotLoggedInException; use OCA\Settings\ResponseDefinitions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\NoAdminRequired; +use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSBadRequestException; use OCP\AppFramework\OCSController; @@ -53,6 +54,45 @@ class DeclarativeSettingsController extends OCSController { */ #[NoAdminRequired] public function setValue(string $app, string $formId, string $fieldId, mixed $value): DataResponse { + return $this->saveValue($app, $formId, $fieldId, $value); + } + + /** + * Sets a declarative settings value. + * Password confirmation is required for sensitive values. + * + * @param string $app ID of the app + * @param string $formId ID of the form + * @param string $fieldId ID of the field + * @param mixed $value Value to be saved + * @return DataResponse<Http::STATUS_OK, null, array{}> + * @throws NotLoggedInException Not logged in or not an admin user + * @throws NotAdminException Not logged in or not an admin user + * @throws OCSBadRequestException Invalid arguments to save value + * + * 200: Value set successfully + */ + #[NoAdminRequired] + #[PasswordConfirmationRequired] + public function setSensitiveValue(string $app, string $formId, string $fieldId, mixed $value): DataResponse { + return $this->saveValue($app, $formId, $fieldId, $value); + } + + /** + * Sets a declarative settings value. + * + * @param string $app ID of the app + * @param string $formId ID of the form + * @param string $fieldId ID of the field + * @param mixed $value Value to be saved + * @return DataResponse<Http::STATUS_OK, null, array{}> + * @throws NotLoggedInException Not logged in or not an admin user + * @throws NotAdminException Not logged in or not an admin user + * @throws OCSBadRequestException Invalid arguments to save value + * + * 200: Value set successfully + */ + private function saveValue(string $app, string $formId, string $fieldId, mixed $value): DataResponse { $user = $this->userSession->getUser(); if ($user === null) { throw new NotLoggedInException(); diff --git a/apps/settings/lib/ResponseDefinitions.php b/apps/settings/lib/ResponseDefinitions.php index 0f3d6bffccf..12adefda91f 100644 --- a/apps/settings/lib/ResponseDefinitions.php +++ b/apps/settings/lib/ResponseDefinitions.php @@ -20,6 +20,7 @@ namespace OCA\Settings; * default: mixed, * options?: list<string|array{name: string, value: mixed}>, * value: string|int|float|bool|list<string>, + * sensitive?: boolean, * } * * @psalm-type SettingsDeclarativeForm = array{ diff --git a/apps/settings/openapi-full.json b/apps/settings/openapi-full.json index e12598a2584..d592051507b 100644 --- a/apps/settings/openapi-full.json +++ b/apps/settings/openapi-full.json @@ -169,6 +169,9 @@ } } ] + }, + "sensitive": { + "type": "boolean" } } }, @@ -373,6 +376,140 @@ } } }, + "/ocs/v2.php/settings/api/declarative/value-sensitive": { + "post": { + "operationId": "declarative_settings-set-sensitive-value", + "summary": "Sets a declarative settings value. Password confirmation is required for sensitive values.", + "description": "This endpoint requires password confirmation", + "tags": [ + "declarative_settings" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "app", + "formId", + "fieldId", + "value" + ], + "properties": { + "app": { + "type": "string", + "description": "ID of the app" + }, + "formId": { + "type": "string", + "description": "ID of the form" + }, + "fieldId": { + "type": "string", + "description": "ID of the field" + }, + "value": { + "type": "object", + "description": "Value to be saved" + } + } + } + } + } + }, + "parameters": [ + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Value set successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "nullable": true + } + } + } + } + } + } + } + }, + "500": { + "description": "Not logged in or not an admin user", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Invalid arguments to save value", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + } + } + } + }, "/ocs/v2.php/settings/api/declarative/forms": { "get": { "operationId": "declarative_settings-get-forms", diff --git a/apps/settings/openapi.json b/apps/settings/openapi.json index f81b18bdc70..f38960aa244 100644 --- a/apps/settings/openapi.json +++ b/apps/settings/openapi.json @@ -169,6 +169,9 @@ } } ] + }, + "sensitive": { + "type": "boolean" } } }, @@ -332,6 +335,140 @@ } } }, + "/ocs/v2.php/settings/api/declarative/value-sensitive": { + "post": { + "operationId": "declarative_settings-set-sensitive-value", + "summary": "Sets a declarative settings value. Password confirmation is required for sensitive values.", + "description": "This endpoint requires password confirmation", + "tags": [ + "declarative_settings" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "app", + "formId", + "fieldId", + "value" + ], + "properties": { + "app": { + "type": "string", + "description": "ID of the app" + }, + "formId": { + "type": "string", + "description": "ID of the form" + }, + "fieldId": { + "type": "string", + "description": "ID of the field" + }, + "value": { + "type": "object", + "description": "Value to be saved" + } + } + } + } + } + }, + "parameters": [ + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Value set successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "nullable": true + } + } + } + } + } + } + } + }, + "500": { + "description": "Not logged in or not an admin user", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Invalid arguments to save value", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + } + } + } + }, "/ocs/v2.php/settings/api/declarative/forms": { "get": { "operationId": "declarative_settings-get-forms", diff --git a/apps/settings/src/components/DeclarativeSettings/DeclarativeSection.vue b/apps/settings/src/components/DeclarativeSettings/DeclarativeSection.vue index 334739337e1..9ee1680516e 100644 --- a/apps/settings/src/components/DeclarativeSettings/DeclarativeSection.vue +++ b/apps/settings/src/components/DeclarativeSettings/DeclarativeSection.vue @@ -119,6 +119,7 @@ import NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection' import NcInputField from '@nextcloud/vue/components/NcInputField' import NcSelect from '@nextcloud/vue/components/NcSelect' import NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch' +import { confirmPassword } from '@nextcloud/password-confirmation' export default { name: 'DeclarativeSection', @@ -202,9 +203,19 @@ export default { } }, - updateDeclarativeSettingsValue(formField, value = null) { + async updateDeclarativeSettingsValue(formField, value = null) { try { - return axios.post(generateOcsUrl('settings/api/declarative/value'), { + let url = generateOcsUrl('settings/api/declarative/value') + if (formField?.sensitive === true) { + url = generateOcsUrl('settings/api/declarative/value-sensitive') + try { + await confirmPassword() + } catch (err) { + showError(t('settings', 'Password confirmation is required')) + return + } + } + return axios.post(url, { app: this.formApp, formId: this.form.id.replace(this.formApp + '_', ''), // Remove app prefix to send clean form id fieldId: formField.id, diff --git a/apps/settings/src/main-declarative-settings-forms.ts b/apps/settings/src/main-declarative-settings-forms.ts index 6e2d71b69ca..d6f5973baea 100644 --- a/apps/settings/src/main-declarative-settings-forms.ts +++ b/apps/settings/src/main-declarative-settings-forms.ts @@ -20,6 +20,7 @@ interface DeclarativeFormField { options: Array<unknown>|null, value: unknown, default: unknown, + sensitive: boolean, } interface DeclarativeForm { diff --git a/apps/systemtags/l10n/lv.js b/apps/systemtags/l10n/lv.js index 437dd173c1a..6bbd17c5d52 100644 --- a/apps/systemtags/l10n/lv.js +++ b/apps/systemtags/l10n/lv.js @@ -46,16 +46,19 @@ OC.L10N.register( "Invisible" : "Neredzama", "Updated tag" : "Birka atjaunināta", "Failed to update tag" : "Birku neizdevās atjaunināt", + "Failed to delete tag" : "Neizdevās izdzēst birku", "Create" : "Izveidot", "Update" : "Atjaunināt", "Delete" : "Izdzēst", "Reset" : "Atiestatīt", "Loading …" : "Ielādē…", "Cancel" : "Atcelt", + "Failed to load selected tags" : "Neizdevās ielādēt atlasītās birkas", "System admin disabled tag creation. You can only use existing ones." : "Sistēmas pārvaldītājs atspējoja birku izveidošanu. Ir iespējams izmantot tikai esošās.", "System tag creation is now restricted to administrators" : "Sistēmas birku izveidošana tagad ir pieejama tikai pārvaldītājiem", "System tag creation is now allowed for everybody" : "Sistēmas birku izveidošana tagad ir ļauta visiem", "Collaborative tags are available for all users. Restricted tags are visible to users but cannot be assigned by them. Invisible tags are for internal use, since users cannot see or assign them." : "Sadarbības birkas ir pieejamas visiem lietotājiem. Ierobežotās birkas ir redzamas lietotājiem, bet viņi tās nevar piešķirt. Neredzamās birkas ir paredzētas iekšējai lietošanai, jo lietotāji nevar tās redzēt vai piešķirt.", - "No tags found" : "Netika atrasta neviena birka" + "No tags found" : "Netika atrasta neviena birka", + "Failed to delete tag for file" : "Neizdevās izdzēst birku vai datni" }, "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"); diff --git a/apps/systemtags/l10n/lv.json b/apps/systemtags/l10n/lv.json index 78723f0c006..254571a47ef 100644 --- a/apps/systemtags/l10n/lv.json +++ b/apps/systemtags/l10n/lv.json @@ -44,16 +44,19 @@ "Invisible" : "Neredzama", "Updated tag" : "Birka atjaunināta", "Failed to update tag" : "Birku neizdevās atjaunināt", + "Failed to delete tag" : "Neizdevās izdzēst birku", "Create" : "Izveidot", "Update" : "Atjaunināt", "Delete" : "Izdzēst", "Reset" : "Atiestatīt", "Loading …" : "Ielādē…", "Cancel" : "Atcelt", + "Failed to load selected tags" : "Neizdevās ielādēt atlasītās birkas", "System admin disabled tag creation. You can only use existing ones." : "Sistēmas pārvaldītājs atspējoja birku izveidošanu. Ir iespējams izmantot tikai esošās.", "System tag creation is now restricted to administrators" : "Sistēmas birku izveidošana tagad ir pieejama tikai pārvaldītājiem", "System tag creation is now allowed for everybody" : "Sistēmas birku izveidošana tagad ir ļauta visiem", "Collaborative tags are available for all users. Restricted tags are visible to users but cannot be assigned by them. Invisible tags are for internal use, since users cannot see or assign them." : "Sadarbības birkas ir pieejamas visiem lietotājiem. Ierobežotās birkas ir redzamas lietotājiem, bet viņi tās nevar piešķirt. Neredzamās birkas ir paredzētas iekšējai lietošanai, jo lietotāji nevar tās redzēt vai piešķirt.", - "No tags found" : "Netika atrasta neviena birka" + "No tags found" : "Netika atrasta neviena birka", + "Failed to delete tag for file" : "Neizdevās izdzēst birku vai datni" },"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);" }
\ No newline at end of file diff --git a/apps/testing/lib/Settings/DeclarativeSettingsForm.php b/apps/testing/lib/Settings/DeclarativeSettingsForm.php index dd83e9c9e89..55e44cbcbea 100644 --- a/apps/testing/lib/Settings/DeclarativeSettingsForm.php +++ b/apps/testing/lib/Settings/DeclarativeSettingsForm.php @@ -169,6 +169,36 @@ class DeclarativeSettingsForm implements IDeclarativeSettingsForm { ], ], ], + [ + 'id' => 'test_sensitive_field', + 'title' => 'Sensitive text field', + 'description' => 'Set some secure value setting that is stored encrypted', + 'type' => DeclarativeSettingsTypes::TEXT, + 'label' => 'Sensitive field', + 'placeholder' => 'Set secure value', + 'default' => '', + 'sensitive' => true, // only for TEXT, PASSWORD types + ], + [ + 'id' => 'test_sensitive_field_2', + 'title' => 'Sensitive password field', + 'description' => 'Set some password setting that is stored encrypted', + 'type' => DeclarativeSettingsTypes::PASSWORD, + 'label' => 'Sensitive field', + 'placeholder' => 'Set secure value', + 'default' => '', + 'sensitive' => true, // only for TEXT, PASSWORD types + ], + [ + 'id' => 'test_non_sensitive_field', + 'title' => 'Password field', + 'description' => 'Set some password setting', + 'type' => DeclarativeSettingsTypes::PASSWORD, + 'label' => 'Password field', + 'placeholder' => 'Set secure value', + 'default' => '', + 'sensitive' => false, + ], ], ]; } diff --git a/apps/theming/l10n/fr.js b/apps/theming/l10n/fr.js index 0e0b8ba0a00..5827c084230 100644 --- a/apps/theming/l10n/fr.js +++ b/apps/theming/l10n/fr.js @@ -76,6 +76,7 @@ OC.L10N.register( "Advanced options" : "Options avancées", "Install the ImageMagick PHP extension with support for SVG images to automatically generate favicons based on the uploaded logo and color." : "Installez l'extension PHP ImageMagick qui prend en charge les images SVG pour générer automatiquement des favicons à partir du logo téléversé et de la couleur indiquée.", "If you find any issues, do not hesitate to report them on {issuetracker}our issue tracker{linkend}. And if you want to get involved, come join {designteam}our design team{linkend}!" : "Si vous rencontrez des problèmes, n'hésitez pas à les signaler sur {issuetracker}notre outil de suivi des problèmes{linkend}. Et si vous voulez vous impliquer, venez rejoindre {designteam}notre équipe de design{linkend} !", + "Unable to apply the setting." : "Impossible d'appliquer le réglage.", "Appearance and accessibility settings" : "Paramètres d’apparence et d’accessibilité", "Misc accessibility options" : "Diverses options d'accessibilité", "Enable blur background filter (may increase GPU load)" : "Activer le filtre flou de l'arrière-plan (peut augmenter la charge du GPU)", @@ -117,6 +118,7 @@ OC.L10N.register( "Reset to default" : "Restaurer les valeurs par défaut", "Upload" : "Téléverser", "Remove background image" : "Retirer l'image d'arrière-plan", - "Universal access is very important to us. We follow web standards and check to make everything usable also without mouse, and assistive software such as screenreaders. We aim to be compliant with the {guidelines}Web Content Accessibility Guidelines{linkend} 2.1 on AA level, with the high contrast theme even on AAA level." : "L'accès universel est très important pour nous. Nous suivons les standards du web et nous vérifions que tout est utilisable même sans souris et sans logiciel d'assistance comme les lecteurs d'écran. Nous visons à respecter les {guidelines}Règles pour l'accessibilité des contenus Web{linkend} 2.1 de niveau AA et même de niveau AAA avec le thème à fort contraste." + "Universal access is very important to us. We follow web standards and check to make everything usable also without mouse, and assistive software such as screenreaders. We aim to be compliant with the {guidelines}Web Content Accessibility Guidelines{linkend} 2.1 on AA level, with the high contrast theme even on AAA level." : "L'accès universel est très important pour nous. Nous suivons les standards du web et nous vérifions que tout est utilisable même sans souris et sans logiciel d'assistance comme les lecteurs d'écran. Nous visons à respecter les {guidelines}Règles pour l'accessibilité des contenus Web{linkend} 2.1 de niveau AA et même de niveau AAA avec le thème à fort contraste.", + ". Unable to apply the setting." : ". Impossible d'appliquer le réglage." }, "nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"); diff --git a/apps/theming/l10n/fr.json b/apps/theming/l10n/fr.json index 4902c6ab2f1..4212fb59560 100644 --- a/apps/theming/l10n/fr.json +++ b/apps/theming/l10n/fr.json @@ -74,6 +74,7 @@ "Advanced options" : "Options avancées", "Install the ImageMagick PHP extension with support for SVG images to automatically generate favicons based on the uploaded logo and color." : "Installez l'extension PHP ImageMagick qui prend en charge les images SVG pour générer automatiquement des favicons à partir du logo téléversé et de la couleur indiquée.", "If you find any issues, do not hesitate to report them on {issuetracker}our issue tracker{linkend}. And if you want to get involved, come join {designteam}our design team{linkend}!" : "Si vous rencontrez des problèmes, n'hésitez pas à les signaler sur {issuetracker}notre outil de suivi des problèmes{linkend}. Et si vous voulez vous impliquer, venez rejoindre {designteam}notre équipe de design{linkend} !", + "Unable to apply the setting." : "Impossible d'appliquer le réglage.", "Appearance and accessibility settings" : "Paramètres d’apparence et d’accessibilité", "Misc accessibility options" : "Diverses options d'accessibilité", "Enable blur background filter (may increase GPU load)" : "Activer le filtre flou de l'arrière-plan (peut augmenter la charge du GPU)", @@ -115,6 +116,7 @@ "Reset to default" : "Restaurer les valeurs par défaut", "Upload" : "Téléverser", "Remove background image" : "Retirer l'image d'arrière-plan", - "Universal access is very important to us. We follow web standards and check to make everything usable also without mouse, and assistive software such as screenreaders. We aim to be compliant with the {guidelines}Web Content Accessibility Guidelines{linkend} 2.1 on AA level, with the high contrast theme even on AAA level." : "L'accès universel est très important pour nous. Nous suivons les standards du web et nous vérifions que tout est utilisable même sans souris et sans logiciel d'assistance comme les lecteurs d'écran. Nous visons à respecter les {guidelines}Règles pour l'accessibilité des contenus Web{linkend} 2.1 de niveau AA et même de niveau AAA avec le thème à fort contraste." + "Universal access is very important to us. We follow web standards and check to make everything usable also without mouse, and assistive software such as screenreaders. We aim to be compliant with the {guidelines}Web Content Accessibility Guidelines{linkend} 2.1 on AA level, with the high contrast theme even on AAA level." : "L'accès universel est très important pour nous. Nous suivons les standards du web et nous vérifions que tout est utilisable même sans souris et sans logiciel d'assistance comme les lecteurs d'écran. Nous visons à respecter les {guidelines}Règles pour l'accessibilité des contenus Web{linkend} 2.1 de niveau AA et même de niveau AAA avec le thème à fort contraste.", + ". Unable to apply the setting." : ". Impossible d'appliquer le réglage." },"pluralForm" :"nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" }
\ No newline at end of file diff --git a/apps/twofactor_backupcodes/l10n/lv.js b/apps/twofactor_backupcodes/l10n/lv.js index a967bacd30c..7c0eaf63c4b 100644 --- a/apps/twofactor_backupcodes/l10n/lv.js +++ b/apps/twofactor_backupcodes/l10n/lv.js @@ -1,7 +1,7 @@ OC.L10N.register( "twofactor_backupcodes", { - "You created two-factor backup codes for your account" : "Jūs izveidojāt divpakāpju dublējumu kodus savam kontam", + "You created two-factor backup codes for your account" : "Tu savam kontam izveidoji divpakāpju rezerves kopiju kodus", "Second-factor backup codes" : "Second-factor dublēšanas kodi", "Generate backup codes" : "Izveidot rezerves kodus", "Backup code" : "Dublēšanas kods", diff --git a/apps/twofactor_backupcodes/l10n/lv.json b/apps/twofactor_backupcodes/l10n/lv.json index 2ed41345eea..871dee78b2c 100644 --- a/apps/twofactor_backupcodes/l10n/lv.json +++ b/apps/twofactor_backupcodes/l10n/lv.json @@ -1,5 +1,5 @@ { "translations": { - "You created two-factor backup codes for your account" : "Jūs izveidojāt divpakāpju dublējumu kodus savam kontam", + "You created two-factor backup codes for your account" : "Tu savam kontam izveidoji divpakāpju rezerves kopiju kodus", "Second-factor backup codes" : "Second-factor dublēšanas kodi", "Generate backup codes" : "Izveidot rezerves kodus", "Backup code" : "Dublēšanas kods", diff --git a/apps/user_ldap/l10n/et_EE.js b/apps/user_ldap/l10n/et_EE.js index 92cb8c11e68..6cec49027af 100644 --- a/apps/user_ldap/l10n/et_EE.js +++ b/apps/user_ldap/l10n/et_EE.js @@ -60,7 +60,7 @@ OC.L10N.register( "Only from these groups:" : "Ainult neist gruppidest:", "Search groups" : "Otsi gruppe", "Available groups" : "Saadaolevad grupid", - "Selected groups" : "Validut grupid", + "Selected groups" : "Valitud grupid", "Edit LDAP Query" : "Muuda LDAP päringut", "LDAP Filter:" : "LDAP filter:", "The filter specifies which LDAP groups shall have access to the %s instance." : "Filter määrab millised LDAP grupid saavad ligipääsu sellele %s instantsile.", diff --git a/apps/user_ldap/l10n/et_EE.json b/apps/user_ldap/l10n/et_EE.json index 47aba4f4b3d..52d283fdf5b 100644 --- a/apps/user_ldap/l10n/et_EE.json +++ b/apps/user_ldap/l10n/et_EE.json @@ -58,7 +58,7 @@ "Only from these groups:" : "Ainult neist gruppidest:", "Search groups" : "Otsi gruppe", "Available groups" : "Saadaolevad grupid", - "Selected groups" : "Validut grupid", + "Selected groups" : "Valitud grupid", "Edit LDAP Query" : "Muuda LDAP päringut", "LDAP Filter:" : "LDAP filter:", "The filter specifies which LDAP groups shall have access to the %s instance." : "Filter määrab millised LDAP grupid saavad ligipääsu sellele %s instantsile.", diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index dba6e5480d5..86ce2aff854 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -41,36 +43,25 @@ use Test\TestCase; * @package OCA\User_LDAP\Tests */ class AccessTest extends TestCase { - /** @var UserMapping|MockObject */ - protected $userMapper; - /** @var IManager|MockObject */ - protected $shareManager; - /** @var GroupMapping|MockObject */ - protected $groupMapper; - /** @var Connection|MockObject */ - private $connection; - /** @var LDAP|MockObject */ - private $ldap; - /** @var Manager|MockObject */ - private $userManager; - /** @var Helper|MockObject */ - private $helper; - /** @var IConfig|MockObject */ - private $config; - /** @var IUserManager|MockObject */ - private $ncUserManager; - + protected UserMapping&MockObject $userMapper; + protected IManager&MockObject $shareManager; + protected GroupMapping&MockObject $groupMapper; + private Connection&MockObject $connection; + private LDAP&MockObject $ldap; + private Manager&MockObject $userManager; + private Helper&MockObject $helper; + private IConfig&MockObject $config; + private IUserManager&MockObject $ncUserManager; private LoggerInterface&MockObject $logger; - private IAppConfig&MockObject $appConfig; - - /** @var IEventDispatcher|MockObject */ - private $dispatcher; + private IEventDispatcher&MockObject $dispatcher; private Access $access; protected function setUp(): void { - $this->connection = $this->createMock(Connection::class); $this->ldap = $this->createMock(LDAP::class); + $this->connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->ldap]) + ->getMock(); $this->userManager = $this->createMock(Manager::class); $this->helper = $this->createMock(Helper::class); $this->config = $this->createMock(IConfig::class); @@ -126,19 +117,19 @@ class AccessTest extends TestCase { public function testEscapeFilterPartValidChars(): void { $input = 'okay'; - $this->assertTrue($input === $this->access->escapeFilterPart($input)); + $this->assertSame($input, $this->access->escapeFilterPart($input)); } public function testEscapeFilterPartEscapeWildcard(): void { $input = '*'; $expected = '\\2a'; - $this->assertTrue($expected === $this->access->escapeFilterPart($input)); + $this->assertSame($expected, $this->access->escapeFilterPart($input)); } public function testEscapeFilterPartEscapeWildcard2(): void { $input = 'foo*bar'; $expected = 'foo\\2abar'; - $this->assertTrue($expected === $this->access->escapeFilterPart($input)); + $this->assertSame($expected, $this->access->escapeFilterPart($input)); } /** @@ -151,7 +142,7 @@ class AccessTest extends TestCase { $this->assertSame($sidExpected, $this->access->convertSID2Str($sidBinary)); } - public function convertSID2StrSuccessData() { + public static function convertSID2StrSuccessData(): array { return [ [ [ @@ -209,55 +200,53 @@ class AccessTest extends TestCase { $this->assertSame($expected, $this->access->getDomainDNFromDN($inputDN)); } - public function dnInputDataProvider() { - return [[ + public static function dnInputDataProvider(): array { + return [ [ - 'input' => 'foo=bar,bar=foo,dc=foobar', - 'interResult' => [ + 'foo=bar,bar=foo,dc=foobar', + [ 'count' => 3, 0 => 'foo=bar', 1 => 'bar=foo', 2 => 'dc=foobar' ], - 'expectedResult' => true + true ], [ - 'input' => 'foobarbarfoodcfoobar', - 'interResult' => false, - 'expectedResult' => false + 'foobarbarfoodcfoobar', + false, + false ] - ]]; + ]; } /** * @dataProvider dnInputDataProvider - * @param array $case */ - public function testStringResemblesDN($case): void { + public function testStringResemblesDN(string $input, array|bool $interResult, bool $expectedResult): void { [$lw, $con, $um, $helper] = $this->getConnectorAndLdapMock(); - /** @var IConfig|MockObject $config */ + /** @var IConfig&MockObject $config */ $config = $this->createMock(IConfig::class); $access = new Access($lw, $con, $um, $helper, $config, $this->ncUserManager, $this->logger, $this->appConfig, $this->dispatcher); $lw->expects($this->exactly(1)) ->method('explodeDN') - ->willReturnCallback(function ($dn) use ($case) { - if ($dn === $case['input']) { - return $case['interResult']; + ->willReturnCallback(function ($dn) use ($input, $interResult) { + if ($dn === $input) { + return $interResult; } return null; }); - $this->assertSame($case['expectedResult'], $access->stringResemblesDN($case['input'])); + $this->assertSame($expectedResult, $access->stringResemblesDN($input)); } /** * @dataProvider dnInputDataProvider - * @param $case */ - public function testStringResemblesDNLDAPmod($case): void { + public function testStringResemblesDNLDAPmod(string $input, array|bool $interResult, bool $expectedResult): void { [, $con, $um, $helper] = $this->getConnectorAndLdapMock(); - /** @var IConfig|MockObject $config */ + /** @var IConfig&MockObject $config */ $config = $this->createMock(IConfig::class); $lw = new LDAP(); $access = new Access($lw, $con, $um, $helper, $config, $this->ncUserManager, $this->logger, $this->appConfig, $this->dispatcher); @@ -266,7 +255,7 @@ class AccessTest extends TestCase { $this->markTestSkipped('LDAP Module not available'); } - $this->assertSame($case['expectedResult'], $access->stringResemblesDN($case['input'])); + $this->assertSame($expectedResult, $access->stringResemblesDN($input)); } public function testCacheUserHome(): void { @@ -290,7 +279,7 @@ class AccessTest extends TestCase { ->method('getAttributes') ->willReturn(['displayname' => ['bar', 'count' => 1]]); - /** @var UserMapping|MockObject $mapperMock */ + /** @var UserMapping&MockObject $mapperMock */ $mapperMock = $this->createMock(UserMapping::class); $mapperMock->expects($this->any()) ->method('getNameByDN') @@ -335,7 +324,7 @@ class AccessTest extends TestCase { } public function testBatchApplyUserAttributesSkipped(): void { - /** @var UserMapping|MockObject $mapperMock */ + /** @var UserMapping&MockObject $mapperMock */ $mapperMock = $this->createMock(UserMapping::class); $mapperMock->expects($this->any()) ->method('getNameByDN') @@ -376,7 +365,7 @@ class AccessTest extends TestCase { } public function testBatchApplyUserAttributesDontSkip(): void { - /** @var UserMapping|MockObject $mapperMock */ + /** @var UserMapping&MockObject $mapperMock */ $mapperMock = $this->createMock(UserMapping::class); $mapperMock->expects($this->any()) ->method('getNameByDN') @@ -416,7 +405,7 @@ class AccessTest extends TestCase { $this->access->batchApplyUserAttributes($data); } - public function dNAttributeProvider() { + public static function dNAttributeProvider(): array { // corresponds to Access::resemblesDN() return [ 'dn' => ['dn'], @@ -428,11 +417,10 @@ class AccessTest extends TestCase { /** * @dataProvider dNAttributeProvider - * @param $attribute */ - public function testSanitizeDN($attribute): void { + public function testSanitizeDN(string $attribute): void { [$lw, $con, $um, $helper] = $this->getConnectorAndLdapMock(); - /** @var IConfig|MockObject $config */ + /** @var IConfig&MockObject $config */ $config = $this->createMock(IConfig::class); $dnFromServer = 'cn=Mixed Cases,ou=Are Sufficient To,ou=Test,dc=example,dc=org'; @@ -628,7 +616,7 @@ class AccessTest extends TestCase { $this->userMapper->expects($this->exactly($fakeLdapEntries['count'])) ->method('getNameByDN') ->willReturnCallback(function ($fdn) { - $parts = ldap_explode_dn($fdn, false); + $parts = ldap_explode_dn($fdn, 0); return $parts[0]; }); @@ -676,7 +664,7 @@ class AccessTest extends TestCase { $this->assertSame('Another Good Team', $groups[1]['cn'][0]); } - public function intUsernameProvider() { + public static function intUsernameProvider(): array { return [ ['alice', 'alice'], ['b/ob', 'bob'], @@ -694,7 +682,7 @@ class AccessTest extends TestCase { ]; } - public function groupIDCandidateProvider() { + public static function groupIDCandidateProvider(): array { return [ ['alice', 'alice'], ['b/ob', 'b/ob'], @@ -713,11 +701,8 @@ class AccessTest extends TestCase { /** * @dataProvider intUsernameProvider - * - * @param $name - * @param $expected */ - public function testSanitizeUsername($name, $expected): void { + public function testSanitizeUsername(string $name, ?string $expected): void { if ($expected === null) { $this->expectException(\InvalidArgumentException::class); } @@ -752,7 +737,7 @@ class AccessTest extends TestCase { ->with('detta') ->willReturnOnConsecutiveCalls($offlineUserMock, $regularUserMock); - /** @var UserMapping|MockObject $mapperMock */ + /** @var UserMapping&MockObject $mapperMock */ $mapperMock = $this->createMock(UserMapping::class); $mapperMock->expects($this->any()) ->method('getNameByDN') diff --git a/apps/user_ldap/tests/ConfigurationTest.php b/apps/user_ldap/tests/ConfigurationTest.php index cced8334bf5..dd6bd020f7b 100644 --- a/apps/user_ldap/tests/ConfigurationTest.php +++ b/apps/user_ldap/tests/ConfigurationTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -10,15 +11,14 @@ namespace OCA\User_LDAP\Tests; use OCA\User_LDAP\Configuration; class ConfigurationTest extends \Test\TestCase { - /** @var Configuration */ - protected $configuration; + protected Configuration $configuration; protected function setUp(): void { parent::setUp(); $this->configuration = new Configuration('t01', false); } - public function configurationDataProvider() { + public static function configurationDataProvider(): array { $inputWithDN = [ 'cn=someUsers,dc=example,dc=org', ' ', @@ -89,12 +89,12 @@ class ConfigurationTest extends \Test\TestCase { /** * @dataProvider configurationDataProvider */ - public function testSetValue($key, $input, $expected): void { + public function testSetValue(string $key, string|array $input, string|array $expected): void { $this->configuration->setConfiguration([$key => $input]); $this->assertSame($this->configuration->$key, $expected); } - public function avatarRuleValueProvider() { + public static function avatarRuleValueProvider(): array { return [ ['none', []], ['data:selfie', ['selfie']], @@ -108,7 +108,7 @@ class ConfigurationTest extends \Test\TestCase { /** * @dataProvider avatarRuleValueProvider */ - public function testGetAvatarAttributes($setting, $expected): void { + public function testGetAvatarAttributes(string $setting, array $expected): void { $this->configuration->setConfiguration(['ldapUserAvatarRule' => $setting]); $this->assertSame($expected, $this->configuration->getAvatarAttributes()); } @@ -116,7 +116,7 @@ class ConfigurationTest extends \Test\TestCase { /** * @dataProvider avatarRuleValueProvider */ - public function testResolveRule($setting, $expected): void { + public function testResolveRule(string $setting, array $expected): void { $this->configuration->setConfiguration(['ldapUserAvatarRule' => $setting]); // so far the only thing that can get resolved :) $this->assertSame($expected, $this->configuration->resolveRule('avatar')); diff --git a/apps/user_ldap/tests/ConnectionTest.php b/apps/user_ldap/tests/ConnectionTest.php index 9cb19891b3d..601611fcc2f 100644 --- a/apps/user_ldap/tests/ConnectionTest.php +++ b/apps/user_ldap/tests/ConnectionTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -10,6 +11,7 @@ namespace OCA\User_LDAP\Tests; use OC\ServerNotAvailableException; use OCA\User_LDAP\Connection; use OCA\User_LDAP\ILDAPWrapper; +use PHPUnit\Framework\MockObject\MockObject; /** * Class Test_Connection @@ -19,19 +21,16 @@ use OCA\User_LDAP\ILDAPWrapper; * @package OCA\User_LDAP\Tests */ class ConnectionTest extends \Test\TestCase { - /** @var ILDAPWrapper|\PHPUnit\Framework\MockObject\MockObject */ - protected $ldap; - - /** @var Connection */ - protected $connection; + protected ILDAPWrapper&MockObject $ldap; + protected Connection $connection; protected function setUp(): void { parent::setUp(); $this->ldap = $this->createMock(ILDAPWrapper::class); // we use a mock here to replace the cache mechanism, due to missing DI in LDAP backend. - $this->connection = $this->getMockBuilder('OCA\User_LDAP\Connection') - ->setMethods(['getFromCache', 'writeToCache']) + $this->connection = $this->getMockBuilder(Connection::class) + ->onlyMethods(['getFromCache', 'writeToCache']) ->setConstructorArgs([$this->ldap, '', null]) ->getMock(); diff --git a/apps/user_ldap/tests/GroupLDAPPluginTest.php b/apps/user_ldap/tests/GroupLDAPPluginTest.php index f67de32c2e9..9f4cff64d6b 100644 --- a/apps/user_ldap/tests/GroupLDAPPluginTest.php +++ b/apps/user_ldap/tests/GroupLDAPPluginTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -9,27 +11,23 @@ use OCA\User_LDAP\GroupPluginManager; use OCP\GroupInterface; class GroupLDAPPluginTest extends \Test\TestCase { - - /** - * @return GroupPluginManager - */ - private function getGroupPluginManager() { + private function getGroupPluginManager(): GroupPluginManager { return new GroupPluginManager(); } public function testImplementsActions(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') - ->setMethods(['respondToActions']) + $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class) + ->onlyMethods(['respondToActions']) ->getMock(); $plugin->expects($this->any()) ->method('respondToActions') ->willReturn(GroupInterface::CREATE_GROUP); - $plugin2 = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') - ->setMethods(['respondToActions']) + $plugin2 = $this->getMockBuilder(LDAPGroupPluginDummy::class) + ->onlyMethods(['respondToActions']) ->getMock(); $plugin2->expects($this->any()) @@ -47,8 +45,8 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testCreateGroup(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') - ->setMethods(['respondToActions', 'createGroup']) + $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class) + ->onlyMethods(['respondToActions', 'createGroup']) ->getMock(); $plugin->expects($this->any()) @@ -77,8 +75,8 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testDeleteGroup(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') - ->setMethods(['respondToActions', 'deleteGroup']) + $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class) + ->onlyMethods(['respondToActions', 'deleteGroup']) ->getMock(); $plugin->expects($this->any()) @@ -107,8 +105,8 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testAddToGroup(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') - ->setMethods(['respondToActions', 'addToGroup']) + $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class) + ->onlyMethods(['respondToActions', 'addToGroup']) ->getMock(); $plugin->expects($this->any()) @@ -138,8 +136,8 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testRemoveFromGroup(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') - ->setMethods(['respondToActions', 'removeFromGroup']) + $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class) + ->onlyMethods(['respondToActions', 'removeFromGroup']) ->getMock(); $plugin->expects($this->any()) @@ -169,8 +167,8 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testCountUsersInGroup(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') - ->setMethods(['respondToActions', 'countUsersInGroup']) + $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class) + ->onlyMethods(['respondToActions', 'countUsersInGroup']) ->getMock(); $plugin->expects($this->any()) @@ -200,8 +198,8 @@ class GroupLDAPPluginTest extends \Test\TestCase { public function testgetGroupDetails(): void { $pluginManager = $this->getGroupPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPGroupPluginDummy') - ->setMethods(['respondToActions', 'getGroupDetails']) + $plugin = $this->getMockBuilder(LDAPGroupPluginDummy::class) + ->onlyMethods(['respondToActions', 'getGroupDetails']) ->getMock(); $plugin->expects($this->any()) diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php index ad97d5024b1..d2634548f4f 100644 --- a/apps/user_ldap/tests/Group_LDAPTest.php +++ b/apps/user_ldap/tests/Group_LDAPTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -34,10 +35,10 @@ use Test\TestCase; * @package OCA\User_LDAP\Tests */ class Group_LDAPTest extends TestCase { - private MockObject|Access $access; - private MockObject|GroupPluginManager $pluginManager; - private MockObject|IConfig $config; - private MockObject|IUserManager $ncUserManager; + private Access&MockObject $access; + private GroupPluginManager&MockObject $pluginManager; + private IConfig&MockObject $config; + private IUserManager&MockObject $ncUserManager; private GroupLDAP $groupBackend; public function setUp(): void { @@ -96,30 +97,19 @@ class Group_LDAPTest extends TestCase { * @return MockObject|Access */ private function getAccessMock() { - static $conMethods; - static $accMethods; - - if (is_null($conMethods) || is_null($accMethods)) { - $conMethods = get_class_methods(Connection::class); - $accMethods = get_class_methods(Access::class); - } $lw = $this->createMock(ILDAPWrapper::class); - $connector = $this->getMockBuilder(Connection::class) - ->setMethods($conMethods) ->setConstructorArgs([$lw, '', null]) ->getMock(); $this->access = $this->createMock(Access::class); - $this->access->connection = $connector; - $this->access->userManager = $this->createMock(Manager::class); return $this->access; } - private function enableGroups() { + private function enableGroups(): void { $this->access->connection->expects($this->any()) ->method('__get') ->willReturnCallback(function ($name) { @@ -179,7 +169,7 @@ class Group_LDAPTest extends TestCase { public function testCountUsersWithPlugin(): void { /** @var GroupPluginManager|MockObject $pluginManager */ $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'countUsersInGroup']) + ->onlyMethods(['implementsActions', 'countUsersInGroup']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -470,7 +460,7 @@ class Group_LDAPTest extends TestCase { $this->groupBackend->inGroup($uid, $gid); } - public function groupWithMembersProvider() { + public static function groupWithMembersProvider(): array { return [ [ 'someGroup', @@ -574,7 +564,7 @@ class Group_LDAPTest extends TestCase { $memberUids = []; $userRecords = []; foreach ($memberDNs as $dn) { - $memberUids[] = ldap_explode_dn($dn, false)[0]; + $memberUids[] = ldap_explode_dn($dn, 0)[0]; $userRecords[] = ['dn' => [$dn]]; } @@ -876,8 +866,8 @@ class Group_LDAPTest extends TestCase { $this->initBackend(); $returnedGroups = $this->groupBackend->getUserGroups('userX'); $this->assertCount(2, $returnedGroups); - $this->assertTrue(in_array('groupB', $returnedGroups)); - $this->assertTrue(in_array('groupF', $returnedGroups)); + $this->assertContains('groupB', $returnedGroups); + $this->assertContains('groupF', $returnedGroups); } /** @@ -903,8 +893,8 @@ class Group_LDAPTest extends TestCase { $this->initBackend(); $returnedGroups = $this->groupBackend->getUserGroups('userX'); $this->assertCount(2, $returnedGroups); - $this->assertTrue(in_array('groupB', $returnedGroups)); - $this->assertTrue(in_array('groupF', $returnedGroups)); + $this->assertContains('groupB', $returnedGroups); + $this->assertContains('groupF', $returnedGroups); } public function testGetUserGroupsUnrecognizedOfflineUser(): void { @@ -946,11 +936,11 @@ class Group_LDAPTest extends TestCase { $this->initBackend(); $returnedGroups = $this->groupBackend->getUserGroups('userX'); $this->assertCount(2, $returnedGroups); - $this->assertTrue(in_array('groupB', $returnedGroups)); - $this->assertTrue(in_array('groupF', $returnedGroups)); + $this->assertContains('groupB', $returnedGroups); + $this->assertContains('groupF', $returnedGroups); } - public function nestedGroupsProvider(): array { + public static function nestedGroupsProvider(): array { return [ [true], [false], @@ -1076,7 +1066,7 @@ class Group_LDAPTest extends TestCase { public function testCreateGroupWithPlugin(): void { $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'createGroup']) + ->onlyMethods(['implementsActions', 'createGroup']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -1090,7 +1080,7 @@ class Group_LDAPTest extends TestCase { ->willReturn('result'); $this->initBackend(); - $this->assertEquals($this->groupBackend->createGroup('gid'), true); + $this->assertTrue($this->groupBackend->createGroup('gid')); } @@ -1098,7 +1088,7 @@ class Group_LDAPTest extends TestCase { $this->expectException(\Exception::class); $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'createGroup']) + ->onlyMethods(['implementsActions', 'createGroup']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -1112,7 +1102,7 @@ class Group_LDAPTest extends TestCase { public function testDeleteGroupWithPlugin(): void { $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'deleteGroup']) + ->onlyMethods(['implementsActions', 'deleteGroup']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -1126,7 +1116,7 @@ class Group_LDAPTest extends TestCase { ->willReturn(true); $mapper = $this->getMockBuilder(GroupMapping::class) - ->setMethods(['unmap']) + ->onlyMethods(['unmap']) ->disableOriginalConstructor() ->getMock(); @@ -1143,7 +1133,7 @@ class Group_LDAPTest extends TestCase { $this->expectException(\Exception::class); $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'deleteGroup']) + ->onlyMethods(['implementsActions', 'deleteGroup']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -1157,7 +1147,7 @@ class Group_LDAPTest extends TestCase { public function testAddToGroupWithPlugin(): void { $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'addToGroup']) + ->onlyMethods(['implementsActions', 'addToGroup']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -1171,7 +1161,7 @@ class Group_LDAPTest extends TestCase { ->willReturn('result'); $this->initBackend(); - $this->assertEquals($this->groupBackend->addToGroup('uid', 'gid'), 'result'); + $this->assertEquals('result', $this->groupBackend->addToGroup('uid', 'gid')); } @@ -1179,7 +1169,7 @@ class Group_LDAPTest extends TestCase { $this->expectException(\Exception::class); $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'addToGroup']) + ->onlyMethods(['implementsActions', 'addToGroup']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -1193,7 +1183,7 @@ class Group_LDAPTest extends TestCase { public function testRemoveFromGroupWithPlugin(): void { $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'removeFromGroup']) + ->onlyMethods(['implementsActions', 'removeFromGroup']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -1207,7 +1197,7 @@ class Group_LDAPTest extends TestCase { ->willReturn('result'); $this->initBackend(); - $this->assertEquals($this->groupBackend->removeFromGroup('uid', 'gid'), 'result'); + $this->assertEquals('result', $this->groupBackend->removeFromGroup('uid', 'gid')); } @@ -1215,7 +1205,7 @@ class Group_LDAPTest extends TestCase { $this->expectException(\Exception::class); $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'removeFromGroup']) + ->onlyMethods(['implementsActions', 'removeFromGroup']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -1230,7 +1220,7 @@ class Group_LDAPTest extends TestCase { public function testGetGroupDetailsWithPlugin(): void { /** @var GroupPluginManager|MockObject $pluginManager */ $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'getGroupDetails']) + ->onlyMethods(['implementsActions', 'getGroupDetails']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -1244,14 +1234,14 @@ class Group_LDAPTest extends TestCase { ->willReturn('result'); $this->initBackend(); - $this->assertEquals($this->groupBackend->getGroupDetails('gid'), 'result'); + $this->assertEquals('result', $this->groupBackend->getGroupDetails('gid')); } public function testGetGroupDetailsFailing(): void { $this->expectException(\Exception::class); $this->pluginManager = $this->getMockBuilder(GroupPluginManager::class) - ->setMethods(['implementsActions', 'getGroupDetails']) + ->onlyMethods(['implementsActions', 'getGroupDetails']) ->getMock(); $this->pluginManager->expects($this->once()) @@ -1263,7 +1253,7 @@ class Group_LDAPTest extends TestCase { $this->groupBackend->getGroupDetails('gid'); } - public function groupMemberProvider() { + public static function groupMemberProvider(): array { $base = 'dc=species,dc=earth'; $birdsDn = [ @@ -1332,10 +1322,9 @@ class Group_LDAPTest extends TestCase { } /** - * @param string[] $expectedMembers * @dataProvider groupMemberProvider */ - public function testGroupMembers(array $expectedResult, ?array $groupsInfo = null): void { + public function testGroupMembers(array $expectedResult, array $groupsInfo): void { $this->access->expects($this->any()) ->method('readAttribute') ->willReturnCallback(function ($group) use ($groupsInfo) { @@ -1360,11 +1349,13 @@ class Group_LDAPTest extends TestCase { foreach ($expectedResult as $groupDN => $expectedMembers) { $resultingMembers = $this->invokePrivate($this->groupBackend, '_groupMembers', [$groupDN]); - $this->assertEqualsCanonicalizing($expectedMembers, $resultingMembers); + sort($expectedMembers); + sort($resultingMembers); + $this->assertEquals($expectedMembers, $resultingMembers); } } - public function displayNameProvider() { + public static function displayNameProvider(): array { return [ ['Graphic Novelists', ['Graphic Novelists']], ['', false], @@ -1374,7 +1365,7 @@ class Group_LDAPTest extends TestCase { /** * @dataProvider displayNameProvider */ - public function testGetDisplayName(string $expected, $ldapResult): void { + public function testGetDisplayName(string $expected, bool|array $ldapResult): void { $gid = 'graphic_novelists'; $this->access->expects($this->atLeastOnce()) diff --git a/apps/user_ldap/tests/HelperTest.php b/apps/user_ldap/tests/HelperTest.php index eee5c162b53..470b67c5531 100644 --- a/apps/user_ldap/tests/HelperTest.php +++ b/apps/user_ldap/tests/HelperTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -9,17 +11,15 @@ use OCA\User_LDAP\Helper; use OCP\IConfig; use OCP\IDBConnection; use OCP\Server; +use PHPUnit\Framework\MockObject\MockObject; /** * @group DB */ class HelperTest extends \Test\TestCase { + private IConfig&MockObject $config; - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - private $config; - - /** @var Helper */ - private $helper; + private Helper $helper; protected function setUp(): void { parent::setUp(); diff --git a/apps/user_ldap/tests/Integration/Lib/IntegrationTestAttributeDetection.php b/apps/user_ldap/tests/Integration/Lib/IntegrationTestAttributeDetection.php index e45238fa978..ae1709edd22 100644 --- a/apps/user_ldap/tests/Integration/Lib/IntegrationTestAttributeDetection.php +++ b/apps/user_ldap/tests/Integration/Lib/IntegrationTestAttributeDetection.php @@ -3,7 +3,7 @@ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\user_ldap\tests\Integration\Lib; +namespace OCA\User_LDAP\Tests\Integration\Lib; use OCA\User_LDAP\Group_LDAP; use OCA\User_LDAP\GroupPluginManager; diff --git a/apps/user_ldap/tests/Jobs/CleanUpTest.php b/apps/user_ldap/tests/Jobs/CleanUpTest.php index 582b6fba5d7..cefc9cc86b5 100644 --- a/apps/user_ldap/tests/Jobs/CleanUpTest.php +++ b/apps/user_ldap/tests/Jobs/CleanUpTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -18,13 +19,11 @@ use OCP\IDBConnection; use Test\TestCase; class CleanUpTest extends TestCase { - /** @var CleanUp */ - protected $bgJob; - - /** @var array */ - protected $mocks; + protected CleanUp $bgJob; + protected array $mocks; public function setUp(): void { + parent::setUp(); $this->createMocks(); $this->bgJob = new CleanUp($this->mocks['timeFactory'], $this->mocks['userBackend'], $this->mocks['deletedUsersIndex']); $this->bgJob->setArguments($this->mocks); diff --git a/apps/user_ldap/tests/Jobs/SyncTest.php b/apps/user_ldap/tests/Jobs/SyncTest.php index 8277e7d48a9..20489ea0901 100644 --- a/apps/user_ldap/tests/Jobs/SyncTest.php +++ b/apps/user_ldap/tests/Jobs/SyncTest.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -26,32 +27,23 @@ use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Test\TestCase; +/** + * @group DB + */ class SyncTest extends TestCase { - /** @var array */ - protected $arguments; - /** @var Helper|MockObject */ - protected $helper; - /** @var LDAP|MockObject */ - protected $ldapWrapper; - /** @var Manager|MockObject */ - protected $userManager; - /** @var UserMapping|MockObject */ - protected $mapper; + protected Helper&MockObject $helper; + protected LDAP&MockObject $ldapWrapper; + protected Manager&MockObject $userManager; + protected UserMapping&MockObject $mapper; + protected IConfig&MockObject $config; + protected IAvatarManager&MockObject $avatarManager; + protected IDBConnection&MockObject $dbc; + protected IUserManager&MockObject $ncUserManager; + protected IManager&MockObject $notificationManager; + protected ConnectionFactory&MockObject $connectionFactory; + protected AccessFactory&MockObject $accessFactory; + protected array $arguments = []; protected Sync $sync; - /** @var IConfig|MockObject */ - protected $config; - /** @var IAvatarManager|MockObject */ - protected $avatarManager; - /** @var IDBConnection|MockObject */ - protected $dbc; - /** @var IUserManager|MockObject */ - protected $ncUserManager; - /** @var IManager|MockObject */ - protected $notificationManager; - /** @var ConnectionFactory|MockObject */ - protected $connectionFactory; - /** @var AccessFactory|MockObject */ - protected $accessFactory; protected function setUp(): void { parent::setUp(); @@ -65,7 +57,11 @@ class SyncTest extends TestCase { $this->dbc = $this->createMock(IDBConnection::class); $this->ncUserManager = $this->createMock(IUserManager::class); $this->notificationManager = $this->createMock(IManager::class); - $this->connectionFactory = $this->createMock(ConnectionFactory::class); + $this->connectionFactory = $this->getMockBuilder(ConnectionFactory::class) + ->setConstructorArgs([ + $this->ldapWrapper, + ]) + ->getMock(); $this->accessFactory = $this->createMock(AccessFactory::class); $this->sync = new Sync( @@ -86,7 +82,7 @@ class SyncTest extends TestCase { $this->sync->overwritePropertiesForTest($this->ldapWrapper); } - public function intervalDataProvider(): array { + public static function intervalDataProvider(): array { return [ [ 0, 1000, 750 @@ -139,7 +135,7 @@ class SyncTest extends TestCase { $this->sync->updateInterval(); } - public function moreResultsProvider() { + public static function moreResultsProvider(): array { return [ [ 3, 3, true ], [ 3, 5, true ], @@ -153,7 +149,11 @@ class SyncTest extends TestCase { * @dataProvider moreResultsProvider */ public function testMoreResults($pagingSize, $results, $expected): void { - $connection = $this->createMock(Connection::class); + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([ + $this->ldapWrapper, + ]) + ->getMock(); $this->connectionFactory->expects($this->any()) ->method('get') ->willReturn($connection); @@ -166,7 +166,7 @@ class SyncTest extends TestCase { return null; }); - /** @var Access|MockObject $access */ + /** @var Access&MockObject $access */ $access = $this->createMock(Access::class); $this->accessFactory->expects($this->any()) ->method('get') @@ -191,7 +191,7 @@ class SyncTest extends TestCase { $this->assertSame($expected, $hasMoreResults); } - public function cycleDataProvider() { + public static function cycleDataProvider(): array { $lastCycle = ['prefix' => 's01', 'offset' => 1000]; $lastCycle2 = ['prefix' => '', 'offset' => 1000]; return [ @@ -207,19 +207,23 @@ class SyncTest extends TestCase { /** * @dataProvider cycleDataProvider */ - public function testDetermineNextCycle($cycleData, $prefixes, $expectedCycle): void { + public function testDetermineNextCycle(?array $cycleData, array $prefixes, ?array $expectedCycle): void { $this->helper->expects($this->any()) ->method('getServerConfigurationPrefixes') ->with(true) ->willReturn($prefixes); if (is_array($expectedCycle)) { + $calls = [ + ['user_ldap', 'background_sync_prefix', $expectedCycle['prefix']], + ['user_ldap', 'background_sync_offset', $expectedCycle['offset']], + ]; $this->config->expects($this->exactly(2)) ->method('setAppValue') - ->withConsecutive( - ['user_ldap', 'background_sync_prefix', $expectedCycle['prefix']], - ['user_ldap', 'background_sync_offset', $expectedCycle['offset']] - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); } else { $this->config->expects($this->never()) ->method('setAppValue'); @@ -248,7 +252,7 @@ class SyncTest extends TestCase { $this->assertFalse($this->sync->qualifiesToRun($cycleData)); } - public function runDataProvider(): array { + public static function runDataProvider(): array { return [ #0 - one LDAP server, reset [[ @@ -283,7 +287,7 @@ class SyncTest extends TestCase { /** * @dataProvider runDataProvider */ - public function testRun($runData): void { + public function testRun(array $runData): void { $this->config->expects($this->any()) ->method('getAppValue') ->willReturnCallback(function ($app, $key, $default) use ($runData) { @@ -310,13 +314,18 @@ class SyncTest extends TestCase { return $default; }); + + $calls = [ + ['user_ldap', 'background_sync_prefix', $runData['expectedNextCycle']['prefix']], + ['user_ldap', 'background_sync_offset', $runData['expectedNextCycle']['offset']], + ['user_ldap', 'background_sync_interval', '43200'], + ]; $this->config->expects($this->exactly(3)) ->method('setAppValue') - ->withConsecutive( - ['user_ldap', 'background_sync_prefix', $runData['expectedNextCycle']['prefix']], - ['user_ldap', 'background_sync_offset', $runData['expectedNextCycle']['offset']], - ['user_ldap', 'background_sync_interval', $this->anything()] - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); $this->config->expects($this->any()) ->method('getAppKeys') ->with('user_ldap') @@ -327,7 +336,11 @@ class SyncTest extends TestCase { ->with(true) ->willReturn($runData['prefixes']); - $connection = $this->createMock(Connection::class); + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([ + $this->ldapWrapper, + ]) + ->getMock(); $this->connectionFactory->expects($this->any()) ->method('get') ->willReturn($connection); @@ -340,7 +353,7 @@ class SyncTest extends TestCase { return null; }); - /** @var Access|MockObject $access */ + /** @var Access&MockObject $access */ $access = $this->createMock(Access::class); $this->accessFactory->expects($this->any()) ->method('get') diff --git a/apps/user_ldap/tests/LDAPGroupPluginDummy.php b/apps/user_ldap/tests/LDAPGroupPluginDummy.php index 0d47fbbd290..5ea1a491f14 100644 --- a/apps/user_ldap/tests/LDAPGroupPluginDummy.php +++ b/apps/user_ldap/tests/LDAPGroupPluginDummy.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/apps/user_ldap/tests/LDAPProviderTest.php b/apps/user_ldap/tests/LDAPProviderTest.php index 9b0830ae513..a4da4a91948 100644 --- a/apps/user_ldap/tests/LDAPProviderTest.php +++ b/apps/user_ldap/tests/LDAPProviderTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -12,6 +14,7 @@ use OCA\User_LDAP\Connection; use OCA\User_LDAP\Group_LDAP; use OCA\User_LDAP\Helper; use OCA\User_LDAP\IGroupLDAP; +use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\IUserLDAP; use OCA\User_LDAP\LDAPProviderFactory; use OCA\User_LDAP\User_LDAP; @@ -31,13 +34,9 @@ use Psr\Log\LoggerInterface; * @package OCA\User_LDAP\Tests */ class LDAPProviderTest extends \Test\TestCase { - protected function setUp(): void { - parent::setUp(); - } - private function getServerMock(IUserLDAP $userBackend, IGroupLDAP $groupBackend) { $server = $this->getMockBuilder('OC\Server') - ->setMethods(['getUserManager', 'getBackends', 'getGroupManager']) + ->onlyMethods(['getUserManager', 'getGroupManager']) ->setConstructorArgs(['', new Config(\OC::$configDir)]) ->getMock(); $server->expects($this->any()) @@ -46,16 +45,13 @@ class LDAPProviderTest extends \Test\TestCase { $server->expects($this->any()) ->method('getGroupManager') ->willReturn($this->getGroupManagerMock($groupBackend)); - $server->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); return $server; } private function getUserManagerMock(IUserLDAP $userBackend) { $userManager = $this->getMockBuilder(Manager::class) - ->setMethods(['getBackends']) + ->onlyMethods(['getBackends']) ->setConstructorArgs([ $this->createMock(IConfig::class), $this->createMock(ICacheFactory::class), @@ -71,7 +67,7 @@ class LDAPProviderTest extends \Test\TestCase { private function getGroupManagerMock(IGroupLDAP $groupBackend) { $groupManager = $this->getMockBuilder('OC\Group\Manager') - ->setMethods(['getBackends']) + ->onlyMethods(['getBackends']) ->disableOriginalConstructor() ->getMock(); $groupManager->expects($this->any()) @@ -98,8 +94,8 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any())->method('userExists')->willReturn(false); @@ -110,20 +106,25 @@ class LDAPProviderTest extends \Test\TestCase { $ldapProvider->getUserDN('nonexisting_user'); } + public function testGetUserDN(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists', 'getLDAPAccess', 'username2dn']) + $userAccess = $this->getMockBuilder(Access::class) + ->onlyMethods(['username2dn']) + ->disableOriginalConstructor() + ->getMock(); + $userAccess->expects($this->once()) + ->method('username2dn') + ->willReturn('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'); + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists', 'getLDAPAccess']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->once()) ->method('userExists') ->willReturn(true); - $userBackend->expects($this->once()) - ->method('username2dn') - ->willReturn('cn=existing_user,ou=Are Sufficient To,ou=Test,dc=example,dc=org'); $userBackend->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); + ->method('getLDAPAccess') + ->willReturn($userAccess); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -137,12 +138,9 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('Group id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->disableOriginalConstructor() - ->getMock(); - - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') - ->setMethods(['groupExists']) + $userBackend = $this->createMock(User_LDAP::class); + $groupBackend = $this->getMockBuilder(Group_LDAP::class) + ->onlyMethods(['groupExists']) ->disableOriginalConstructor() ->getMock(); @@ -155,25 +153,23 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetGroupDN(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists', 'getLDAPAccess', 'username2dn']) - ->disableOriginalConstructor() - ->getMock(); + $userBackend = $this->createMock(User_LDAP::class); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') - ->setMethods(['groupExists', 'getLDAPAccess', 'groupname2dn']) + $groupBackend = $this->getMockBuilder(Group_LDAP::class) + ->onlyMethods(['groupExists', 'getLDAPAccess']) ->disableOriginalConstructor() ->getMock(); + $groupAccess = $this->createMock(Access::class); + $groupAccess->expects($this->once()) + ->method('groupname2dn') + ->willReturn('cn=existing_group,ou=Are Sufficient To,ou=Test,dc=example,dc=org'); $groupBackend->expects($this->once()) ->method('groupExists') ->willReturn(true); - $groupBackend->expects($this->once()) - ->method('groupname2dn') - ->willReturn('cn=existing_group,ou=Are Sufficient To,ou=Test,dc=example,dc=org'); $groupBackend->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); + ->method('getLDAPAccess') + ->willReturn($groupAccess); $server = $this->getServerMock($userBackend, $groupBackend); @@ -183,8 +179,8 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetUserName(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['dn2UserName']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['dn2UserName']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any()) @@ -199,10 +195,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testDNasBaseParameter(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods([]) - ->disableOriginalConstructor() - ->getMock(); + $userBackend = $this->createMock(User_LDAP::class); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -215,10 +208,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testSanitizeDN(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods([]) - ->disableOriginalConstructor() - ->getMock(); + $userBackend = $this->createMock(User_LDAP::class); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -235,10 +225,7 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists']) - ->disableOriginalConstructor() - ->getMock(); + $userBackend = $this->createMock(User_LDAP::class); $userBackend->expects($this->any())->method('userExists')->willReturn(false); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -248,8 +235,8 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetLDAPConnection(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists', 'getNewLDAPConnection']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists', 'getNewLDAPConnection']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any()) @@ -271,12 +258,9 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('Group id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->disableOriginalConstructor() - ->getMock(); - - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') - ->setMethods(['groupExists']) + $userBackend = $this->createMock(User_LDAP::class); + $groupBackend = $this->getMockBuilder(Group_LDAP::class) + ->onlyMethods(['groupExists']) ->disableOriginalConstructor() ->getMock(); @@ -289,12 +273,9 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetGroupLDAPConnection(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->disableOriginalConstructor() - ->getMock(); - - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') - ->setMethods(['groupExists','getNewLDAPConnection']) + $userBackend = $this->createMock(User_LDAP::class); + $groupBackend = $this->getMockBuilder(Group_LDAP::class) + ->onlyMethods(['groupExists','getNewLDAPConnection']) ->disableOriginalConstructor() ->getMock(); @@ -318,8 +299,8 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any())->method('userExists')->willReturn(false); @@ -337,7 +318,9 @@ class LDAPProviderTest extends \Test\TestCase { ]; $dn = 'uid=malik,' . $bases[1]; - $connection = $this->createMock(Connection::class); + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); $connection->expects($this->any()) ->method('__get') ->willReturnCallback(function ($key) use ($bases) { @@ -359,8 +342,8 @@ class LDAPProviderTest extends \Test\TestCase { ->method('username2dn') ->willReturn($dn); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists', 'getLDAPAccess']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->atLeastOnce()) @@ -381,8 +364,8 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any())->method('userExists')->willReturn(false); @@ -399,7 +382,9 @@ class LDAPProviderTest extends \Test\TestCase { 'ou=groups,ou=barfoo,dc=example,dc=org', ]; - $connection = $this->createMock(Connection::class); + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); $connection->expects($this->any()) ->method('__get') ->willReturnCallback(function ($key) use ($bases) { @@ -415,8 +400,8 @@ class LDAPProviderTest extends \Test\TestCase { ->method('getConnection') ->willReturn($connection); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists', 'getLDAPAccess']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any()) @@ -437,8 +422,8 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any())->method('userExists')->willReturn(false); @@ -450,19 +435,25 @@ class LDAPProviderTest extends \Test\TestCase { } public function testClearCache(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'clearCache']) + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); + $connection->expects($this->once()) + ->method('clearCache') + ->willReturn(true); + $access = $this->createMock(Access::class); + $access->method('getConnection') + ->willReturn($connection); + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists', 'getLDAPAccess']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->once()) ->method('userExists') ->willReturn(true); - $userBackend->expects($this->once()) - ->method('clearCache') - ->willReturn(true); $userBackend->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); + ->method('getLDAPAccess') + ->willReturn($access); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -476,11 +467,11 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('Group id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') + $userBackend = $this->getMockBuilder(User_LDAP::class) ->disableOriginalConstructor() ->getMock(); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') - ->setMethods(['groupExists']) + $groupBackend = $this->getMockBuilder(Group_LDAP::class) + ->onlyMethods(['groupExists']) ->disableOriginalConstructor() ->getMock(); $groupBackend->expects($this->any())->method('groupExists')->willReturn(false); @@ -492,22 +483,26 @@ class LDAPProviderTest extends \Test\TestCase { } public function testClearGroupCache(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->disableOriginalConstructor() + $userBackend = $this->createMock(User_LDAP::class); + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) ->getMock(); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') - ->setMethods(['groupExists', 'getLDAPAccess', 'getConnection', 'clearCache']) + $connection->expects($this->once()) + ->method('clearCache') + ->willReturn(true); + $access = $this->createMock(Access::class); + $access->method('getConnection') + ->willReturn($connection); + $groupBackend = $this->getMockBuilder(Group_LDAP::class) + ->onlyMethods(['groupExists', 'getLDAPAccess']) ->disableOriginalConstructor() ->getMock(); $groupBackend->expects($this->once()) ->method('groupExists') ->willReturn(true); - $groupBackend->expects($this->once()) - ->method('clearCache') - ->willReturn(true); $groupBackend->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); + ->method('getLDAPAccess') + ->willReturn($access); $server = $this->getServerMock($userBackend, $groupBackend); @@ -517,8 +512,8 @@ class LDAPProviderTest extends \Test\TestCase { } public function testDnExists(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['dn2UserName']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['dn2UserName']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any()) @@ -532,11 +527,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testFlagRecord(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods([]) - ->disableOriginalConstructor() - ->getMock(); - + $userBackend = $this->createMock(User_LDAP::class); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); $ldapProvider = $this->getLDAPProvider($server); @@ -545,11 +536,7 @@ class LDAPProviderTest extends \Test\TestCase { } public function testUnflagRecord(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods([]) - ->disableOriginalConstructor() - ->getMock(); - + $userBackend = $this->createMock(User_LDAP::class); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); $ldapProvider = $this->getLDAPProvider($server); @@ -562,8 +549,8 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any())->method('userExists')->willReturn(false); @@ -575,19 +562,25 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetLDAPDisplayNameField(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration']) + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); + $connection->expects($this->once()) + ->method('getConfiguration') + ->willReturn(['ldap_display_name' => 'displayName']); + $access = $this->createMock(Access::class); + $access->method('getConnection') + ->willReturn($connection); + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists', 'getLDAPAccess']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->once()) ->method('userExists') ->willReturn(true); - $userBackend->expects($this->once()) - ->method('getConfiguration') - ->willReturn(['ldap_display_name' => 'displayName']); $userBackend->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); + ->method('getLDAPAccess') + ->willReturn($access); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -600,8 +593,8 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('User id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists']) + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->any())->method('userExists')->willReturn(false); @@ -613,19 +606,25 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetLDAPEmailField(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->setMethods(['userExists', 'getLDAPAccess', 'getConnection', 'getConfiguration']) + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); + $connection->expects($this->once()) + ->method('getConfiguration') + ->willReturn(['ldap_email_attr' => 'mail']); + $access = $this->createMock(Access::class); + $access->method('getConnection') + ->willReturn($connection); + $userBackend = $this->getMockBuilder(User_LDAP::class) + ->onlyMethods(['userExists', 'getLDAPAccess']) ->disableOriginalConstructor() ->getMock(); $userBackend->expects($this->once()) ->method('userExists') ->willReturn(true); - $userBackend->expects($this->once()) - ->method('getConfiguration') - ->willReturn(['ldap_email_attr' => 'mail']); $userBackend->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); + ->method('getLDAPAccess') + ->willReturn($access); $server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock()); @@ -638,16 +637,15 @@ class LDAPProviderTest extends \Test\TestCase { $this->expectException(\Exception::class); $this->expectExceptionMessage('Group id not found in LDAP'); - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->disableOriginalConstructor() - ->getMock(); - - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') - ->setMethods(['groupExists']) + $userBackend = $this->createMock(User_LDAP::class); + $groupBackend = $this->getMockBuilder(Group_LDAP::class) + ->onlyMethods(['groupExists']) ->disableOriginalConstructor() ->getMock(); - $groupBackend->expects($this->any())->method('groupExists')->willReturn(false); + $groupBackend->expects($this->any()) + ->method('groupExists') + ->willReturn(false); $server = $this->getServerMock($userBackend, $groupBackend); @@ -656,12 +654,19 @@ class LDAPProviderTest extends \Test\TestCase { } public function testgetLDAPGroupMemberAssoc(): void { - $userBackend = $this->getMockBuilder('OCA\User_LDAP\User_LDAP') - ->disableOriginalConstructor() - ->getMock(); + $userBackend = $this->createMock(User_LDAP::class); - $groupBackend = $this->getMockBuilder('OCA\User_LDAP\Group_LDAP') - ->setMethods(['groupExists', 'getLDAPAccess', 'getConnection', 'getConfiguration']) + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); + $connection->expects($this->once()) + ->method('getConfiguration') + ->willReturn(['ldap_group_member_assoc_attribute' => 'assoc_type']); + $access = $this->createMock(Access::class); + $access->method('getConnection') + ->willReturn($connection); + $groupBackend = $this->getMockBuilder(Group_LDAP::class) + ->onlyMethods(['groupExists', 'getLDAPAccess']) ->disableOriginalConstructor() ->getMock(); @@ -669,11 +674,8 @@ class LDAPProviderTest extends \Test\TestCase { ->method('groupExists') ->willReturn(true); $groupBackend->expects($this->any()) - ->method('getConfiguration') - ->willReturn(['ldap_group_member_assoc_attribute' => 'assoc_type']); - $groupBackend->expects($this->any()) - ->method($this->anything()) - ->willReturnSelf(); + ->method('getLDAPAccess') + ->willReturn($access); $server = $this->getServerMock($userBackend, $groupBackend); @@ -698,7 +700,9 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetMultiValueUserAttributeCacheHit(): void { - $connection = $this->createMock(Connection::class); + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); $connection->expects(self::once()) ->method('getFromCache') ->with('admin-mailAlias') @@ -723,7 +727,9 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetMultiValueUserAttributeLdapError(): void { - $connection = $this->createMock(Connection::class); + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); $connection->expects(self::once()) ->method('getFromCache') ->with('admin-mailAlias') @@ -760,7 +766,9 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetMultiValueUserAttribute(): void { - $connection = $this->createMock(Connection::class); + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); $connection->expects(self::once()) ->method('getFromCache') ->with('admin-mailAlias') @@ -797,7 +805,9 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetUserAttributeLdapError(): void { - $connection = $this->createMock(Connection::class); + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); $connection->expects(self::once()) ->method('getFromCache') ->with('admin-mailAlias') @@ -834,7 +844,9 @@ class LDAPProviderTest extends \Test\TestCase { } public function testGetUserAttribute(): void { - $connection = $this->createMock(Connection::class); + $connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); $connection->expects(self::once()) ->method('getFromCache') ->with('admin-mailAlias') diff --git a/apps/user_ldap/tests/LDAPTest.php b/apps/user_ldap/tests/LDAPTest.php index a29751555cb..936a1a27d3d 100644 --- a/apps/user_ldap/tests/LDAPTest.php +++ b/apps/user_ldap/tests/LDAPTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -6,20 +8,20 @@ namespace OCA\User_LDAP\Tests; use OCA\User_LDAP\LDAP; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class LDAPTest extends TestCase { - /** @var LDAP|\PHPUnit\Framework\MockObject\MockObject */ - private $ldap; + private LDAP&MockObject $ldap; protected function setUp(): void { parent::setUp(); $this->ldap = $this->getMockBuilder(LDAP::class) - ->setMethods(['invokeLDAPMethod']) + ->onlyMethods(['invokeLDAPMethod']) ->getMock(); } - public function errorProvider() { + public static function errorProvider(): array { return [ [ 'ldap_search(): Partial search results returned: Sizelimit exceeded at /srv/http/nextcloud/master/apps/user_ldap/lib/LDAP.php#292', @@ -32,8 +34,6 @@ class LDAPTest extends TestCase { } /** - * @param string $errorMessage - * @param bool $passThrough * @dataProvider errorProvider */ public function testSearchWithErrorHandler(string $errorMessage, bool $passThrough): void { diff --git a/apps/user_ldap/tests/LDAPUserPluginDummy.php b/apps/user_ldap/tests/LDAPUserPluginDummy.php index f6edf3df63b..8d4870406ae 100644 --- a/apps/user_ldap/tests/LDAPUserPluginDummy.php +++ b/apps/user_ldap/tests/LDAPUserPluginDummy.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -39,4 +41,12 @@ class LDAPUserPluginDummy implements ILDAPUserPlugin { public function countUsers() { return null; } + + public function canDeleteUser() { + return true; + } + + public function deleteUser($uid) { + return null; + } } diff --git a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php b/apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php index f1e9b1b67bc..8efee4e2085 100644 --- a/apps/user_ldap/tests/Mapping/AbstractMappingTest.php +++ b/apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -11,7 +12,7 @@ use OCA\User_LDAP\Mapping\AbstractMapping; use OCP\IDBConnection; use OCP\Server; -abstract class AbstractMappingTest extends \Test\TestCase { +abstract class AbstractMappingTestCase extends \Test\TestCase { abstract public function getMapper(IDBConnection $dbMock); /** @@ -29,8 +30,8 @@ abstract class AbstractMappingTest extends \Test\TestCase { * returns an array of test entries with dn, name and uuid as keys * @return array */ - protected function getTestData() { - $data = [ + protected static function getTestData(): array { + return [ [ 'dn' => 'uid=foobar,dc=example,dc=org', 'name' => 'Foobar', @@ -47,8 +48,6 @@ abstract class AbstractMappingTest extends \Test\TestCase { 'uuid' => '3333-CCCC-1234-CDEF', ] ]; - - return $data; } /** @@ -56,7 +55,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { * @param AbstractMapping $mapper * @param array $data */ - protected function mapEntries($mapper, $data) { + protected function mapEntries(AbstractMapping $mapper, array $data): void { foreach ($data as $entry) { $done = $mapper->map($entry['dn'], $entry['name'], $entry['uuid']); $this->assertTrue($done); @@ -70,7 +69,7 @@ abstract class AbstractMappingTest extends \Test\TestCase { * @return array 0 = \OCA\User_LDAP\Mapping\AbstractMapping, 1 = array of * users or groups */ - private function initTest() { + private function initTest(): array { $dbc = Server::get(IDBConnection::class); $mapper = $this->getMapper($dbc); $data = $this->getTestData(); @@ -157,13 +156,13 @@ abstract class AbstractMappingTest extends \Test\TestCase { [$mapper,] = $this->initTest(); $names = $mapper->getNamesBySearch('oo', '%', '%'); - $this->assertTrue(is_array($names)); + $this->assertIsArray($names); $this->assertSame(2, count($names)); - $this->assertTrue(in_array('Foobar', $names)); - $this->assertTrue(in_array('Barfoo', $names)); + $this->assertContains('Foobar', $names); + $this->assertContains('Barfoo', $names); $names = $mapper->getNamesBySearch('nada'); - $this->assertTrue(is_array($names)); - $this->assertSame(0, count($names)); + $this->assertIsArray($names); + $this->assertCount(0, $names); } /** @@ -250,20 +249,20 @@ abstract class AbstractMappingTest extends \Test\TestCase { // get all entries without specifying offset or limit $results = $mapper->getList(); - $this->assertSame(3, count($results)); + $this->assertCount(3, $results); // get all-1 entries by specifying offset, and an high limit // specifying only offset without limit will not work by underlying lib $results = $mapper->getList(1, 999); - $this->assertSame(count($data) - 1, count($results)); + $this->assertCount(count($data) - 1, $results); // get first 2 entries by limit, but not offset $results = $mapper->getList(0, 2); - $this->assertSame(2, count($results)); + $this->assertCount(2, $results); // get 2nd entry by specifying both offset and limit $results = $mapper->getList(1, 1); - $this->assertSame(1, count($results)); + $this->assertCount(1, $results); } public function testGetListOfIdsByDn(): void { @@ -282,6 +281,6 @@ abstract class AbstractMappingTest extends \Test\TestCase { } $result = $mapper->getListOfIdsByDn($listOfDNs); - $this->assertSame(66640 / 20, count($result)); + $this->assertCount(66640 / 20, $result); } } diff --git a/apps/user_ldap/tests/Mapping/GroupMappingTest.php b/apps/user_ldap/tests/Mapping/GroupMappingTest.php index efa42e47863..5729058d10e 100644 --- a/apps/user_ldap/tests/Mapping/GroupMappingTest.php +++ b/apps/user_ldap/tests/Mapping/GroupMappingTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -17,7 +18,7 @@ use OCP\IDBConnection; * * @package OCA\User_LDAP\Tests\Mapping */ -class GroupMappingTest extends AbstractMappingTest { +class GroupMappingTest extends AbstractMappingTestCase { public function getMapper(IDBConnection $dbMock) { return new GroupMapping($dbMock); } diff --git a/apps/user_ldap/tests/Mapping/UserMappingTest.php b/apps/user_ldap/tests/Mapping/UserMappingTest.php index 07980ba470c..4346fe1d23f 100644 --- a/apps/user_ldap/tests/Mapping/UserMappingTest.php +++ b/apps/user_ldap/tests/Mapping/UserMappingTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -18,7 +19,7 @@ use OCP\Support\Subscription\IAssertion; * * @package OCA\User_LDAP\Tests\Mapping */ -class UserMappingTest extends AbstractMappingTest { +class UserMappingTest extends AbstractMappingTestCase { public function getMapper(IDBConnection $dbMock) { return new UserMapping($dbMock, $this->createMock(IAssertion::class)); } diff --git a/apps/user_ldap/tests/Migration/AbstractUUIDFixTest.php b/apps/user_ldap/tests/Migration/AbstractUUIDFixTestCase.php index f8abcaeb482..7a85b885bc1 100644 --- a/apps/user_ldap/tests/Migration/AbstractUUIDFixTest.php +++ b/apps/user_ldap/tests/Migration/AbstractUUIDFixTestCase.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -13,17 +15,18 @@ use OCA\User_LDAP\Migration\UUIDFix; use OCA\User_LDAP\Proxy; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IConfig; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; -abstract class AbstractUUIDFixTest extends TestCase { - protected Helper $helper; - protected IConfig $config; - protected LDAP $ldap; +abstract class AbstractUUIDFixTestCase extends TestCase { + protected Helper&MockObject $helper; + protected IConfig&MockObject $config; + protected LDAP&MockObject $ldap; protected AbstractMapping $mapper; protected UUIDFix $job; protected Proxy $proxy; - protected Access $access; - protected ITimeFactory $time; + protected Access&MockObject $access; + protected ITimeFactory&MockObject $time; protected bool $isUser = true; protected function setUp(): void { @@ -141,19 +144,23 @@ abstract class AbstractUUIDFixTest extends TestCase { $this->access->expects($this->exactly(3)) ->method('getUUID') - ->withConsecutive( - [$args['records'][0]['dn'], $this->isUser], - [$args['records'][1]['dn'], $this->isUser], - [$args['records'][2]['dn'], $this->isUser] - ) - ->willReturnOnConsecutiveCalls($correctUUIDs[0], $correctUUIDs[1], $correctUUIDs[2]); - + ->willReturnMap([ + [$args['records'][0]['dn'], $this->isUser, null, $correctUUIDs[0]], + [$args['records'][1]['dn'], $this->isUser, null, $correctUUIDs[1]], + [$args['records'][2]['dn'], $this->isUser, null, $correctUUIDs[2]], + ]); + + $calls = [ + [$correctUUIDs[0], $args['records'][0]['dn']], + [$correctUUIDs[2], $args['records'][2]['dn']], + ]; $this->mapper->expects($this->exactly(2)) ->method('setUUIDbyDN') - ->withConsecutive( - [$correctUUIDs[0], $args['records'][0]['dn']], - [$correctUUIDs[2], $args['records'][2]['dn']] - ); + ->willReturnCallback(function ($i, $j) use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + return true; + }); $this->job->run($args); } diff --git a/apps/user_ldap/tests/Migration/UUIDFixGroupTest.php b/apps/user_ldap/tests/Migration/UUIDFixGroupTest.php index ab8fe03d6d2..89d880f4acb 100644 --- a/apps/user_ldap/tests/Migration/UUIDFixGroupTest.php +++ b/apps/user_ldap/tests/Migration/UUIDFixGroupTest.php @@ -1,14 +1,15 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\Group_LDAP\Tests\Migration; +namespace OCA\User_LDAP\Tests\Migration; use OCA\User_LDAP\Group_Proxy; use OCA\User_LDAP\Mapping\GroupMapping; use OCA\User_LDAP\Migration\UUIDFixGroup; -use OCA\User_LDAP\Tests\Migration\AbstractUUIDFixTest; /** * Class UUIDFixGroupTest @@ -16,7 +17,7 @@ use OCA\User_LDAP\Tests\Migration\AbstractUUIDFixTest; * @package OCA\Group_LDAP\Tests\Migration * @group DB */ -class UUIDFixGroupTest extends AbstractUUIDFixTest { +class UUIDFixGroupTest extends AbstractUUIDFixTestCase { protected function setUp(): void { $this->isUser = false; parent::setUp(); diff --git a/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php b/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php index f31da43c584..0fc601c7d2e 100644 --- a/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php +++ b/apps/user_ldap/tests/Migration/UUIDFixInsertTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -11,23 +13,15 @@ use OCA\User_LDAP\Migration\UUIDFixInsert; use OCP\BackgroundJob\IJobList; use OCP\IConfig; use OCP\Migration\IOutput; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class UUIDFixInsertTest extends TestCase { - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - protected $config; - - /** @var UserMapping|\PHPUnit\Framework\MockObject\MockObject */ - protected $userMapper; - - /** @var GroupMapping|\PHPUnit\Framework\MockObject\MockObject */ - protected $groupMapper; - - /** @var IJobList|\PHPUnit\Framework\MockObject\MockObject */ - protected $jobList; - - /** @var UUIDFixInsert */ - protected $job; + protected IConfig&MockObject $config; + protected UserMapping&MockObject $userMapper; + protected GroupMapping&MockObject $groupMapper; + protected IJobList&MockObject $jobList; + protected UUIDFixInsert $job; protected function setUp(): void { parent::setUp(); @@ -48,13 +42,12 @@ class UUIDFixInsertTest extends TestCase { $this->assertSame('Insert UUIDFix background job for user and group in batches', $this->job->getName()); } - public function recordProvider() { + public static function recordProvider(): array { $record = [ 'dn' => 'cn=somerecord,dc=somewhere', 'name' => 'Something', 'uuid' => 'AB12-3456-CDEF7-8GH9' ]; - array_fill(0, 50, $record); $userBatches = [ 0 => array_fill(0, 50, $record), @@ -71,13 +64,12 @@ class UUIDFixInsertTest extends TestCase { ]; } - public function recordProviderTooLongAndNone() { + public static function recordProviderTooLongAndNone(): array { $record = [ 'dn' => 'cn=somerecord,dc=somewhere', 'name' => 'Something', 'uuid' => 'AB12-3456-CDEF7-8GH9' ]; - array_fill(0, 50, $record); $userBatches = [ 0 => array_fill(0, 50, $record), @@ -97,7 +89,7 @@ class UUIDFixInsertTest extends TestCase { /** * @dataProvider recordProvider */ - public function testRun($userBatches, $groupBatches): void { + public function testRun(array $userBatches, array $groupBatches): void { $this->config->expects($this->once()) ->method('getAppValue') ->with('user_ldap', 'installed_version', '1.2.1') @@ -105,8 +97,11 @@ class UUIDFixInsertTest extends TestCase { $this->userMapper->expects($this->exactly(3)) ->method('getList') - ->withConsecutive([0, 50], [50, 50], [100, 50]) - ->willReturnOnConsecutiveCalls($userBatches[0], $userBatches[1], $userBatches[2]); + ->willReturnMap([ + [0, 50, false, $userBatches[0]], + [50, 50, false, $userBatches[1]], + [100, 50, false, $userBatches[2]], + ]); $this->groupMapper->expects($this->exactly(1)) ->method('getList') @@ -124,7 +119,7 @@ class UUIDFixInsertTest extends TestCase { /** * @dataProvider recordProviderTooLongAndNone */ - public function testRunWithManyAndNone($userBatches, $groupBatches): void { + public function testRunWithManyAndNone(array $userBatches, array $groupBatches): void { $this->config->expects($this->once()) ->method('getAppValue') ->with('user_ldap', 'installed_version', '1.2.1') @@ -132,8 +127,13 @@ class UUIDFixInsertTest extends TestCase { $this->userMapper->expects($this->exactly(5)) ->method('getList') - ->withConsecutive([0, 50], [0, 40], [0, 32], [32, 32], [64, 32]) - ->willReturnOnConsecutiveCalls($userBatches[0], $userBatches[1], $userBatches[2], $userBatches[3], $userBatches[4]); + ->willReturnMap([ + [0, 50, false, $userBatches[0]], + [0, 40, false, $userBatches[1]], + [0, 32, false, $userBatches[2]], + [32, 32, false, $userBatches[3]], + [64, 32, false, $userBatches[4]], + ]); $this->groupMapper->expects($this->once()) ->method('getList') diff --git a/apps/user_ldap/tests/Migration/UUIDFixUserTest.php b/apps/user_ldap/tests/Migration/UUIDFixUserTest.php index dfa1898450f..a582fd677fa 100644 --- a/apps/user_ldap/tests/Migration/UUIDFixUserTest.php +++ b/apps/user_ldap/tests/Migration/UUIDFixUserTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -15,7 +17,7 @@ use OCA\User_LDAP\User_Proxy; * @package OCA\User_LDAP\Tests\Migration * @group DB */ -class UUIDFixUserTest extends AbstractUUIDFixTest { +class UUIDFixUserTest extends AbstractUUIDFixTestCase { protected function setUp(): void { $this->isUser = true; parent::setUp(); diff --git a/apps/user_ldap/tests/Service/BirthdateParserServiceTest.php b/apps/user_ldap/tests/Service/BirthdateParserServiceTest.php index 79450d6913e..85d6a6ba5f7 100644 --- a/apps/user_ldap/tests/Service/BirthdateParserServiceTest.php +++ b/apps/user_ldap/tests/Service/BirthdateParserServiceTest.php @@ -1,11 +1,12 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\user_ldap\tests\Service; +namespace OCA\User_LDAP\Tests\Service; use DateTimeImmutable; use OCA\User_LDAP\Service\BirthdateParserService; @@ -20,7 +21,7 @@ class BirthdateParserServiceTest extends TestCase { $this->service = new BirthdateParserService(); } - public function parseBirthdateDataProvider(): array { + public static function parseBirthdateDataProvider(): array { return [ ['2024-01-01', new DateTimeImmutable('2024-01-01'), false], ['20240101', new DateTimeImmutable('2024-01-01'), false], diff --git a/apps/user_ldap/tests/Service/UpdateGroupsServiceTest.php b/apps/user_ldap/tests/Service/UpdateGroupsServiceTest.php index 84aefb484bb..601aee86602 100644 --- a/apps/user_ldap/tests/Service/UpdateGroupsServiceTest.php +++ b/apps/user_ldap/tests/Service/UpdateGroupsServiceTest.php @@ -6,17 +6,15 @@ declare(strict_types=1); * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -namespace OCA\user_ldap\tests\Service; +namespace OCA\User_LDAP\Tests\Service; use OCA\User_LDAP\Db\GroupMembership; use OCA\User_LDAP\Db\GroupMembershipMapper; use OCA\User_LDAP\Group_Proxy; use OCA\User_LDAP\Service\UpdateGroupsService; -use OCP\AppFramework\Utility\ITimeFactory; use OCP\EventDispatcher\IEventDispatcher; use OCP\Group\Events\UserAddedEvent; use OCP\Group\Events\UserRemovedEvent; -use OCP\IConfig; use OCP\IGroup; use OCP\IGroupManager; use OCP\IUser; @@ -26,23 +24,12 @@ use Psr\Log\LoggerInterface; use Test\TestCase; class UpdateGroupsServiceTest extends TestCase { - /** @var Group_Proxy|MockObject */ - protected $groupBackend; - /** @var IEventDispatcher|MockObject */ - protected $dispatcher; - /** @var IGroupManager|MockObject */ - protected $groupManager; - /** @var IUserManager|MockObject */ - protected $userManager; - /** @var LoggerInterface|MockObject */ - protected $logger; - /** @var GroupMembershipMapper|MockObject */ - protected $groupMembershipMapper; - /** @var IConfig|MockObject */ - protected $config; - /** @var ITimeFactory|MockObject */ - protected $timeFactory; - + protected Group_Proxy&MockObject $groupBackend; + protected IEventDispatcher&MockObject $dispatcher; + protected IGroupManager&MockObject $groupManager; + protected IUserManager&MockObject $userManager; + protected LoggerInterface&MockObject $logger; + protected GroupMembershipMapper&MockObject $groupMembershipMapper; protected UpdateGroupsService $updateGroupsService; public function setUp(): void { @@ -52,8 +39,6 @@ class UpdateGroupsServiceTest extends TestCase { $this->userManager = $this->createMock(IUserManager::class); $this->logger = $this->createMock(LoggerInterface::class); $this->groupMembershipMapper = $this->createMock(GroupMembershipMapper::class); - $this->config = $this->createMock(IConfig::class); - $this->timeFactory = $this->createMock(ITimeFactory::class); $this->updateGroupsService = new UpdateGroupsService( $this->groupBackend, @@ -62,8 +47,6 @@ class UpdateGroupsServiceTest extends TestCase { $this->userManager, $this->logger, $this->groupMembershipMapper, - $this->config, - $this->timeFactory ); } diff --git a/apps/user_ldap/tests/Settings/AdminTest.php b/apps/user_ldap/tests/Settings/AdminTest.php index 05b9697e4c8..b17e96c1a68 100644 --- a/apps/user_ldap/tests/Settings/AdminTest.php +++ b/apps/user_ldap/tests/Settings/AdminTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -20,13 +22,12 @@ use Test\TestCase; */ class AdminTest extends TestCase { private IL10N&MockObject $l10n; - private ITemplateManager $templateManager; private Admin $admin; protected function setUp(): void { parent::setUp(); - $this->l10n = $this->getMockBuilder(IL10N::class)->getMock(); + $this->l10n = $this->createMock(IL10N::class); $this->templateManager = Server::get(ITemplateManager::class); $this->admin = new Admin( @@ -35,9 +36,6 @@ class AdminTest extends TestCase { ); } - /** - * @UseDB - */ public function testGetForm(): void { $prefixes = ['s01']; $hosts = ['s01' => '']; diff --git a/apps/user_ldap/tests/Settings/SectionTest.php b/apps/user_ldap/tests/Settings/SectionTest.php index 722581713d1..3f9ae1e56d4 100644 --- a/apps/user_ldap/tests/Settings/SectionTest.php +++ b/apps/user_ldap/tests/Settings/SectionTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -8,15 +10,13 @@ namespace OCA\User_LDAP\Tests\Settings; use OCA\User_LDAP\Settings\Section; use OCP\IL10N; use OCP\IURLGenerator; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class SectionTest extends TestCase { - /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */ - private $url; - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - private $l; - /** @var Section */ - private $section; + private IURLGenerator&MockObject $url; + private IL10N&MockObject $l; + private Section $section; protected function setUp(): void { parent::setUp(); diff --git a/apps/user_ldap/tests/User/DeletedUsersIndexTest.php b/apps/user_ldap/tests/User/DeletedUsersIndexTest.php index 64e443a064f..b245e52fe6e 100644 --- a/apps/user_ldap/tests/User/DeletedUsersIndexTest.php +++ b/apps/user_ldap/tests/User/DeletedUsersIndexTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -11,6 +13,7 @@ use OCP\IConfig; use OCP\IDBConnection; use OCP\Server; use OCP\Share\IManager; +use PHPUnit\Framework\MockObject\MockObject; /** * Class DeletedUsersIndexTest @@ -20,19 +23,11 @@ use OCP\Share\IManager; * @package OCA\User_LDAP\Tests\User */ class DeletedUsersIndexTest extends \Test\TestCase { - /** @var DeletedUsersIndex */ - protected $dui; - - /** @var IConfig */ - protected $config; - - /** @var IDBConnection */ - protected $db; - - /** @var UserMapping|\PHPUnit\Framework\MockObject\MockObject */ - protected $mapping; - /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $shareManager; + protected DeletedUsersIndex $dui; + protected IConfig $config; + protected IDBConnection $db; + protected UserMapping&MockObject $mapping; + protected IManager&MockObject $shareManager; protected function setUp(): void { parent::setUp(); diff --git a/apps/user_ldap/tests/User/ManagerTest.php b/apps/user_ldap/tests/User/ManagerTest.php index 4f504ff5f7a..3f8b3aa174f 100644 --- a/apps/user_ldap/tests/User/ManagerTest.php +++ b/apps/user_ldap/tests/User/ManagerTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -19,6 +20,7 @@ use OCP\Image; use OCP\IUserManager; use OCP\Notification\IManager as INotificationManager; use OCP\Share\IManager; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; /** @@ -29,40 +31,18 @@ use Psr\Log\LoggerInterface; * @package OCA\User_LDAP\Tests\User */ class ManagerTest extends \Test\TestCase { - /** @var Access|\PHPUnit\Framework\MockObject\MockObject */ - protected $access; - - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - protected $config; - - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ - protected $logger; - - /** @var IAvatarManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $avatarManager; - - /** @var Image|\PHPUnit\Framework\MockObject\MockObject */ - protected $image; - - /** @var IDBConnection|\PHPUnit\Framework\MockObject\MockObject */ - protected $dbc; - - /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $ncUserManager; - - /** @var INotificationManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $notificationManager; - - /** @var ILDAPWrapper|\PHPUnit\Framework\MockObject\MockObject */ - protected $ldapWrapper; - - /** @var Connection */ - protected $connection; - - /** @var Manager */ - protected $manager; - /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $shareManager; + protected Access&MockObject $access; + protected IConfig&MockObject $config; + protected LoggerInterface&MockObject $logger; + protected IAvatarManager&MockObject $avatarManager; + protected Image&MockObject $image; + protected IDBConnection&MockObject $dbc; + protected IUserManager&MockObject $ncUserManager; + protected INotificationManager&MockObject $notificationManager; + protected ILDAPWrapper&MockObject $ldapWrapper; + protected Connection $connection; + protected IManager&MockObject $shareManager; + protected Manager $manager; protected function setUp(): void { parent::setUp(); @@ -97,7 +77,7 @@ class ManagerTest extends \Test\TestCase { $this->manager->setLdapAccess($this->access); } - public function dnProvider() { + public static function dnProvider(): array { return [ ['cn=foo,dc=foobar,dc=bar'], ['uid=foo,o=foobar,c=bar'], @@ -197,7 +177,7 @@ class ManagerTest extends \Test\TestCase { $this->assertNull($user); } - public function attributeRequestProvider() { + public static function attributeRequestProvider(): array { return [ [false], [true], @@ -217,10 +197,10 @@ class ManagerTest extends \Test\TestCase { $attributes = $this->manager->getAttributes($minimal); - $this->assertTrue(in_array('dn', $attributes)); - $this->assertTrue(in_array(strtolower($this->access->getConnection()->ldapEmailAttribute), $attributes)); - $this->assertTrue(!in_array($this->access->getConnection()->ldapEmailAttribute, $attributes)); #cases check - $this->assertFalse(in_array('', $attributes)); + $this->assertContains('dn', $attributes); + $this->assertContains(strtolower($this->access->getConnection()->ldapEmailAttribute), $attributes); + $this->assertNotContains($this->access->getConnection()->ldapEmailAttribute, $attributes); #cases check + $this->assertNotContains('', $attributes); $this->assertSame(!$minimal, in_array('jpegphoto', $attributes)); $this->assertSame(!$minimal, in_array('thumbnailphoto', $attributes)); $valueCounts = array_count_values($attributes); diff --git a/apps/user_ldap/tests/User/OfflineUserTest.php b/apps/user_ldap/tests/User/OfflineUserTest.php index e53bfca7f47..5ef89303111 100644 --- a/apps/user_ldap/tests/User/OfflineUserTest.php +++ b/apps/user_ldap/tests/User/OfflineUserTest.php @@ -13,20 +13,15 @@ use OCA\User_LDAP\User\OfflineUser; use OCP\IConfig; use OCP\Share\IManager; use OCP\Share\IShare; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class OfflineUserTest extends TestCase { - - /** @var OfflineUser */ - protected $offlineUser; - /** @var UserMapping|\PHPUnit\Framework\MockObject\MockObject */ - protected $mapping; - /** @var string */ - protected $uid; - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - protected $config; - /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $shareManager; + protected UserMapping&MockObject $mapping; + protected string $uid; + protected IConfig&MockObject $config; + protected IManager&MockObject $shareManager; + protected OfflineUser $offlineUser; public function setUp(): void { $this->uid = 'deborah'; @@ -42,7 +37,7 @@ class OfflineUserTest extends TestCase { ); } - public function shareOwnerProvider(): array { + public static function shareOwnerProvider(): array { return [ [[], false], [[IShare::TYPE_USER], true], diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php index badbca7f476..d9075af1569 100644 --- a/apps/user_ldap/tests/User/UserTest.php +++ b/apps/user_ldap/tests/User/UserTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -9,6 +10,7 @@ namespace OCA\User_LDAP\Tests\User; use OCA\User_LDAP\Access; use OCA\User_LDAP\Connection; +use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\User\User; use OCP\IAvatar; use OCP\IAvatarManager; @@ -19,6 +21,7 @@ use OCP\IUserManager; use OCP\Notification\IManager as INotificationManager; use OCP\Notification\INotification; use OCP\Util; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; /** @@ -29,33 +32,24 @@ use Psr\Log\LoggerInterface; * @package OCA\User_LDAP\Tests\User */ class UserTest extends \Test\TestCase { - /** @var Access|\PHPUnit\Framework\MockObject\MockObject */ - protected $access; - /** @var Connection|\PHPUnit\Framework\MockObject\MockObject */ - protected $connection; - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ - protected $config; - /** @var INotificationManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $notificationManager; - /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $userManager; - /** @var Image|\PHPUnit\Framework\MockObject\MockObject */ - protected $image; - /** @var IAvatarManager|\PHPUnit\Framework\MockObject\MockObject */ - protected $avatarManager; - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ - protected $logger; - /** @var string */ - protected $uid = 'alice'; - /** @var string */ - protected $dn = 'uid=alice,dc=foo,dc=bar'; - /** @var User */ - protected $user; + protected Access&MockObject $access; + protected Connection&MockObject $connection; + protected IConfig&MockObject $config; + protected INotificationManager&MockObject $notificationManager; + protected IUserManager&MockObject $userManager; + protected Image&MockObject $image; + protected IAvatarManager&MockObject $avatarManager; + protected LoggerInterface&MockObject $logger; + protected string $uid = 'alice'; + protected string $dn = 'uid=alice,dc=foo,dc=bar'; + protected User $user; protected function setUp(): void { parent::setUp(); - $this->connection = $this->createMock(Connection::class); + $this->connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); $this->access = $this->createMock(Access::class); $this->access->connection = $this->connection; @@ -100,9 +94,7 @@ class UserTest extends \Test\TestCase { $this->equalTo('email')) ->willReturn(['alice@foo.bar']); - $coreUser = $this->getMockBuilder(IUser::class) - ->disableOriginalConstructor() - ->getMock(); + $coreUser = $this->createMock(IUser::class); $coreUser->expects($this->once()) ->method('setSystemEMailAddress') ->with('alice@foo.bar'); @@ -506,7 +498,7 @@ class UserTest extends \Test\TestCase { $avatar = $this->createMock(IAvatar::class); $avatar->expects($this->once()) ->method('set') - ->with($this->isInstanceOf($this->image)); + ->with($this->image); $this->avatarManager->expects($this->once()) ->method('getAvatar') @@ -617,7 +609,7 @@ class UserTest extends \Test\TestCase { $avatar = $this->createMock(IAvatar::class); $avatar->expects($this->once()) ->method('set') - ->with($this->isInstanceOf($this->image)); + ->with($this->image); $this->avatarManager->expects($this->once()) ->method('getAvatar') @@ -723,7 +715,7 @@ class UserTest extends \Test\TestCase { $avatar = $this->createMock(IAvatar::class); $avatar->expects($this->once()) ->method('set') - ->with($this->isInstanceOf($this->image)) + ->with($this->image) ->willThrowException(new \Exception()); $this->avatarManager->expects($this->once()) @@ -780,7 +772,7 @@ class UserTest extends \Test\TestCase { $this->user->updateAvatar(); } - public function extStorageHomeDataProvider() { + public static function extStorageHomeDataProvider(): array { return [ [ 'myFolder', null ], [ '', null, false ], @@ -865,7 +857,7 @@ class UserTest extends \Test\TestCase { $this->assertFalse($this->user->getAvatarImage()); } - public function imageDataProvider() { + public static function imageDataProvider(): array { return [ [ false, false ], [ 'corruptData', false ], @@ -884,7 +876,7 @@ class UserTest extends \Test\TestCase { 'updateExtStorageHome', ]; - /** @var User|\PHPUnit\Framework\MockObject\MockObject $userMock */ + /** @var User&MockObject $userMock */ $userMock = $this->getMockBuilder(User::class) ->setConstructorArgs([ $this->uid, @@ -897,7 +889,7 @@ class UserTest extends \Test\TestCase { $this->userManager, $this->notificationManager ]) - ->setMethods($requiredMethods) + ->onlyMethods($requiredMethods) ->getMock(); $this->connection->setConfiguration([ @@ -937,7 +929,7 @@ class UserTest extends \Test\TestCase { \OC_Hook::emit('OC_User', 'post_login', ['uid' => $this->uid]); } - public function emptyHomeFolderAttributeValueProvider() { + public static function emptyHomeFolderAttributeValueProvider(): array { return [ 'empty' => [''], 'prefixOnly' => ['attr:'], @@ -947,7 +939,7 @@ class UserTest extends \Test\TestCase { /** * @dataProvider emptyHomeFolderAttributeValueProvider */ - public function testGetHomePathNotConfigured($attributeValue): void { + public function testGetHomePathNotConfigured(string $attributeValue): void { $this->connection->expects($this->any()) ->method('__get') ->with($this->equalTo('homeFolderNamingRule')) @@ -1011,7 +1003,7 @@ class UserTest extends \Test\TestCase { $this->user->getHomePath(); } - public function displayNameProvider() { + public static function displayNameProvider(): array { return [ ['Roland Deschain', '', 'Roland Deschain', false], ['Roland Deschain', '', 'Roland Deschain', true], @@ -1023,7 +1015,7 @@ class UserTest extends \Test\TestCase { /** * @dataProvider displayNameProvider */ - public function testComposeAndStoreDisplayName($part1, $part2, $expected, $expectTriggerChange): void { + public function testComposeAndStoreDisplayName(string $part1, string $part2, string $expected, bool $expectTriggerChange): void { $this->config->expects($this->once()) ->method('setUserValue'); $oldName = $expectTriggerChange ? 'xxGunslingerxx' : null; diff --git a/apps/user_ldap/tests/UserLDAPPluginTest.php b/apps/user_ldap/tests/UserLDAPPluginTest.php index 5f11f817771..8a065374e61 100644 --- a/apps/user_ldap/tests/UserLDAPPluginTest.php +++ b/apps/user_ldap/tests/UserLDAPPluginTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -9,27 +11,23 @@ use OC\User\Backend; use OCA\User_LDAP\UserPluginManager; class UserLDAPPluginTest extends \Test\TestCase { - - /** - * @return UserPluginManager - */ - private function getUserPluginManager() { + private function getUserPluginManager(): UserPluginManager { return new UserPluginManager(); } public function testImplementsActions(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') - ->setMethods(['respondToActions']) + $plugin = $this->getMockBuilder(LDAPUserPluginDummy::class) + ->onlyMethods(['respondToActions']) ->getMock(); $plugin->expects($this->any()) ->method('respondToActions') ->willReturn(Backend::CREATE_USER); - $plugin2 = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') - ->setMethods(['respondToActions']) + $plugin2 = $this->getMockBuilder(LDAPUserPluginDummy::class) + ->onlyMethods(['respondToActions']) ->getMock(); $plugin2->expects($this->any()) @@ -47,8 +45,8 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testCreateUser(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') - ->setMethods(['respondToActions', 'createUser']) + $plugin = $this->getMockBuilder(LDAPUserPluginDummy::class) + ->onlyMethods(['respondToActions', 'createUser']) ->getMock(); $plugin->expects($this->any()) @@ -66,7 +64,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->createUser('user', 'password'); } - + public function testCreateUserNotRegistered(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements createUser in this LDAP Backend.'); @@ -78,8 +76,8 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testSetPassword(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') - ->setMethods(['respondToActions', 'setPassword']) + $plugin = $this->getMockBuilder(LDAPUserPluginDummy::class) + ->onlyMethods(['respondToActions', 'setPassword']) ->getMock(); $plugin->expects($this->any()) @@ -97,7 +95,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->setPassword('user', 'password'); } - + public function testSetPasswordNotRegistered(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements setPassword in this LDAP Backend.'); @@ -109,8 +107,8 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testGetHome(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') - ->setMethods(['respondToActions', 'getHome']) + $plugin = $this->getMockBuilder(LDAPUserPluginDummy::class) + ->onlyMethods(['respondToActions', 'getHome']) ->getMock(); $plugin->expects($this->any()) @@ -127,7 +125,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->getHome('uid'); } - + public function testGetHomeNotRegistered(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements getHome in this LDAP Backend.'); @@ -139,8 +137,8 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testGetDisplayName(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') - ->setMethods(['respondToActions', 'getDisplayName']) + $plugin = $this->getMockBuilder(LDAPUserPluginDummy::class) + ->onlyMethods(['respondToActions', 'getDisplayName']) ->getMock(); $plugin->expects($this->any()) @@ -157,7 +155,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->getDisplayName('uid'); } - + public function testGetDisplayNameNotRegistered(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements getDisplayName in this LDAP Backend.'); @@ -169,8 +167,8 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testSetDisplayName(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') - ->setMethods(['respondToActions', 'setDisplayName']) + $plugin = $this->getMockBuilder(LDAPUserPluginDummy::class) + ->onlyMethods(['respondToActions', 'setDisplayName']) ->getMock(); $plugin->expects($this->any()) @@ -188,7 +186,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->setDisplayName('user', 'password'); } - + public function testSetDisplayNameNotRegistered(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements setDisplayName in this LDAP Backend.'); @@ -200,8 +198,8 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testCanChangeAvatar(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') - ->setMethods(['respondToActions', 'canChangeAvatar']) + $plugin = $this->getMockBuilder(LDAPUserPluginDummy::class) + ->onlyMethods(['respondToActions', 'canChangeAvatar']) ->getMock(); $plugin->expects($this->any()) @@ -218,7 +216,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->canChangeAvatar('uid'); } - + public function testCanChangeAvatarNotRegistered(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements canChangeAvatar in this LDAP Backend.'); @@ -230,8 +228,8 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testCountUsers(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') - ->setMethods(['respondToActions', 'countUsers']) + $plugin = $this->getMockBuilder(LDAPUserPluginDummy::class) + ->onlyMethods(['respondToActions', 'countUsers']) ->getMock(); $plugin->expects($this->any()) @@ -245,7 +243,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->countUsers(); } - + public function testCountUsersNotRegistered(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements countUsers in this LDAP Backend.'); @@ -257,8 +255,8 @@ class UserLDAPPluginTest extends \Test\TestCase { public function testDeleteUser(): void { $pluginManager = $this->getUserPluginManager(); - $plugin = $this->getMockBuilder('OCA\User_LDAP\Tests\LDAPUserPluginDummy') - ->setMethods(['respondToActions', 'canDeleteUser','deleteUser']) + $plugin = $this->getMockBuilder(LDAPUserPluginDummy::class) + ->onlyMethods(['respondToActions', 'canDeleteUser','deleteUser']) ->getMock(); $plugin->expects($this->any()) @@ -281,7 +279,7 @@ class UserLDAPPluginTest extends \Test\TestCase { $pluginManager->deleteUser('uid'); } - + public function testDeleteUserNotRegistered(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('No plugin implements deleteUser in this LDAP Backend.'); diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index ede7123bd36..5be01d5e414 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -10,6 +11,7 @@ namespace OCA\User_LDAP\Tests; use OC\User\Backend; use OCA\User_LDAP\Access; use OCA\User_LDAP\Connection; +use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\Mapping\AbstractMapping; use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\User\DeletedUsersIndex; @@ -38,24 +40,15 @@ use Test\TestCase; * @package OCA\User_LDAP\Tests */ class User_LDAPTest extends TestCase { - /** @var User_LDAP */ - protected $backend; - /** @var Access|MockObject */ - protected $access; - /** @var OfflineUser|MockObject */ - protected $offlineUser; - /** @var INotificationManager|MockObject */ - protected $notificationManager; - /** @var UserPluginManager|MockObject */ - protected $pluginManager; - /** @var Connection|MockObject */ - protected $connection; - /** @var Manager|MockObject */ - protected $userManager; - /** @var LoggerInterface|MockObject */ - protected $logger; - /** @var DeletedUsersIndex|MockObject */ - protected $deletedUsersIndex; + protected Access&MockObject $access; + protected OfflineUser&MockObject $offlineUser; + protected INotificationManager&MockObject $notificationManager; + protected UserPluginManager&MockObject $pluginManager; + protected Connection&MockObject $connection; + protected Manager&MockObject $userManager; + protected LoggerInterface&MockObject $logger; + protected DeletedUsersIndex&MockObject $deletedUsersIndex; + protected User_LDAP $backend; protected function setUp(): void { parent::setUp(); @@ -63,7 +56,9 @@ class User_LDAPTest extends TestCase { Server::get(IUserManager::class)->clearBackends(); Server::get(IGroupManager::class)->clearBackends(); - $this->connection = $this->createMock(Connection::class); + $this->connection = $this->getMockBuilder(Connection::class) + ->setConstructorArgs([$this->createMock(ILDAPWrapper::class)]) + ->getMock(); $this->userManager = $this->createMock(Manager::class); $this->access = $this->createMock(Access::class); @@ -86,7 +81,7 @@ class User_LDAPTest extends TestCase { ); } - private function prepareMockForUserExists() { + private function prepareMockForUserExists(): void { $this->access->expects($this->any()) ->method('username2dn') ->willReturnCallback(function ($uid) { @@ -114,10 +109,8 @@ class User_LDAPTest extends TestCase { /** * Prepares the Access mock for checkPassword tests - * @param bool $noDisplayName - * @return void */ - private function prepareAccessForCheckPassword($noDisplayName = false) { + private function prepareAccessForCheckPassword(bool $noDisplayName = false): void { $this->connection->expects($this->any()) ->method('__get') ->willReturnCallback(function ($name) { @@ -347,7 +340,7 @@ class User_LDAPTest extends TestCase { ->method('invalidate') ->with('uid'); - $this->assertEquals(true, $this->backend->deleteUser('uid')); + $this->assertTrue($this->backend->deleteUser('uid')); } /** @@ -404,7 +397,7 @@ class User_LDAPTest extends TestCase { $backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex); $result = $backend->getUsers(); - $this->assertEquals(3, count($result)); + $this->assertCount(3, $result); } public function testGetUsersLimitOffset(): void { @@ -412,7 +405,7 @@ class User_LDAPTest extends TestCase { $backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex); $result = $backend->getUsers('', 1, 2); - $this->assertEquals(1, count($result)); + $this->assertCount(1, $result); } public function testGetUsersLimitOffset2(): void { @@ -420,7 +413,7 @@ class User_LDAPTest extends TestCase { $backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex); $result = $backend->getUsers('', 2, 1); - $this->assertEquals(2, count($result)); + $this->assertCount(2, $result); } public function testGetUsersSearchWithResult(): void { @@ -428,7 +421,7 @@ class User_LDAPTest extends TestCase { $backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex); $result = $backend->getUsers('yo'); - $this->assertEquals(2, count($result)); + $this->assertCount(2, $result); } public function testGetUsersSearchEmptyResult(): void { @@ -436,7 +429,7 @@ class User_LDAPTest extends TestCase { $backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex); $result = $backend->getUsers('nix'); - $this->assertEquals(0, count($result)); + $this->assertCount(0, $result); } private function getUsers($search = '', $limit = null, $offset = null) { @@ -453,7 +446,7 @@ class User_LDAPTest extends TestCase { Server::get(IUserManager::class)->registerBackend($backend); $result = $this->getUsers(); - $this->assertEquals(3, count($result)); + $this->assertCount(3, $result); } public function testGetUsersViaAPILimitOffset(): void { @@ -462,7 +455,7 @@ class User_LDAPTest extends TestCase { Server::get(IUserManager::class)->registerBackend($backend); $result = $this->getUsers('', 1, 2); - $this->assertEquals(1, count($result)); + $this->assertCount(1, $result); } public function testGetUsersViaAPILimitOffset2(): void { @@ -471,7 +464,7 @@ class User_LDAPTest extends TestCase { Server::get(IUserManager::class)->registerBackend($backend); $result = $this->getUsers('', 2, 1); - $this->assertEquals(2, count($result)); + $this->assertCount(2, $result); } public function testGetUsersViaAPISearchWithResult(): void { @@ -480,7 +473,7 @@ class User_LDAPTest extends TestCase { Server::get(IUserManager::class)->registerBackend($backend); $result = $this->getUsers('yo'); - $this->assertEquals(2, count($result)); + $this->assertCount(2, $result); } public function testGetUsersViaAPISearchEmptyResult(): void { @@ -489,15 +482,13 @@ class User_LDAPTest extends TestCase { Server::get(IUserManager::class)->registerBackend($backend); $result = $this->getUsers('nix'); - $this->assertEquals(0, count($result)); + $this->assertCount(0, $result); } public function testUserExists(): void { $backend = new UserLDAP($this->access, $this->notificationManager, $this->pluginManager, $this->logger, $this->deletedUsersIndex); $this->prepareMockForUserExists(); - $user = $this->createMock(User::class); - $this->userManager->expects($this->never()) ->method('get'); $this->userManager->expects($this->once()) @@ -1182,8 +1173,6 @@ class User_LDAPTest extends TestCase { /** * Prepares the Access mock for setPassword tests - * - * @param bool $enablePasswordChange */ private function prepareAccessForSetPassword($enablePasswordChange = true) { $this->connection->expects($this->any()) @@ -1328,7 +1317,7 @@ class User_LDAPTest extends TestCase { $this->assertEquals($this->backend->setPassword('uid', 'password'), 'result'); } - public function avatarDataProvider() { + public static function avatarDataProvider(): array { return [ [ 'validImageData', false ], [ 'corruptImageData', true ], @@ -1336,8 +1325,10 @@ class User_LDAPTest extends TestCase { ]; } - /** @dataProvider avatarDataProvider */ - public function testCanChangeAvatar($imageData, $expected): void { + /** + * @dataProvider avatarDataProvider + */ + public function testCanChangeAvatar(string|bool $imageData, bool $expected): void { $isValidImage = str_starts_with((string)$imageData, 'valid'); $user = $this->createMock(User::class); @@ -1451,9 +1442,9 @@ class User_LDAPTest extends TestCase { $this->assertFalse($this->backend->createUser('uid', 'password')); } - public function actionProvider() { + public static function actionProvider(): array { return [ - [ 'ldapUserAvatarRule', 'default', Backend::PROVIDE_AVATAR, true] , + [ 'ldapUserAvatarRule', 'default', Backend::PROVIDE_AVATAR, true], [ 'ldapUserAvatarRule', 'data:selfiePhoto', Backend::PROVIDE_AVATAR, true], [ 'ldapUserAvatarRule', 'none', Backend::PROVIDE_AVATAR, false], [ 'turnOnPasswordChange', 0, Backend::SET_PASSWORD, false], @@ -1464,7 +1455,7 @@ class User_LDAPTest extends TestCase { /** * @dataProvider actionProvider */ - public function testImplementsAction($configurable, $value, $actionCode, $expected): void { + public function testImplementsAction(string $configurable, string|int $value, int $actionCode, bool $expected): void { $this->pluginManager->expects($this->once()) ->method('getImplementedActions') ->willReturn(0); diff --git a/apps/user_ldap/tests/User_ProxyTest.php b/apps/user_ldap/tests/User_ProxyTest.php index 4544276a714..38f94af33a7 100644 --- a/apps/user_ldap/tests/User_ProxyTest.php +++ b/apps/user_ldap/tests/User_ProxyTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -17,22 +19,14 @@ use Psr\Log\LoggerInterface; use Test\TestCase; class User_ProxyTest extends TestCase { - /** @var Helper|MockObject */ - protected $helper; - /** @var ILDAPWrapper|MockObject */ - private $ldapWrapper; - /** @var AccessFactory|MockObject */ - private $accessFactory; - /** @var INotificationManager|MockObject */ - private $notificationManager; - /** @var User_Proxy|MockObject */ - private $proxy; - /** @var UserPluginManager|MockObject */ - private $userPluginManager; - /** @var LoggerInterface|MockObject */ - protected $logger; - /** @var DeletedUsersIndex|MockObject */ - protected $deletedUsersIndex; + protected Helper&MockObject $helper; + private ILDAPWrapper&MockObject $ldapWrapper; + private AccessFactory&MockObject $accessFactory; + private INotificationManager&MockObject $notificationManager; + private User_Proxy&MockObject $proxy; + private UserPluginManager&MockObject $userPluginManager; + protected LoggerInterface&MockObject $logger; + protected DeletedUsersIndex&MockObject $deletedUsersIndex; protected function setUp(): void { parent::setUp(); @@ -54,7 +48,7 @@ class User_ProxyTest extends TestCase { $this->logger, $this->deletedUsersIndex, ]) - ->setMethods(['handleRequest']) + ->onlyMethods(['handleRequest']) ->getMock(); } diff --git a/apps/user_ldap/tests/WizardTest.php b/apps/user_ldap/tests/WizardTest.php index 31fd28e2fa1..3ae9a409e88 100644 --- a/apps/user_ldap/tests/WizardTest.php +++ b/apps/user_ldap/tests/WizardTest.php @@ -1,5 +1,6 @@ <?php +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -35,32 +36,28 @@ class WizardTest extends TestCase { } } - private function getWizardAndMocks() { + private function getWizardAndMocks(): array { static $confMethods; - static $connMethods; - static $accMethods; if (is_null($confMethods)) { $confMethods = get_class_methods('\OCA\User_LDAP\Configuration'); - $connMethods = get_class_methods('\OCA\User_LDAP\Connection'); - $accMethods = get_class_methods('\OCA\User_LDAP\Access'); } - /** @var ILDAPWrapper|\PHPUnit\Framework\MockObject\MockObject $lw */ + /** @var ILDAPWrapper&MockObject $lw */ $lw = $this->createMock(ILDAPWrapper::class); - /** @var Configuration|\PHPUnit\Framework\MockObject\MockObject $conf */ + /** @var Configuration&MockObject $conf */ $conf = $this->getMockBuilder(Configuration::class) - ->setMethods($confMethods) + ->onlyMethods($confMethods) ->setConstructorArgs(['', true]) ->getMock(); - /** @var Access|\PHPUnit\Framework\MockObject\MockObject $access */ + /** @var Access&MockObject $access */ $access = $this->createMock(Access::class); return [new Wizard($conf, $lw, $access), $conf, $lw, $access]; } - private function prepareLdapWrapperForConnections(MockObject &$ldap) { + private function prepareLdapWrapperForConnections(MockObject $ldap) { $ldap->expects($this->once()) ->method('connect') //dummy value @@ -346,7 +343,7 @@ class WizardTest extends TestCase { }); $result = $wizard->detectEmailAttribute(); - $this->assertSame(false, $result->hasChanges()); + $this->assertFalse($result->hasChanges()); } public function testCumulativeSearchOnAttributeSkipReadDN(): void { @@ -423,7 +420,7 @@ class WizardTest extends TestCase { // The following expectations are the real test $filters = ['f1', 'f2', '*']; $resultArray = $wizard->cumulativeSearchOnAttribute($filters, 'cn', 0); - $this->assertSame(6, count($resultArray)); + $this->assertCount(6, $resultArray); unset($mark); } } |