diff options
author | Kate <26026535+provokateurin@users.noreply.github.com> | 2024-10-22 12:47:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-22 12:47:45 +0200 |
commit | 070adc1131fcd5476e4a93ebf28be6f409c5a992 (patch) | |
tree | 1e8e2238a22d544c370f1ac804426ed675c5eacf /apps/dav/tests/unit | |
parent | 582af10e0be1b22ebde0429b756f62107d8e8083 (diff) | |
parent | e8426996f59ab6dbf0c94adee8f410cbd572b11a (diff) | |
download | nextcloud-server-070adc1131fcd5476e4a93ebf28be6f409c5a992.tar.gz nextcloud-server-070adc1131fcd5476e4a93ebf28be6f409c5a992.zip |
Merge pull request #48790 from nextcloud/refactor/apps/constructor-property-promotion
Diffstat (limited to 'apps/dav/tests/unit')
18 files changed, 40 insertions, 55 deletions
diff --git a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php index f895deb7fd1..e60efc6fb19 100644 --- a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php +++ b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php @@ -18,7 +18,7 @@ class EnablePluginTest extends TestCase { /** @var \Sabre\DAV\Server|\PHPUnit\Framework\MockObject\MockObject */ protected $server; - /** @var \OCP\IConfig|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ protected $config; /** @var BirthdayService |\PHPUnit\Framework\MockObject\MockObject */ diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php index bdb318ee32f..6c46a2aed2d 100644 --- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php +++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php @@ -14,6 +14,7 @@ use OCA\DAV\CalDAV\Reminder\NotificationProvider\PushProvider; use OCA\DAV\CalDAV\Reminder\NotificationProviderManager; use OCA\DAV\CalDAV\Reminder\NotificationTypeDoesNotExistException; use OCA\DAV\Capabilities; +use OCP\AppFramework\QueryException; use Test\TestCase; class NotificationProviderManagerTest extends TestCase { @@ -22,7 +23,7 @@ class NotificationProviderManagerTest extends TestCase { private $providerManager; /** - * @throws \OCP\AppFramework\QueryException + * @throws QueryException */ protected function setUp(): void { parent::setUp(); @@ -65,7 +66,7 @@ class NotificationProviderManagerTest extends TestCase { } /** - * @throws \OCP\AppFramework\QueryException + * @throws QueryException */ public function testRegisterBadProvider(): void { $this->expectException(\InvalidArgumentException::class); diff --git a/apps/dav/tests/unit/Command/ListCalendarsTest.php b/apps/dav/tests/unit/Command/ListCalendarsTest.php index 2640b4d966b..1f5f9882ac4 100644 --- a/apps/dav/tests/unit/Command/ListCalendarsTest.php +++ b/apps/dav/tests/unit/Command/ListCalendarsTest.php @@ -19,7 +19,7 @@ use Test\TestCase; */ class ListCalendarsTest extends TestCase { - /** @var \OCP\IUserManager|\PHPUnit\Framework\MockObject\MockObject $userManager */ + /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject $userManager */ private $userManager; /** @var CalDavBackend|\PHPUnit\Framework\MockObject\MockObject $l10n */ diff --git a/apps/dav/tests/unit/Command/MoveCalendarTest.php b/apps/dav/tests/unit/Command/MoveCalendarTest.php index 892b00968f9..9b935ca3cdb 100644 --- a/apps/dav/tests/unit/Command/MoveCalendarTest.php +++ b/apps/dav/tests/unit/Command/MoveCalendarTest.php @@ -24,10 +24,10 @@ use Test\TestCase; * @package OCA\DAV\Tests\Command */ class MoveCalendarTest extends TestCase { - /** @var \OCP\IUserManager|MockObject $userManager */ + /** @var IUserManager|MockObject $userManager */ private $userManager; - /** @var \OCP\IGroupManager|MockObject $groupManager */ + /** @var IGroupManager|MockObject $groupManager */ private $groupManager; /** @var \OCP\Share\IManager|MockObject $shareManager */ diff --git a/apps/dav/tests/unit/Comments/EntityCollectionTest.php b/apps/dav/tests/unit/Comments/EntityCollectionTest.php index 6996022b607..e5a68e5a726 100644 --- a/apps/dav/tests/unit/Comments/EntityCollectionTest.php +++ b/apps/dav/tests/unit/Comments/EntityCollectionTest.php @@ -18,7 +18,7 @@ use Psr\Log\LoggerInterface; class EntityCollectionTest extends \Test\TestCase { - /** @var \OCP\Comments\ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ protected $commentsManager; /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ protected $userManager; diff --git a/apps/dav/tests/unit/Comments/EntityTypeCollectionTest.php b/apps/dav/tests/unit/Comments/EntityTypeCollectionTest.php index 15b8073481c..e5706099270 100644 --- a/apps/dav/tests/unit/Comments/EntityTypeCollectionTest.php +++ b/apps/dav/tests/unit/Comments/EntityTypeCollectionTest.php @@ -18,7 +18,7 @@ class EntityTypeCollectionTest extends \Test\TestCase { /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ protected $commentsManager; - /** @var \OCP\IUserManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ protected $userManager; /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ protected $logger; diff --git a/apps/dav/tests/unit/Comments/RootCollectionTest.php b/apps/dav/tests/unit/Comments/RootCollectionTest.php index 8f58e5c3c5f..5d9e828f687 100644 --- a/apps/dav/tests/unit/Comments/RootCollectionTest.php +++ b/apps/dav/tests/unit/Comments/RootCollectionTest.php @@ -20,19 +20,19 @@ use Psr\Log\LoggerInterface; class RootCollectionTest extends \Test\TestCase { - /** @var \OCP\Comments\ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */ protected $commentsManager; - /** @var \OCP\IUserManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ protected $userManager; /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ protected $logger; /** @var RootCollection */ protected $collection; - /** @var \OCP\IUserSession|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */ protected $userSession; /** @var IEventDispatcher */ protected $dispatcher; - /** @var \OCP\IUser|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IUser|\PHPUnit\Framework\MockObject\MockObject */ protected $user; protected function setUp(): void { diff --git a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php index 3f134745f86..72d5e7198a3 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php @@ -40,7 +40,7 @@ class CustomPropertiesBackendTest extends \Test\TestCase { private $plugin; /** - * @var \OCP\IUser + * @var IUser */ private $user; diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php index d659b01d039..7510340aa57 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php @@ -23,14 +23,11 @@ use OCP\Files\StorageNotAvailableException; use Test\Traits\UserTrait; class TestViewDirectory extends View { - private $updatables; - private $deletables; - private $canRename; - - public function __construct($updatables, $deletables, $canRename = true) { - $this->updatables = $updatables; - $this->deletables = $deletables; - $this->canRename = $canRename; + public function __construct( + private $updatables, + private $deletables, + private $canRename = true, + ) { } public function isUpdatable($path) { @@ -61,9 +58,9 @@ class TestViewDirectory extends View { class DirectoryTest extends \Test\TestCase { use UserTrait; - /** @var \OC\Files\View | \PHPUnit\Framework\MockObject\MockObject */ + /** @var View|\PHPUnit\Framework\MockObject\MockObject */ private $view; - /** @var \OC\Files\FileInfo | \PHPUnit\Framework\MockObject\MockObject */ + /** @var FileInfo|\PHPUnit\Framework\MockObject\MockObject */ private $info; protected function setUp(): void { diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php index cf1ea4c6bae..df48cd61114 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Auth.php @@ -13,24 +13,15 @@ use Sabre\HTTP\ResponseInterface; class Auth implements BackendInterface { /** - * @var string - */ - private $user; - - /** - * @var string - */ - private $password; - - /** * Auth constructor. * * @param string $user * @param string $password */ - public function __construct($user, $password) { - $this->user = $user; - $this->password = $password; + public function __construct( + private $user, + private $password, + ) { } /** diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php index 67c2aa61430..4085bc93c78 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTestCase.php @@ -64,7 +64,7 @@ abstract class RequestTestCase extends TestCase { } /** - * @param \OC\Files\View $view the view to run the webdav server against + * @param View $view the view to run the webdav server against * @param string $user * @param string $password * @param string $method diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Sapi.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Sapi.php index f7bcdd930ca..f12c93468ff 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/Sapi.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/Sapi.php @@ -12,11 +12,6 @@ use Sabre\HTTP\Response; class Sapi { /** - * @var \Sabre\HTTP\Request - */ - private $request; - - /** * @var \Sabre\HTTP\Response */ private $response; @@ -31,8 +26,9 @@ class Sapi { return $this->request; } - public function __construct(Request $request) { - $this->request = $request; + public function __construct( + private Request $request, + ) { } /** diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php index 125fe3959bb..97d3ba79046 100644 --- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php @@ -38,7 +38,7 @@ class SharesPluginTest extends \Test\TestCase { private $shareManager; /** - * @var \OCP\Files\Folder + * @var Folder */ private $userFolder; diff --git a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php index 59fd1e56963..bdab8135b1c 100644 --- a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php @@ -33,12 +33,12 @@ class TagsPluginTest extends \Test\TestCase { private $tree; /** - * @var \OCP\ITagManager + * @var ITagManager */ private $tagManager; /** - * @var \OCP\ITags + * @var ITags */ private $tagger; diff --git a/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php b/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php index 7ad1d34d94f..fd2bb451021 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php @@ -19,12 +19,12 @@ use Sabre\DAV\Exception\Forbidden; class SystemTagNodeTest extends \Test\TestCase { /** - * @var \OCP\SystemTag\ISystemTagManager|\PHPUnit\Framework\MockObject\MockObject + * @var ISystemTagManager|\PHPUnit\Framework\MockObject\MockObject */ private $tagManager; /** - * @var \OCP\IUser + * @var IUser */ private $user; diff --git a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php index 91dab4ecf11..e1517eec425 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php @@ -42,7 +42,7 @@ class SystemTagPluginTest extends \Test\TestCase { private $tree; /** - * @var \OCP\SystemTag\ISystemTagManager + * @var ISystemTagManager */ private $tagManager; diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php index 2ffbc1cf01f..57e2454f06c 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php @@ -18,12 +18,12 @@ use OCP\SystemTag\TagNotFoundException; class SystemTagsByIdCollectionTest extends \Test\TestCase { /** - * @var \OCP\SystemTag\ISystemTagManager + * @var ISystemTagManager */ private $tagManager; /** - * @var \OCP\IUser + * @var IUser */ private $user; diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php index 62f6963e202..ba9304d33fc 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php @@ -24,17 +24,17 @@ class SystemTagsObjectTypeCollectionTest extends \Test\TestCase { private $node; /** - * @var \OCP\SystemTag\ISystemTagManager + * @var ISystemTagManager */ private $tagManager; /** - * @var \OCP\SystemTag\ISystemTagObjectMapper + * @var ISystemTagObjectMapper */ private $tagMapper; /** - * @var \OCP\Files\Folder + * @var Folder */ private $userFolder; |