diff --git a/apps/comments/tests/unit/ActivityListenerTest.php b/apps/comments/tests/unit/ActivityListenerTest.php index 6f81cc1da7d6..f4fd1bffbb09 100644 --- a/apps/comments/tests/unit/ActivityListenerTest.php +++ b/apps/comments/tests/unit/ActivityListenerTest.php @@ -71,7 +71,7 @@ class ActivityListenerTest extends \Test\TestCase { */ private $activityManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->activityManager = $this->createMock(IManager::class); diff --git a/apps/comments/tests/unit/Dav/CommentsNodeTest.php b/apps/comments/tests/unit/Dav/CommentsNodeTest.php index 8f866fe08332..aad4cb2e29b5 100644 --- a/apps/comments/tests/unit/Dav/CommentsNodeTest.php +++ b/apps/comments/tests/unit/Dav/CommentsNodeTest.php @@ -35,7 +35,7 @@ class CommentsNodeTest extends \Test\TestCase { protected $logger; protected $userSession; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->commentsManager = $this->createMock('\OCP\Comments\ICommentsManager'); diff --git a/apps/comments/tests/unit/Dav/CommentsPluginTest.php b/apps/comments/tests/unit/Dav/CommentsPluginTest.php index 16666f01a484..b18bb98ea995 100644 --- a/apps/comments/tests/unit/Dav/CommentsPluginTest.php +++ b/apps/comments/tests/unit/Dav/CommentsPluginTest.php @@ -44,7 +44,7 @@ class CommentsPluginTest extends \Test\TestCase { /** @var CommentsPluginImplementation */ private $plugin; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->tree = $this->getMockBuilder('\Sabre\DAV\Tree') ->disableOriginalConstructor() diff --git a/apps/comments/tests/unit/Dav/EntityCollectionTest.php b/apps/comments/tests/unit/Dav/EntityCollectionTest.php index db8de3930ade..a8fa40a2b2ec 100644 --- a/apps/comments/tests/unit/Dav/EntityCollectionTest.php +++ b/apps/comments/tests/unit/Dav/EntityCollectionTest.php @@ -46,7 +46,7 @@ class EntityCollectionTest extends \Test\TestCase { /** @var EventDispatcherInterface | \PHPUnit\Framework\MockObject\MockObject */ private $dispatcher; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->commentsManager = $this->createMock(ICommentsManager::class); diff --git a/apps/comments/tests/unit/Dav/EntityTypeCollectionTest.php b/apps/comments/tests/unit/Dav/EntityTypeCollectionTest.php index b7c0adfd2b2e..e42437da0937 100644 --- a/apps/comments/tests/unit/Dav/EntityTypeCollectionTest.php +++ b/apps/comments/tests/unit/Dav/EntityTypeCollectionTest.php @@ -48,7 +48,7 @@ class EntityTypeCollectionTest extends \Test\TestCase { /** @var EventDispatcherInterface | \PHPUnit\Framework\MockObject\MockObject */ private $dispatcher; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->commentsManager = $this->createMock(ICommentsManager::class); diff --git a/apps/comments/tests/unit/Dav/RootCollectionTest.php b/apps/comments/tests/unit/Dav/RootCollectionTest.php index 7714a8cbbb40..2c15a8e92ef3 100644 --- a/apps/comments/tests/unit/Dav/RootCollectionTest.php +++ b/apps/comments/tests/unit/Dav/RootCollectionTest.php @@ -45,7 +45,7 @@ class RootCollectionTest extends \Test\TestCase { /** @var \OCP\IUser|\PHPUnit\Framework\MockObject\MockObject */ protected $user; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->user = $this->createMock('\OCP\IUser'); diff --git a/apps/dav/tests/unit/Avatars/AvatarHomeTest.php b/apps/dav/tests/unit/Avatars/AvatarHomeTest.php index 202b7293e713..7a34ebc77ffb 100644 --- a/apps/dav/tests/unit/Avatars/AvatarHomeTest.php +++ b/apps/dav/tests/unit/Avatars/AvatarHomeTest.php @@ -37,7 +37,7 @@ class AvatarHomeTest extends TestCase { /** @var IAvatarManager | \PHPUnit\Framework\MockObject\MockObject */ private $avatarManager; - public function setUp() { + public function setUp(): void { $this->avatarManager = $this->createMock(IAvatarManager::class); $this->home = new AvatarHome(['uri' => 'principals/users/admin'], $this->avatarManager); } diff --git a/apps/dav/tests/unit/BackgroundJob/CleanPropertiesTest.php b/apps/dav/tests/unit/BackgroundJob/CleanPropertiesTest.php index 121e99351437..39533c73f807 100644 --- a/apps/dav/tests/unit/BackgroundJob/CleanPropertiesTest.php +++ b/apps/dav/tests/unit/BackgroundJob/CleanPropertiesTest.php @@ -44,7 +44,7 @@ class CleanPropertiesTest extends TestCase { /** @var string */ private $username; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php index 8a1b52a1c620..136d15763da8 100644 --- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php @@ -59,7 +59,7 @@ abstract class AbstractCalDavBackendTest extends TestCase { /** @var ISecureRandom */ private $random; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->principal = $this->getMockBuilder(Principal::class) @@ -83,7 +83,7 @@ public function setUp() { $this->tearDown(); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); if ($this->backend === null) { diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php index 1806a6525512..b90d1f3537f7 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php @@ -36,7 +36,7 @@ class CalendarTest extends TestCase { /** @var IL10N */ private $l10n; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->l10n = $this->getMockBuilder(IL10N::class) ->disableOriginalConstructor()->getMock(); diff --git a/apps/dav/tests/unit/CalDAV/PluginTest.php b/apps/dav/tests/unit/CalDAV/PluginTest.php index 8e09e34bff28..07f25746c043 100644 --- a/apps/dav/tests/unit/CalDAV/PluginTest.php +++ b/apps/dav/tests/unit/CalDAV/PluginTest.php @@ -14,7 +14,7 @@ class PluginTest extends TestCase { /** @var Plugin */ private $plugin; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->plugin = new Plugin(); diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php index 7df339e9b707..d393dd181887 100644 --- a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php +++ b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php @@ -61,7 +61,7 @@ class PublicCalendarRootTest extends TestCase { /** @var ISecureRandom */ private $random; - public function setUp() { + public function setUp(): void { parent::setUp(); $db = \OC::$server->getDatabaseConnection(); @@ -81,7 +81,7 @@ public function setUp() { ->disableOriginalConstructor()->getMock(); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); if ($this->backend === null) { diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php index bfde545f33bc..bedd8e88c377 100644 --- a/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php +++ b/apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php @@ -44,7 +44,7 @@ class PluginTest extends TestCase { /** @var IURLGenerator | \PHPUnit\Framework\MockObject\MockObject */ private $urlGenerator; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder('\OCP\IConfig')-> diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php index af113a85803a..99ff041a97c7 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -52,7 +52,7 @@ class AddressBookImplTest extends TestCase { /** @var VCard | \PHPUnit\Framework\MockObject\MockObject */ private $vCard; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->addressBookInfo = [ diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php index 885ba6f1299b..a2abe22e118e 100644 --- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php @@ -42,7 +42,7 @@ class BirthdayServiceTest extends TestCase { /** @var GroupPrincipalBackend | \PHPUnit\Framework\MockObject\MockObject */ private $groupPrincipalBackend; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->calDav = $this->getMockBuilder(CalDavBackend::class)->disableOriginalConstructor()->getMock(); diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index 9dae23bb041a..db837faa3e9a 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -68,7 +68,7 @@ class CardDavBackendTest extends TestCase { const UNIT_TEST_USER1 = 'principals/users/carddav-unit-test1'; const UNIT_TEST_GROUP = 'principals/groups/carddav-unit-test-group'; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->principal = $this->getMockBuilder(Principal::class) @@ -98,7 +98,7 @@ public function setUp() { $this->tearDown(); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); if ($this->backend === null) { diff --git a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php index ebc5f94abb5e..f6e11b92dd81 100644 --- a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php +++ b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php @@ -46,7 +46,7 @@ class ImageExportPluginTest extends TestCase { /** @var ILogger | \PHPUnit\Framework\MockObject\MockObject */ private $logger; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder('Sabre\HTTP\RequestInterface')->getMock(); diff --git a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php index 720522952c02..20a11df8ed8e 100644 --- a/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php +++ b/apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php @@ -41,7 +41,7 @@ class PluginTest extends TestCase { /** @var IShareable | \PHPUnit\Framework\MockObject\MockObject */ private $book; - public function setUp() { + public function setUp(): void { parent::setUp(); /** @var Auth | \PHPUnit\Framework\MockObject\MockObject $authBackend */ diff --git a/apps/dav/tests/unit/Command/CleanupChunksTest.php b/apps/dav/tests/unit/Command/CleanupChunksTest.php index 225ebcef82c1..f28d6f6f6c64 100644 --- a/apps/dav/tests/unit/Command/CleanupChunksTest.php +++ b/apps/dav/tests/unit/Command/CleanupChunksTest.php @@ -42,7 +42,7 @@ class CleanupChunksTest extends TestCase { /** @var IUser */ private $user; - public function setUp() { + public function setUp(): void { parent::setUp(); $command = new CleanupChunks(\OC::$server->getUserManager()); diff --git a/apps/dav/tests/unit/Connector/PublicAuthTest.php b/apps/dav/tests/unit/Connector/PublicAuthTest.php index 5040b05f0c66..e26dba5c6509 100644 --- a/apps/dav/tests/unit/Connector/PublicAuthTest.php +++ b/apps/dav/tests/unit/Connector/PublicAuthTest.php @@ -49,7 +49,7 @@ class PublicAuthTest extends \Test\TestCase { /** @var string */ private $oldUser; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->session = $this->createMock('\OCP\ISession'); @@ -66,7 +66,7 @@ protected function setUp() { $this->oldUser = \OC_User::getUser(); } - protected function tearDown() { + protected function tearDown(): void { \OC_User::setIncognitoMode(false); // Set old user diff --git a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php index dfb8bac5e994..114d0e39bf7a 100644 --- a/apps/dav/tests/unit/Connector/Sabre/AuthTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/AuthTest.php @@ -60,7 +60,7 @@ class AuthTest extends TestCase { /** @var AccountModuleManager | \PHPUnit\Framework\MockObject\MockObject */ private $accountModuleManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->session = $this->createMock(ISession::class); $this->userSession = $this->createMock(Session::class); diff --git a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php index 1051867640d0..507c330d848b 100644 --- a/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/BlockLegacyClientPluginTest.php @@ -39,7 +39,7 @@ class BlockLegacyClientPluginTest extends TestCase { /** @var BlockLegacyClientPlugin */ private $blockLegacyClientVersionPlugin; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock('\OCP\IConfig'); diff --git a/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php index 8e20020030b1..ee8d65b19d49 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CommentsPropertiesPluginTest.php @@ -34,7 +34,7 @@ class CommentsPropertiesPluginTest extends \Test\TestCase { protected $server; protected $userFolder; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->commentsManager = $this->createMock('\OCP\Comments\ICommentsManager'); diff --git a/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php index 6728c802c564..b9bb2f595004 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CopyEtagHeaderPluginTest.php @@ -42,7 +42,7 @@ class CopyEtagHeaderPluginTest extends TestCase { /** @var Server */ private $server; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->server = new \Sabre\DAV\Server(); $this->plugin = new CopyEtagHeaderPlugin(); diff --git a/apps/dav/tests/unit/Connector/Sabre/CorsPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/CorsPluginTest.php index dbb25d3a882b..dae5b442c349 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CorsPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CorsPluginTest.php @@ -52,7 +52,7 @@ class CorsPluginTest extends TestCase { */ private $config; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->server = new Server(); @@ -80,7 +80,7 @@ public function setUp() { $this->server->addPlugin($extraMethodPlugin); } - public function tearDown() { + public function tearDown(): void { $this->restoreService('AllConfig'); } diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php index 1459e6f6403a..ea246c5c6f9b 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php @@ -75,7 +75,7 @@ class DirectoryTest extends \Test\TestCase { /** @var \OC\Files\FileInfo | \PHPUnit\Framework\MockObject\MockObject */ private $info; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->view = $this->createMock('OC\Files\View', [], [], '', false); diff --git a/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php b/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php index df5403bc595d..bbddea9db928 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DummyGetResponsePluginTest.php @@ -35,7 +35,7 @@ class DummyGetResponsePluginTest extends TestCase { /** @var DummyGetResponsePlugin */ private $dummyGetResponsePlugin; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->dummyGetResponsePlugin = new DummyGetResponsePlugin(); diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index d776733735dd..27f7e9c34a56 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -69,7 +69,7 @@ class FileTest extends TestCase { /** @var IConfig | \PHPUnit\Framework\MockObject\MockObject */ protected $config; - public function setUp() { + public function setUp(): void { parent::setUp(); unset($_SERVER['HTTP_OC_CHUNKED'], $_SERVER['CONTENT_LENGTH'], $_SERVER['REQUEST_METHOD']); @@ -84,7 +84,7 @@ public function setUp() { $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock(); } - public function tearDown() { + public function tearDown(): void { $userManager = \OC::$server->getUserManager(); if ($userManager->userExists($this->user)) { $userManager->get($this->user)->delete(); diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php index abf19835b891..8afad2be3359 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php @@ -87,7 +87,7 @@ class FilesPluginTest extends TestCase { */ private $request; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->server = $this->getMockBuilder(Server::class) ->disableOriginalConstructor() diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php index 1271ceaf6a9e..f2e9452537a5 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php @@ -66,7 +66,7 @@ class FilesReportPluginTest extends \Test\TestCase { /** @var Folder|\PHPUnit\Framework\MockObject\MockObject **/ private $userFolder; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->tree = $this->getMockBuilder('\Sabre\DAV\Tree') ->disableOriginalConstructor() diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesSearchReportPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesSearchReportPluginTest.php index bdeb571d34ab..67efe34bf3b0 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesSearchReportPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesSearchReportPluginTest.php @@ -45,7 +45,7 @@ class FilesSearchReportPluginTest extends \Test\TestCase { /** @var FilesSearchReportPlugin|\PHPUnit\Framework\MockObject\MockObject */ private $plugin; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->tree = $this->getMockBuilder(Tree::class) diff --git a/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php b/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php index 9efaf5edc0ad..d487161cd132 100644 --- a/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php @@ -37,7 +37,7 @@ class MaintenancePluginTest extends TestCase { /** @var MaintenancePlugin */ private $maintenancePlugin; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock('\OCP\IConfig'); diff --git a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php index 77aca9282ef0..be586c122d69 100644 --- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php @@ -37,7 +37,7 @@ class PrincipalTest extends TestCase { /** @var IGroupManager | \PHPUnit\Framework\MockObject\MockObject */ private $groupManager; - public function setUp() { + public function setUp(): void { $this->userManager = $this->getMockBuilder('\OCP\IUserManager') ->disableOriginalConstructor()->getMock(); $this->groupManager = $this->getMockBuilder('\OCP\IGroupManager') diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/PartFileInRootUploadTest.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/PartFileInRootUploadTest.php index 556b55558215..24400afd69cb 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/PartFileInRootUploadTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/PartFileInRootUploadTest.php @@ -33,18 +33,18 @@ class PartFileInRootUploadTest extends UploadTest { protected $original; - protected function setUp() { + protected function setUp(): void { $config = \OC::$server->getConfig(); $this->original = $config->getSystemValue('part_file_in_storage', null); $config->setSystemValue('part_file_in_storage', false); parent::setUp(); } - protected function tearDown() { + protected function tearDown(): void { if ($this->original !== null) { $config = \OC::$server->getConfig(); $this->original = $config->setSystemValue('part_file_in_storage', $this->original); } - return parent::tearDown(); + parent::tearDown(); } } diff --git a/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTest.php b/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTest.php index 987525050f2a..bbcef1089ec3 100644 --- a/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/RequestTest/RequestTest.php @@ -50,7 +50,7 @@ protected function getStream($string) { return $stream; } - protected function setUp() { + protected function setUp(): void { parent::setUp(); unset($_SERVER['HTTP_OC_CHUNKED']); diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php index 8e5bfc301d24..82dee09b59cc 100644 --- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php @@ -52,7 +52,7 @@ class SharesPluginTest extends \Test\TestCase { */ private $plugin; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->server = new \Sabre\DAV\Server(); $this->tree = $this->getMockBuilder('\Sabre\DAV\Tree') diff --git a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php index 01d7319d5295..d2b3d8f46726 100644 --- a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php @@ -58,7 +58,7 @@ class TagsPluginTest extends \Test\TestCase { */ private $plugin; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->server = new \Sabre\DAV\Server(); $this->tree = $this->getMockBuilder('\Sabre\DAV\Tree') diff --git a/apps/dav/tests/unit/Connector/Sabre/ValidateRequestPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/ValidateRequestPluginTest.php index 2fc5f6333d23..bc34bd2c94d7 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ValidateRequestPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ValidateRequestPluginTest.php @@ -36,7 +36,7 @@ class ValidateRequestPluginTest extends TestCase { /** @var ValidateRequestPlugin */ private $plugin; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->server = new \Sabre\DAV\Server(); diff --git a/apps/dav/tests/unit/DAV/CopyPluginTest.php b/apps/dav/tests/unit/DAV/CopyPluginTest.php index d439724f9fe6..5d3d9fca4107 100644 --- a/apps/dav/tests/unit/DAV/CopyPluginTest.php +++ b/apps/dav/tests/unit/DAV/CopyPluginTest.php @@ -48,7 +48,7 @@ class CopyPluginTest extends TestCase { /** @var ResponseInterface | \PHPUnit\Framework\MockObject\MockObject */ private $response; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->plugin = new CopyPlugin(); diff --git a/apps/dav/tests/unit/DAV/FileCustomPropertiesBackendTest.php b/apps/dav/tests/unit/DAV/FileCustomPropertiesBackendTest.php index 456658120c6f..b7c5b5d8973f 100644 --- a/apps/dav/tests/unit/DAV/FileCustomPropertiesBackendTest.php +++ b/apps/dav/tests/unit/DAV/FileCustomPropertiesBackendTest.php @@ -70,7 +70,7 @@ class FileCustomPropertiesBackendTest extends \Test\TestCase { /** @var int */ private $maxId; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->server = new \Sabre\DAV\Server(); $this->tree = $this->getMockBuilder(Tree::class) @@ -101,7 +101,7 @@ public function setUp() { ->execute()->fetchColumn(); } - public function tearDown() { + public function tearDown(): void { $connection = \OC::$server->getDatabaseConnection(); $deleteStatement = $connection->prepare( 'DELETE FROM `*PREFIX*properties`' . diff --git a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php index e8efede071d3..fb1f1f3b2abe 100644 --- a/apps/dav/tests/unit/DAV/GroupPrincipalTest.php +++ b/apps/dav/tests/unit/DAV/GroupPrincipalTest.php @@ -36,7 +36,7 @@ class GroupPrincipalTest extends \Test\TestCase { /** @var GroupPrincipalBackend */ private $connector; - public function setUp() { + public function setUp(): void { $this->groupManager = $this->getMockBuilder(IGroupManager::class) ->disableOriginalConstructor()->getMock(); diff --git a/apps/dav/tests/unit/DAV/HookManagerTest.php b/apps/dav/tests/unit/DAV/HookManagerTest.php index d55bac0a5457..a65aa9b852ec 100644 --- a/apps/dav/tests/unit/DAV/HookManagerTest.php +++ b/apps/dav/tests/unit/DAV/HookManagerTest.php @@ -38,7 +38,7 @@ class HookManagerTest extends TestCase { /** @var L10N */ private $l10n; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->l10n = $this->getMockBuilder('OC\L10N\L10N') diff --git a/apps/dav/tests/unit/DAV/HookManagerZsyncTest.php b/apps/dav/tests/unit/DAV/HookManagerZsyncTest.php index ebd8fed42dde..411398d8c6c8 100644 --- a/apps/dav/tests/unit/DAV/HookManagerZsyncTest.php +++ b/apps/dav/tests/unit/DAV/HookManagerZsyncTest.php @@ -54,7 +54,7 @@ public static function setUpBeforeClass() { self::loginHelper(self::TEST_ZSYNC_HOOKS_USER, true); } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { // cleanup test user $user = \OC::$server->getUserManager()->get(self::TEST_ZSYNC_HOOKS_USER); if ($user !== null) { @@ -64,7 +64,7 @@ public static function tearDownAfterClass() { parent::tearDownAfterClass(); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = \OC::$server->getConfig(); @@ -121,7 +121,7 @@ protected function setUp() { } } - protected function tearDown() { + protected function tearDown(): void { $this->restoreService('AllConfig'); if ($this->rootView) { diff --git a/apps/dav/tests/unit/DAV/LazyOpsPluginTest.php b/apps/dav/tests/unit/DAV/LazyOpsPluginTest.php index 037360c6dc80..628a3a53df88 100644 --- a/apps/dav/tests/unit/DAV/LazyOpsPluginTest.php +++ b/apps/dav/tests/unit/DAV/LazyOpsPluginTest.php @@ -50,7 +50,7 @@ class LazyOpsPluginTest extends TestCase { /** @var IUserSession | \PHPUnit\Framework\MockObject\MockObject */ private $userSession; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->userSession = $this->createMock(IUserSession::class); diff --git a/apps/dav/tests/unit/DAV/LockPluginTest.php b/apps/dav/tests/unit/DAV/LockPluginTest.php index 68dfdb19b9f1..c62d0e4db6ac 100644 --- a/apps/dav/tests/unit/DAV/LockPluginTest.php +++ b/apps/dav/tests/unit/DAV/LockPluginTest.php @@ -51,7 +51,7 @@ class LockPluginTest extends TestCase { /** @var IUserSession | \PHPUnit\Framework\MockObject\MockObject */ private $userSession; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->plugin = new LockPlugin(); @@ -67,7 +67,7 @@ public function setUp() { $this->overwriteService('UserSession', $this->userSession); } - protected function tearDown() { + protected function tearDown(): void { parent::tearDown(); $this->restoreService('UserSession'); $this->restoreService(LockMapper::class); diff --git a/apps/dav/tests/unit/DAV/MiscCustomPropertiesBackendTest.php b/apps/dav/tests/unit/DAV/MiscCustomPropertiesBackendTest.php index 42e25c92f1fc..029fb57d0cfd 100644 --- a/apps/dav/tests/unit/DAV/MiscCustomPropertiesBackendTest.php +++ b/apps/dav/tests/unit/DAV/MiscCustomPropertiesBackendTest.php @@ -59,7 +59,7 @@ class MiscCustomPropertiesBackendTest extends \Test\TestCase { /** @var int */ private $maxId; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->server = new \Sabre\DAV\Server(); $this->tree = $this->getMockBuilder('\Sabre\DAV\Tree') @@ -89,7 +89,7 @@ public function setUp() { ->execute()->fetchColumn(); } - public function tearDown() { + public function tearDown(): void { $connection = \OC::$server->getDatabaseConnection(); $deleteStatement = $connection->prepare( 'DELETE FROM `*PREFIX*dav_properties`' . diff --git a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php index f5d13888b03b..36630f874b48 100644 --- a/apps/dav/tests/unit/DAV/Sharing/PluginTest.php +++ b/apps/dav/tests/unit/DAV/Sharing/PluginTest.php @@ -41,7 +41,7 @@ class PluginTest extends TestCase { /** @var IShareable | \PHPUnit\Framework\MockObject\MockObject */ private $book; - public function setUp() { + public function setUp(): void { parent::setUp(); /** @var Auth | \PHPUnit\Framework\MockObject\MockObject $authBackend */ diff --git a/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php b/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php index 577935be7b07..22ec2d64c208 100644 --- a/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php +++ b/apps/dav/tests/unit/DAV/ViewOnlyPluginTest.php @@ -43,7 +43,7 @@ class ViewOnlyPluginTest extends TestCase { /** @var RequestInterface | \PHPUnit\Framework\MockObject\MockObject */ private $request; - public function setUp() { + public function setUp(): void { $this->plugin = new ViewOnlyPlugin( $this->createMock(ILogger::class) ); diff --git a/apps/dav/tests/unit/DAV/ZsyncPluginTest.php b/apps/dav/tests/unit/DAV/ZsyncPluginTest.php index 0dc92dabad2d..e125c6a81e14 100644 --- a/apps/dav/tests/unit/DAV/ZsyncPluginTest.php +++ b/apps/dav/tests/unit/DAV/ZsyncPluginTest.php @@ -41,7 +41,7 @@ class ZsyncPluginTest extends TestCase { /** @var RequestInterface | \PHPUnit\Framework\MockObject\MockObject */ private $request; - public function setUp() { + public function setUp(): void { $this->view = $this->getMockBuilder('\OC\Files\View') ->disableOriginalConstructor() ->getMock(); diff --git a/apps/dav/tests/unit/Files/FileLocksBackendTest.php b/apps/dav/tests/unit/Files/FileLocksBackendTest.php index 7cecd6ada7f7..034871bc4d4d 100644 --- a/apps/dav/tests/unit/Files/FileLocksBackendTest.php +++ b/apps/dav/tests/unit/Files/FileLocksBackendTest.php @@ -49,7 +49,7 @@ class FileLocksBackendTest extends TestCase { /** @var IPersistentLockingStorage | IStorage | \PHPUnit\Framework\MockObject\MockObject */ private $storageOfFileToBeLocked; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->storageOfFileToBeLocked = $this->createMock([IPersistentLockingStorage::class, IStorage::class]); diff --git a/apps/dav/tests/unit/Files/FilesHomeTest.php b/apps/dav/tests/unit/Files/FilesHomeTest.php index ec984fc23927..ae01a2d46995 100644 --- a/apps/dav/tests/unit/Files/FilesHomeTest.php +++ b/apps/dav/tests/unit/Files/FilesHomeTest.php @@ -37,7 +37,7 @@ class FilesHomeTest extends TestCase { /** @var View | \PHPUnit\Framework\MockObject\MockObject */ private $view; - protected function setUp() { + protected function setUp(): void { $this->view = $this->createMock(View::class); $this->filesHome = new FilesHome([ 'uri' => 'principals/users/user01' diff --git a/apps/dav/tests/unit/Files/PreviewPluginTest.php b/apps/dav/tests/unit/Files/PreviewPluginTest.php index 09d17feb2f58..7fb080cf2aaa 100644 --- a/apps/dav/tests/unit/Files/PreviewPluginTest.php +++ b/apps/dav/tests/unit/Files/PreviewPluginTest.php @@ -53,7 +53,7 @@ class PreviewPluginTest extends TestCase { /** @var ResponseInterface| \PHPUnit\Framework\MockObject\MockObject */ private $response; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->previewManager = $this->createMock(IPreview::class); diff --git a/apps/dav/tests/unit/JobStatus/Entity/JobStatusMapperTest.php b/apps/dav/tests/unit/JobStatus/Entity/JobStatusMapperTest.php index 649e99ffdc5c..f101acedd4e6 100644 --- a/apps/dav/tests/unit/JobStatus/Entity/JobStatusMapperTest.php +++ b/apps/dav/tests/unit/JobStatus/Entity/JobStatusMapperTest.php @@ -42,7 +42,7 @@ class JobStatusMapperTest extends TestCase { /** @var JobStatus */ private $testJobStatus; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->database = \OC::$server->getDatabaseConnection(); $this->mapper = new JobStatusMapper($this->database); @@ -54,7 +54,7 @@ public function setUp() { $this->testJobStatus->setStatusInfo(\json_encode([])); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); if ($this->mapper !== null && $this->testJobStatus !== null) { $this->mapper->delete($this->testJobStatus); diff --git a/apps/dav/tests/unit/JobStatus/JobStatusTest.php b/apps/dav/tests/unit/JobStatus/JobStatusTest.php index 124c8f7e9822..e0ab645fdc8d 100644 --- a/apps/dav/tests/unit/JobStatus/JobStatusTest.php +++ b/apps/dav/tests/unit/JobStatus/JobStatusTest.php @@ -40,7 +40,7 @@ class JobStatusTest extends TestCase { /** @var JobStatusMapper | \PHPUnit\Framework\MockObject\MockObject */ private $mapper; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->mapper = $this->createMock(JobStatusMapper::class); diff --git a/apps/dav/tests/unit/Repair/RemoveInvalidSharesTest.php b/apps/dav/tests/unit/Repair/RemoveInvalidSharesTest.php index 76a7b11cdacd..ae6a2d10cdd4 100644 --- a/apps/dav/tests/unit/Repair/RemoveInvalidSharesTest.php +++ b/apps/dav/tests/unit/Repair/RemoveInvalidSharesTest.php @@ -34,7 +34,7 @@ * @group DB */ class RemoveInvalidSharesTest extends TestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $db = \OC::$server->getDatabaseConnection(); diff --git a/apps/dav/tests/unit/SystemTag/SystemTagMappingNodeTest.php b/apps/dav/tests/unit/SystemTag/SystemTagMappingNodeTest.php index 33762e330139..f719edf4fd92 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagMappingNodeTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagMappingNodeTest.php @@ -44,7 +44,7 @@ class SystemTagMappingNodeTest extends \Test\TestCase { */ private $user; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tagManager = $this->createMock('\OCP\SystemTag\ISystemTagManager'); diff --git a/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php b/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php index 9c9861d6cf02..4e41c16c3619 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php @@ -40,7 +40,7 @@ class SystemTagNodeTest extends \Test\TestCase { */ private $user; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tagManager = $this->createMock('\OCP\SystemTag\ISystemTagManager'); diff --git a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php index 7274468dea82..5fb19cacdb14 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagPluginTest.php @@ -77,7 +77,7 @@ class SystemTagPluginTest extends \Test\TestCase { */ private $plugin; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->tree = $this->getMockBuilder('\Sabre\DAV\Tree') ->disableOriginalConstructor() diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php index a7dc867f3e70..9924d836a0a3 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsByIdCollectionTest.php @@ -39,7 +39,7 @@ class SystemTagsByIdCollectionTest extends \Test\TestCase { */ private $user; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tagManager = $this->createMock('\OCP\SystemTag\ISystemTagManager'); diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php index f00d95c3171b..0283dc5d7233 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php @@ -43,7 +43,7 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { */ private $user; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tagManager = $this->createMock('\OCP\SystemTag\ISystemTagManager'); diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php index 5aa5bb64cfe9..e3eab3de090a 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php @@ -45,7 +45,7 @@ class SystemTagsObjectTypeCollectionTest extends \Test\TestCase { */ private $userFolder; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tagManager = $this->createMock('\OCP\SystemTag\ISystemTagManager'); diff --git a/apps/dav/tests/unit/TreeTest.php b/apps/dav/tests/unit/TreeTest.php index c4b4027031a0..0a6d716fb05b 100644 --- a/apps/dav/tests/unit/TreeTest.php +++ b/apps/dav/tests/unit/TreeTest.php @@ -45,7 +45,7 @@ public function providesPaths() { ]; } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->rootNode = $this->createMock(ICollection::class); diff --git a/apps/dav/tests/unit/Upload/ChunkLocationProviderTest.php b/apps/dav/tests/unit/Upload/ChunkLocationProviderTest.php index 38401e545c16..7eb6ff747173 100644 --- a/apps/dav/tests/unit/Upload/ChunkLocationProviderTest.php +++ b/apps/dav/tests/unit/Upload/ChunkLocationProviderTest.php @@ -39,7 +39,7 @@ class ChunkLocationProviderTest extends TestCase { /** @var IStorageFactory | \PHPUnit\Framework\MockObject\MockObject */ private $factory; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); $this->provider = new ChunkLocationProvider($this->config); diff --git a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php index fee71266cc53..90f9c9db7266 100644 --- a/apps/dav/tests/unit/Upload/ChunkingPluginTest.php +++ b/apps/dav/tests/unit/Upload/ChunkingPluginTest.php @@ -49,7 +49,7 @@ class ChunkingPluginTest extends TestCase { /** @var ResponseInterface | \PHPUnit\Framework\MockObject\MockObject */ private $response; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->server = $this->getMockBuilder('\Sabre\DAV\Server') diff --git a/apps/dav/tests/unit/Upload/ChunkingPluginZsyncTest.php b/apps/dav/tests/unit/Upload/ChunkingPluginZsyncTest.php index 48caaf0d6590..3dbd503133a2 100644 --- a/apps/dav/tests/unit/Upload/ChunkingPluginZsyncTest.php +++ b/apps/dav/tests/unit/Upload/ChunkingPluginZsyncTest.php @@ -54,7 +54,7 @@ class ChunkingPluginZsyncTest extends TestCase { /** @var ResponseInterface | \PHPUnit\Framework\MockObject\MockObject */ private $response; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->server = $this->getMockBuilder('\Sabre\DAV\Server') diff --git a/apps/federatedfilesharing/tests/AddressHandlerTest.php b/apps/federatedfilesharing/tests/AddressHandlerTest.php index 415e033e27e2..d2763a25c598 100644 --- a/apps/federatedfilesharing/tests/AddressHandlerTest.php +++ b/apps/federatedfilesharing/tests/AddressHandlerTest.php @@ -38,7 +38,7 @@ class AddressHandlerTest extends \Test\TestCase { /** @var IL10N | \PHPUnit\Framework\MockObject\MockObject */ private $il10n; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->urlGenerator = $this->createMock('OCP\IURLGenerator'); diff --git a/apps/federatedfilesharing/tests/Command/PollIncomingSharesTest.php b/apps/federatedfilesharing/tests/Command/PollIncomingSharesTest.php index 2c146df53b9a..3b8f1e040614 100644 --- a/apps/federatedfilesharing/tests/Command/PollIncomingSharesTest.php +++ b/apps/federatedfilesharing/tests/Command/PollIncomingSharesTest.php @@ -65,7 +65,7 @@ class PollIncomingSharesTest extends TestCase { */ private $externalManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->dbConnection = $this->createMock(IDBConnection::class); $this->userManager = $this->createMock(IUserManager::class); diff --git a/apps/federatedfilesharing/tests/Controller/OcmControllerTest.php b/apps/federatedfilesharing/tests/Controller/OcmControllerTest.php index 1243da907009..2a953a2ddf1b 100644 --- a/apps/federatedfilesharing/tests/Controller/OcmControllerTest.php +++ b/apps/federatedfilesharing/tests/Controller/OcmControllerTest.php @@ -96,7 +96,7 @@ class OcmControllerTest extends TestCase { */ private $shareToken = 'abc'; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = $this->createMock(IRequest::class); diff --git a/apps/federatedfilesharing/tests/Controller/RequestHandlerTest.php b/apps/federatedfilesharing/tests/Controller/RequestHandlerTest.php index 4e8f4e4fbb0a..6da812747fe7 100644 --- a/apps/federatedfilesharing/tests/Controller/RequestHandlerTest.php +++ b/apps/federatedfilesharing/tests/Controller/RequestHandlerTest.php @@ -82,7 +82,7 @@ class RequestHandlerTest extends TestCase { */ private $requestHandlerController; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = $this->createMock(IRequest::class); diff --git a/apps/federatedfilesharing/tests/Controller/SharingPersonalSettingsControllerTest.php b/apps/federatedfilesharing/tests/Controller/SharingPersonalSettingsControllerTest.php index a5037c447c61..765c98b4739a 100644 --- a/apps/federatedfilesharing/tests/Controller/SharingPersonalSettingsControllerTest.php +++ b/apps/federatedfilesharing/tests/Controller/SharingPersonalSettingsControllerTest.php @@ -44,7 +44,7 @@ class SharingPersonalSettingsControllerTest extends TestCase { /** @var SharingPersonalSettingsController $personalSettingsController */ private $sharingPersonalSettingsController; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder(IConfig::class) ->disableOriginalConstructor() diff --git a/apps/federatedfilesharing/tests/DiscoveryManagerTest.php b/apps/federatedfilesharing/tests/DiscoveryManagerTest.php index e9edc6bbc437..7ca1a36c709e 100644 --- a/apps/federatedfilesharing/tests/DiscoveryManagerTest.php +++ b/apps/federatedfilesharing/tests/DiscoveryManagerTest.php @@ -38,7 +38,7 @@ class DiscoveryManagerTest extends \Test\TestCase { /** @var DiscoveryManager */ private $discoveryManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->cache = $this->createMock('\OCP\ICache'); /** @var ICacheFactory $cacheFactory */ diff --git a/apps/federatedfilesharing/tests/FedShareManagerTest.php b/apps/federatedfilesharing/tests/FedShareManagerTest.php index 226f9e6cdf60..b089e87f4a41 100644 --- a/apps/federatedfilesharing/tests/FedShareManagerTest.php +++ b/apps/federatedfilesharing/tests/FedShareManagerTest.php @@ -71,7 +71,7 @@ class FedShareManagerTest extends TestCase { /** @var EventDispatcherInterface | \PHPUnit\Framework\MockObject\MockObject */ private $eventDispatcher; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->federatedShareProvider = $this->getMockBuilder( diff --git a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php index f5a7ddea4483..bf029a6a11be 100644 --- a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php +++ b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php @@ -79,7 +79,7 @@ class FederatedShareProviderTest extends \Test\TestCase { /** @var FederatedShareProvider */ protected $provider; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -121,10 +121,10 @@ public function setUp() { $this->shareManager = \OC::$server->getShareManager(); } - public function tearDown() { + public function tearDown(): void { $this->connection->getQueryBuilder()->delete('share')->execute(); - return parent::tearDown(); + parent::tearDown(); } public function testCreate() { diff --git a/apps/federatedfilesharing/tests/Middleware/OcmMiddlewareTest.php b/apps/federatedfilesharing/tests/Middleware/OcmMiddlewareTest.php index 8c3151f8ddcc..087e29d479cc 100644 --- a/apps/federatedfilesharing/tests/Middleware/OcmMiddlewareTest.php +++ b/apps/federatedfilesharing/tests/Middleware/OcmMiddlewareTest.php @@ -71,7 +71,7 @@ class OcmMiddlewareTest extends TestCase { */ private $logger; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->federatedShareProvider = $this->createMock( diff --git a/apps/federatedfilesharing/tests/NotificationsTest.php b/apps/federatedfilesharing/tests/NotificationsTest.php index 3f508b86f66b..283464b95664 100644 --- a/apps/federatedfilesharing/tests/NotificationsTest.php +++ b/apps/federatedfilesharing/tests/NotificationsTest.php @@ -57,7 +57,7 @@ class NotificationsTest extends \Test\TestCase { /** @var IConfig | \PHPUnit\Framework\MockObject\MockObject */ private $config; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->jobList = $this->createMock(IJobList::class); diff --git a/apps/federatedfilesharing/tests/Ocm/PermissionsTest.php b/apps/federatedfilesharing/tests/Ocm/PermissionsTest.php index f2734c597d20..107b2500c529 100644 --- a/apps/federatedfilesharing/tests/Ocm/PermissionsTest.php +++ b/apps/federatedfilesharing/tests/Ocm/PermissionsTest.php @@ -37,7 +37,7 @@ class PermissionsTest extends TestCase { */ private $permissions; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->permissions = new Permissions(); } diff --git a/apps/federatedfilesharing/tests/Panels/AdminPanelTest.php b/apps/federatedfilesharing/tests/Panels/AdminPanelTest.php index da0da9c64a7f..ffdff2aec740 100644 --- a/apps/federatedfilesharing/tests/Panels/AdminPanelTest.php +++ b/apps/federatedfilesharing/tests/Panels/AdminPanelTest.php @@ -37,7 +37,7 @@ class AdminPanelTest extends \Test\TestCase { /** @var IConfig */ private $config; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->shareProvider = $this->getMockBuilder(FederatedShareProvider::class) ->disableOriginalConstructor() diff --git a/apps/federatedfilesharing/tests/Panels/GeneralPersonalPanelTest.php b/apps/federatedfilesharing/tests/Panels/GeneralPersonalPanelTest.php index 209abea65e6b..950cbb47f636 100644 --- a/apps/federatedfilesharing/tests/Panels/GeneralPersonalPanelTest.php +++ b/apps/federatedfilesharing/tests/Panels/GeneralPersonalPanelTest.php @@ -47,7 +47,7 @@ class GeneralPersonalPanelTest extends \Test\TestCase { /** @var IRequest */ private $request; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->l = $this->getMockBuilder(IL10N::class)->getMock(); $this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)->getMock(); diff --git a/apps/federatedfilesharing/tests/Panels/SharingPersonalPanelTest.php b/apps/federatedfilesharing/tests/Panels/SharingPersonalPanelTest.php index 32b0775c4603..a7982cd87e52 100644 --- a/apps/federatedfilesharing/tests/Panels/SharingPersonalPanelTest.php +++ b/apps/federatedfilesharing/tests/Panels/SharingPersonalPanelTest.php @@ -36,7 +36,7 @@ class SharingPersonalPanelTest extends \Test\TestCase { /** @var SharingPersonalPanel $personalPanel */ private $sharingPersonalPanel; - protected function setUp() { + protected function setUp(): void { $this->config = $this->getMockBuilder(IConfig::class) ->disableOriginalConstructor() ->getMock(); diff --git a/apps/federatedfilesharing/tests/TestCase.php b/apps/federatedfilesharing/tests/TestCase.php index 86d44a0bf213..97dff4a25781 100644 --- a/apps/federatedfilesharing/tests/TestCase.php +++ b/apps/federatedfilesharing/tests/TestCase.php @@ -47,7 +47,7 @@ public static function setUpBeforeClass() { \OC::$server->getGroupManager()->clearBackends(); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->createUser(self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER1); @@ -57,7 +57,7 @@ protected function setUp() { self::loginHelper(self::TEST_FILES_SHARING_API_USER1); } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { // cleanup users $user = \OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER1); if ($user !== null) { diff --git a/apps/federatedfilesharing/tests/TokenHandlerTest.php b/apps/federatedfilesharing/tests/TokenHandlerTest.php index 5c404210a962..9037f5711562 100644 --- a/apps/federatedfilesharing/tests/TokenHandlerTest.php +++ b/apps/federatedfilesharing/tests/TokenHandlerTest.php @@ -37,7 +37,7 @@ class TokenHandlerTest extends \Test\TestCase { /** @var int */ private $expectedTokenLength = 15; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->secureRandom = $this->createMock('OCP\Security\ISecureRandom'); diff --git a/apps/federation/tests/API/OCSAuthAPITest.php b/apps/federation/tests/API/OCSAuthAPITest.php index c3b73c067525..ad406075546e 100644 --- a/apps/federation/tests/API/OCSAuthAPITest.php +++ b/apps/federation/tests/API/OCSAuthAPITest.php @@ -56,7 +56,7 @@ class OCSAuthAPITest extends TestCase { /** @var OCSAuthAPIController */ private $ocsAuthApi; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->createMock(IRequest::class); diff --git a/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php index 2899c7f01ba7..c000df5540ca 100644 --- a/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php +++ b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php @@ -67,7 +67,7 @@ class GetSharedSecretTest extends TestCase { /** @var GetSharedSecret */ private $getSharedSecret; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->httpClient = $this->createMock('OCP\Http\Client\IClient'); diff --git a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php index 6681dd4f28ce..b705f2174f80 100644 --- a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php +++ b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php @@ -56,7 +56,7 @@ class RequestSharedSecretTest extends TestCase { /** @var RequestSharedSecret */ private $requestSharedSecret; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->httpClient = $this->createMock('OCP\Http\Client\IClient'); diff --git a/apps/federation/tests/Controller/SettingsControllerTest.php b/apps/federation/tests/Controller/SettingsControllerTest.php index 9086409e405d..bc3bb70ea7cd 100644 --- a/apps/federation/tests/Controller/SettingsControllerTest.php +++ b/apps/federation/tests/Controller/SettingsControllerTest.php @@ -40,7 +40,7 @@ class SettingsControllerTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject | \OCA\Federation\TrustedServers */ private $trustedServers; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->createMock('OCP\IRequest'); diff --git a/apps/federation/tests/DbHandlerTest.php b/apps/federation/tests/DbHandlerTest.php index e036ac69e0ef..ba7260546ea8 100644 --- a/apps/federation/tests/DbHandlerTest.php +++ b/apps/federation/tests/DbHandlerTest.php @@ -46,7 +46,7 @@ class DbHandlerTest extends TestCase { /** @var string */ private $dbTable = 'trusted_servers'; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -62,7 +62,7 @@ public function setUp() { $this->assertEmpty($result, 'we need to start with a empty trusted_servers table'); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); $query = $this->connection->getQueryBuilder()->delete($this->dbTable); $query->execute(); diff --git a/apps/federation/tests/HooksTest.php b/apps/federation/tests/HooksTest.php index 9cd0085048f0..de1f6a050159 100644 --- a/apps/federation/tests/HooksTest.php +++ b/apps/federation/tests/HooksTest.php @@ -34,7 +34,7 @@ class HooksTest extends TestCase { /** @var Hooks */ private $hooks; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->trustedServers = $this->getMockBuilder('OCA\Federation\TrustedServers') diff --git a/apps/federation/tests/Middleware/AddServerMiddlewareTest.php b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php index 2e870b706286..21be6a28b7b5 100644 --- a/apps/federation/tests/Middleware/AddServerMiddlewareTest.php +++ b/apps/federation/tests/Middleware/AddServerMiddlewareTest.php @@ -43,7 +43,7 @@ class AddServerMiddlewareTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject | Controller */ private $controller; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->logger = $this->createMock('OCP\ILogger'); diff --git a/apps/federation/tests/PanelTest.php b/apps/federation/tests/PanelTest.php index 48880cb413ef..6b5f53246576 100644 --- a/apps/federation/tests/PanelTest.php +++ b/apps/federation/tests/PanelTest.php @@ -57,7 +57,7 @@ class PanelTest extends \Test\TestCase { /** @var EventDispatcherInterface */ private $eventDispatcher; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->connection = $this->getMockBuilder(IDBConnection::class)->getMock(); $this->l = $this->getMockBuilder(IL10N::class)->getMock(); diff --git a/apps/federation/tests/TrustedServersTest.php b/apps/federation/tests/TrustedServersTest.php index 387f5ee23a68..f4f6310d5648 100644 --- a/apps/federation/tests/TrustedServersTest.php +++ b/apps/federation/tests/TrustedServersTest.php @@ -68,7 +68,7 @@ class TrustedServersTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject | EventDispatcherInterface */ private $dispatcher; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->dbHandler = $this->getMockBuilder('\OCA\Federation\DbHandler') diff --git a/apps/files/tests/ActivityHelperTest.php b/apps/files/tests/ActivityHelperTest.php index e2c04ea276e8..dcfd72b9ab8f 100644 --- a/apps/files/tests/ActivityHelperTest.php +++ b/apps/files/tests/ActivityHelperTest.php @@ -52,7 +52,7 @@ class ActivityHelperTest extends \Test\TestCase { */ private $user; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tags = $this->createMock(ITags::class); diff --git a/apps/files/tests/ActivityTest.php b/apps/files/tests/ActivityTest.php index f014850d6cc6..3931f95d12d4 100644 --- a/apps/files/tests/ActivityTest.php +++ b/apps/files/tests/ActivityTest.php @@ -55,7 +55,7 @@ class ActivityTest extends TestCase { /** @var \OCA\Files\Activity */ protected $activityExtension; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder('OCP\IRequest') diff --git a/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php b/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php index 4c00b888783c..c40a7e9ab791 100644 --- a/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php +++ b/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php @@ -37,7 +37,7 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase { /** @var \OCP\IDBConnection */ protected $connection; - protected function setup() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); } diff --git a/apps/files/tests/BackgroundJob/ScanFilesTest.php b/apps/files/tests/BackgroundJob/ScanFilesTest.php index 6650e7be089e..50dcbb60b7d5 100644 --- a/apps/files/tests/BackgroundJob/ScanFilesTest.php +++ b/apps/files/tests/BackgroundJob/ScanFilesTest.php @@ -39,7 +39,7 @@ class ScanFilesTest extends TestCase { /** @var ScanFiles */ private $scanFiles; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock('\OCP\IConfig'); diff --git a/apps/files/tests/CapabilitiesTest.php b/apps/files/tests/CapabilitiesTest.php index 54b13e4e3f0a..70af42962fe5 100644 --- a/apps/files/tests/CapabilitiesTest.php +++ b/apps/files/tests/CapabilitiesTest.php @@ -34,7 +34,7 @@ class CapabilitiesTest extends TestCase { /** @var Capabilities */ protected $capabilities; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); diff --git a/apps/files/tests/Command/DeleteOrphanedFilesTest.php b/apps/files/tests/Command/DeleteOrphanedFilesTest.php index 6524a8380064..7ead597e0755 100644 --- a/apps/files/tests/Command/DeleteOrphanedFilesTest.php +++ b/apps/files/tests/Command/DeleteOrphanedFilesTest.php @@ -52,7 +52,7 @@ class DeleteOrphanedFilesTest extends TestCase { */ private $user1; - protected function setup() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -65,7 +65,7 @@ protected function setup() { $this->command = new DeleteOrphanedFiles($this->connection); } - protected function tearDown() { + protected function tearDown(): void { $userManager = \OC::$server->getUserManager(); $user1 = $userManager->get($this->user1); if ($user1) { diff --git a/apps/files/tests/Command/ScanTest.php b/apps/files/tests/Command/ScanTest.php index 76c1419e4243..fad75d0973a0 100644 --- a/apps/files/tests/Command/ScanTest.php +++ b/apps/files/tests/Command/ScanTest.php @@ -94,7 +94,7 @@ class ScanTest extends TestCase { */ private $groupsCreated = []; - protected function setUp() { + protected function setUp(): void { if ($this->runsWithPrimaryObjectstorage()) { $this->markTestSkipped('not testing scanner as it does not make sense for primary object store'); } @@ -131,7 +131,7 @@ protected function setUp() { @\mkdir($this->dataDir . '/' . $this->scanUser1->getUID() . '/files/toscan', 0777, true); } - protected function tearDown() { + protected function tearDown(): void { foreach ($this->groupsCreated as $group) { $this->groupManager->get($group)->delete(); } diff --git a/apps/files/tests/Command/VerifyChecksumsTest.php b/apps/files/tests/Command/VerifyChecksumsTest.php index 6d49c0bfe1a1..4b9602f9997c 100644 --- a/apps/files/tests/Command/VerifyChecksumsTest.php +++ b/apps/files/tests/Command/VerifyChecksumsTest.php @@ -43,7 +43,7 @@ class VerifyChecksumsTest extends TestCase { */ private $testFiles; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->rootFolder = \OC::$server->getRootFolder(); diff --git a/apps/files/tests/Controller/ApiControllerTest.php b/apps/files/tests/Controller/ApiControllerTest.php index 0cdf158d44ce..dfa113e43de0 100644 --- a/apps/files/tests/Controller/ApiControllerTest.php +++ b/apps/files/tests/Controller/ApiControllerTest.php @@ -59,7 +59,7 @@ class ApiControllerTest extends TestCase { /** @var \OCP\IConfig */ private $config; - public function setUp() { + public function setUp(): void { $this->request = $this->getMockBuilder('\OCP\IRequest') ->disableOriginalConstructor() ->getMock(); diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index b557b1608640..344a38738e94 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -69,7 +69,7 @@ class ViewControllerTest extends TestCase { /** @var Folder | \PHPUnit\Framework\MockObject\MockObject */ private $rootFolder; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->createMock('\OCP\IRequest'); $this->urlGenerator = $this->createMock('\OCP\IURLGenerator'); diff --git a/apps/files/tests/Service/TagServiceTest.php b/apps/files/tests/Service/TagServiceTest.php index 8cf7bb291255..3497cd206172 100644 --- a/apps/files/tests/Service/TagServiceTest.php +++ b/apps/files/tests/Service/TagServiceTest.php @@ -58,7 +58,7 @@ class TagServiceTest extends \Test\TestCase { */ private $tagManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->user = $this->getUniqueID('user'); $user = $this->createUser($this->user, 'test'); @@ -81,7 +81,7 @@ protected function setUp() { ); } - protected function tearDown() { + protected function tearDown(): void { \OC_User::setUserId(''); parent::tearDown(); } diff --git a/apps/files_external/tests/Controller/GlobalStoragesControllerTest.php b/apps/files_external/tests/Controller/GlobalStoragesControllerTest.php index 2d4e2771c64c..d99b1c7b2856 100644 --- a/apps/files_external/tests/Controller/GlobalStoragesControllerTest.php +++ b/apps/files_external/tests/Controller/GlobalStoragesControllerTest.php @@ -28,7 +28,7 @@ use OCP\Files\External\IStoragesBackendService; class GlobalStoragesControllerTest extends StoragesControllerTest { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->service = $this->createMock('\OCP\Files\External\Service\IGlobalStoragesService'); diff --git a/apps/files_external/tests/Controller/StoragesControllerTest.php b/apps/files_external/tests/Controller/StoragesControllerTest.php index 001a3b38994a..763b460e0cee 100644 --- a/apps/files_external/tests/Controller/StoragesControllerTest.php +++ b/apps/files_external/tests/Controller/StoragesControllerTest.php @@ -41,12 +41,12 @@ abstract class StoragesControllerTest extends \Test\TestCase { */ protected $service; - public function setUp() { + public function setUp(): void { \OC_Mount_Config::$skipTest = true; \OC::$server->getSystemConfig()->setValue('files_external_allow_create_new_local', true); } - public function tearDown() { + public function tearDown(): void { \OC_Mount_Config::$skipTest = false; \OC::$server->getSystemConfig()->setValue('files_external_allow_create_new_local', false); } diff --git a/apps/files_external/tests/Controller/UserStoragesControllerTest.php b/apps/files_external/tests/Controller/UserStoragesControllerTest.php index cd0b9a6af915..ce36f407ff12 100644 --- a/apps/files_external/tests/Controller/UserStoragesControllerTest.php +++ b/apps/files_external/tests/Controller/UserStoragesControllerTest.php @@ -36,7 +36,7 @@ class UserStoragesControllerTest extends StoragesControllerTest { */ private $oldAllowedBackends; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->service = $this->createMock('\OCP\Files\External\Service\IUserStoragesService'); diff --git a/apps/files_external/tests/Panels/AdminTest.php b/apps/files_external/tests/Panels/AdminTest.php index a1d2f31547af..d15a99681dac 100644 --- a/apps/files_external/tests/Panels/AdminTest.php +++ b/apps/files_external/tests/Panels/AdminTest.php @@ -43,7 +43,7 @@ class AdminTest extends \Test\TestCase { /** @var IConfig */ private $config; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->backendService = $this->createMock(IStoragesBackendService::class); $this->storagesService = $this->createMock(IGlobalStoragesService::class); diff --git a/apps/files_external/tests/Panels/PersonalTest.php b/apps/files_external/tests/Panels/PersonalTest.php index 0f00813b3105..e50920030532 100644 --- a/apps/files_external/tests/Panels/PersonalTest.php +++ b/apps/files_external/tests/Panels/PersonalTest.php @@ -43,7 +43,7 @@ class PersonalTest extends \Test\TestCase { /** @var Manager */ private $encManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->backendService = $this->createMock(IStoragesBackendService::class); $this->storagesService = $this->createMock(IUserStoragesService::class); diff --git a/apps/files_external/tests/Storage/OwncloudTest.php b/apps/files_external/tests/Storage/OwncloudTest.php index 20f7876f4b42..5900e443ec3c 100644 --- a/apps/files_external/tests/Storage/OwncloudTest.php +++ b/apps/files_external/tests/Storage/OwncloudTest.php @@ -37,7 +37,7 @@ class OwncloudTest extends \Test\Files\Storage\Storage { private $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $id = $this->getUniqueID(); @@ -50,7 +50,7 @@ protected function setUp() { $this->instance->mkdir('/'); } - protected function tearDown() { + protected function tearDown(): void { if ($this->instance) { $this->instance->rmdir('/'); } diff --git a/apps/files_external/tests/Storage/SFTP_KeyTest.php b/apps/files_external/tests/Storage/SFTP_KeyTest.php index 706c5b7a7853..4625f9283a3c 100644 --- a/apps/files_external/tests/Storage/SFTP_KeyTest.php +++ b/apps/files_external/tests/Storage/SFTP_KeyTest.php @@ -37,7 +37,7 @@ class SFTP_KeyTest extends \Test\Files\Storage\Storage { private $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $id = $this->getUniqueID(); @@ -51,7 +51,7 @@ protected function setUp() { $this->instance->mkdir('/'); } - protected function tearDown() { + protected function tearDown(): void { if ($this->instance) { $this->instance->rmdir('/'); } diff --git a/apps/files_external/tests/Storage/SftpTest.php b/apps/files_external/tests/Storage/SftpTest.php index 6f48366264b2..a1813ba3a2be 100644 --- a/apps/files_external/tests/Storage/SftpTest.php +++ b/apps/files_external/tests/Storage/SftpTest.php @@ -44,7 +44,7 @@ class SftpTest extends \Test\Files\Storage\Storage { private $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $id = $this->getUniqueID(); @@ -57,7 +57,7 @@ protected function setUp() { $this->instance->mkdir('/'); } - protected function tearDown() { + protected function tearDown(): void { if ($this->instance) { $this->instance->rmdir('/'); } diff --git a/apps/files_external/tests/Storage/SmbTest.php b/apps/files_external/tests/Storage/SmbTest.php index d7887e6e8fb9..957ad570c102 100644 --- a/apps/files_external/tests/Storage/SmbTest.php +++ b/apps/files_external/tests/Storage/SmbTest.php @@ -37,7 +37,7 @@ * @package OCA\Files_External\Tests\Storage */ class SmbTest extends \Test\Files\Storage\Storage { - protected function setUp() { + protected function setUp(): void { parent::setUp(); $id = $this->getUniqueID(); @@ -53,7 +53,7 @@ protected function setUp() { $this->assertTrue($this->instance->mkdir('/')); } - protected function tearDown() { + protected function tearDown(): void { if ($this->instance) { $this->instance->rmdir(''); // force disconnect of the client diff --git a/apps/files_external/tests/Storage/SwiftTest.php b/apps/files_external/tests/Storage/SwiftTest.php index 8b04e45ab8c2..1a444ca89a23 100644 --- a/apps/files_external/tests/Storage/SwiftTest.php +++ b/apps/files_external/tests/Storage/SwiftTest.php @@ -38,7 +38,7 @@ class SwiftTest extends \Test\Files\Storage\Storage { private $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = include('files_external/tests/config.swift.php'); @@ -48,7 +48,7 @@ protected function setUp() { $this->instance = new Swift($this->config); } - protected function tearDown() { + protected function tearDown(): void { if ($this->instance) { try { $connection = $this->instance->getConnection(); diff --git a/apps/files_external/tests/Storage/WebdavTest.php b/apps/files_external/tests/Storage/WebdavTest.php index b22c7615cf94..daec691331d3 100644 --- a/apps/files_external/tests/Storage/WebdavTest.php +++ b/apps/files_external/tests/Storage/WebdavTest.php @@ -36,7 +36,7 @@ * @package OCA\Files_External\Tests\Storage */ class WebdavTest extends \Test\Files\Storage\Storage { - protected function setUp() { + protected function setUp(): void { parent::setUp(); $id = $this->getUniqueID(); @@ -52,7 +52,7 @@ protected function setUp() { $this->instance->mkdir('/'); } - protected function tearDown() { + protected function tearDown(): void { if ($this->instance) { $this->instance->rmdir('/'); } diff --git a/apps/files_sharing/tests/API/ShareesTest.php b/apps/files_sharing/tests/API/ShareesTest.php index cc5aab612766..d69551ba50dc 100644 --- a/apps/files_sharing/tests/API/ShareesTest.php +++ b/apps/files_sharing/tests/API/ShareesTest.php @@ -78,7 +78,7 @@ class ShareesTest extends TestCase { /** @var SharingBlacklist|\PHPUnit\Framework\MockObject\MockObject */ protected $sharingBlacklist; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userManager = $this->getMockBuilder(IUserManager::class) diff --git a/apps/files_sharing/tests/ActivityTest.php b/apps/files_sharing/tests/ActivityTest.php index 95c2a57d8e34..f7494ea4d6b8 100644 --- a/apps/files_sharing/tests/ActivityTest.php +++ b/apps/files_sharing/tests/ActivityTest.php @@ -40,7 +40,7 @@ class ActivityTest extends TestCase { */ private $activity; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->activity = new Activity( $this->getMockBuilder('OCP\L10N\IFactory') diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index ec32676a5209..f5d5b45e58b8 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -52,7 +52,7 @@ class ApiTest extends TestCase { /** @var string */ private $subsubfolder; - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', 'no'); @@ -75,7 +75,7 @@ protected function setUp() { $this->userFolder = \OC::$server->getUserFolder(self::TEST_FILES_SHARING_API_USER1); } - protected function tearDown() { + protected function tearDown(): void { if ($this->view instanceof \OC\Files\View) { $this->view->unlink($this->filename); $this->view->deleteAll($this->folder); diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php index 7fe77f4d96a9..42987a908858 100644 --- a/apps/files_sharing/tests/CacheTest.php +++ b/apps/files_sharing/tests/CacheTest.php @@ -58,7 +58,7 @@ class CacheTest extends TestCase { /** @var \OCP\Share\IManager */ protected $shareManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->shareManager = \OC::$server->getShareManager(); @@ -123,7 +123,7 @@ protected function setUp() { $this->sharedCache = $this->sharedStorage->getCache(); } - protected function tearDown() { + protected function tearDown(): void { if ($this->sharedCache) { $this->sharedCache->clear(); } diff --git a/apps/files_sharing/tests/CapabilitiesTest.php b/apps/files_sharing/tests/CapabilitiesTest.php index a4f3204e46ae..a5d1460d619f 100644 --- a/apps/files_sharing/tests/CapabilitiesTest.php +++ b/apps/files_sharing/tests/CapabilitiesTest.php @@ -43,7 +43,7 @@ class CapabilitiesTest extends \Test\TestCase { /** * */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userSearch = $this->getMockBuilder(\OCP\Util\UserSearch::class) ->disableOriginalConstructor() diff --git a/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php b/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php index b7c707db7734..3b359e9fbe2e 100644 --- a/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php +++ b/apps/files_sharing/tests/Command/CleanupRemoteStoragesTest.php @@ -54,7 +54,7 @@ class CleanupRemoteStoragesTest extends TestCase { ['notExistingId' => 'shared::c34568c143cdac7d2f06e0800b5280f9', 'share_token' => 'f2c69dad1dc0649f26976fd210fc62e7', 'remote' => 'https://hostname.tld/owncloud7', 'user' => 'user7'], ]; - protected function setup() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -107,7 +107,7 @@ protected function setup() { $this->command = new CleanupRemoteStorages($this->connection); } - public function tearDown() { + public function tearDown(): void { $storageQuery = \OC::$server->getDatabaseConnection()->getQueryBuilder(); $storageQuery->delete('storages') ->where($storageQuery->expr()->eq('id', $storageQuery->createParameter('id'))); @@ -130,7 +130,7 @@ public function tearDown() { } } - return parent::tearDown(); + parent::tearDown(); } private function doesStorageExist($numericId) { diff --git a/apps/files_sharing/tests/Controller/PersonalSettingsControllerTest.php b/apps/files_sharing/tests/Controller/PersonalSettingsControllerTest.php index b023725a0a5b..42e2244b287c 100644 --- a/apps/files_sharing/tests/Controller/PersonalSettingsControllerTest.php +++ b/apps/files_sharing/tests/Controller/PersonalSettingsControllerTest.php @@ -44,7 +44,7 @@ class PersonalSettingsControllerTest extends TestCase { /** @var PersonalSettingsController $personalSettingsController */ private $personalSettingsController; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder(IConfig::class) ->disableOriginalConstructor() diff --git a/apps/files_sharing/tests/Controller/Share20OcsControllerTest.php b/apps/files_sharing/tests/Controller/Share20OcsControllerTest.php index b2c89458ef6d..0f578aaf8f25 100644 --- a/apps/files_sharing/tests/Controller/Share20OcsControllerTest.php +++ b/apps/files_sharing/tests/Controller/Share20OcsControllerTest.php @@ -106,7 +106,7 @@ class Share20OcsControllerTest extends TestCase { /** @var SharingBlacklist */ private $sharingBlacklist; - protected function setUp() { + protected function setUp(): void { $this->shareManager = $this->getMockBuilder(IManager::class) ->disableOriginalConstructor() ->getMock(); @@ -164,7 +164,7 @@ protected function setUp() { ); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); } diff --git a/apps/files_sharing/tests/Controllers/ExternalShareControllerTest.php b/apps/files_sharing/tests/Controllers/ExternalShareControllerTest.php index 34ac1c625d80..d54c637b2285 100644 --- a/apps/files_sharing/tests/Controllers/ExternalShareControllerTest.php +++ b/apps/files_sharing/tests/Controllers/ExternalShareControllerTest.php @@ -44,7 +44,7 @@ class ExternalShareControllerTest extends \Test\TestCase { /** @var IClientService */ private $clientService; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder('\\OCP\\IRequest') ->disableOriginalConstructor()->getMock(); diff --git a/apps/files_sharing/tests/Controllers/ShareControllerTest.php b/apps/files_sharing/tests/Controllers/ShareControllerTest.php index a8e49f9707b5..eb5de966e60a 100644 --- a/apps/files_sharing/tests/Controllers/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controllers/ShareControllerTest.php @@ -74,7 +74,7 @@ class ShareControllerTest extends \Test\TestCase { /** @var EventDispatcher | \PHPUnit\Framework\MockObject\MockObject */ private $eventDispatcher; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->appName = 'files_sharing'; @@ -112,7 +112,7 @@ protected function setUp() { $this->loginAsUser($this->user); } - protected function tearDown() { + protected function tearDown(): void { \OC_Util::tearDownFS(); \OC_User::setUserId(''); Filesystem::tearDown(); diff --git a/apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php b/apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php index 5350507101bf..3c87fef70448 100644 --- a/apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php +++ b/apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php @@ -68,13 +68,13 @@ public static function setUpBeforeClass() { \OC\Files\Filesystem::getLoader()->removeStorageWrapper('oc_trashbin'); } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { if (self::$trashBinStatus) { \OC::$server->getAppManager()->enableApp('files_trashbin'); } } - protected function setup() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -93,7 +93,7 @@ protected function setup() { $this->job = new DeleteOrphanedSharesJob(); } - protected function tearDown() { + protected function tearDown(): void { $this->connection->executeUpdate('DELETE FROM `*PREFIX*share`'); $userManager = \OC::$server->getUserManager(); diff --git a/apps/files_sharing/tests/ExpireSharesJobTest.php b/apps/files_sharing/tests/ExpireSharesJobTest.php index d5b530df8ceb..861f454ae02b 100644 --- a/apps/files_sharing/tests/ExpireSharesJobTest.php +++ b/apps/files_sharing/tests/ExpireSharesJobTest.php @@ -60,7 +60,7 @@ class ExpireSharesJobTest extends \Test\TestCase { */ private $user2; - protected function setup() { + protected function setUp(): void { parent::setUp(); $this->shareManager = \OC::$server->getShareManager(); @@ -80,7 +80,7 @@ protected function setup() { $this->job = new ExpireSharesJob($this->connection, $this->shareManager, \OC::$server->getLogger()); } - protected function tearDown() { + protected function tearDown(): void { $this->connection->executeUpdate('DELETE FROM `*PREFIX*share`'); $userManager = \OC::$server->getUserManager(); diff --git a/apps/files_sharing/tests/External/CacheTest.php b/apps/files_sharing/tests/External/CacheTest.php index 65e061cff2ca..b10d7f659205 100644 --- a/apps/files_sharing/tests/External/CacheTest.php +++ b/apps/files_sharing/tests/External/CacheTest.php @@ -49,7 +49,7 @@ class CacheTest extends TestCase { */ private $remoteUser; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->remoteUser = $this->getUniqueID('remoteuser'); @@ -76,7 +76,7 @@ protected function setUp() { ); } - protected function tearDown() { + protected function tearDown(): void { if ($this->cache) { $this->cache->clear(); } diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php index 5d566b293bac..75f00c2b1d03 100644 --- a/apps/files_sharing/tests/External/ManagerTest.php +++ b/apps/files_sharing/tests/External/ManagerTest.php @@ -61,7 +61,7 @@ class ManagerTest extends TestCase { private $user; private $mountProvider; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->uid = $this->getUniqueID('user'); diff --git a/apps/files_sharing/tests/External/MountProviderTest.php b/apps/files_sharing/tests/External/MountProviderTest.php index 8965de004b7b..f8236452d125 100644 --- a/apps/files_sharing/tests/External/MountProviderTest.php +++ b/apps/files_sharing/tests/External/MountProviderTest.php @@ -43,7 +43,7 @@ class MountProviderTest extends TestCase { /** @var MountProvider */ private $mountProvider; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->dbConnection = $this->createMock(IDBConnection::class); $this->mountProvider = new MountProvider($this->dbConnection, function () { diff --git a/apps/files_sharing/tests/HooksTest.php b/apps/files_sharing/tests/HooksTest.php index 58a25594fe17..31d80dd1f060 100644 --- a/apps/files_sharing/tests/HooksTest.php +++ b/apps/files_sharing/tests/HooksTest.php @@ -85,7 +85,7 @@ class HooksTest extends TestCase { */ private $hooks; - public function setUp() { + public function setUp(): void { $this->eventDispatcher = new EventDispatcher(); $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->rootFolder = $this->createMock(IRootFolder::class); diff --git a/apps/files_sharing/tests/LockingTest.php b/apps/files_sharing/tests/LockingTest.php index a07c96c9ccf2..e5a556740e21 100644 --- a/apps/files_sharing/tests/LockingTest.php +++ b/apps/files_sharing/tests/LockingTest.php @@ -43,7 +43,7 @@ class LockingTest extends TestCase { private $ownerUid; private $recipientUid; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->ownerUid = $this->getUniqueID('owner_'); diff --git a/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php index 4c2d1000817a..2a08cc92f386 100644 --- a/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php +++ b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php @@ -45,7 +45,7 @@ class SharingCheckMiddlewareTest extends \Test\TestCase { /** @var IControllerMethodReflector */ private $reflector; - protected function setUp() { + protected function setUp(): void { $this->config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); $this->appManager = $this->getMockBuilder('\OCP\App\IAppManager') diff --git a/apps/files_sharing/tests/MigrationTest.php b/apps/files_sharing/tests/MigrationTest.php index b220d6435dfd..754bfe981a9a 100644 --- a/apps/files_sharing/tests/MigrationTest.php +++ b/apps/files_sharing/tests/MigrationTest.php @@ -42,7 +42,7 @@ class MigrationTest extends TestCase { private $table = 'share'; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -51,7 +51,7 @@ public function setUp() { $this->cleanDB(); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); $this->cleanDB(); } diff --git a/apps/files_sharing/tests/MountProviderTest.php b/apps/files_sharing/tests/MountProviderTest.php index ecafbcb27ccb..e436d0d29dad 100644 --- a/apps/files_sharing/tests/MountProviderTest.php +++ b/apps/files_sharing/tests/MountProviderTest.php @@ -58,7 +58,7 @@ class MountProviderTest extends TestCase { /** @var ILogger | \PHPUnit\Framework\MockObject\MockObject */ private $logger; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); diff --git a/apps/files_sharing/tests/NotifierTest.php b/apps/files_sharing/tests/NotifierTest.php index b39dd5bdc9a2..68a971b5ae8a 100644 --- a/apps/files_sharing/tests/NotifierTest.php +++ b/apps/files_sharing/tests/NotifierTest.php @@ -55,7 +55,7 @@ class NotifierTest extends \Test\TestCase { /** @var IConfig */ private $config; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->notificationManager = $this->getMockBuilder(INotificationManager::class) diff --git a/apps/files_sharing/tests/Panels/Admin/SettingsPanelTest.php b/apps/files_sharing/tests/Panels/Admin/SettingsPanelTest.php index 1df1fdc27d17..81c93ebd21cb 100644 --- a/apps/files_sharing/tests/Panels/Admin/SettingsPanelTest.php +++ b/apps/files_sharing/tests/Panels/Admin/SettingsPanelTest.php @@ -31,7 +31,7 @@ class SettingsPanelTest extends \Test\TestCase { /** @var SettingsPanel | \PHPUnit\Framework\MockObject\MockObject */ private $settingsPanel; - protected function setUp() { + protected function setUp(): void { $this->sharingBlacklist = $this->getMockBuilder(SharingBlacklist::class) ->disableOriginalConstructor() ->getMock(); diff --git a/apps/files_sharing/tests/Panels/Personal/PersonalPanelTest.php b/apps/files_sharing/tests/Panels/Personal/PersonalPanelTest.php index 01a510df39f5..b779a82d15ca 100644 --- a/apps/files_sharing/tests/Panels/Personal/PersonalPanelTest.php +++ b/apps/files_sharing/tests/Panels/Personal/PersonalPanelTest.php @@ -36,7 +36,7 @@ class PersonalPanelTest extends \Test\TestCase { /** @var PersonalPanel $personalPanel */ private $personalPanel; - protected function setUp() { + protected function setUp(): void { $this->config = $this->getMockBuilder(IConfig::class) ->disableOriginalConstructor() ->getMock(); diff --git a/apps/files_sharing/tests/Panels/Personal/SectionTest.php b/apps/files_sharing/tests/Panels/Personal/SectionTest.php index 7b5fe76d4e1a..5ec92ac7407b 100644 --- a/apps/files_sharing/tests/Panels/Personal/SectionTest.php +++ b/apps/files_sharing/tests/Panels/Personal/SectionTest.php @@ -31,7 +31,7 @@ class SectionTest extends \Test\TestCase { /** @var Section $section */ private $section; - protected function setUp() { + protected function setUp(): void { $this->l = $this->getMockBuilder(IL10N::class) ->disableOriginalConstructor() ->getMock(); diff --git a/apps/files_sharing/tests/PermissionsTest.php b/apps/files_sharing/tests/PermissionsTest.php index 6033133c6bbc..5e65522706e4 100644 --- a/apps/files_sharing/tests/PermissionsTest.php +++ b/apps/files_sharing/tests/PermissionsTest.php @@ -58,7 +58,7 @@ class PermissionsTest extends TestCase { /** @var Cache */ private $ownerCache; - protected function setUp() { + protected function setUp(): void { parent::setUp(); self::loginHelper(self::TEST_FILES_SHARING_API_USER1); @@ -109,7 +109,7 @@ protected function setUp() { $this->sharedCacheRestrictedShare = $this->sharedStorageRestrictedShare->getCache(); } - protected function tearDown() { + protected function tearDown(): void { if ($this->sharedCache) { $this->sharedCache->clear(); } diff --git a/apps/files_sharing/tests/PropagationTestCase.php b/apps/files_sharing/tests/PropagationTestCase.php index b6bf6f966096..6d16de929500 100644 --- a/apps/files_sharing/tests/PropagationTestCase.php +++ b/apps/files_sharing/tests/PropagationTestCase.php @@ -35,12 +35,12 @@ public static function setUpBeforeClass() { \OCA\Files_Sharing\Helper::registerHooks(); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->setUpShares(); } - protected function tearDown() { + protected function tearDown(): void { \OC_Hook::clear('OC_Filesystem', 'post_write'); \OC_Hook::clear('OC_Filesystem', 'post_delete'); \OC_Hook::clear('OC_Filesystem', 'post_rename'); diff --git a/apps/files_sharing/tests/Service/NotificationPublisherTest.php b/apps/files_sharing/tests/Service/NotificationPublisherTest.php index 7a251efdaada..9f964f3fb891 100644 --- a/apps/files_sharing/tests/Service/NotificationPublisherTest.php +++ b/apps/files_sharing/tests/Service/NotificationPublisherTest.php @@ -51,7 +51,7 @@ class NotificationPublisherTest extends TestCase { /** @var NotificationPublisher */ private $publisher; - protected function setUp() { + protected function setUp(): void { $this->groupManager = $this->createMock('OCP\IGroupManager'); $this->userManager = $this->createMock('OCP\IUserManager'); $this->notificationManager = $this->createMock(\OCP\Notification\IManager::class); @@ -79,7 +79,7 @@ protected function setUp() { ->will($this->returnArgument(0)); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); } diff --git a/apps/files_sharing/tests/ShareTest.php b/apps/files_sharing/tests/ShareTest.php index f9da0506416e..144e9ae9da2c 100644 --- a/apps/files_sharing/tests/ShareTest.php +++ b/apps/files_sharing/tests/ShareTest.php @@ -36,7 +36,7 @@ class ShareTest extends TestCase { private static $tempStorage; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->folder = self::TEST_FOLDER_NAME; @@ -54,7 +54,7 @@ protected function setUp() { $this->view->file_put_contents($this->folder . $this->subfolder . $this->filename, $this->data); } - protected function tearDown() { + protected function tearDown(): void { self::loginHelper(self::TEST_FILES_SHARING_API_USER1); $this->view->unlink($this->filename); $this->view->deleteAll($this->folder); diff --git a/apps/files_sharing/tests/SharedMountTest.php b/apps/files_sharing/tests/SharedMountTest.php index 3af41e36dbd6..5e820a73186c 100644 --- a/apps/files_sharing/tests/SharedMountTest.php +++ b/apps/files_sharing/tests/SharedMountTest.php @@ -35,7 +35,7 @@ * @group DB */ class SharedMountTest extends TestCase { - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->folder = '/folder_share_storage_test'; @@ -49,7 +49,7 @@ protected function setUp() { $this->view->file_put_contents($this->folder . $this->filename, "file in subfolder"); } - protected function tearDown() { + protected function tearDown(): void { if ($this->view) { if ($this->view->file_exists($this->folder)) { $this->view->unlink($this->folder); diff --git a/apps/files_sharing/tests/SharedStorageTest.php b/apps/files_sharing/tests/SharedStorageTest.php index 4f4e601f2c16..8721930cdae0 100644 --- a/apps/files_sharing/tests/SharedStorageTest.php +++ b/apps/files_sharing/tests/SharedStorageTest.php @@ -39,7 +39,7 @@ * @group DB */ class SharedStorageTest extends TestCase { - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OCA\Files_Trashbin\Trashbin::registerHooks(); $this->folder = '/folder_share_storage_test'; @@ -53,7 +53,7 @@ protected function setUp() { $this->view->file_put_contents($this->folder . $this->filename, "file in subfolder"); } - protected function tearDown() { + protected function tearDown(): void { if ($this->view) { if ($this->view->file_exists($this->folder)) { $this->view->unlink($this->folder); diff --git a/apps/files_sharing/tests/SharingBlacklistTest.php b/apps/files_sharing/tests/SharingBlacklistTest.php index 40bb2810fc68..4c0a6d327102 100644 --- a/apps/files_sharing/tests/SharingBlacklistTest.php +++ b/apps/files_sharing/tests/SharingBlacklistTest.php @@ -32,7 +32,7 @@ class SharingBlacklistTest extends \Test\TestCase { /** @var SharingBlacklist | \PHPUnit\Framework\MockObject\MockObject */ private $sharingBlacklist; - public function setUp() { + public function setUp(): void { $this->config = $this->getMockBuilder(IConfig::class) ->disableOriginalConstructor() ->getMock(); diff --git a/apps/files_sharing/tests/TestCase.php b/apps/files_sharing/tests/TestCase.php index f21a64b2cfa5..d32da3119fe8 100644 --- a/apps/files_sharing/tests/TestCase.php +++ b/apps/files_sharing/tests/TestCase.php @@ -84,7 +84,7 @@ public static function setUpBeforeClass() { \OC::registerShareHooks(); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); // create users @@ -119,14 +119,14 @@ protected function setUp() { $this->rootFolder = \OC::$server->getRootFolder(); } - protected function tearDown() { + protected function tearDown(): void { $query = \OCP\DB::prepare('DELETE FROM `*PREFIX*share`'); $query->execute(); parent::tearDown(); } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { // delete group $group = \OC::$server->getGroupManager()->get(self::TEST_FILES_SHARING_API_GROUP1); if ($group !== null) { diff --git a/apps/files_sharing/tests/UnshareChildrenTest.php b/apps/files_sharing/tests/UnshareChildrenTest.php index 4bb6cfef94c0..afe6779a1dcf 100644 --- a/apps/files_sharing/tests/UnshareChildrenTest.php +++ b/apps/files_sharing/tests/UnshareChildrenTest.php @@ -40,7 +40,7 @@ class UnshareChildrenTest extends TestCase { private static $tempStorage; - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OCP\Util::connectHook('OC_Filesystem', 'post_delete', '\OCA\Files_Sharing\Hooks', 'unshareChildren'); @@ -59,7 +59,7 @@ protected function setUp() { $this->view->file_put_contents($this->folder . $this->subfolder . $this->filename, $this->data); } - protected function tearDown() { + protected function tearDown(): void { if ($this->view) { $this->view->deleteAll($this->folder); } diff --git a/apps/files_sharing/tests/UpdaterTest.php b/apps/files_sharing/tests/UpdaterTest.php index 12eb8af0369c..fcade7cb87f0 100644 --- a/apps/files_sharing/tests/UpdaterTest.php +++ b/apps/files_sharing/tests/UpdaterTest.php @@ -42,7 +42,7 @@ public static function setUpBeforeClass() { \OCA\Files_Sharing\Helper::registerHooks(); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->folder = self::TEST_FOLDER_NAME; @@ -55,7 +55,7 @@ protected function setUp() { $this->view->file_put_contents($this->folder . '/' . $this->filename, $this->data); } - protected function tearDown() { + protected function tearDown(): void { if ($this->view) { $this->view->unlink($this->filename); $this->view->deleteAll($this->folder); diff --git a/apps/files_sharing/tests/WatcherTest.php b/apps/files_sharing/tests/WatcherTest.php index e700cabf04e0..6e745d529db4 100644 --- a/apps/files_sharing/tests/WatcherTest.php +++ b/apps/files_sharing/tests/WatcherTest.php @@ -50,7 +50,7 @@ class WatcherTest extends TestCase { /** @var \OCP\Share\IShare */ private $_share; - protected function setUp() { + protected function setUp(): void { parent::setUp(); self::loginHelper(self::TEST_FILES_SHARING_API_USER1); @@ -82,7 +82,7 @@ protected function setUp() { $this->sharedCache = $this->sharedStorage->getCache(); } - protected function tearDown() { + protected function tearDown(): void { if ($this->sharedCache) { $this->sharedCache->clear(); } diff --git a/apps/files_trashbin/tests/Command/CleanUpTest.php b/apps/files_trashbin/tests/Command/CleanUpTest.php index bd91ab36e9a9..f3b8a0893c2d 100644 --- a/apps/files_trashbin/tests/Command/CleanUpTest.php +++ b/apps/files_trashbin/tests/Command/CleanUpTest.php @@ -55,7 +55,7 @@ class CleanUpTest extends TestCase { /** @var string */ protected $user0 = 'user0'; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder') ->disableOriginalConstructor()->getMock(); diff --git a/apps/files_trashbin/tests/Command/ExpireTrashTest.php b/apps/files_trashbin/tests/Command/ExpireTrashTest.php index b6f781248823..9cd872e766d8 100644 --- a/apps/files_trashbin/tests/Command/ExpireTrashTest.php +++ b/apps/files_trashbin/tests/Command/ExpireTrashTest.php @@ -43,7 +43,7 @@ class ExpireTrashTest extends TestCase { private $expiration; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->userManager = $this->createMock(IUserManager::class); diff --git a/apps/files_trashbin/tests/QuotaTest.php b/apps/files_trashbin/tests/QuotaTest.php index 29a225fabfd5..571e313d581a 100644 --- a/apps/files_trashbin/tests/QuotaTest.php +++ b/apps/files_trashbin/tests/QuotaTest.php @@ -31,7 +31,7 @@ class QuotaTest extends \Test\TestCase { /** @var IConfig | \PHPUnit\Framework\MockObject\MockObject */ protected $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userManager = $this->getMockBuilder(IUserManager::class) diff --git a/apps/files_trashbin/tests/StorageTest.php b/apps/files_trashbin/tests/StorageTest.php index ae38a8b24528..0fceb8eeb4ee 100644 --- a/apps/files_trashbin/tests/StorageTest.php +++ b/apps/files_trashbin/tests/StorageTest.php @@ -61,7 +61,7 @@ class StorageTest extends TestCase { */ private $userView; - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OC_Hook::clear(); @@ -87,7 +87,7 @@ protected function setUp() { $this->userView->file_put_contents('folder/inside.txt', 'bar'); } - protected function tearDown() { + protected function tearDown(): void { \OC\Files\Filesystem::getLoader()->removeStorageWrapper('oc_trashbin'); $this->logout(); \OC_Hook::clear(); diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php index 0455b7ea98ab..cd55f758417b 100644 --- a/apps/files_trashbin/tests/TrashbinTest.php +++ b/apps/files_trashbin/tests/TrashbinTest.php @@ -97,7 +97,7 @@ public static function setUpBeforeClass() { self::loginHelper(self::TEST_TRASHBIN_USER1, true); } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { // cleanup test user $user = \OC::$server->getUserManager()->get(self::TEST_TRASHBIN_USER1); if ($user !== null) { @@ -121,7 +121,7 @@ public static function tearDownAfterClass() { parent::tearDownAfterClass(); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OC::$server->getAppManager()->enableApp('files_trashbin'); @@ -144,7 +144,7 @@ protected function setUp() { self::loginHelper(self::TEST_TRASHBIN_USER1); } - protected function tearDown() { + protected function tearDown(): void { $this->restoreService('AllConfig'); // disable trashbin to be able to properly clean up \OC::$server->getAppManager()->disableApp('files_trashbin'); diff --git a/apps/files_versions/tests/Command/CleanupTest.php b/apps/files_versions/tests/Command/CleanupTest.php index 9e75ef17a0d0..0f3861b25b1f 100644 --- a/apps/files_versions/tests/Command/CleanupTest.php +++ b/apps/files_versions/tests/Command/CleanupTest.php @@ -45,7 +45,7 @@ class CleanupTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject | IRootFolder */ protected $rootFolder; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder') diff --git a/apps/files_versions/tests/Command/ExpireVersionsTest.php b/apps/files_versions/tests/Command/ExpireVersionsTest.php index e9e3634b77a3..54a52e33f07b 100644 --- a/apps/files_versions/tests/Command/ExpireVersionsTest.php +++ b/apps/files_versions/tests/Command/ExpireVersionsTest.php @@ -43,7 +43,7 @@ class ExpireVersionsTest extends TestCase { private $expiration; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->userManager = $this->createMock(IUserManager::class); diff --git a/apps/files_versions/tests/VersioningTest.php b/apps/files_versions/tests/VersioningTest.php index 86fadba00873..5810f4b218fc 100644 --- a/apps/files_versions/tests/VersioningTest.php +++ b/apps/files_versions/tests/VersioningTest.php @@ -67,7 +67,7 @@ public static function setUpBeforeClass() { $application->registerMountProviders(); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = \OC::$server->getConfig(); @@ -107,7 +107,7 @@ protected function setUp() { } } - protected function tearDown() { + protected function tearDown(): void { $this->restoreService('AllConfig'); if ($this->rootView) { diff --git a/apps/provisioning_api/tests/AppsTest.php b/apps/provisioning_api/tests/AppsTest.php index 00eda3f95c65..1a01a7303cc0 100644 --- a/apps/provisioning_api/tests/AppsTest.php +++ b/apps/provisioning_api/tests/AppsTest.php @@ -45,7 +45,7 @@ class AppsTest extends TestCase { /** @var IUserSession */ private $userSession; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->appManager = \OC::$server->getAppManager(); diff --git a/apps/provisioning_api/tests/GroupsTest.php b/apps/provisioning_api/tests/GroupsTest.php index 4d9bfeea2008..b007f5052899 100644 --- a/apps/provisioning_api/tests/GroupsTest.php +++ b/apps/provisioning_api/tests/GroupsTest.php @@ -45,7 +45,7 @@ class GroupsTest extends \Test\TestCase { /** @var Groups */ protected $api; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->subAdminManager = $this->getMockBuilder('OC\SubAdmin') diff --git a/apps/provisioning_api/tests/TestCase.php b/apps/provisioning_api/tests/TestCase.php index 4a60bde4aef1..4d1ade402b1a 100644 --- a/apps/provisioning_api/tests/TestCase.php +++ b/apps/provisioning_api/tests/TestCase.php @@ -39,7 +39,7 @@ abstract class TestCase extends \Test\TestCase { /** @var IGroupManager */ protected $groupManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userManager = \OC::$server->getUserManager(); @@ -62,7 +62,7 @@ protected function generateUsers($num = 1) { return \count($users) == 1 ? \reset($users) : $users; } - protected function tearDown() { + protected function tearDown(): void { foreach ($this->users as $user) { $user->delete(); } diff --git a/apps/provisioning_api/tests/UsersTest.php b/apps/provisioning_api/tests/UsersTest.php index 0c1b7503faf3..d4eb95e4da5d 100644 --- a/apps/provisioning_api/tests/UsersTest.php +++ b/apps/provisioning_api/tests/UsersTest.php @@ -57,13 +57,13 @@ class UsersTest extends OriginalTest { /** @var \OC\Authentication\TwoFactorAuth\Manager | PHPUnit\Framework\MockObject\MockObject */ private $twoFactorAuthManager; - protected function tearDown() { + protected function tearDown(): void { $_GET = null; $_POST = null; parent::tearDown(); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userManager = $this->createMock(IUserManager::class); diff --git a/apps/systemtags/tests/unit/activity/ExtensionTest.php b/apps/systemtags/tests/unit/activity/ExtensionTest.php index 62b1d30fd663..e9f2dceb3467 100644 --- a/apps/systemtags/tests/unit/activity/ExtensionTest.php +++ b/apps/systemtags/tests/unit/activity/ExtensionTest.php @@ -42,7 +42,7 @@ class ExtensionTest extends TestCase { /** @var Extension */ private $extension; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->languageFactory = $this->createMock(IFactory::class); diff --git a/apps/systemtags/tests/unit/activity/ListenerTest.php b/apps/systemtags/tests/unit/activity/ListenerTest.php index 1ecc2df62897..c6fe0901927b 100644 --- a/apps/systemtags/tests/unit/activity/ListenerTest.php +++ b/apps/systemtags/tests/unit/activity/ListenerTest.php @@ -83,7 +83,7 @@ class ActivityListenerTest extends \Test\TestCase { */ private $activityManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->groupManager = $this->createMock(IGroupManager::class); diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php index 7272044ae392..6b968f77453b 100644 --- a/apps/updatenotification/tests/Controller/AdminControllerTest.php +++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php @@ -58,7 +58,7 @@ class AdminControllerTest extends TestCase { /** @var IDateTimeFormatter */ private $dateTimeFormatter; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->createMock('\\OCP\\IRequest'); diff --git a/apps/updatenotification/tests/Notification/BackgroundJobTest.php b/apps/updatenotification/tests/Notification/BackgroundJobTest.php index f96df597a20d..8e5676f8ecd9 100644 --- a/apps/updatenotification/tests/Notification/BackgroundJobTest.php +++ b/apps/updatenotification/tests/Notification/BackgroundJobTest.php @@ -47,7 +47,7 @@ class BackgroundJobTest extends TestCase { /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */ protected $urlGenerator; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock('OCP\IConfig'); diff --git a/apps/updatenotification/tests/Notification/NotifierTest.php b/apps/updatenotification/tests/Notification/NotifierTest.php index 15332a0f3755..288dfd19cbe1 100644 --- a/apps/updatenotification/tests/Notification/NotifierTest.php +++ b/apps/updatenotification/tests/Notification/NotifierTest.php @@ -34,7 +34,7 @@ class NotifierTest extends TestCase { /** @var IFactory|\PHPUnit\Framework\MockObject\MockObject */ protected $l10nFactory; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->notificationManager = $this->createMock('OCP\Notification\IManager'); diff --git a/apps/updatenotification/tests/ResetTokenBackgroundJobTest.php b/apps/updatenotification/tests/ResetTokenBackgroundJobTest.php index a3059047b193..efe81a653b25 100644 --- a/apps/updatenotification/tests/ResetTokenBackgroundJobTest.php +++ b/apps/updatenotification/tests/ResetTokenBackgroundJobTest.php @@ -35,7 +35,7 @@ class ResetTokenBackgroundJobTest extends TestCase { /** @var ITimeFactory */ private $timeFactory; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock('\\OCP\\IConfig'); $this->timeFactory = $this->createMock('\\OCP\\AppFramework\\Utility\\ITimeFactory'); diff --git a/apps/updatenotification/tests/UpdateCheckerTest.php b/apps/updatenotification/tests/UpdateCheckerTest.php index d80160c3b0c8..1c8eb68ea003 100644 --- a/apps/updatenotification/tests/UpdateCheckerTest.php +++ b/apps/updatenotification/tests/UpdateCheckerTest.php @@ -32,7 +32,7 @@ class UpdateCheckerTest extends TestCase { /** @var UpdateChecker */ private $updateChecker; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->updater = $this->getMockBuilder('\OC\Updater\VersionCheck') diff --git a/tests/Core/Command/Apps/AppsDisableTest.php b/tests/Core/Command/Apps/AppsDisableTest.php index 16bcebe0747a..11b19037e7e3 100644 --- a/tests/Core/Command/Apps/AppsDisableTest.php +++ b/tests/Core/Command/Apps/AppsDisableTest.php @@ -35,7 +35,7 @@ class AppsDisableTest extends TestCase { /** @var CommandTester */ private $commandTester; - public function setUp() { + public function setUp(): void { parent::setUp(); $command = new Disable(\OC::$server->getAppManager()); diff --git a/tests/Core/Command/Apps/AppsEnableTest.php b/tests/Core/Command/Apps/AppsEnableTest.php index ccd56737d247..446e88a15a7a 100644 --- a/tests/Core/Command/Apps/AppsEnableTest.php +++ b/tests/Core/Command/Apps/AppsEnableTest.php @@ -35,7 +35,7 @@ class AppsEnableTest extends TestCase { /** @var CommandTester */ private $commandTester; - public function setUp() { + public function setUp(): void { parent::setUp(); $command = new Enable(\OC::$server->getAppManager()); diff --git a/tests/Core/Command/Apps/AppsGetPathTest.php b/tests/Core/Command/Apps/AppsGetPathTest.php index fe2020afe412..852337e3f38c 100644 --- a/tests/Core/Command/Apps/AppsGetPathTest.php +++ b/tests/Core/Command/Apps/AppsGetPathTest.php @@ -35,7 +35,7 @@ class AppsGetPathTest extends TestCase { /** @var CommandTester */ private $commandTester; - public function setUp() { + public function setUp(): void { parent::setUp(); $command = new GetPath(); diff --git a/tests/Core/Command/Apps/AppsListTest.php b/tests/Core/Command/Apps/AppsListTest.php index 209437b9486f..0ecbc8a2e3e1 100644 --- a/tests/Core/Command/Apps/AppsListTest.php +++ b/tests/Core/Command/Apps/AppsListTest.php @@ -35,7 +35,7 @@ class AppsListTest extends TestCase { /** @var CommandTester */ private $commandTester; - public function setUp() { + public function setUp(): void { parent::setUp(); $command = new ListApps(\OC::$server->getAppManager()); diff --git a/tests/Core/Command/Background/Queue/DeleteTest.php b/tests/Core/Command/Background/Queue/DeleteTest.php index fabd3a3b38a4..895e36edd638 100644 --- a/tests/Core/Command/Background/Queue/DeleteTest.php +++ b/tests/Core/Command/Background/Queue/DeleteTest.php @@ -38,7 +38,7 @@ class DeleteTest extends TestCase { /** @var IJobList */ private $jobList; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->jobList = $this->createMock(IJobList::class); diff --git a/tests/Core/Command/Background/Queue/ExecuteTest.php b/tests/Core/Command/Background/Queue/ExecuteTest.php index cafd2c7777b4..3981de03ee1c 100644 --- a/tests/Core/Command/Background/Queue/ExecuteTest.php +++ b/tests/Core/Command/Background/Queue/ExecuteTest.php @@ -45,7 +45,7 @@ class ExecuteTest extends TestCase { /** @var IJob[] */ private $jobById = []; - public function setUp() { + public function setUp(): void { parent::setUp(); $normalJob = $this->createMock(IJob::class); diff --git a/tests/Core/Command/Background/Queue/StatusTest.php b/tests/Core/Command/Background/Queue/StatusTest.php index 61a2c5dad5bf..e86af81e21bb 100644 --- a/tests/Core/Command/Background/Queue/StatusTest.php +++ b/tests/Core/Command/Background/Queue/StatusTest.php @@ -40,7 +40,7 @@ class StatusTest extends TestCase { /** @var IJobList */ private $jobList; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->jobList = $this->createMock(IJobList::class); diff --git a/tests/Core/Command/Config/App/DeleteConfigTest.php b/tests/Core/Command/Config/App/DeleteConfigTest.php index c1e59d45302c..9986e9989e37 100644 --- a/tests/Core/Command/Config/App/DeleteConfigTest.php +++ b/tests/Core/Command/Config/App/DeleteConfigTest.php @@ -36,7 +36,7 @@ class DeleteConfigTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->config = $this->getMockBuilder('OCP\IConfig') diff --git a/tests/Core/Command/Config/App/GetConfigTest.php b/tests/Core/Command/Config/App/GetConfigTest.php index f0b31fa7c6ad..a46fd1966f70 100644 --- a/tests/Core/Command/Config/App/GetConfigTest.php +++ b/tests/Core/Command/Config/App/GetConfigTest.php @@ -38,7 +38,7 @@ class GetConfigTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->config = $this->getMockBuilder(IConfig::class) diff --git a/tests/Core/Command/Config/App/SetConfigTest.php b/tests/Core/Command/Config/App/SetConfigTest.php index a84edf1f3df4..b2ee0694293a 100644 --- a/tests/Core/Command/Config/App/SetConfigTest.php +++ b/tests/Core/Command/Config/App/SetConfigTest.php @@ -36,7 +36,7 @@ class SetConfigTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->config = $this->getMockBuilder('OCP\IConfig') diff --git a/tests/Core/Command/Config/ImportTest.php b/tests/Core/Command/Config/ImportTest.php index b5cbbada0ba2..eaf1f8dc88c7 100644 --- a/tests/Core/Command/Config/ImportTest.php +++ b/tests/Core/Command/Config/ImportTest.php @@ -36,7 +36,7 @@ class ImportTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->config = $this->getMockBuilder('OCP\IConfig') diff --git a/tests/Core/Command/Config/ListConfigsTest.php b/tests/Core/Command/Config/ListConfigsTest.php index 954675875c58..f68abd9f2248 100644 --- a/tests/Core/Command/Config/ListConfigsTest.php +++ b/tests/Core/Command/Config/ListConfigsTest.php @@ -39,7 +39,7 @@ class ListConfigsTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') diff --git a/tests/Core/Command/Config/System/DeleteConfigTest.php b/tests/Core/Command/Config/System/DeleteConfigTest.php index eebbf139c5e3..6d159ef45c4a 100644 --- a/tests/Core/Command/Config/System/DeleteConfigTest.php +++ b/tests/Core/Command/Config/System/DeleteConfigTest.php @@ -36,7 +36,7 @@ class DeleteConfigTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') diff --git a/tests/Core/Command/Config/System/GetConfigTest.php b/tests/Core/Command/Config/System/GetConfigTest.php index 191de04d7705..514479ee5f13 100644 --- a/tests/Core/Command/Config/System/GetConfigTest.php +++ b/tests/Core/Command/Config/System/GetConfigTest.php @@ -37,7 +37,7 @@ class GetConfigTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $systemConfig = $this->systemConfig = $this->getMockBuilder(SystemConfig::class) diff --git a/tests/Core/Command/Config/System/SetConfigTest.php b/tests/Core/Command/Config/System/SetConfigTest.php index b87dfb313f2e..7a8f24ca899c 100644 --- a/tests/Core/Command/Config/System/SetConfigTest.php +++ b/tests/Core/Command/Config/System/SetConfigTest.php @@ -36,7 +36,7 @@ class SetConfigTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $systemConfig = $this->systemConfig = $this->getMockBuilder('OC\SystemConfig') diff --git a/tests/Core/Command/Db/ConvertTypeTest.php b/tests/Core/Command/Db/ConvertTypeTest.php index 6dbae8931793..8a22e09b8933 100644 --- a/tests/Core/Command/Db/ConvertTypeTest.php +++ b/tests/Core/Command/Db/ConvertTypeTest.php @@ -50,7 +50,7 @@ class ConvertTypeTest extends TestCase { /** @var \Doctrine\DBAL\Connection */ private $connection; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); $this->config = $this->getMockBuilder(IConfig::class) diff --git a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php index 225cdb801706..98a70980a828 100644 --- a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php +++ b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php @@ -60,7 +60,7 @@ class ChangeKeyStorageRootTest extends TestCase { /** @var \OCP\UserInterface | \PHPUnit\Framework\MockObject\MockObject */ protected $userInterface; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->view = $this->createMock('\OC\Files\View'); diff --git a/tests/Core/Command/Encryption/DecryptAllTest.php b/tests/Core/Command/Encryption/DecryptAllTest.php index 09e8de1c9173..97f0e89ed8bf 100644 --- a/tests/Core/Command/Encryption/DecryptAllTest.php +++ b/tests/Core/Command/Encryption/DecryptAllTest.php @@ -47,7 +47,7 @@ class DecryptAllTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject | \OC\Encryption\DecryptAll */ protected $decryptAll; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder('OCP\IConfig') diff --git a/tests/Core/Command/Encryption/DisableTest.php b/tests/Core/Command/Encryption/DisableTest.php index fd5bbfb7e4c6..74a42767c6d0 100644 --- a/tests/Core/Command/Encryption/DisableTest.php +++ b/tests/Core/Command/Encryption/DisableTest.php @@ -35,7 +35,7 @@ class DisableTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->config = $this->getMockBuilder('OCP\IConfig') diff --git a/tests/Core/Command/Encryption/EnableTest.php b/tests/Core/Command/Encryption/EnableTest.php index 607f51bf33ce..b8a548515d51 100644 --- a/tests/Core/Command/Encryption/EnableTest.php +++ b/tests/Core/Command/Encryption/EnableTest.php @@ -37,7 +37,7 @@ class EnableTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->config = $this->getMockBuilder('OCP\IConfig') diff --git a/tests/Core/Command/Encryption/EncryptAllTest.php b/tests/Core/Command/Encryption/EncryptAllTest.php index 5a58c390127a..b984027e003e 100644 --- a/tests/Core/Command/Encryption/EncryptAllTest.php +++ b/tests/Core/Command/Encryption/EncryptAllTest.php @@ -50,7 +50,7 @@ class EncryptAllTest extends TestCase { /** @var EncryptAll */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder('OCP\IConfig') diff --git a/tests/Core/Command/Encryption/SetDefaultModuleTest.php b/tests/Core/Command/Encryption/SetDefaultModuleTest.php index f1cebf495d75..68cb47f6b449 100644 --- a/tests/Core/Command/Encryption/SetDefaultModuleTest.php +++ b/tests/Core/Command/Encryption/SetDefaultModuleTest.php @@ -35,7 +35,7 @@ class SetDefaultModuleTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $manager = $this->manager = $this->getMockBuilder('OCP\Encryption\IManager') diff --git a/tests/Core/Command/Group/AddMemberTest.php b/tests/Core/Command/Group/AddMemberTest.php index e3b92494e504..68c54133413f 100644 --- a/tests/Core/Command/Group/AddMemberTest.php +++ b/tests/Core/Command/Group/AddMemberTest.php @@ -37,7 +37,7 @@ class AddMemberTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $command = new AddMember(\OC::$server->getGroupManager(), \OC::$server->getUserManager()); diff --git a/tests/Core/Command/Group/AddTest.php b/tests/Core/Command/Group/AddTest.php index ee2c18d33f2e..5ff614ad26bc 100644 --- a/tests/Core/Command/Group/AddTest.php +++ b/tests/Core/Command/Group/AddTest.php @@ -34,7 +34,7 @@ class AddTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $command = new Add(\OC::$server->getGroupManager()); diff --git a/tests/Core/Command/Group/DeleteTest.php b/tests/Core/Command/Group/DeleteTest.php index 021642420e7c..e22cfc0455b9 100644 --- a/tests/Core/Command/Group/DeleteTest.php +++ b/tests/Core/Command/Group/DeleteTest.php @@ -35,7 +35,7 @@ class DeleteTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $groupManager = $this->groupManager = $this->getMockBuilder('OCP\IGroupManager') diff --git a/tests/Core/Command/Group/ListGroupMembersTest.php b/tests/Core/Command/Group/ListGroupMembersTest.php index 8e9ac9a46067..aced8bc01a18 100644 --- a/tests/Core/Command/Group/ListGroupMembersTest.php +++ b/tests/Core/Command/Group/ListGroupMembersTest.php @@ -37,7 +37,7 @@ class ListGroupMembersTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $command = new ListGroupMembers(\OC::$server->getGroupManager()); diff --git a/tests/Core/Command/Group/ListGroupsTest.php b/tests/Core/Command/Group/ListGroupsTest.php index 6c9c75a510b4..f888bc466b26 100644 --- a/tests/Core/Command/Group/ListGroupsTest.php +++ b/tests/Core/Command/Group/ListGroupsTest.php @@ -34,7 +34,7 @@ class ListGroupsTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $command = new ListGroups(\OC::$server->getGroupManager()); diff --git a/tests/Core/Command/Group/RemoveMemberTest.php b/tests/Core/Command/Group/RemoveMemberTest.php index 57a519f5700c..882b2d0d3be3 100644 --- a/tests/Core/Command/Group/RemoveMemberTest.php +++ b/tests/Core/Command/Group/RemoveMemberTest.php @@ -37,7 +37,7 @@ class RemoveMemberTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $command = new RemoveMember(\OC::$server->getGroupManager(), \OC::$server->getUserManager()); diff --git a/tests/Core/Command/Log/ManageTest.php b/tests/Core/Command/Log/ManageTest.php index 5259a57eac58..bed6a5e47d11 100644 --- a/tests/Core/Command/Log/ManageTest.php +++ b/tests/Core/Command/Log/ManageTest.php @@ -35,7 +35,7 @@ class ManageTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->config = $this->getMockBuilder('OCP\IConfig') diff --git a/tests/Core/Command/Log/OwnCloudTest.php b/tests/Core/Command/Log/OwnCloudTest.php index 5c5ae8b56aac..11713ff51c38 100644 --- a/tests/Core/Command/Log/OwnCloudTest.php +++ b/tests/Core/Command/Log/OwnCloudTest.php @@ -35,7 +35,7 @@ class OwnCloudTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->config = $this->getMockBuilder('OCP\IConfig') diff --git a/tests/Core/Command/Maintenance/DataFingerprintTest.php b/tests/Core/Command/Maintenance/DataFingerprintTest.php index 29777cb9e1c1..dda2cd2af933 100644 --- a/tests/Core/Command/Maintenance/DataFingerprintTest.php +++ b/tests/Core/Command/Maintenance/DataFingerprintTest.php @@ -49,7 +49,7 @@ public function providesAnswers() { ]; } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); diff --git a/tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php b/tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php index bcb527eaf540..621e2624f8ac 100644 --- a/tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php +++ b/tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php @@ -40,7 +40,7 @@ class UpdateDBTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->detector = $this->getMockBuilder('OC\Files\Type\Detection') diff --git a/tests/Core/Command/Maintenance/RepairTest.php b/tests/Core/Command/Maintenance/RepairTest.php index 37b318f61eb8..607c15d7953e 100644 --- a/tests/Core/Command/Maintenance/RepairTest.php +++ b/tests/Core/Command/Maintenance/RepairTest.php @@ -36,7 +36,7 @@ class RepairTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $application = new Application( @@ -54,7 +54,7 @@ protected function setUp() { $this->commandTester = new CommandTester($command); } - protected function tearDown() { + protected function tearDown(): void { parent::tearDown(); \OC::$server->getConfig()->setSystemValue('maintenance', false); } diff --git a/tests/Core/Command/Maintenance/SingleUserTest.php b/tests/Core/Command/Maintenance/SingleUserTest.php index fb8efaf0a579..194fa44eedfc 100644 --- a/tests/Core/Command/Maintenance/SingleUserTest.php +++ b/tests/Core/Command/Maintenance/SingleUserTest.php @@ -35,7 +35,7 @@ class SingleUserTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->config = $this->getMockBuilder('OCP\IConfig') diff --git a/tests/Core/Command/System/CronTest.php b/tests/Core/Command/System/CronTest.php index 0823086e9e39..5cdb9b32938a 100644 --- a/tests/Core/Command/System/CronTest.php +++ b/tests/Core/Command/System/CronTest.php @@ -51,7 +51,7 @@ class CronTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); diff --git a/tests/Core/Command/TwoFactorAuth/DisableTest.php b/tests/Core/Command/TwoFactorAuth/DisableTest.php index 75ed6a13a20d..a1b4fc87d815 100644 --- a/tests/Core/Command/TwoFactorAuth/DisableTest.php +++ b/tests/Core/Command/TwoFactorAuth/DisableTest.php @@ -37,7 +37,7 @@ class DisableTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $command = new Disable(\OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()); diff --git a/tests/Core/Command/TwoFactorAuth/EnableTest.php b/tests/Core/Command/TwoFactorAuth/EnableTest.php index 041e8af8ee08..c0ae7bdd6f16 100644 --- a/tests/Core/Command/TwoFactorAuth/EnableTest.php +++ b/tests/Core/Command/TwoFactorAuth/EnableTest.php @@ -37,7 +37,7 @@ class EnableTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $command = new Enable(\OC::$server->getTwoFactorAuthManager(), \OC::$server->getUserManager()); diff --git a/tests/Core/Command/User/AddTest.php b/tests/Core/Command/User/AddTest.php index 5f09ee5339b5..0ae99e3cec1b 100644 --- a/tests/Core/Command/User/AddTest.php +++ b/tests/Core/Command/User/AddTest.php @@ -39,7 +39,7 @@ class AddTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $application = new Application(\OC::$server->getConfig(), \OC::$server->getEventDispatcher(), \OC::$server->getRequest()); @@ -49,7 +49,7 @@ protected function setUp() { $this->createUser('user1'); } - protected function tearDown() { + protected function tearDown(): void { parent::tearDown(); if (\OC::$server->getUserManager()->get('user2') instanceof User) { \OC::$server->getUserManager()->get('user2')->delete(); diff --git a/tests/Core/Command/User/DeleteTest.php b/tests/Core/Command/User/DeleteTest.php index ba2a27c67be1..b958c870ecd6 100644 --- a/tests/Core/Command/User/DeleteTest.php +++ b/tests/Core/Command/User/DeleteTest.php @@ -36,7 +36,7 @@ class DeleteTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userManager = $this->getMockBuilder('OCP\IUserManager') ->disableOriginalConstructor() diff --git a/tests/Core/Command/User/DisableTest.php b/tests/Core/Command/User/DisableTest.php index 9305f3577324..acf9b229b9a9 100644 --- a/tests/Core/Command/User/DisableTest.php +++ b/tests/Core/Command/User/DisableTest.php @@ -37,7 +37,7 @@ class DisableTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $command = new Disable(\OC::$server->getUserManager()); diff --git a/tests/Core/Command/User/EnableTest.php b/tests/Core/Command/User/EnableTest.php index 5adca7c6e786..23ab982b05f9 100644 --- a/tests/Core/Command/User/EnableTest.php +++ b/tests/Core/Command/User/EnableTest.php @@ -37,7 +37,7 @@ class EnableTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $command = new Enable(\OC::$server->getUserManager()); diff --git a/tests/Core/Command/User/InactiveTest.php b/tests/Core/Command/User/InactiveTest.php index 69854e023022..7d4bfcda58ab 100644 --- a/tests/Core/Command/User/InactiveTest.php +++ b/tests/Core/Command/User/InactiveTest.php @@ -39,7 +39,7 @@ class InactiveTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $userManager = $this->userManager = $this->getMockBuilder('OCP\IUserManager') diff --git a/tests/Core/Command/User/LastSeenTest.php b/tests/Core/Command/User/LastSeenTest.php index 02d6a7b6127a..af147435423d 100644 --- a/tests/Core/Command/User/LastSeenTest.php +++ b/tests/Core/Command/User/LastSeenTest.php @@ -35,7 +35,7 @@ class LastSeenTest extends TestCase { /** @var \Symfony\Component\Console\Command\Command */ protected $command; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $userManager = $this->userManager = $this->getMockBuilder('OCP\IUserManager') diff --git a/tests/Core/Command/User/ListUserGroupsTest.php b/tests/Core/Command/User/ListUserGroupsTest.php index f202c8652876..1c98ce453261 100644 --- a/tests/Core/Command/User/ListUserGroupsTest.php +++ b/tests/Core/Command/User/ListUserGroupsTest.php @@ -37,7 +37,7 @@ class ListUserGroupsTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $command = new ListUserGroups(\OC::$server->getUserManager(), \OC::$server->getGroupManager()); diff --git a/tests/Core/Command/User/ListUsersTest.php b/tests/Core/Command/User/ListUsersTest.php index d439d50e622d..cbb89a799334 100644 --- a/tests/Core/Command/User/ListUsersTest.php +++ b/tests/Core/Command/User/ListUsersTest.php @@ -34,7 +34,7 @@ class ListUsersTest extends TestCase { /** @var CommandTester */ private $commandTester; - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OC::$server->getUserManager()->createUser('testlistuser', 'password'); @@ -42,7 +42,7 @@ protected function setUp() { $this->commandTester = new CommandTester($command); } - protected function tearDown() { + protected function tearDown(): void { parent::tearDown(); \OC::$server->getUserManager()->get('testlistuser')->delete(); } diff --git a/tests/Core/Command/User/ModifyTest.php b/tests/Core/Command/User/ModifyTest.php index 15de3a072001..7d66115d7e91 100644 --- a/tests/Core/Command/User/ModifyTest.php +++ b/tests/Core/Command/User/ModifyTest.php @@ -50,7 +50,7 @@ class ModifyTest extends TestCase { /** @var OutputInterface | \PHPUnit\Framework\MockObject\MockObject */ protected $consoleOutput; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userManager = $this->createMock(IUserManager::class); diff --git a/tests/Core/Command/User/ResetPasswordTest.php b/tests/Core/Command/User/ResetPasswordTest.php index c7867f02596e..aea29d1dbf91 100644 --- a/tests/Core/Command/User/ResetPasswordTest.php +++ b/tests/Core/Command/User/ResetPasswordTest.php @@ -51,7 +51,7 @@ class ResetPasswordTest extends TestCase { private $lostController; /** @var ResetPassword */ private $resetPassword; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userManager = $this->createMock(IUserManager::class); diff --git a/tests/Core/Command/User/SettingTest.php b/tests/Core/Command/User/SettingTest.php index 84287731ffd4..ad4c872a6580 100644 --- a/tests/Core/Command/User/SettingTest.php +++ b/tests/Core/Command/User/SettingTest.php @@ -36,7 +36,7 @@ class SettingTest extends TestCase { /** @var \Symfony\Component\Console\Output\OutputInterface|\PHPUnit\Framework\MockObject\MockObject */ protected $consoleOutput; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userManager = $this->getMockBuilder('OCP\IUserManager') diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index 060428f86cb0..020a04aad9e8 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -73,7 +73,7 @@ class AvatarControllerTest extends TestCase { /** @var ILogger | \PHPUnit\Framework\MockObject\MockObject */ private $logger; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->createUser('userid', 'pass'); $this->loginAsUser('userid'); @@ -124,7 +124,7 @@ protected function setUp() { $this->avatarFile->expects($this->any())->method('getEtag')->willReturn('my etag'); } - public function tearDown() { + public function tearDown(): void { $this->logout(); parent::tearDown(); } diff --git a/tests/Core/Controller/CronControllerTest.php b/tests/Core/Controller/CronControllerTest.php index 0a627469cb33..bb143aa9aaec 100644 --- a/tests/Core/Controller/CronControllerTest.php +++ b/tests/Core/Controller/CronControllerTest.php @@ -48,7 +48,7 @@ class CronControllerTest extends TestCase { /** @var IRequest | \PHPUnit\Framework\MockObject\MockObject */ private $request; - protected function setUp() { + protected function setUp(): void { $this->request = $this->createMock(IRequest::class); $this->config = $this->createMock(IConfig::class); $this->logger = $this->createMock(ILogger::class); diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php index 1ac78dcfd7ce..6bb76c52512e 100644 --- a/tests/Core/Controller/LoginControllerTest.php +++ b/tests/Core/Controller/LoginControllerTest.php @@ -53,7 +53,7 @@ class LoginControllerTest extends TestCase { /** @var Manager | \PHPUnit\Framework\MockObject\MockObject */ private $twoFactorManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->createMock(IRequest::class); $this->userManager = $this->createMock(IUserManager::class); diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index d668592c67ee..4ccb0d05af71 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -71,7 +71,7 @@ class LostControllerTest extends TestCase { /** @var Session */ private $userSession; - protected function setUp() { + protected function setUp(): void { $this->existingUser = $this->getMockBuilder('OCP\IUser') ->disableOriginalConstructor()->getMock(); diff --git a/tests/Core/Controller/TokenControllerTest.php b/tests/Core/Controller/TokenControllerTest.php index 8a79225bec4a..945040aeb865 100644 --- a/tests/Core/Controller/TokenControllerTest.php +++ b/tests/Core/Controller/TokenControllerTest.php @@ -38,7 +38,7 @@ class TokenControllerTest extends TestCase { private $twoFactorAuthManager; private $secureRandom; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = $this->createMock('\OCP\IRequest'); diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php index 9ea2d493f40f..e747ca6978e8 100644 --- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php +++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php @@ -48,7 +48,7 @@ class TwoFactorChallengeControllerTest extends TestCase { /** @var TwoFactorChallengeController|\PHPUnit\Framework\MockObject\MockObject */ private $controller; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = $this->createMock('\OCP\IRequest'); diff --git a/tests/Core/Middleware/AccountModuleMiddlewareTest.php b/tests/Core/Middleware/AccountModuleMiddlewareTest.php index ef8cad4b31d1..348a048ca099 100644 --- a/tests/Core/Middleware/AccountModuleMiddlewareTest.php +++ b/tests/Core/Middleware/AccountModuleMiddlewareTest.php @@ -50,7 +50,7 @@ class AccountModuleMiddlewareTest extends TestCase { /** @var AccountModuleMiddleware */ private $middleware; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->logger = $this->createMock(ILogger::class); diff --git a/tests/Core/Middleware/TwoFactorMiddlewareTest.php b/tests/Core/Middleware/TwoFactorMiddlewareTest.php index 366d94ce47f0..8a7b1bf2507c 100644 --- a/tests/Core/Middleware/TwoFactorMiddlewareTest.php +++ b/tests/Core/Middleware/TwoFactorMiddlewareTest.php @@ -53,7 +53,7 @@ class TwoFactorMiddlewareTest extends TestCase { /** @var TwoFactorMiddleware */ private $middleware; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->twoFactorManager = $this->getMockBuilder(Manager::class) diff --git a/tests/Settings/Controller/AppSettingsControllerTest.php b/tests/Settings/Controller/AppSettingsControllerTest.php index 756d8a744eda..40672b782d07 100644 --- a/tests/Settings/Controller/AppSettingsControllerTest.php +++ b/tests/Settings/Controller/AppSettingsControllerTest.php @@ -45,7 +45,7 @@ class AppSettingsControllerTest extends TestCase { /** @var IAppManager */ private $appManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder(IRequest::class) diff --git a/tests/Settings/Controller/AuthSettingsControllerTest.php b/tests/Settings/Controller/AuthSettingsControllerTest.php index 99cb8ec36a74..bb67f5752dbc 100644 --- a/tests/Settings/Controller/AuthSettingsControllerTest.php +++ b/tests/Settings/Controller/AuthSettingsControllerTest.php @@ -42,7 +42,7 @@ class AuthSettingsControllerTest extends TestCase { private $secureRandom; private $uid; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = $this->createMock('\OCP\IRequest'); diff --git a/tests/Settings/Controller/CertificateControllerTest.php b/tests/Settings/Controller/CertificateControllerTest.php index b74802eb569b..49c7490f385a 100644 --- a/tests/Settings/Controller/CertificateControllerTest.php +++ b/tests/Settings/Controller/CertificateControllerTest.php @@ -48,7 +48,7 @@ class CertificateControllerTest extends \Test\TestCase { /** @var ICertificateManager */ private $systemCertificateManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->createMock('\OCP\IRequest'); diff --git a/tests/Settings/Controller/CheckSetupControllerTest.php b/tests/Settings/Controller/CheckSetupControllerTest.php index 9bb2143e9d9a..cb2c096a5c8a 100644 --- a/tests/Settings/Controller/CheckSetupControllerTest.php +++ b/tests/Settings/Controller/CheckSetupControllerTest.php @@ -60,7 +60,7 @@ class CheckSetupControllerTest extends TestCase { /** @var Checker | \PHPUnit\Framework\MockObject\MockObject */ private $checker; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder('\OCP\IRequest') diff --git a/tests/Settings/Controller/CorsControllerTest.php b/tests/Settings/Controller/CorsControllerTest.php index 94b6a472efc9..09484f04d113 100644 --- a/tests/Settings/Controller/CorsControllerTest.php +++ b/tests/Settings/Controller/CorsControllerTest.php @@ -56,7 +56,7 @@ class CorsControllerTest extends TestCase { /** @var IUser */ private $userSession; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->createMock(IRequest::class); diff --git a/tests/Settings/Controller/GroupsControllerTest.php b/tests/Settings/Controller/GroupsControllerTest.php index 087524b5c1ac..f9e9cee51760 100644 --- a/tests/Settings/Controller/GroupsControllerTest.php +++ b/tests/Settings/Controller/GroupsControllerTest.php @@ -55,7 +55,7 @@ class GroupsControllerTest extends TestCase { /** @var GroupsController */ private $groupsController; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->appName = 'settings'; $this->request = $this->createMock(IRequest::class); diff --git a/tests/Settings/Controller/LegalControllerTest.php b/tests/Settings/Controller/LegalControllerTest.php index 7acdeccb7cb7..3548cd8dc07f 100644 --- a/tests/Settings/Controller/LegalControllerTest.php +++ b/tests/Settings/Controller/LegalControllerTest.php @@ -39,7 +39,7 @@ class LegalSettingsControllerTest extends \Test\TestCase { */ private $legalSettingsController; - protected function setUp() { + protected function setUp(): void { $app = new Application(); $this->container = $app->getContainer(); $this->container['Config'] = $this->getMockBuilder(IConfig::class) diff --git a/tests/Settings/Controller/LogSettingsControllerTest.php b/tests/Settings/Controller/LogSettingsControllerTest.php index cae35eb97221..a179fca7d7aa 100644 --- a/tests/Settings/Controller/LogSettingsControllerTest.php +++ b/tests/Settings/Controller/LogSettingsControllerTest.php @@ -24,7 +24,7 @@ class LogSettingsControllerTest extends \Test\TestCase { /** @var LogSettingsController */ private $logSettingsController; - protected function setUp() { + protected function setUp(): void { $app = new Application(); $this->container = $app->getContainer(); $this->container['Config'] = $this->getMockBuilder('\OCP\IConfig') diff --git a/tests/Settings/Controller/MailSettingsControllerTest.php b/tests/Settings/Controller/MailSettingsControllerTest.php index 6256730ea822..e8c2eeac2433 100644 --- a/tests/Settings/Controller/MailSettingsControllerTest.php +++ b/tests/Settings/Controller/MailSettingsControllerTest.php @@ -18,7 +18,7 @@ class MailSettingsControllerTest extends \Test\TestCase { private $container; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $app = new Application(); diff --git a/tests/Settings/Controller/SettingsPageControllerTest.php b/tests/Settings/Controller/SettingsPageControllerTest.php index 02fdd5785470..2e7362f6a806 100644 --- a/tests/Settings/Controller/SettingsPageControllerTest.php +++ b/tests/Settings/Controller/SettingsPageControllerTest.php @@ -46,7 +46,7 @@ class SettingsPageControllerTest extends TestCase { /** @var IFactory */ protected $lfactory; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder(IRequest::class)->getMock(); diff --git a/tests/Settings/Panels/Admin/AppsTest.php b/tests/Settings/Panels/Admin/AppsTest.php index 51bb0a1a0440..dc8cf5225ba9 100644 --- a/tests/Settings/Panels/Admin/AppsTest.php +++ b/tests/Settings/Panels/Admin/AppsTest.php @@ -23,7 +23,7 @@ class AppsTest extends \Test\TestCase { /** @var IConfig */ private $config; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder(IConfig::class)->getMock(); $this->panel = new Apps($this->config); diff --git a/tests/Settings/Panels/Admin/BackgroundJobsTest.php b/tests/Settings/Panels/Admin/BackgroundJobsTest.php index dbd235a64cf5..fcb4fab357e7 100644 --- a/tests/Settings/Panels/Admin/BackgroundJobsTest.php +++ b/tests/Settings/Panels/Admin/BackgroundJobsTest.php @@ -24,7 +24,7 @@ class BackgroundJobsTest extends \Test\TestCase { /** @var IConfig */ private $config; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config =$this->getMockBuilder(IConfig::class)->getMock(); $this->panel = new BackgroundJobs($this->config); diff --git a/tests/Settings/Panels/Admin/CertificatesTest.php b/tests/Settings/Panels/Admin/CertificatesTest.php index 1d434615c1e5..3f5038aa20fe 100644 --- a/tests/Settings/Panels/Admin/CertificatesTest.php +++ b/tests/Settings/Panels/Admin/CertificatesTest.php @@ -30,7 +30,7 @@ class CertificatesTest extends \Test\TestCase { /** @var ICertificateManager */ private $certManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->urlGenerator =$this->getMockBuilder(IURLGenerator::class)->getMock(); $this->config = $this->getMockBuilder(IConfig::class)->getMock(); diff --git a/tests/Settings/Panels/Admin/EncryptionTest.php b/tests/Settings/Panels/Admin/EncryptionTest.php index bee48b0a8a40..547227c201f6 100644 --- a/tests/Settings/Panels/Admin/EncryptionTest.php +++ b/tests/Settings/Panels/Admin/EncryptionTest.php @@ -20,7 +20,7 @@ class EncryptionTest extends \Test\TestCase { /** @var Encryption */ private $panel; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->panel = new Encryption(); } diff --git a/tests/Settings/Panels/Admin/FileSharingTest.php b/tests/Settings/Panels/Admin/FileSharingTest.php index 645dee602714..76339b8b5d8e 100644 --- a/tests/Settings/Panels/Admin/FileSharingTest.php +++ b/tests/Settings/Panels/Admin/FileSharingTest.php @@ -27,7 +27,7 @@ class FileSharingTest extends \Test\TestCase { /** @var Helper */ private $helper; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder(IConfig::class)->getMock(); $this->helper = $this->getMockBuilder(Helper::class)->getMock(); diff --git a/tests/Settings/Panels/Admin/LegacyTest.php b/tests/Settings/Panels/Admin/LegacyTest.php index 5ee93c0a3358..e7331b7d7b73 100644 --- a/tests/Settings/Panels/Admin/LegacyTest.php +++ b/tests/Settings/Panels/Admin/LegacyTest.php @@ -23,7 +23,7 @@ class LegacyTest extends \Test\TestCase { /** @var Helper */ private $helper; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->helper = $this->getMockBuilder(Helper::class)->getMock(); $this->panel = new Legacy($this->helper); diff --git a/tests/Settings/Panels/Admin/LegalTest.php b/tests/Settings/Panels/Admin/LegalTest.php index bd7df2e11cd8..6e6ab4173c68 100644 --- a/tests/Settings/Panels/Admin/LegalTest.php +++ b/tests/Settings/Panels/Admin/LegalTest.php @@ -33,7 +33,7 @@ class LegalTest extends \Test\TestCase { /** @var IConfig */ private $config; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder(IConfig::class)->getMock(); $this->panel = new Legal($this->config); diff --git a/tests/Settings/Panels/Admin/LoggingTest.php b/tests/Settings/Panels/Admin/LoggingTest.php index 05ecb9fc264d..0efc2360e0bd 100644 --- a/tests/Settings/Panels/Admin/LoggingTest.php +++ b/tests/Settings/Panels/Admin/LoggingTest.php @@ -29,7 +29,7 @@ class LoggingTest extends \Test\TestCase { /** @var Helper */ private $helper; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)->getMock(); $this->config = $this->getMockBuilder(IConfig::class)->getMock(); diff --git a/tests/Settings/Panels/Admin/MailTest.php b/tests/Settings/Panels/Admin/MailTest.php index 58e5bb56b990..d38b9731ac65 100644 --- a/tests/Settings/Panels/Admin/MailTest.php +++ b/tests/Settings/Panels/Admin/MailTest.php @@ -26,7 +26,7 @@ class MailTest extends \Test\TestCase { /** @var Helper */ private $helper; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder(IConfig::class)->getMock(); $this->helper = $this->getMockBuilder(Helper::class)->getMock(); diff --git a/tests/Settings/Panels/Admin/SecurityWarningTest.php b/tests/Settings/Panels/Admin/SecurityWarningTest.php index d490abe2fc57..02a8916fffee 100644 --- a/tests/Settings/Panels/Admin/SecurityWarningTest.php +++ b/tests/Settings/Panels/Admin/SecurityWarningTest.php @@ -35,7 +35,7 @@ class SecurityWarningTest extends \Test\TestCase { /** @var Helper */ private $helper; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->l = $this->getMockBuilder(IL10N::class)->getMock(); $this->config = $this->getMockBuilder(IConfig::class)->getMock(); diff --git a/tests/Settings/Panels/Admin/TipsTest.php b/tests/Settings/Panels/Admin/TipsTest.php index 57df06c2e17c..8abc2668e871 100644 --- a/tests/Settings/Panels/Admin/TipsTest.php +++ b/tests/Settings/Panels/Admin/TipsTest.php @@ -20,7 +20,7 @@ class TipsTest extends \Test\TestCase { /** @var Tips */ private $panel; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->panel = new Tips(); } diff --git a/tests/Settings/Panels/Personal/ClientsTest.php b/tests/Settings/Panels/Personal/ClientsTest.php index fa57eaafa534..61027b015b02 100644 --- a/tests/Settings/Panels/Personal/ClientsTest.php +++ b/tests/Settings/Panels/Personal/ClientsTest.php @@ -26,7 +26,7 @@ class ClientsTest extends \Test\TestCase { /** @var Defaults */ private $defaults; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder(IConfig::class)->getMock(); $this->defaults = $this->getMockBuilder(Defaults::class)->getMock(); diff --git a/tests/Settings/Panels/Personal/LegacyTest.php b/tests/Settings/Panels/Personal/LegacyTest.php index 6d0d9bab996b..587b5b229a72 100644 --- a/tests/Settings/Panels/Personal/LegacyTest.php +++ b/tests/Settings/Panels/Personal/LegacyTest.php @@ -23,7 +23,7 @@ class LegacyTest extends \Test\TestCase { /** @var Helper */ private $helper; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->helper = $this->getMockBuilder(Helper::class)->getMock(); $this->panel = new Legacy($this->helper); diff --git a/tests/Settings/Panels/Personal/ProfileTest.php b/tests/Settings/Panels/Personal/ProfileTest.php index 088e6417030b..5f8b2f3e281d 100644 --- a/tests/Settings/Panels/Personal/ProfileTest.php +++ b/tests/Settings/Panels/Personal/ProfileTest.php @@ -34,7 +34,7 @@ class ProfileTest extends \Test\TestCase { /** @var IUserSession */ private $userSession; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder(IConfig::class)->getMock(); $this->groupManager = $this->getMockBuilder(IGroupManager::class)->getMock(); diff --git a/tests/Settings/Panels/Personal/QuotaTest.php b/tests/Settings/Panels/Personal/QuotaTest.php index 20ab741ecb24..04dcd8edf576 100644 --- a/tests/Settings/Panels/Personal/QuotaTest.php +++ b/tests/Settings/Panels/Personal/QuotaTest.php @@ -23,7 +23,7 @@ class QuotaTest extends \Test\TestCase { /** @var Helper */ private $helper; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->helper = $this->getMockBuilder(Helper::class)->getMock(); $this->panel = new Quota($this->helper); diff --git a/tests/Settings/Panels/Personal/TokensTest.php b/tests/Settings/Panels/Personal/TokensTest.php index 5328444b7f0a..9a3732138bac 100644 --- a/tests/Settings/Panels/Personal/TokensTest.php +++ b/tests/Settings/Panels/Personal/TokensTest.php @@ -20,7 +20,7 @@ class TokensTest extends \Test\TestCase { /** @var Tokens */ private $panel; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->panel = new Tokens; } diff --git a/tests/Settings/Panels/Personal/VersionTest.php b/tests/Settings/Panels/Personal/VersionTest.php index 4b5c8fb74292..a54b5913a45d 100644 --- a/tests/Settings/Panels/Personal/VersionTest.php +++ b/tests/Settings/Panels/Personal/VersionTest.php @@ -20,7 +20,7 @@ class VersionTest extends \Test\TestCase { /** @var Version */ private $panel; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->panel = new Version; } diff --git a/tests/TestHelpers/Unit/DeleteHelperTest.php b/tests/TestHelpers/Unit/DeleteHelperTest.php index 00aa9dfe0e20..005dc1887d79 100644 --- a/tests/TestHelpers/Unit/DeleteHelperTest.php +++ b/tests/TestHelpers/Unit/DeleteHelperTest.php @@ -36,7 +36,7 @@ class DeleteHelperTest extends PHPUnit\Framework\TestCase { * * @return void */ - public function setUp() { + public function setUp(): void { $mock = new Mock( [ new Response(204, [])] ); diff --git a/tests/TestHelpers/Unit/WebDavHelperTest.php b/tests/TestHelpers/Unit/WebDavHelperTest.php index d34871cbd158..4f332f7cea40 100644 --- a/tests/TestHelpers/Unit/WebDavHelperTest.php +++ b/tests/TestHelpers/Unit/WebDavHelperTest.php @@ -36,7 +36,7 @@ class WebDavHelperTest extends PHPUnit\Framework\TestCase { * * @return void */ - public function setUp() { + public function setUp(): void { // mocks is not used, but is required. Else it will try to // contact original server and will fail our tests. $mock = new Mock( diff --git a/tests/lib/Activity/ManagerTest.php b/tests/lib/Activity/ManagerTest.php index 0f40795d09e4..00e2c2b6163c 100644 --- a/tests/lib/Activity/ManagerTest.php +++ b/tests/lib/Activity/ManagerTest.php @@ -26,7 +26,7 @@ class ManagerTest extends TestCase { /** @var \OCP\IConfig|\PHPUnit\Framework\MockObject\MockObject */ protected $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder('OCP\IRequest') diff --git a/tests/lib/Activity/NullSession/ManagerTest.php b/tests/lib/Activity/NullSession/ManagerTest.php index 13630518fbc4..e8a509c4d903 100644 --- a/tests/lib/Activity/NullSession/ManagerTest.php +++ b/tests/lib/Activity/NullSession/ManagerTest.php @@ -27,7 +27,7 @@ class ManagerTest extends TestCase { /** @var \OCP\IConfig|\PHPUnit\Framework\MockObject\MockObject */ protected $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder(IRequest::class) diff --git a/tests/lib/App/CodeChecker/InfoCheckerTest.php b/tests/lib/App/CodeChecker/InfoCheckerTest.php index 976b93f2ffae..2a44db5233bf 100644 --- a/tests/lib/App/CodeChecker/InfoCheckerTest.php +++ b/tests/lib/App/CodeChecker/InfoCheckerTest.php @@ -32,7 +32,7 @@ class InfoCheckerTest extends TestCase { /** @var IAppManager | \PHPUnit\Framework\MockObject\MockObject */ protected $appManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->appManager = $this->getMockBuilder(IAppManager::class) diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php index eac27d48e995..e652cb82bcdf 100644 --- a/tests/lib/App/DependencyAnalyzerTest.php +++ b/tests/lib/App/DependencyAnalyzerTest.php @@ -29,7 +29,7 @@ class DependencyAnalyzerTest extends TestCase { '@attributes' => [ 'min-version' => '11.0', 'max-version' => '100.0.0' ] ]; - public function setUp() { + public function setUp(): void { $this->platformMock = $this->getMockBuilder(Platform::class) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/lib/App/InfoParserTest.php b/tests/lib/App/InfoParserTest.php index 457f90e15f9d..13396f5d66a4 100644 --- a/tests/lib/App/InfoParserTest.php +++ b/tests/lib/App/InfoParserTest.php @@ -18,7 +18,7 @@ class InfoParserTest extends TestCase { /** @var InfoParser */ private $parser; - public function setUp() { + public function setUp(): void { $this->parser = new InfoParser(); } diff --git a/tests/lib/App/ManagerTest.php b/tests/lib/App/ManagerTest.php index f8cfc7f6fa4a..fcc1cdc02415 100644 --- a/tests/lib/App/ManagerTest.php +++ b/tests/lib/App/ManagerTest.php @@ -92,7 +92,7 @@ protected function getAppConfig() { return $config; } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userSession = $this->createMock(IUserSession::class); diff --git a/tests/lib/AppConfigTest.php b/tests/lib/AppConfigTest.php index 6e8073f33dfb..cf44679948fa 100644 --- a/tests/lib/AppConfigTest.php +++ b/tests/lib/AppConfigTest.php @@ -26,7 +26,7 @@ class AppConfigTest extends TestCase { protected $originalConfig; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -111,7 +111,7 @@ public function setUp() { ])->execute(); } - public function tearDown() { + public function tearDown(): void { $sql = $this->connection->getQueryBuilder(); $sql->delete('appconfig'); $sql->execute(); diff --git a/tests/lib/AppFramework/AppTest.php b/tests/lib/AppFramework/AppTest.php index 6ff1c12a9539..345da7994f8c 100644 --- a/tests/lib/AppFramework/AppTest.php +++ b/tests/lib/AppFramework/AppTest.php @@ -51,7 +51,7 @@ class AppTest extends \Test\TestCase { private $controllerMethod; private $appPath; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', []); @@ -118,7 +118,7 @@ public function testBuildAppNamespaceInfoXml() { $this->assertEquals('OCA\NameSpaceTestApp', $ns); } - protected function tearDown() { + protected function tearDown(): void { rrmdir($this->appPath); parent::tearDown(); } diff --git a/tests/lib/AppFramework/Controller/ControllerTest.php b/tests/lib/AppFramework/Controller/ControllerTest.php index 5b0e9271adf0..858b82bebba8 100644 --- a/tests/lib/AppFramework/Controller/ControllerTest.php +++ b/tests/lib/AppFramework/Controller/ControllerTest.php @@ -66,7 +66,7 @@ class ControllerTest extends TestCase { /** @var DIContainer */ private $app; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $request = new Request( diff --git a/tests/lib/AppFramework/Db/EntityTest.php b/tests/lib/AppFramework/Db/EntityTest.php index d2aaa69cee14..f5da2cdf9212 100644 --- a/tests/lib/AppFramework/Db/EntityTest.php +++ b/tests/lib/AppFramework/Db/EntityTest.php @@ -52,7 +52,7 @@ public function __construct($name=null) { class EntityTest extends \Test\TestCase { private $entity; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->entity = new TestEntity(); } diff --git a/tests/lib/AppFramework/Db/MapperTest.php b/tests/lib/AppFramework/Db/MapperTest.php index 45e56b5bf361..9dba80eecc89 100644 --- a/tests/lib/AppFramework/Db/MapperTest.php +++ b/tests/lib/AppFramework/Db/MapperTest.php @@ -68,7 +68,7 @@ class MapperTest extends MapperTestUtility { */ private $mapper; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->mapper = new ExampleMapper($this->db); } diff --git a/tests/lib/AppFramework/Db/MapperTestUtility.php b/tests/lib/AppFramework/Db/MapperTestUtility.php index 1359f66de0be..4e6d24e88810 100644 --- a/tests/lib/AppFramework/Db/MapperTestUtility.php +++ b/tests/lib/AppFramework/Db/MapperTestUtility.php @@ -38,7 +38,7 @@ abstract class MapperTestUtility extends \Test\TestCase { * Run this function before the actual test to either set or initialize the * db. After this the db can be accessed by using $this->db */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->db = $this->getMockBuilder( diff --git a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php index 6c8b4d551fc5..e3651747f81f 100644 --- a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php +++ b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php @@ -30,7 +30,7 @@ class DIContainerTest extends \Test\TestCase { private $container; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->container = $this->getMockBuilder('OC\AppFramework\DependencyInjection\DIContainer') ->setMethods(['isAdminUser']) diff --git a/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php b/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php index 469bf3b7962d..856c9e502508 100644 --- a/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php +++ b/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php @@ -21,7 +21,7 @@ class ContentSecurityPolicyTest extends TestCase { /** @var ContentSecurityPolicy */ private $contentSecurityPolicy; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->contentSecurityPolicy = new ContentSecurityPolicy(); } diff --git a/tests/lib/AppFramework/Http/DataResponseTest.php b/tests/lib/AppFramework/Http/DataResponseTest.php index c515a7eb8c81..c9ee4c12ccaa 100644 --- a/tests/lib/AppFramework/Http/DataResponseTest.php +++ b/tests/lib/AppFramework/Http/DataResponseTest.php @@ -34,7 +34,7 @@ class DataResponseTest extends TestCase { */ private $response; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->response = new DataResponse(); } diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php index 9596016785df..05c5af2f1ce9 100644 --- a/tests/lib/AppFramework/Http/DispatcherTest.php +++ b/tests/lib/AppFramework/Http/DispatcherTest.php @@ -88,7 +88,7 @@ class DispatcherTest extends \Test\TestCase { /** @var Controller | \PHPUnit\Framework\MockObject\MockObject */ private $controller; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->controllerMethod = 'test'; diff --git a/tests/lib/AppFramework/Http/DownloadResponseTest.php b/tests/lib/AppFramework/Http/DownloadResponseTest.php index 4fe15f9d01e0..8cb8404252d9 100644 --- a/tests/lib/AppFramework/Http/DownloadResponseTest.php +++ b/tests/lib/AppFramework/Http/DownloadResponseTest.php @@ -35,7 +35,7 @@ class DownloadResponseTest extends \Test\TestCase { */ protected $response; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->response = new ChildDownloadResponse('file', 'content'); } diff --git a/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php b/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php index 579994e5800e..7b415b441c4d 100644 --- a/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php +++ b/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php @@ -21,7 +21,7 @@ class EmptyContentSecurityPolicyTest extends TestCase { /** @var EmptyContentSecurityPolicy */ private $contentSecurityPolicy; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->contentSecurityPolicy = new EmptyContentSecurityPolicy(); } diff --git a/tests/lib/AppFramework/Http/HttpTest.php b/tests/lib/AppFramework/Http/HttpTest.php index 8a89c7d18d29..737880addbd2 100644 --- a/tests/lib/AppFramework/Http/HttpTest.php +++ b/tests/lib/AppFramework/Http/HttpTest.php @@ -33,7 +33,7 @@ class HttpTest extends \Test\TestCase { */ private $http; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->server = []; diff --git a/tests/lib/AppFramework/Http/JSONResponseTest.php b/tests/lib/AppFramework/Http/JSONResponseTest.php index 3c28d514913f..2ff551b94226 100644 --- a/tests/lib/AppFramework/Http/JSONResponseTest.php +++ b/tests/lib/AppFramework/Http/JSONResponseTest.php @@ -35,7 +35,7 @@ class JSONResponseTest extends \Test\TestCase { */ private $json; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->json = new JSONResponse(); } diff --git a/tests/lib/AppFramework/Http/RedirectResponseTest.php b/tests/lib/AppFramework/Http/RedirectResponseTest.php index afb3b7d045d4..f2a26a274cff 100644 --- a/tests/lib/AppFramework/Http/RedirectResponseTest.php +++ b/tests/lib/AppFramework/Http/RedirectResponseTest.php @@ -33,7 +33,7 @@ class RedirectResponseTest extends \Test\TestCase { */ protected $response; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->response = new RedirectResponse('/url'); } diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php index 417bf6933199..b9a4f82adf6a 100644 --- a/tests/lib/AppFramework/Http/RequestTest.php +++ b/tests/lib/AppFramework/Http/RequestTest.php @@ -33,7 +33,7 @@ class RequestTest extends TestCase { /** @var CsrfTokenManager | \PHPUnit\Framework\MockObject\MockObject */ protected $csrfTokenManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); if (\in_array('fakeinput', \stream_get_wrappers())) { @@ -47,7 +47,7 @@ protected function setUp() { ->disableOriginalConstructor()->getMock(); } - protected function tearDown() { + protected function tearDown(): void { \stream_wrapper_unregister('fakeinput'); parent::tearDown(); } diff --git a/tests/lib/AppFramework/Http/ResponseTest.php b/tests/lib/AppFramework/Http/ResponseTest.php index ba7b725b29ee..980dba430c76 100644 --- a/tests/lib/AppFramework/Http/ResponseTest.php +++ b/tests/lib/AppFramework/Http/ResponseTest.php @@ -37,7 +37,7 @@ class ResponseTest extends TestCase { */ private $childResponse; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->childResponse = new Response(); } diff --git a/tests/lib/AppFramework/Http/StreamResponseTest.php b/tests/lib/AppFramework/Http/StreamResponseTest.php index dd74c3530c3f..5c6922f04972 100644 --- a/tests/lib/AppFramework/Http/StreamResponseTest.php +++ b/tests/lib/AppFramework/Http/StreamResponseTest.php @@ -32,7 +32,7 @@ class StreamResponseTest extends \Test\TestCase { /** @var IOutput */ private $output; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->output = $this->createMock('OCP\\AppFramework\\Http\\IOutput'); } diff --git a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php index 351c5de433da..f1bf26a89511 100644 --- a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php +++ b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php @@ -109,7 +109,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase { */ private $dispatcher; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->dispatcher = new MiddlewareDispatcher(); diff --git a/tests/lib/AppFramework/Middleware/MiddlewareTest.php b/tests/lib/AppFramework/Middleware/MiddlewareTest.php index 5317e6eba7a4..50a163933d15 100644 --- a/tests/lib/AppFramework/Middleware/MiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/MiddlewareTest.php @@ -42,7 +42,7 @@ class MiddlewareTest extends \Test\TestCase { /** @var Response */ private $response; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->middleware = new ChildMiddleware(); diff --git a/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php index 27e6a63c5b55..c2bb717d451c 100644 --- a/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php @@ -43,7 +43,7 @@ public function providesConfigForPublicPageTest() { ]; } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); diff --git a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php index e076bc29e8fe..0c206f117560 100644 --- a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php @@ -72,7 +72,7 @@ class SecurityMiddlewareTest extends TestCase { /** @var IUserSession | \PHPUnit\Framework\MockObject\MockObject */ private $session; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->controller = $this->getMockBuilder(Controller::class) diff --git a/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php b/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php index 51df557dbd08..3ae26f3bbc42 100644 --- a/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/SessionMiddlewareTest.php @@ -28,7 +28,7 @@ class SessionMiddlewareTest extends \Test\TestCase { */ private $request; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->request = new Request( diff --git a/tests/lib/AppFramework/Utility/SimpleContainerTest.php b/tests/lib/AppFramework/Utility/SimpleContainerTest.php index 66d710ff0aa4..a121cc2a5257 100644 --- a/tests/lib/AppFramework/Utility/SimpleContainerTest.php +++ b/tests/lib/AppFramework/Utility/SimpleContainerTest.php @@ -62,7 +62,7 @@ class SimpleContainerTest extends \Test\TestCase { /** @var SimpleContainer */ private $container; - public function setUp() { + public function setUp(): void { $this->container = new SimpleContainer(); } diff --git a/tests/lib/Archive/TARTest.php b/tests/lib/Archive/TARTest.php index ffa4a3710416..ddace27eb96a 100644 --- a/tests/lib/Archive/TARTest.php +++ b/tests/lib/Archive/TARTest.php @@ -11,7 +11,7 @@ use OC\Archive\TAR; class TARTest extends TestBase { - protected function setUp() { + protected function setUp(): void { parent::setUp(); } diff --git a/tests/lib/Archive/ZIPTest.php b/tests/lib/Archive/ZIPTest.php index 4863fce1ae85..246f54646c0f 100644 --- a/tests/lib/Archive/ZIPTest.php +++ b/tests/lib/Archive/ZIPTest.php @@ -11,7 +11,7 @@ use OC\Archive\ZIP; class ZIPTest extends TestBase { - protected function setUp() { + protected function setUp(): void { parent::setUp(); } diff --git a/tests/lib/Authentication/AccountModule/ManagerTest.php b/tests/lib/Authentication/AccountModule/ManagerTest.php index 56d1beda3611..a9ded8f5314b 100644 --- a/tests/lib/Authentication/AccountModule/ManagerTest.php +++ b/tests/lib/Authentication/AccountModule/ManagerTest.php @@ -46,7 +46,7 @@ class ManagerTest extends TestCase { /** @var Manager */ private $manager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->user = $this->createMock(IUser::class); diff --git a/tests/lib/Authentication/Token/DefaultTokenCleanupJobTest.php b/tests/lib/Authentication/Token/DefaultTokenCleanupJobTest.php index 59083b058963..2d26c5a5c90a 100644 --- a/tests/lib/Authentication/Token/DefaultTokenCleanupJobTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenCleanupJobTest.php @@ -31,7 +31,7 @@ class DefaultTokenCleanupJobTest extends TestCase { private $job; private $tokenProvider; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tokenProvider = $this->getMockBuilder('\OC\Authentication\Token\DefaultTokenProvider') @@ -41,7 +41,7 @@ protected function setUp() { $this->job = new DefaultTokenCleanupJob(); } - protected function tearDown() { + protected function tearDown(): void { parent::tearDown(); $this->restoreService('\OC\Authentication\Token\DefaultTokenProvider'); diff --git a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php index 53f40e6e81c4..d39d50a98c7a 100644 --- a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php @@ -45,7 +45,7 @@ class DefaultTokenMapperTest extends TestCase { private $dbConnection; private $time; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->dbConnection = OC::$server->getDatabaseConnection(); diff --git a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php index 6904bff2a6f8..a298e1c1daf0 100644 --- a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php @@ -38,7 +38,7 @@ class DefaultTokenProviderTest extends TestCase { private $timeFactory; private $time; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->mapper = $this->getMockBuilder('\OC\Authentication\Token\DefaultTokenMapper') diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php index fdb9b47a4f3c..f54f9951b294 100644 --- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php +++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php @@ -45,7 +45,7 @@ class ManagerTest extends TestCase { /** @var \OCP\Authentication\TwoFactorAuth\IProvider|\PHPUnit\Framework\MockObject\MockObject */ private $fakeProvider; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->user = $this->createMock('\OCP\IUser'); diff --git a/tests/lib/AutoLoaderTest.php b/tests/lib/AutoLoaderTest.php index ed431360e32f..cc3ea677b551 100644 --- a/tests/lib/AutoLoaderTest.php +++ b/tests/lib/AutoLoaderTest.php @@ -16,7 +16,7 @@ class AutoLoaderTest extends TestCase { */ private $loader; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->loader = new AutoLoader(); } diff --git a/tests/lib/AvatarManagerTest.php b/tests/lib/AvatarManagerTest.php index d38c2ea52900..55e5e428f778 100644 --- a/tests/lib/AvatarManagerTest.php +++ b/tests/lib/AvatarManagerTest.php @@ -60,7 +60,7 @@ class AvatarManagerTest extends TestCase { /** @var ILogger | \PHPUnit\Framework\MockObject\MockObject */ private $logger; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->userManager = $this->createMock(IUserManager::class); diff --git a/tests/lib/AvatarTest.php b/tests/lib/AvatarTest.php index 447512b243cf..b6f0ad4c3614 100644 --- a/tests/lib/AvatarTest.php +++ b/tests/lib/AvatarTest.php @@ -27,7 +27,7 @@ class AvatarTest extends \Test\TestCase { /** @var \OC\User\User | \PHPUnit\Framework\MockObject\MockObject $user */ private $user; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->storage = $this->createMock(IStorage::class); diff --git a/tests/lib/BackgroundJob/JobListTest.php b/tests/lib/BackgroundJob/JobListTest.php index 68c864afa384..babbd3d830c7 100644 --- a/tests/lib/BackgroundJob/JobListTest.php +++ b/tests/lib/BackgroundJob/JobListTest.php @@ -35,7 +35,7 @@ class JobListTest extends TestCase { /** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */ protected $logger; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); diff --git a/tests/lib/BackgroundJob/JobTest.php b/tests/lib/BackgroundJob/JobTest.php index 7923eef11ef6..4c13798da25b 100644 --- a/tests/lib/BackgroundJob/JobTest.php +++ b/tests/lib/BackgroundJob/JobTest.php @@ -11,7 +11,7 @@ class JobTest extends \Test\TestCase { private $run = false; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->run = false; } diff --git a/tests/lib/BackgroundJob/QueuedJobTest.php b/tests/lib/BackgroundJob/QueuedJobTest.php index a3e9cc296a0d..2ff39dd78f6c 100644 --- a/tests/lib/BackgroundJob/QueuedJobTest.php +++ b/tests/lib/BackgroundJob/QueuedJobTest.php @@ -39,7 +39,7 @@ public function markRun() { $this->jobRun = true; } - protected function setup() { + protected function setUp(): void { parent::setUp(); $this->jobList = new DummyJobList(); diff --git a/tests/lib/BackgroundJob/TimedJobTest.php b/tests/lib/BackgroundJob/TimedJobTest.php index c8e5addcb87b..bdd44978bf01 100644 --- a/tests/lib/BackgroundJob/TimedJobTest.php +++ b/tests/lib/BackgroundJob/TimedJobTest.php @@ -40,7 +40,7 @@ public function markRun() { $this->jobRun = true; } - protected function setup() { + protected function setUp(): void { parent::setUp(); $this->jobList = new DummyJobList(); diff --git a/tests/lib/Cache/CappedMemoryCacheTest.php b/tests/lib/Cache/CappedMemoryCacheTest.php index 3823f0a3bebd..6d6d4878b83b 100644 --- a/tests/lib/Cache/CappedMemoryCacheTest.php +++ b/tests/lib/Cache/CappedMemoryCacheTest.php @@ -30,7 +30,7 @@ * @package Test\Cache */ class CappedMemoryCacheTest extends TestCache { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->instance = new \OC\Cache\CappedMemoryCache(); } diff --git a/tests/lib/Cache/FileCacheTest.php b/tests/lib/Cache/FileCacheTest.php index 6d334e9a182b..8e0b623b75b6 100644 --- a/tests/lib/Cache/FileCacheTest.php +++ b/tests/lib/Cache/FileCacheTest.php @@ -51,7 +51,7 @@ class FileCacheTest extends TestCache { * */ private $rootView; - protected function setUp() { + protected function setUp(): void { parent::setUp(); //clear all proxies and hooks so we can do clean testing @@ -83,7 +83,7 @@ protected function setUp() { $this->instance->set('hack', 'hack'); } - protected function tearDown() { + protected function tearDown(): void { if ($this->instance) { $this->instance->remove('hack', 'hack'); } diff --git a/tests/lib/Cache/TestCache.php b/tests/lib/Cache/TestCache.php index d7a2215c9c68..2aa30baabf9d 100644 --- a/tests/lib/Cache/TestCache.php +++ b/tests/lib/Cache/TestCache.php @@ -14,7 +14,7 @@ abstract class TestCache extends \Test\TestCase { */ protected $instance; - protected function tearDown() { + protected function tearDown(): void { if ($this->instance) { $this->instance->clear(); } diff --git a/tests/lib/Command/AsyncBusTest.php b/tests/lib/Command/AsyncBusTest.php index 9a9f6b7a3c8b..c8153c5618c7 100644 --- a/tests/lib/Command/AsyncBusTest.php +++ b/tests/lib/Command/AsyncBusTest.php @@ -80,7 +80,7 @@ public static function DummyCommand() { self::$lastCommand = 'static'; } - public function setUp() { + public function setUp(): void { $this->jobList = new DummyJobList(); $this->bus = new \OC\Command\AsyncBus($this->jobList); self::$lastCommand = ''; diff --git a/tests/lib/Command/Integrity/SignAppTest.php b/tests/lib/Command/Integrity/SignAppTest.php index fd1da87fdb0c..de4c4f94dffd 100644 --- a/tests/lib/Command/Integrity/SignAppTest.php +++ b/tests/lib/Command/Integrity/SignAppTest.php @@ -36,7 +36,7 @@ class SignAppTest extends TestCase { /** @var IURLGenerator */ private $urlGenerator; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker') ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Command/Integrity/SignCoreTest.php b/tests/lib/Command/Integrity/SignCoreTest.php index 701eceadf4e6..04cdd01f3eda 100644 --- a/tests/lib/Command/Integrity/SignCoreTest.php +++ b/tests/lib/Command/Integrity/SignCoreTest.php @@ -33,7 +33,7 @@ class SignCoreTest extends TestCase { /** @var FileAccessHelper */ private $fileAccessHelper; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker') ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Command/User/SyncBackendTest.php b/tests/lib/Command/User/SyncBackendTest.php index a90293f90927..0f4edd085266 100644 --- a/tests/lib/Command/User/SyncBackendTest.php +++ b/tests/lib/Command/User/SyncBackendTest.php @@ -50,7 +50,7 @@ class SyncBackendTest extends TestCase { /** @var UserInterface | \PHPUnit\Framework\MockObject\MockObject */ private $dummyBackend; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); diff --git a/tests/lib/Comments/ManagerTest.php b/tests/lib/Comments/ManagerTest.php index 1c2decb88507..3aad81e64d56 100644 --- a/tests/lib/Comments/ManagerTest.php +++ b/tests/lib/Comments/ManagerTest.php @@ -19,7 +19,7 @@ class ManagerTest extends TestCase { /** @var IDBConnection */ private $dbConn; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->dbConn = \OC::$server->getDatabaseConnection(); @@ -29,7 +29,7 @@ public function setUp() { $this->dbConn->prepare($sql)->execute(); } - public function tearDown() { + public function tearDown(): void { $this->dbConn->getQueryBuilder()->delete('comments')->execute(); $this->dbConn->getQueryBuilder()->delete('comments_read_markers')->execute(); parent::tearDown(); diff --git a/tests/lib/ConfigTest.php b/tests/lib/ConfigTest.php index 0f13307b7443..ef22d355545a 100644 --- a/tests/lib/ConfigTest.php +++ b/tests/lib/ConfigTest.php @@ -28,7 +28,7 @@ class ConfigTest extends TestCase { /** @var string */ private $randomTmpDir; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->randomTmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); @@ -37,7 +37,7 @@ protected function setUp() { $this->config = new \OC\Config($this->randomTmpDir, 'testconfig.php'); } - protected function tearDown() { + protected function tearDown(): void { \unlink($this->configFile); parent::tearDown(); } diff --git a/tests/lib/ContactsManagerTest.php b/tests/lib/ContactsManagerTest.php index 42a006ecd250..4c5ec08e75dd 100644 --- a/tests/lib/ContactsManagerTest.php +++ b/tests/lib/ContactsManagerTest.php @@ -7,7 +7,7 @@ class ContactsManagerTest extends \Test\TestCase { /** @var \OC\ContactsManager */ private $cm; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->cm = new \OC\ContactsManager(); } diff --git a/tests/lib/DB/AdapterTest.php b/tests/lib/DB/AdapterTest.php index 0fe1cb58a9ad..6a4cc54f79e1 100644 --- a/tests/lib/DB/AdapterTest.php +++ b/tests/lib/DB/AdapterTest.php @@ -49,7 +49,7 @@ public function __construct() { parent::__construct(); } - public function tearDown() { + public function tearDown(): void { // remove columns from the appconfig table $qb = $this->conn->getQueryBuilder(); $qb->delete('*PREFIX*appconfig') diff --git a/tests/lib/DB/ConnectionTest.php b/tests/lib/DB/ConnectionTest.php index 68187a576c77..772533dd20f6 100644 --- a/tests/lib/DB/ConnectionTest.php +++ b/tests/lib/DB/ConnectionTest.php @@ -32,7 +32,7 @@ public static function setUpBeforeClass() { parent::setUpBeforeClass(); } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { self::dropTestTable(); parent::tearDownAfterClass(); } @@ -43,12 +43,12 @@ protected static function dropTestTable() { } } - public function setUp() { + public function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); $this->connection->dropTable('table'); } diff --git a/tests/lib/DB/DBSchemaTest.php b/tests/lib/DB/DBSchemaTest.php index 55fb5e5e7f9d..d35419a2bdd0 100644 --- a/tests/lib/DB/DBSchemaTest.php +++ b/tests/lib/DB/DBSchemaTest.php @@ -24,7 +24,7 @@ class DBSchemaTest extends TestCase { protected $table1; protected $table2; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $dbfile = \OC::$SERVERROOT.'/tests/data/db_structure.xml'; @@ -43,7 +43,7 @@ protected function setUp() { $this->table2 = $r.'cntcts_cards'; } - protected function tearDown() { + protected function tearDown(): void { \unlink($this->schema_file); \unlink($this->schema_file2); diff --git a/tests/lib/DB/LegacyDBTest.php b/tests/lib/DB/LegacyDBTest.php index a0224b8ad172..623cca82a6c9 100644 --- a/tests/lib/DB/LegacyDBTest.php +++ b/tests/lib/DB/LegacyDBTest.php @@ -51,7 +51,7 @@ class LegacyDBTest extends \Test\TestCase { */ private $text_table; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $dbFile = \OC::$SERVERROOT.'/tests/data/db_structure.xml'; @@ -71,7 +71,7 @@ protected function setUp() { $this->text_table = $this->test_prefix.'text_table'; } - protected function tearDown() { + protected function tearDown(): void { OC_DB::removeDBStructure(self::$schema_file); \unlink(self::$schema_file); diff --git a/tests/lib/DB/MDB2SchemaManagerTest.php b/tests/lib/DB/MDB2SchemaManagerTest.php index 0079b50021de..80de55859353 100644 --- a/tests/lib/DB/MDB2SchemaManagerTest.php +++ b/tests/lib/DB/MDB2SchemaManagerTest.php @@ -19,7 +19,7 @@ * @package Test\DB */ class MDB2SchemaManagerTest extends \Test\TestCase { - protected function tearDown() { + protected function tearDown(): void { // do not drop the table for Oracle as it will create a bogus transaction // that will break the following test suites requiring transactions if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') { diff --git a/tests/lib/DB/MigrationsTest.php b/tests/lib/DB/MigrationsTest.php index 9c2748bbad23..ea0dfbfaa3ed 100644 --- a/tests/lib/DB/MigrationsTest.php +++ b/tests/lib/DB/MigrationsTest.php @@ -28,7 +28,7 @@ class MigrationsTest extends \Test\TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject | IDBConnection $db */ private $db; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->db = $this->createMock(Connection::class); diff --git a/tests/lib/DB/MigratorTest.php b/tests/lib/DB/MigratorTest.php index 1587aca7d99c..c760dd58b5d8 100644 --- a/tests/lib/DB/MigratorTest.php +++ b/tests/lib/DB/MigratorTest.php @@ -44,7 +44,7 @@ class MigratorTest extends \Test\TestCase { /** @var string */ private $tableNameTmp; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = \OC::$server->getConfig(); @@ -58,7 +58,7 @@ private function getUniqueTableName() { return \strtolower($this->getUniqueID($this->config->getSystemValue('dbtableprefix', 'oc_') . 'test_')); } - protected function tearDown() { + protected function tearDown(): void { // Try to delete if exists (IF EXISTS NOT SUPPORTED IN ORACLE) try { $this->connection->exec('DROP TABLE ' . $this->connection->quoteIdentifier($this->tableNameTmp)); diff --git a/tests/lib/DB/MySqlMigrationTest.php b/tests/lib/DB/MySqlMigrationTest.php index 9687a1052f84..73d5829780e6 100644 --- a/tests/lib/DB/MySqlMigrationTest.php +++ b/tests/lib/DB/MySqlMigrationTest.php @@ -21,7 +21,7 @@ class MySqlMigrationTest extends \Test\TestCase { /** @var string */ private $tableName; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -34,7 +34,7 @@ protected function setUp() { $this->connection->exec("CREATE TABLE $this->tableName(b BIT, e ENUM('1','2','3','4'))"); } - protected function tearDown() { + protected function tearDown(): void { $this->connection->getSchemaManager()->dropTable($this->tableName); parent::tearDown(); } diff --git a/tests/lib/DB/MySqlToolsTest.php b/tests/lib/DB/MySqlToolsTest.php index c626f3590f1e..51591443a9cd 100644 --- a/tests/lib/DB/MySqlToolsTest.php +++ b/tests/lib/DB/MySqlToolsTest.php @@ -42,7 +42,7 @@ class MySqlToolsTest extends \Test\TestCase { * @var MySqlTools */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->db = $this->createMock(Connection::class); diff --git a/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php b/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php index 80957361d331..b719684df5b5 100644 --- a/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php +++ b/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php @@ -43,7 +43,7 @@ class ExpressionBuilderTest extends TestCase { /** @var \Doctrine\DBAL\Connection|\OCP\IDBConnection */ protected $connection; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); diff --git a/tests/lib/DB/QueryBuilder/QueryBuilderTest.php b/tests/lib/DB/QueryBuilder/QueryBuilderTest.php index 7938e8c98222..5640053ccd73 100644 --- a/tests/lib/DB/QueryBuilder/QueryBuilderTest.php +++ b/tests/lib/DB/QueryBuilder/QueryBuilderTest.php @@ -41,7 +41,7 @@ class QueryBuilderTest extends \Test\TestCase { /** @var IDBConnection */ protected $connection; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); diff --git a/tests/lib/DB/QueryBuilder/QuoteHelperTest.php b/tests/lib/DB/QueryBuilder/QuoteHelperTest.php index 1777cea8762f..98ea8b58e4bb 100644 --- a/tests/lib/DB/QueryBuilder/QuoteHelperTest.php +++ b/tests/lib/DB/QueryBuilder/QuoteHelperTest.php @@ -31,7 +31,7 @@ class QuoteHelperTest extends \Test\TestCase { /** @var QuoteHelper */ protected $helper; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->helper = new QuoteHelper(); diff --git a/tests/lib/DB/SchemaDiffTest.php b/tests/lib/DB/SchemaDiffTest.php index 9b6a7699f64a..2826bc7236a0 100644 --- a/tests/lib/DB/SchemaDiffTest.php +++ b/tests/lib/DB/SchemaDiffTest.php @@ -48,7 +48,7 @@ class SchemaDiffTest extends TestCase { /** @var string */ private $testPrefix; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = \OC::$server->getConfig(); @@ -57,7 +57,7 @@ protected function setUp() { $this->testPrefix= \strtolower($this->getUniqueID($this->config->getSystemValue('dbtableprefix', 'oc_'), 3)); } - protected function tearDown() { + protected function tearDown(): void { $this->manager->removeDBStructure('static://test_db_scheme'); parent::tearDown(); } diff --git a/tests/lib/DB/SqliteMigrationTest.php b/tests/lib/DB/SqliteMigrationTest.php index cbea5c3418eb..1c383c33a8ee 100644 --- a/tests/lib/DB/SqliteMigrationTest.php +++ b/tests/lib/DB/SqliteMigrationTest.php @@ -21,7 +21,7 @@ class SqliteMigrationTest extends \Test\TestCase { /** @var string */ private $tableName; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -34,7 +34,7 @@ protected function setUp() { $this->connection->exec("CREATE TABLE $this->tableName(t0 tinyint unsigned, t1 tinyint)"); } - protected function tearDown() { + protected function tearDown(): void { $this->connection->getSchemaManager()->dropTable($this->tableName); parent::tearDown(); } diff --git a/tests/lib/DateTimeFormatterTest.php b/tests/lib/DateTimeFormatterTest.php index 38ff89e41908..169413bdc8e0 100644 --- a/tests/lib/DateTimeFormatterTest.php +++ b/tests/lib/DateTimeFormatterTest.php @@ -27,12 +27,12 @@ public static function setUpBeforeClass() { self::$oneYear = self::$oneDay * 365; } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { \date_default_timezone_set(self::$defaultTimeZone); parent::tearDownAfterClass(); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->formatter = new \OC\DateTimeFormatter(new \DateTimeZone('UTC'), \OC::$server->getL10NFactory()->get('lib', 'en')); } diff --git a/tests/lib/Diagnostics/EventLoggerTest.php b/tests/lib/Diagnostics/EventLoggerTest.php index b7f0b8344a79..a130c1842336 100644 --- a/tests/lib/Diagnostics/EventLoggerTest.php +++ b/tests/lib/Diagnostics/EventLoggerTest.php @@ -29,7 +29,7 @@ class EventLoggerTest extends TestCase { /** @var \OC\Diagnostics\EventLogger */ private $logger; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->logger = new EventLogger(); diff --git a/tests/lib/Diagnostics/QueryLoggerTest.php b/tests/lib/Diagnostics/QueryLoggerTest.php index 643f838e66db..fc492ccec59d 100644 --- a/tests/lib/Diagnostics/QueryLoggerTest.php +++ b/tests/lib/Diagnostics/QueryLoggerTest.php @@ -29,7 +29,7 @@ class QueryLoggerTest extends TestCase { /** @var \OC\Diagnostics\QueryLogger */ private $logger; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->logger = new QueryLogger(); diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php index 92def1ea630d..f6fd6b15dfe8 100644 --- a/tests/lib/Encryption/DecryptAllTest.php +++ b/tests/lib/Encryption/DecryptAllTest.php @@ -83,7 +83,7 @@ class DecryptAllTest extends TestCase { /** @var DecryptAll */ protected $instance; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->userManager = $this->getMockBuilder(IUserManager::class) diff --git a/tests/lib/Encryption/EncryptionWrapperTest.php b/tests/lib/Encryption/EncryptionWrapperTest.php index fd76d1df2a39..1204cb9f0ad4 100644 --- a/tests/lib/Encryption/EncryptionWrapperTest.php +++ b/tests/lib/Encryption/EncryptionWrapperTest.php @@ -38,7 +38,7 @@ class EncryptionWrapperTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject | \OC\Memcache\ArrayCache */ private $arrayCache; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->arrayCache = $this->createMock('OC\Memcache\ArrayCache'); diff --git a/tests/lib/Encryption/Keys/StorageTest.php b/tests/lib/Encryption/Keys/StorageTest.php index 571dd882528d..3cdde407759a 100644 --- a/tests/lib/Encryption/Keys/StorageTest.php +++ b/tests/lib/Encryption/Keys/StorageTest.php @@ -53,7 +53,7 @@ class StorageTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject */ protected $config; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->util = $this->getMockBuilder('OC\Encryption\Util') @@ -81,7 +81,7 @@ public function setUp() { $this->storage = new Storage($this->view, $this->util, $userSession); } - public function tearDown() { + public function tearDown(): void { \OC\Files\Filesystem::tearDown(); parent::tearDown(); } diff --git a/tests/lib/Encryption/ManagerTest.php b/tests/lib/Encryption/ManagerTest.php index 28d14c7f0e5a..c77bfd50b8ed 100644 --- a/tests/lib/Encryption/ManagerTest.php +++ b/tests/lib/Encryption/ManagerTest.php @@ -28,7 +28,7 @@ class ManagerTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\MockObject | \OC\Memcache\ArrayCache */ private $arrayCache; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock('\OCP\IConfig'); $this->logger = $this->createMock('\OCP\ILogger'); diff --git a/tests/lib/Encryption/UpdateTest.php b/tests/lib/Encryption/UpdateTest.php index 64bccc12ab27..412e0a41af0e 100644 --- a/tests/lib/Encryption/UpdateTest.php +++ b/tests/lib/Encryption/UpdateTest.php @@ -50,7 +50,7 @@ class UpdateTest extends TestCase { /** @var \OC\Encryption\File | \PHPUnit\Framework\MockObject\MockObject */ private $fileHelper; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->view = $this->getMockBuilder('\OC\Files\View') diff --git a/tests/lib/Encryption/UtilTest.php b/tests/lib/Encryption/UtilTest.php index c67ebfa587da..73adb6621e2d 100644 --- a/tests/lib/Encryption/UtilTest.php +++ b/tests/lib/Encryption/UtilTest.php @@ -29,7 +29,7 @@ class UtilTest extends TestCase { /** @var \OC\Encryption\Util */ private $util; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->view = $this->getMockBuilder('OC\Files\View') ->disableOriginalConstructor() diff --git a/tests/lib/Events/EventEmitterTraitTest.php b/tests/lib/Events/EventEmitterTraitTest.php index e8cce5668a05..8c96ddacaf56 100644 --- a/tests/lib/Events/EventEmitterTraitTest.php +++ b/tests/lib/Events/EventEmitterTraitTest.php @@ -20,8 +20,8 @@ */ class EventEmitterTraitTest extends TestCase { use EventEmitterTrait; - protected function setUp() { - return parent::setUp(); + protected function setUp(): void { + parent::setUp(); } public function dummyFunction() { diff --git a/tests/lib/Files/Cache/CacheTest.php b/tests/lib/Files/Cache/CacheTest.php index 06210c9140a9..69ca9543e653 100644 --- a/tests/lib/Files/Cache/CacheTest.php +++ b/tests/lib/Files/Cache/CacheTest.php @@ -672,7 +672,7 @@ public function testUpdateClearsCacheColumn() { $this->assertEmpty($entry['checksum']); } - protected function tearDown() { + protected function tearDown(): void { if ($this->cache) { $this->cache->clear(); } @@ -680,7 +680,7 @@ protected function tearDown() { parent::tearDown(); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->storage = new Temporary([]); diff --git a/tests/lib/Files/Cache/HomeCacheTest.php b/tests/lib/Files/Cache/HomeCacheTest.php index d93abc766735..3b94eb1557b3 100644 --- a/tests/lib/Files/Cache/HomeCacheTest.php +++ b/tests/lib/Files/Cache/HomeCacheTest.php @@ -66,7 +66,7 @@ class HomeCacheTest extends \Test\TestCase { */ private $user; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->user = new DummyUser('foo', \OC::$server->getTempManager()->getTemporaryFolder()); diff --git a/tests/lib/Files/Cache/MoveFromCacheTraitTest.php b/tests/lib/Files/Cache/MoveFromCacheTraitTest.php index 7f5d34a922eb..6e1430d146bd 100644 --- a/tests/lib/Files/Cache/MoveFromCacheTraitTest.php +++ b/tests/lib/Files/Cache/MoveFromCacheTraitTest.php @@ -20,7 +20,7 @@ class FallBackCrossCacheMoveCache extends \OC\Files\Cache\Cache { * @group DB */ class MoveFromCacheTraitTest extends CacheTest { - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->storage = new \OC\Files\Storage\Temporary([]); diff --git a/tests/lib/Files/Cache/PropagatorTest.php b/tests/lib/Files/Cache/PropagatorTest.php index 95870ab8cdec..97a40512fc9c 100644 --- a/tests/lib/Files/Cache/PropagatorTest.php +++ b/tests/lib/Files/Cache/PropagatorTest.php @@ -20,7 +20,7 @@ class PropagatorTest extends TestCase { /** @var IStorage */ private $storage; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->storage = new Temporary(); $this->storage->mkdir('foo/bar'); diff --git a/tests/lib/Files/Cache/ScannerTest.php b/tests/lib/Files/Cache/ScannerTest.php index 677e087e8a9b..26b35f59d743 100644 --- a/tests/lib/Files/Cache/ScannerTest.php +++ b/tests/lib/Files/Cache/ScannerTest.php @@ -37,7 +37,7 @@ class ScannerTest extends \Test\TestCase { */ private $cache; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->storage = new \OC\Files\Storage\Temporary([]); @@ -45,7 +45,7 @@ protected function setUp() { $this->cache = new \OC\Files\Cache\Cache($this->storage); } - protected function tearDown() { + protected function tearDown(): void { if ($this->cache) { $this->cache->clear(); } diff --git a/tests/lib/Files/Cache/UpdaterLegacyTest.php b/tests/lib/Files/Cache/UpdaterLegacyTest.php index 7bc71d7f49f7..9938438b1d86 100644 --- a/tests/lib/Files/Cache/UpdaterLegacyTest.php +++ b/tests/lib/Files/Cache/UpdaterLegacyTest.php @@ -36,7 +36,7 @@ class UpdaterLegacyTest extends \Test\TestCase { private static $user; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->storage = new \OC\Files\Storage\Temporary([]); @@ -67,7 +67,7 @@ protected function setUp() { \OC_Hook::clear('OC_Filesystem'); } - protected function tearDown() { + protected function tearDown(): void { if ($this->cache) { $this->cache->clear(); } diff --git a/tests/lib/Files/Cache/UpdaterTest.php b/tests/lib/Files/Cache/UpdaterTest.php index 907c968bd1bb..4c99b24d9d6c 100644 --- a/tests/lib/Files/Cache/UpdaterTest.php +++ b/tests/lib/Files/Cache/UpdaterTest.php @@ -39,7 +39,7 @@ class UpdaterTest extends \Test\TestCase { */ protected $updater; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->loginAsUser(); @@ -49,7 +49,7 @@ protected function setUp() { $this->cache = $this->storage->getCache(); } - protected function tearDown() { + protected function tearDown(): void { Filesystem::clearMounts(); $this->logout(); diff --git a/tests/lib/Files/Cache/WatcherTest.php b/tests/lib/Files/Cache/WatcherTest.php index f2738257791d..79e03763fcaa 100644 --- a/tests/lib/Files/Cache/WatcherTest.php +++ b/tests/lib/Files/Cache/WatcherTest.php @@ -22,13 +22,13 @@ class WatcherTest extends \Test\TestCase { */ private $storages = []; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->loginAsUser(); } - protected function tearDown() { + protected function tearDown(): void { foreach ($this->storages as $storage) { $cache = $storage->getCache(); $cache->clear(); diff --git a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php index 00e7e07fbaec..4eccd0baa88a 100644 --- a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php +++ b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php @@ -23,7 +23,7 @@ class CacheJailTest extends CacheTest { */ protected $sourceCache; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->storage->mkdir('foo'); $this->sourceCache = $this->cache; diff --git a/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php b/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php index ab0db9cfc393..959d556ba88f 100644 --- a/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php +++ b/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php @@ -24,7 +24,7 @@ class CachePermissionsMaskTest extends CacheTest { */ protected $sourceCache; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->storage->mkdir('foo'); $this->sourceCache = $this->cache; diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php index a7587c4a5016..5a4a90336993 100644 --- a/tests/lib/Files/Config/UserMountCacheTest.php +++ b/tests/lib/Files/Config/UserMountCacheTest.php @@ -48,7 +48,7 @@ class UserMountCacheTest extends TestCase { private $fileIds = []; - public function setUp() { + public function setUp(): void { $this->fileIds = []; $this->connection = \OC::$server->getDatabaseConnection(); $this->userSearch = $this->getMockBuilder(\OCP\Util\UserSearch::class) @@ -89,7 +89,7 @@ public function setUp() { $this->userManager->listen('\OC\User', 'postDelete', [$this->cache, 'removeUserMounts']); } - public function tearDown() { + public function tearDown(): void { $builder = $this->connection->getQueryBuilder(); $builder->delete('mounts')->execute(); diff --git a/tests/lib/Files/EtagTest.php b/tests/lib/Files/EtagTest.php index 2ffc340f3cb4..4aa23aa1a22f 100644 --- a/tests/lib/Files/EtagTest.php +++ b/tests/lib/Files/EtagTest.php @@ -26,7 +26,7 @@ class EtagTest extends \Test\TestCase { private $tmpDir; - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OC_Hook::clear('OC_Filesystem', 'setup'); @@ -39,7 +39,7 @@ protected function setUp() { $config->setSystemValue('datadirectory', $this->tmpDir); } - protected function tearDown() { + protected function tearDown(): void { \OC::$server->getConfig()->setSystemValue('datadirectory', $this->datadir); $this->logout(); diff --git a/tests/lib/Files/External/Auth/Password/SessionCredentialsTest.php b/tests/lib/Files/External/Auth/Password/SessionCredentialsTest.php index 2e35f70248e9..650d5fd74a1a 100644 --- a/tests/lib/Files/External/Auth/Password/SessionCredentialsTest.php +++ b/tests/lib/Files/External/Auth/Password/SessionCredentialsTest.php @@ -38,7 +38,7 @@ class SessionCredentialsTest extends \Test\TestCase { /** @var ICrypto | \PHPUnit\Framework\MockObject\MockObject */ private $crypto; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->session = $this->createMock(ISession::class); $this->crypto = $this->createMock(ICrypto::class); @@ -48,7 +48,7 @@ public function setUp() { ); } - public function tearDown() { + public function tearDown(): void { \OC_Hook::clear('OC_User', 'post_login'); parent::tearDown(); } diff --git a/tests/lib/Files/External/ConfigAdapterTest.php b/tests/lib/Files/External/ConfigAdapterTest.php index 8006cab83013..fc3fc50ea213 100644 --- a/tests/lib/Files/External/ConfigAdapterTest.php +++ b/tests/lib/Files/External/ConfigAdapterTest.php @@ -54,7 +54,7 @@ class ConfigAdapterTest extends \Test\TestCase { /** @var int */ private $configId; - protected function setUp() { + protected function setUp(): void { $this->config = $this->createMock(IConfig::class); $this->userStoragesService = $this->createMock(UserStoragesService::class); $this->userGlobalStoragesService = $this->createMock(UserGlobalStoragesService::class); diff --git a/tests/lib/Files/External/Service/DBConfigServiceTest.php b/tests/lib/Files/External/Service/DBConfigServiceTest.php index 4408b2c3ab6d..96888e04531a 100644 --- a/tests/lib/Files/External/Service/DBConfigServiceTest.php +++ b/tests/lib/Files/External/Service/DBConfigServiceTest.php @@ -42,13 +42,13 @@ class DBConfigServiceTest extends TestCase { private $mounts = []; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); $this->dbConfig = new DBConfigService($this->connection, \OC::$server->getCrypto()); } - public function tearDown() { + public function tearDown(): void { foreach ($this->mounts as $mount) { $this->dbConfig->removeMount($mount); } diff --git a/tests/lib/Files/External/Service/GlobalStoragesServiceDeleteUserTest.php b/tests/lib/Files/External/Service/GlobalStoragesServiceDeleteUserTest.php index 89c6912a708d..edbe59f5c641 100644 --- a/tests/lib/Files/External/Service/GlobalStoragesServiceDeleteUserTest.php +++ b/tests/lib/Files/External/Service/GlobalStoragesServiceDeleteUserTest.php @@ -35,11 +35,11 @@ * @package Test\Files\External\Service */ class GlobalStoragesServiceDeleteUserTest extends TestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); //Remove all global storages created diff --git a/tests/lib/Files/External/Service/GlobalStoragesServiceTest.php b/tests/lib/Files/External/Service/GlobalStoragesServiceTest.php index 43720082648e..b4f3aacb5235 100644 --- a/tests/lib/Files/External/Service/GlobalStoragesServiceTest.php +++ b/tests/lib/Files/External/Service/GlobalStoragesServiceTest.php @@ -31,12 +31,12 @@ * @group DB */ class GlobalStoragesServiceTest extends StoragesServiceTest { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->service = new GlobalStoragesService($this->backendService, $this->dbConfig, $this->mountCache); } - public function tearDown() { + public function tearDown(): void { @\unlink($this->dataDir . '/mount.json'); parent::tearDown(); } diff --git a/tests/lib/Files/External/Service/StoragesServiceTest.php b/tests/lib/Files/External/Service/StoragesServiceTest.php index 958172c4772b..a3e13e70af6c 100644 --- a/tests/lib/Files/External/Service/StoragesServiceTest.php +++ b/tests/lib/Files/External/Service/StoragesServiceTest.php @@ -74,7 +74,7 @@ abstract class StoragesServiceTest extends TestCase { */ protected $backends; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->dbConfig = new CleaningDBConfig(\OC::$server->getDatabaseConnection(), \OC::$server->getCrypto()); self::$hookCalls = []; @@ -152,7 +152,7 @@ public function setUp() { })); } - public function tearDown() { + public function tearDown(): void { self::$hookCalls = []; if ($this->dbConfig) { $this->dbConfig->clean(); diff --git a/tests/lib/Files/External/Service/UserGlobalStoragesServiceTest.php b/tests/lib/Files/External/Service/UserGlobalStoragesServiceTest.php index 5ad8f1686322..3c3258ed354c 100644 --- a/tests/lib/Files/External/Service/UserGlobalStoragesServiceTest.php +++ b/tests/lib/Files/External/Service/UserGlobalStoragesServiceTest.php @@ -56,7 +56,7 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { const GROUP_ID = 'test_group'; const GROUP_ID2 = 'test_group2'; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->globalStoragesService = $this->service; diff --git a/tests/lib/Files/External/Service/UserStoragesServiceTest.php b/tests/lib/Files/External/Service/UserStoragesServiceTest.php index d6ad5e11659a..03c16f49c3e5 100644 --- a/tests/lib/Files/External/Service/UserStoragesServiceTest.php +++ b/tests/lib/Files/External/Service/UserStoragesServiceTest.php @@ -50,7 +50,7 @@ class UserStoragesServiceTest extends StoragesServiceTest { */ protected $globalStoragesService; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->globalStoragesService = new GlobalStoragesService($this->backendService, $this->dbConfig, $this->mountCache); diff --git a/tests/lib/Files/External/StoragesBackendServiceTest.php b/tests/lib/Files/External/StoragesBackendServiceTest.php index b1765d858eb6..087f454e1e3f 100644 --- a/tests/lib/Files/External/StoragesBackendServiceTest.php +++ b/tests/lib/Files/External/StoragesBackendServiceTest.php @@ -28,7 +28,7 @@ class StoragesBackendServiceTest extends \Test\TestCase { /** @var \OCP\IConfig */ protected $config; - protected function setUp() { + protected function setUp(): void { $this->config = $this->createMock('\OCP\IConfig'); } diff --git a/tests/lib/Files/FilesystemTest.php b/tests/lib/Files/FilesystemTest.php index ca22344d071f..8adf1140708c 100644 --- a/tests/lib/Files/FilesystemTest.php +++ b/tests/lib/Files/FilesystemTest.php @@ -82,14 +82,14 @@ private function getStorageData() { return ['datadir' => $dir]; } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->createUser(self::TEST_FILESYSTEM_USER1, self::TEST_FILESYSTEM_USER1); $this->createUser(self::TEST_FILESYSTEM_USER2, self::TEST_FILESYSTEM_USER2); $this->loginAsUser(); } - protected function tearDown() { + protected function tearDown(): void { foreach ($this->tmpDirs as $dir) { \OC_Helper::rmdirr($dir); } diff --git a/tests/lib/Files/MetaFilesTest.php b/tests/lib/Files/MetaFilesTest.php index 9db1638234dd..c65b57f87149 100644 --- a/tests/lib/Files/MetaFilesTest.php +++ b/tests/lib/Files/MetaFilesTest.php @@ -48,7 +48,7 @@ class MetaFilesTest extends TestCase { */ private $userId; - protected function setUp() { + protected function setUp(): void { parent::setUp(); // workaround: re-setup versions hooks @@ -59,7 +59,7 @@ protected function setUp() { $this->loginAsUser($this->userId); } - protected function tearDown() { + protected function tearDown(): void { self::logout(); parent::tearDown(); } diff --git a/tests/lib/Files/MetaVersionCollectionTest.php b/tests/lib/Files/MetaVersionCollectionTest.php index 60164286b693..47dc1f6d18a9 100644 --- a/tests/lib/Files/MetaVersionCollectionTest.php +++ b/tests/lib/Files/MetaVersionCollectionTest.php @@ -56,7 +56,7 @@ class MetaVersionCollectionTest extends TestCase { */ private $storage; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->rootFolder = $this->createMock(IRootFolder::class); @@ -66,7 +66,7 @@ protected function setUp() { $this->collection = new MetaVersionCollection($this->rootFolder, $this->node); } - protected function tearDown() { + protected function tearDown(): void { parent::tearDown(); } diff --git a/tests/lib/Files/Mount/CacheMountProviderTest.php b/tests/lib/Files/Mount/CacheMountProviderTest.php index e3eb2c728b7f..7b5d988ce637 100644 --- a/tests/lib/Files/Mount/CacheMountProviderTest.php +++ b/tests/lib/Files/Mount/CacheMountProviderTest.php @@ -41,7 +41,7 @@ class CacheMountProviderTest extends \Test\TestCase { /** @var IStorageFactory|\PHPUnit\Framework\MockObject\MockObject */ protected $loader; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); diff --git a/tests/lib/Files/Mount/ManagerTest.php b/tests/lib/Files/Mount/ManagerTest.php index 77a0c67d1ac7..1c579c24d3c2 100644 --- a/tests/lib/Files/Mount/ManagerTest.php +++ b/tests/lib/Files/Mount/ManagerTest.php @@ -22,7 +22,7 @@ class ManagerTest extends \Test\TestCase { */ private $manager; - protected function setup() { + protected function setUp(): void { parent::setUp(); $this->manager = new \OC\Files\Mount\Manager(); } diff --git a/tests/lib/Files/Mount/ObjectHomeMountProviderTest.php b/tests/lib/Files/Mount/ObjectHomeMountProviderTest.php index 9e60e5456e0c..316c95dd6690 100644 --- a/tests/lib/Files/Mount/ObjectHomeMountProviderTest.php +++ b/tests/lib/Files/Mount/ObjectHomeMountProviderTest.php @@ -21,7 +21,7 @@ class ObjectHomeMountProviderTest extends \Test\TestCase { /** @var IStorageFactory|\PHPUnit\Framework\MockObject\MockObject */ protected $loader; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock('OCP\IConfig'); diff --git a/tests/lib/Files/Mount/PreviewsMountProviderTest.php b/tests/lib/Files/Mount/PreviewsMountProviderTest.php index aaf074b646d7..9788598cea64 100644 --- a/tests/lib/Files/Mount/PreviewsMountProviderTest.php +++ b/tests/lib/Files/Mount/PreviewsMountProviderTest.php @@ -41,7 +41,7 @@ class PreviewsMountProviderTest extends \Test\TestCase { /** @var IStorageFactory|\PHPUnit\Framework\MockObject\MockObject */ protected $loader; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); diff --git a/tests/lib/Files/Node/HookConnectorTest.php b/tests/lib/Files/Node/HookConnectorTest.php index 7245dd375935..886cf98e1a94 100644 --- a/tests/lib/Files/Node/HookConnectorTest.php +++ b/tests/lib/Files/Node/HookConnectorTest.php @@ -43,7 +43,7 @@ class HookConnectorTest extends TestCase { */ private $userId; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->userId = $this->getUniqueID(); $this->createUser($this->userId, 'pass'); @@ -53,7 +53,7 @@ public function setUp() { $this->root = new Root(Filesystem::getMountManager(), $this->view, \OC::$server->getUserManager()->get($this->userId)); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); \OC_Hook::clear('OC_Filesystem'); \OC_Util::tearDownFS(); diff --git a/tests/lib/Files/Node/IntegrationTest.php b/tests/lib/Files/Node/IntegrationTest.php index da73e96ffe72..d2209ebdd4de 100644 --- a/tests/lib/Files/Node/IntegrationTest.php +++ b/tests/lib/Files/Node/IntegrationTest.php @@ -40,7 +40,7 @@ class IntegrationTest extends TestCase { */ private $view; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $manager = Filesystem::getMountManager(); @@ -60,7 +60,7 @@ protected function setUp() { $this->root->mount($subStorage, '/substorage/'); } - protected function tearDown() { + protected function tearDown(): void { parent::tearDown(); foreach ($this->storages as $storage) { $storage->getCache()->clear(); diff --git a/tests/lib/Files/Node/NodeTest.php b/tests/lib/Files/Node/NodeTest.php index 35eb3752ea2f..843201ba4948 100644 --- a/tests/lib/Files/Node/NodeTest.php +++ b/tests/lib/Files/Node/NodeTest.php @@ -28,7 +28,7 @@ abstract class NodeTest extends TestCase { protected $viewDeleteMethod = 'unlink'; protected $user; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->user = $this->createMock(IUser::class); } diff --git a/tests/lib/Files/Node/RootTest.php b/tests/lib/Files/Node/RootTest.php index 340ad875ff05..d92616d7b9b8 100644 --- a/tests/lib/Files/Node/RootTest.php +++ b/tests/lib/Files/Node/RootTest.php @@ -22,7 +22,7 @@ class RootTest extends TestCase { private $user; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->user = $this->createMock(IUser::class); } diff --git a/tests/lib/Files/ObjectStore/NoopScannerTest.php b/tests/lib/Files/ObjectStore/NoopScannerTest.php index e496a999da87..fbca38b2a785 100644 --- a/tests/lib/Files/ObjectStore/NoopScannerTest.php +++ b/tests/lib/Files/ObjectStore/NoopScannerTest.php @@ -18,7 +18,7 @@ class NoopScannerTest extends \Test\TestCase { /** @var \OC\Files\ObjectStore\NoopScanner $scanner */ private $scanner; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->storage = new \OC\Files\Storage\Temporary([]); diff --git a/tests/lib/Files/ObjectStore/ObjectStoreTest.php b/tests/lib/Files/ObjectStore/ObjectStoreTest.php index 92bbe27524cb..c7655bba3636 100644 --- a/tests/lib/Files/ObjectStore/ObjectStoreTest.php +++ b/tests/lib/Files/ObjectStore/ObjectStoreTest.php @@ -44,7 +44,7 @@ class ObjectStoreTest extends TestCase { /** @var ObjectStoreStorage | \PHPUnit\Framework\MockObject\MockObject */ private $objectStore; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->impl = $this->createMock([IObjectStore::class, IVersionedObjectStorage::class]); $this->impl->expects($this->any()) diff --git a/tests/lib/Files/PathVerificationTest.php b/tests/lib/Files/PathVerificationTest.php index 6fa8b9041ba2..950a22b06855 100644 --- a/tests/lib/Files/PathVerificationTest.php +++ b/tests/lib/Files/PathVerificationTest.php @@ -25,7 +25,7 @@ class PathVerificationTest extends \Test\TestCase { */ private $view; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->view = new View(); } diff --git a/tests/lib/Files/Storage/CommonTest.php b/tests/lib/Files/Storage/CommonTest.php index 8f6595c28ce6..ac90de1fd996 100644 --- a/tests/lib/Files/Storage/CommonTest.php +++ b/tests/lib/Files/Storage/CommonTest.php @@ -34,14 +34,14 @@ class CommonTest extends Storage { * @var string tmpDir */ private $tmpDir; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); $this->instance=new \OC\Files\Storage\CommonTest(['datadir'=>$this->tmpDir]); } - protected function tearDown() { + protected function tearDown(): void { \OC_Helper::rmdirr($this->tmpDir); parent::tearDown(); } diff --git a/tests/lib/Files/Storage/CopyDirectoryTest.php b/tests/lib/Files/Storage/CopyDirectoryTest.php index 6bee7d0788c4..53f0f83aa8b7 100644 --- a/tests/lib/Files/Storage/CopyDirectoryTest.php +++ b/tests/lib/Files/Storage/CopyDirectoryTest.php @@ -44,7 +44,7 @@ class CopyDirectoryStorage extends StorageNoRecursiveCopy { * @package Test\Files\Storage */ class CopyDirectoryTest extends Storage { - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->instance = new CopyDirectoryStorage([]); } diff --git a/tests/lib/Files/Storage/DavTest.php b/tests/lib/Files/Storage/DavTest.php index 6a153dde1a06..8f2fe0b99a14 100644 --- a/tests/lib/Files/Storage/DavTest.php +++ b/tests/lib/Files/Storage/DavTest.php @@ -84,7 +84,7 @@ class DavTest extends TestCase { */ private $cache; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->httpClientService = $this->createMock(IClientService::class); @@ -117,7 +117,7 @@ protected function setUp() { $this->instance->method('getCache')->willReturn($this->cache); } - protected function tearDown() { + protected function tearDown(): void { $this->restoreService('HttpClientService'); $this->restoreService('WebDavClientService'); $this->restoreService('TimeFactory'); diff --git a/tests/lib/Files/Storage/HomeTest.php b/tests/lib/Files/Storage/HomeTest.php index 29139ebf6ba1..9b163e84cbbb 100644 --- a/tests/lib/Files/Storage/HomeTest.php +++ b/tests/lib/Files/Storage/HomeTest.php @@ -67,7 +67,7 @@ class HomeTest extends Storage { */ private $user; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); @@ -76,7 +76,7 @@ protected function setUp() { $this->instance = new \OC\Files\Storage\Home(['user' => $this->user]); } - protected function tearDown() { + protected function tearDown(): void { \OC_Helper::rmdirr($this->tmpDir); parent::tearDown(); } diff --git a/tests/lib/Files/Storage/LocalTest.php b/tests/lib/Files/Storage/LocalTest.php index 0dd3b48cd8f7..a9af8d261c9d 100644 --- a/tests/lib/Files/Storage/LocalTest.php +++ b/tests/lib/Files/Storage/LocalTest.php @@ -41,14 +41,14 @@ class LocalTest extends Storage { /** @var Local */ protected $instance; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); $this->instance = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir]); } - protected function tearDown() { + protected function tearDown(): void { \OC_Helper::rmdirr($this->tmpDir); parent::tearDown(); } diff --git a/tests/lib/Files/Storage/LockingTests.php b/tests/lib/Files/Storage/LockingTests.php index 8c43ae2bad70..9be4424c627f 100644 --- a/tests/lib/Files/Storage/LockingTests.php +++ b/tests/lib/Files/Storage/LockingTests.php @@ -40,7 +40,7 @@ class LockingTests extends TestCase { /** @var int */ private $fileId; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $user = $this->createUser('locking-user'); @@ -55,7 +55,7 @@ protected function setUp() { list($this->storage, ) = $this->view->resolvePath('foo/bar.txt'); } - protected function tearDown() { + protected function tearDown(): void { if ($this->storage) { $this->storage->unlockNodePersistent('files/foo/bar.txt', [ 'token' => '123-456-789' diff --git a/tests/lib/Files/Storage/NodeTest.php b/tests/lib/Files/Storage/NodeTest.php index ca176e905572..0fddbc7c6178 100644 --- a/tests/lib/Files/Storage/NodeTest.php +++ b/tests/lib/Files/Storage/NodeTest.php @@ -39,7 +39,7 @@ abstract class NodeTest extends TestCase { */ protected $storage; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->storage = $this->createMock(IStorage::class); $this->storage->expects($this->any()) diff --git a/tests/lib/Files/Storage/Wrapper/ChecksumTest.php b/tests/lib/Files/Storage/Wrapper/ChecksumTest.php index 8be0ff08bd19..85e758d97db2 100644 --- a/tests/lib/Files/Storage/Wrapper/ChecksumTest.php +++ b/tests/lib/Files/Storage/Wrapper/ChecksumTest.php @@ -41,7 +41,7 @@ class ChecksumTest extends \Test\TestCase { const TEST_DATA = 'somedata'; const EXPECTED_CHECKSUMS = 'SHA1:efaa311ae448a7374c122061bfed952d940e9e37 MD5:aefaf7502d52994c3b01957636a3cdd2 ADLER32:0f2c034f'; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->sourceStorage = new \OC\Files\Storage\Temporary([]); $this->instance = new \OC\Files\Storage\Wrapper\Checksum([ diff --git a/tests/lib/Files/Storage/Wrapper/DirMaskTest.php b/tests/lib/Files/Storage/Wrapper/DirMaskTest.php index 1ee57cb0d9a4..4d5e527a3fed 100644 --- a/tests/lib/Files/Storage/Wrapper/DirMaskTest.php +++ b/tests/lib/Files/Storage/Wrapper/DirMaskTest.php @@ -49,7 +49,7 @@ private function getStorage($mask) { ); } - public function setUp() { + public function setUp(): void { parent::setUp(); $this->sourceStorage = new Temporary([]); } diff --git a/tests/lib/Files/Storage/Wrapper/EncodingTest.php b/tests/lib/Files/Storage/Wrapper/EncodingTest.php index 3f138693fc64..fc8503f3dc34 100644 --- a/tests/lib/Files/Storage/Wrapper/EncodingTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncodingTest.php @@ -17,7 +17,7 @@ class EncodingTest extends \Test\Files\Storage\Storage { */ private $sourceStorage; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->sourceStorage = new \OC\Files\Storage\Temporary([]); $this->instance = new \OC\Files\Storage\Wrapper\Encoding([ @@ -25,7 +25,7 @@ public function setUp() { ]); } - public function tearDown() { + public function tearDown(): void { $this->sourceStorage->cleanUp(); parent::tearDown(); } diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php index 772bb425829d..b6667efd435d 100644 --- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php @@ -104,7 +104,7 @@ class EncryptionTest extends Storage { /** @var integer dummy unencrypted size */ private $dummySize = -1; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $mockModule = $this->buildMockModule(); diff --git a/tests/lib/Files/Storage/Wrapper/JailTest.php b/tests/lib/Files/Storage/Wrapper/JailTest.php index 1b8f708155a5..d1cca4db1529 100644 --- a/tests/lib/Files/Storage/Wrapper/JailTest.php +++ b/tests/lib/Files/Storage/Wrapper/JailTest.php @@ -18,7 +18,7 @@ class JailTest extends \Test\Files\Storage\Storage { */ private $sourceStorage; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->sourceStorage = new \OC\Files\Storage\Temporary([]); $this->sourceStorage->mkdir('foo'); @@ -28,7 +28,7 @@ public function setUp() { ]); } - public function tearDown() { + public function tearDown(): void { // test that nothing outside our jail is touched $contents = []; $dh = $this->sourceStorage->opendir(''); diff --git a/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php b/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php index ea2724a8f0b5..ae409cc88f69 100644 --- a/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php +++ b/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php @@ -17,13 +17,13 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage { */ private $sourceStorage; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->sourceStorage = new \OC\Files\Storage\Temporary([]); $this->instance = $this->getMaskedStorage(Constants::PERMISSION_ALL); } - public function tearDown() { + public function tearDown(): void { $this->sourceStorage->cleanUp(); parent::tearDown(); } diff --git a/tests/lib/Files/Storage/Wrapper/QuotaTest.php b/tests/lib/Files/Storage/Wrapper/QuotaTest.php index 2efb329a4b27..e9bd4252fc05 100644 --- a/tests/lib/Files/Storage/Wrapper/QuotaTest.php +++ b/tests/lib/Files/Storage/Wrapper/QuotaTest.php @@ -27,7 +27,7 @@ class QuotaTest extends \Test\Files\Storage\Storage { */ private $tmpDir; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); @@ -35,7 +35,7 @@ protected function setUp() { $this->instance = new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => 10000000]); } - protected function tearDown() { + protected function tearDown(): void { \OC_Helper::rmdirr($this->tmpDir); parent::tearDown(); } diff --git a/tests/lib/Files/Storage/Wrapper/ReadOnlyJailTest.php b/tests/lib/Files/Storage/Wrapper/ReadOnlyJailTest.php index 686c3d135d0a..defd689e3a74 100644 --- a/tests/lib/Files/Storage/Wrapper/ReadOnlyJailTest.php +++ b/tests/lib/Files/Storage/Wrapper/ReadOnlyJailTest.php @@ -14,7 +14,7 @@ class ReadOnlyJailTest extends TestCase { /** @var Temporary */ private $sourceStorage; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->sourceStorage = new Temporary([]); diff --git a/tests/lib/Files/Storage/Wrapper/WrapperTest.php b/tests/lib/Files/Storage/Wrapper/WrapperTest.php index eaf827a0f88f..09153e822765 100644 --- a/tests/lib/Files/Storage/Wrapper/WrapperTest.php +++ b/tests/lib/Files/Storage/Wrapper/WrapperTest.php @@ -23,7 +23,7 @@ class WrapperTest extends Storage { */ private $tmpDir; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); @@ -31,7 +31,7 @@ protected function setUp() { $this->instance = new Wrapper(['storage' => $storage]); } - protected function tearDown() { + protected function tearDown(): void { \OC_Helper::rmdirr($this->tmpDir); parent::tearDown(); } diff --git a/tests/lib/Files/Stream/QuotaTest.php b/tests/lib/Files/Stream/QuotaTest.php index 7d34e5d9378d..a9b41db11155 100644 --- a/tests/lib/Files/Stream/QuotaTest.php +++ b/tests/lib/Files/Stream/QuotaTest.php @@ -9,7 +9,7 @@ namespace Test\Files\Stream; class QuotaTest extends \Test\TestCase { - protected function tearDown() { + protected function tearDown(): void { \OC\Files\Stream\Quota::clear(); parent::tearDown(); } diff --git a/tests/lib/Files/Stream/StaticStreamTest.php b/tests/lib/Files/Stream/StaticStreamTest.php index e9156da085c5..32e460b128fd 100644 --- a/tests/lib/Files/Stream/StaticStreamTest.php +++ b/tests/lib/Files/Stream/StaticStreamTest.php @@ -12,13 +12,13 @@ class StaticStreamTest extends \Test\TestCase { private $sourceFile; private $sourceText; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->sourceFile = \OC::$SERVERROOT . '/tests/data/lorem.txt'; $this->sourceText = \file_get_contents($this->sourceFile); } - protected function tearDown() { + protected function tearDown(): void { \OC\Files\Stream\StaticStream::clear(); parent::tearDown(); } diff --git a/tests/lib/Files/Type/DetectionTest.php b/tests/lib/Files/Type/DetectionTest.php index 8938f4ada02e..8dcd0f0d2c5d 100644 --- a/tests/lib/Files/Type/DetectionTest.php +++ b/tests/lib/Files/Type/DetectionTest.php @@ -28,7 +28,7 @@ class DetectionTest extends \Test\TestCase { /** @var Detection */ private $detection; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->detection = new Detection( \OC::$server->getURLGenerator(), diff --git a/tests/lib/Files/Type/LoaderTest.php b/tests/lib/Files/Type/LoaderTest.php index c6ce22244250..dbe849913e44 100644 --- a/tests/lib/Files/Type/LoaderTest.php +++ b/tests/lib/Files/Type/LoaderTest.php @@ -30,12 +30,12 @@ class LoaderTest extends \Test\TestCase { /** @var Loader */ protected $loader; - protected function setUp() { + protected function setUp(): void { $this->db = \OC::$server->getDatabaseConnection(); $this->loader = new Loader($this->db); } - protected function tearDown() { + protected function tearDown(): void { $deleteMimetypes = $this->db->getQueryBuilder(); $deleteMimetypes->delete('mimetypes') ->where($deleteMimetypes->expr()->like( diff --git a/tests/lib/Files/Utils/ScannerTest.php b/tests/lib/Files/Utils/ScannerTest.php index 8706a84ad795..e8cfc39c47c2 100644 --- a/tests/lib/Files/Utils/ScannerTest.php +++ b/tests/lib/Files/Utils/ScannerTest.php @@ -46,13 +46,13 @@ protected function getMounts($dir) { class ScannerTest extends \Test\TestCase { use UserTrait; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->loginAsUser(); } - protected function tearDown() { + protected function tearDown(): void { $this->logout(); parent::tearDown(); } diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index cd08b971fba5..29a8aac806e8 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -80,7 +80,7 @@ class ViewTest extends TestCase { /** @var \OC\Files\Storage\Storage */ private $tempStorage; - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OC_Hook::clear(); @@ -106,7 +106,7 @@ protected function setUp() { $this->tempStorage = null; } - protected function tearDown() { + protected function tearDown(): void { \OC_User::setUserId($this->user); foreach ($this->storages as $storage) { $cache = $storage->getCache(); diff --git a/tests/lib/Group/DatabaseTest.php b/tests/lib/Group/DatabaseTest.php index b04efe6ee5b6..b582211ba650 100644 --- a/tests/lib/Group/DatabaseTest.php +++ b/tests/lib/Group/DatabaseTest.php @@ -45,12 +45,12 @@ public function getGroupName($name = null) { return $name; } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->backend = new \OC\Group\Database(); } - protected function tearDown() { + protected function tearDown(): void { foreach ($this->groups as $group) { $this->backend->deleteGroup($group); } diff --git a/tests/lib/Group/Dummy.php b/tests/lib/Group/Dummy.php index 830e33220727..66a8cdb84a9c 100644 --- a/tests/lib/Group/Dummy.php +++ b/tests/lib/Group/Dummy.php @@ -28,7 +28,7 @@ * @group DB */ class Dummy extends Backend { - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->backend=new \Test\Util\Group\Dummy(); } diff --git a/tests/lib/Group/ManagerTest.php b/tests/lib/Group/ManagerTest.php index bb715eef15ba..f33333111af2 100644 --- a/tests/lib/Group/ManagerTest.php +++ b/tests/lib/Group/ManagerTest.php @@ -49,7 +49,7 @@ class ManagerTest extends \Test\TestCase { /** @var \OC\Group\Manager */ protected $manager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->userSearch = $this->getMockBuilder(UserSearch::class) ->disableOriginalConstructor() diff --git a/tests/lib/HTTPHelperTest.php b/tests/lib/HTTPHelperTest.php index b430478cc162..aa2beb312244 100644 --- a/tests/lib/HTTPHelperTest.php +++ b/tests/lib/HTTPHelperTest.php @@ -17,7 +17,7 @@ class HTTPHelperTest extends \Test\TestCase { /** @var \OCP\Http\Client\IClientService */ private $clientService; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder('\OCP\IConfig') diff --git a/tests/lib/Helper/EnvironmentHelperTest.php b/tests/lib/Helper/EnvironmentHelperTest.php index b20dc0e07216..7380673c8c30 100644 --- a/tests/lib/Helper/EnvironmentHelperTest.php +++ b/tests/lib/Helper/EnvironmentHelperTest.php @@ -27,7 +27,7 @@ class EnvironmentHelperTest extends TestCase { private $environmentHelper; - public function setUp() { + public function setUp(): void { $this->environmentHelper = new EnvironmentHelper(); parent::setUp(); } diff --git a/tests/lib/Helper/LocaleHelperTest.php b/tests/lib/Helper/LocaleHelperTest.php index 8ac067d6e70f..1e0d89c8eef1 100644 --- a/tests/lib/Helper/LocaleHelperTest.php +++ b/tests/lib/Helper/LocaleHelperTest.php @@ -37,7 +37,7 @@ class LocaleHelperTest extends TestCase { */ protected $localeHelper; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->localeHelper = new LocaleHelper(); } diff --git a/tests/lib/HelperStorageTest.php b/tests/lib/HelperStorageTest.php index 1e931f7da465..fce4805747b0 100644 --- a/tests/lib/HelperStorageTest.php +++ b/tests/lib/HelperStorageTest.php @@ -26,7 +26,7 @@ class HelperStorageTest extends TestCase { /** @var IUser */ private $userObj; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->user = $this->getUniqueID('user_'); @@ -41,7 +41,7 @@ protected function setUp() { $this->storageMock = null; } - protected function tearDown() { + protected function tearDown(): void { if ($this->storageMock) { $this->storageMock->getCache()->clear(); $this->storageMock = null; diff --git a/tests/lib/Hooks/BasicEmitterTest.php b/tests/lib/Hooks/BasicEmitterTest.php index 886fe4d52e5a..86fce1b241ef 100644 --- a/tests/lib/Hooks/BasicEmitterTest.php +++ b/tests/lib/Hooks/BasicEmitterTest.php @@ -37,7 +37,7 @@ class BasicEmitterTest extends \Test\TestCase { */ protected $emitter; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->emitter = new DummyEmitter(); } diff --git a/tests/lib/Hooks/LegacyEmitterTest.php b/tests/lib/Hooks/LegacyEmitterTest.php index ad69dde93693..8be901659926 100644 --- a/tests/lib/Hooks/LegacyEmitterTest.php +++ b/tests/lib/Hooks/LegacyEmitterTest.php @@ -26,7 +26,7 @@ class LegacyEmitterTest extends BasicEmitterTest { //we can't use exceptions here since OC_Hooks catches all exceptions private static $emitted = false; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->emitter = new DummyLegacyEmitter(); diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php index 83eeee64220f..925b3e1e5921 100644 --- a/tests/lib/Http/Client/ClientTest.php +++ b/tests/lib/Http/Client/ClientTest.php @@ -23,7 +23,7 @@ class ClientTest extends \Test\TestCase { /** @var IConfig */ private $config; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock('\OCP\IConfig'); $this->guzzleClient = $this->getMockBuilder('\GuzzleHttp\Client') diff --git a/tests/lib/Http/Client/ResponseTest.php b/tests/lib/Http/Client/ResponseTest.php index ba448a326bb0..5973a8e573bb 100644 --- a/tests/lib/Http/Client/ResponseTest.php +++ b/tests/lib/Http/Client/ResponseTest.php @@ -20,7 +20,7 @@ class ResponseTest extends \Test\TestCase { /** @var GuzzleResponse */ private $guzzleResponse; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->guzzleResponse = new GuzzleResponse(1337); $this->response = new Response($this->guzzleResponse); diff --git a/tests/lib/Http/Client/WebDavClientServiceTest.php b/tests/lib/Http/Client/WebDavClientServiceTest.php index 1a7c97695e48..c837aeac6ab9 100644 --- a/tests/lib/Http/Client/WebDavClientServiceTest.php +++ b/tests/lib/Http/Client/WebDavClientServiceTest.php @@ -36,12 +36,12 @@ class WebDavClientServiceTest extends \Test\TestCase { */ private $tempManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->tempManager = \OC::$server->getTempManager(); } - public function tearDown() { + public function tearDown(): void { $this->tempManager->clean(); parent::tearDown(); } diff --git a/tests/lib/ImageTest.php b/tests/lib/ImageTest.php index 245128332ab1..9339a735cdee 100644 --- a/tests/lib/ImageTest.php +++ b/tests/lib/ImageTest.php @@ -11,7 +11,7 @@ use OC; class ImageTest extends \Test\TestCase { - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { @\unlink(OC::$SERVERROOT.'/tests/data/testimage2.png'); @\unlink(OC::$SERVERROOT.'/tests/data/testimage2.jpg'); diff --git a/tests/lib/InstallerTest.php b/tests/lib/InstallerTest.php index ebaa4ec9e1fe..c173997ceb8b 100644 --- a/tests/lib/InstallerTest.php +++ b/tests/lib/InstallerTest.php @@ -13,14 +13,14 @@ class InstallerTest extends TestCase { private static $appid = 'testapp'; - protected function setUp() { + protected function setUp(): void { parent::setUp(); Installer::removeApp(self::$appid); \OC::$server->getConfig()->deleteAppValues(self::$appid); } - protected function tearDown() { + protected function tearDown(): void { Installer::removeApp(self::$appid); \OC::$server->getConfig()->deleteAppValues(self::$appid); parent::tearDown(); diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php index a5604cad2f08..afbb88117a45 100644 --- a/tests/lib/IntegrityCheck/CheckerTest.php +++ b/tests/lib/IntegrityCheck/CheckerTest.php @@ -59,7 +59,7 @@ class CheckerTest extends TestCase { /** @var IAppManager | \PHPUnit\Framework\MockObject\MockObject */ private $appManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->environmentHelper = $this->createMock(EnvironmentHelper::class); $this->fileAccessHelper = $this->createMock(FileAccessHelper::class); diff --git a/tests/lib/IntegrityCheck/Helpers/AppLocatorTest.php b/tests/lib/IntegrityCheck/Helpers/AppLocatorTest.php index 7877c1718221..a1a3489c79d2 100644 --- a/tests/lib/IntegrityCheck/Helpers/AppLocatorTest.php +++ b/tests/lib/IntegrityCheck/Helpers/AppLocatorTest.php @@ -28,7 +28,7 @@ class AppLocatorTest extends TestCase { /** @var AppLocator */ private $locator; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->locator = new AppLocator(); } diff --git a/tests/lib/IntegrityCheck/Helpers/EnvironmentHelperTest.php b/tests/lib/IntegrityCheck/Helpers/EnvironmentHelperTest.php index abf2421a6177..688c7d56fe77 100644 --- a/tests/lib/IntegrityCheck/Helpers/EnvironmentHelperTest.php +++ b/tests/lib/IntegrityCheck/Helpers/EnvironmentHelperTest.php @@ -28,9 +28,9 @@ class EnvironmentHelperTest extends TestCase { /** @var EnvironmentHelper */ private $environmentHelper; - public function setUp() { + public function setUp(): void { $this->environmentHelper = new EnvironmentHelper(); - return parent::setUp(); + parent::setUp(); } public function testGetServerRoot() { diff --git a/tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php b/tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php index 27c41d241d7b..5e48fc9764ca 100644 --- a/tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php +++ b/tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php @@ -27,7 +27,7 @@ class FileAccessHelperTest extends TestCase { /** @var FileAccessHelper */ private $fileAccessHelper; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->fileAccessHelper = new FileAccessHelper(); } diff --git a/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php b/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php index c440a1983ad6..b2dc17dfcefb 100644 --- a/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php +++ b/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php @@ -28,7 +28,7 @@ class ExcludeFileByNameFilterIteratorTest extends TestCase { /** @var \PHPUnit\Framework\MockObject\Mockbuilder */ protected $filter; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->filter = $this->getMockBuilder(ExcludeFileByNameFilterIterator::class) ->disableOriginalConstructor() diff --git a/tests/lib/L10N/FactoryTest.php b/tests/lib/L10N/FactoryTest.php index c00905b69fc9..63b1a3f600fe 100644 --- a/tests/lib/L10N/FactoryTest.php +++ b/tests/lib/L10N/FactoryTest.php @@ -35,7 +35,7 @@ class FactoryTest extends TestCase { /** @var string */ protected $serverRoot; - public function setUp() { + public function setUp(): void { parent::setUp(); /** @var \OCP\IConfig $request */ diff --git a/tests/lib/LargeFileHelperGetFileSizeTest.php b/tests/lib/LargeFileHelperGetFileSizeTest.php index f1b610e57e36..90430dd2a4d2 100644 --- a/tests/lib/LargeFileHelperGetFileSizeTest.php +++ b/tests/lib/LargeFileHelperGetFileSizeTest.php @@ -20,7 +20,7 @@ class LargeFileHelperGetFileSizeTest extends TestCase { /** @var \OC\LargeFileHelper */ protected $helper; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->helper = new \OC\LargeFileHelper(); } diff --git a/tests/lib/LargeFileHelperTest.php b/tests/lib/LargeFileHelperTest.php index 7d155ff8b447..bfe26246918f 100644 --- a/tests/lib/LargeFileHelperTest.php +++ b/tests/lib/LargeFileHelperTest.php @@ -11,7 +11,7 @@ class LargeFileHelperTest extends TestCase { protected $helper; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->helper = new \OC\LargeFileHelper; } diff --git a/tests/lib/Lock/DBLockingProviderTest.php b/tests/lib/Lock/DBLockingProviderTest.php index 68c6a54d6ccf..e754f818aa0a 100644 --- a/tests/lib/Lock/DBLockingProviderTest.php +++ b/tests/lib/Lock/DBLockingProviderTest.php @@ -48,7 +48,7 @@ class DBLockingProviderTest extends LockingProvider { private $currentTime; - public function setUp() { + public function setUp(): void { $this->currentTime = \time(); $this->timeFactory = $this->createMock('\OCP\AppFramework\Utility\ITimeFactory'); $this->timeFactory->expects($this->any()) @@ -69,7 +69,7 @@ protected function getInstance() { return new \OC\Lock\DBLockingProvider($this->connection, \OC::$server->getLogger(), $this->timeFactory, 3600); } - public function tearDown() { + public function tearDown(): void { $this->connection->executeQuery('DELETE FROM `*PREFIX*file_locks`'); parent::tearDown(); } diff --git a/tests/lib/Lock/LockingProvider.php b/tests/lib/Lock/LockingProvider.php index a2ddeb332f88..c6eecf118db8 100644 --- a/tests/lib/Lock/LockingProvider.php +++ b/tests/lib/Lock/LockingProvider.php @@ -36,7 +36,7 @@ abstract class LockingProvider extends TestCase { */ abstract protected function getInstance(); - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->instance = $this->getInstance(); } diff --git a/tests/lib/Lock/MemcacheLockingProviderTest.php b/tests/lib/Lock/MemcacheLockingProviderTest.php index 5ba25e0c2c4e..e702a9e2c64e 100644 --- a/tests/lib/Lock/MemcacheLockingProviderTest.php +++ b/tests/lib/Lock/MemcacheLockingProviderTest.php @@ -38,7 +38,7 @@ protected function getInstance() { return new \OC\Lock\MemcacheLockingProvider($this->memcache); } - public function tearDown() { + public function tearDown(): void { $this->memcache->clear(); parent::tearDown(); } diff --git a/tests/lib/Lock/Persistent/LockManagerTest.php b/tests/lib/Lock/Persistent/LockManagerTest.php index 8b946468037a..76d216bec5bb 100644 --- a/tests/lib/Lock/Persistent/LockManagerTest.php +++ b/tests/lib/Lock/Persistent/LockManagerTest.php @@ -46,7 +46,7 @@ class LockManagerTest extends TestCase { /** @var ITimeFactory | \PHPUnit\Framework\MockObject\MockObject */ private $timeFactory; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->lockMapper = $this->createMock(LockMapper::class); diff --git a/tests/lib/Lock/Persistent/LockMapperTest.php b/tests/lib/Lock/Persistent/LockMapperTest.php index 513d1c6ff9be..56b215ac1650 100644 --- a/tests/lib/Lock/Persistent/LockMapperTest.php +++ b/tests/lib/Lock/Persistent/LockMapperTest.php @@ -66,7 +66,7 @@ class LockMapperTest extends TestCase { /** @var ITimeFactory */ private $timeFactory; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->db = \OC::$server->getDatabaseConnection(); @@ -117,7 +117,7 @@ public function providesInvalidEntities() { ]; } - protected function tearDown() { + protected function tearDown(): void { foreach ($this->locks as $lock) { $this->mapper->delete($lock); } diff --git a/tests/lib/Log/OwncloudTest.php b/tests/lib/Log/OwncloudTest.php index 3a5ef87d6c07..d1f5d0261ae0 100644 --- a/tests/lib/Log/OwncloudTest.php +++ b/tests/lib/Log/OwncloudTest.php @@ -29,7 +29,7 @@ class OwncloudTest extends TestCase { private $restore_logfile; private $restore_logdateformat; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = \OC::$server->getConfig(); $this->restore_logfile = $config->getSystemValue("logfile"); @@ -38,7 +38,7 @@ protected function setUp() { $config->setSystemValue("logfile", $config->getSystemValue('datadirectory') . "/logtest"); Owncloud::init(); } - protected function tearDown() { + protected function tearDown(): void { $config = \OC::$server->getConfig(); if (isset($this->restore_logfile)) { $config->getSystemValue("logfile", $this->restore_logfile); diff --git a/tests/lib/LoggerTest.php b/tests/lib/LoggerTest.php index eabb62dda914..32ad09dddb94 100644 --- a/tests/lib/LoggerTest.php +++ b/tests/lib/LoggerTest.php @@ -27,7 +27,7 @@ class LoggerTest extends TestCase { /** @var EventDispatcherInterface | \PHPUnit\Framework\MockObject\MockObject */ private $eventDispatcher; - protected function setUp() { + protected function setUp(): void { parent::setUp(); self::$logs = []; diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php index 01706b8001b6..78bca0913db8 100644 --- a/tests/lib/Mail/MailerTest.php +++ b/tests/lib/Mail/MailerTest.php @@ -25,7 +25,7 @@ class MailerTest extends TestCase { /** @var Mailer */ private $mailer; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder(IConfig::class) diff --git a/tests/lib/Mail/MessageTest.php b/tests/lib/Mail/MessageTest.php index f30ff8ae7b6e..8fd493883ac5 100644 --- a/tests/lib/Mail/MessageTest.php +++ b/tests/lib/Mail/MessageTest.php @@ -30,7 +30,7 @@ public function mailAddressProvider() { ]; } - public function setUp() { + public function setUp(): void { parent::setUp(); $this->swiftMessage = $this->getMockBuilder('\Swift_Message') diff --git a/tests/lib/Memcache/APCuTest.php b/tests/lib/Memcache/APCuTest.php index d82fbacdd29d..85b24f1d115c 100644 --- a/tests/lib/Memcache/APCuTest.php +++ b/tests/lib/Memcache/APCuTest.php @@ -10,7 +10,7 @@ namespace Test\Memcache; class APCuTest extends Cache { - protected function setUp() { + protected function setUp(): void { parent::setUp(); if (!\OC\Memcache\APCu::isAvailable()) { diff --git a/tests/lib/Memcache/ArrayCacheTest.php b/tests/lib/Memcache/ArrayCacheTest.php index 3ae8c116a01b..4e3623d344d0 100644 --- a/tests/lib/Memcache/ArrayCacheTest.php +++ b/tests/lib/Memcache/ArrayCacheTest.php @@ -10,7 +10,7 @@ namespace Test\Memcache; class ArrayCacheTest extends Cache { - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->instance = new \OC\Memcache\ArrayCache(''); } diff --git a/tests/lib/Memcache/Cache.php b/tests/lib/Memcache/Cache.php index f44fe712c225..6b1263f429c1 100644 --- a/tests/lib/Memcache/Cache.php +++ b/tests/lib/Memcache/Cache.php @@ -122,7 +122,7 @@ public function testCadChanged() { $this->assertTrue($this->instance->hasKey('foo')); } - protected function tearDown() { + protected function tearDown(): void { if ($this->instance) { $this->instance->clear(); } diff --git a/tests/lib/Memcache/MemcachedTest.php b/tests/lib/Memcache/MemcachedTest.php index 58550a01d757..b50a88503416 100644 --- a/tests/lib/Memcache/MemcachedTest.php +++ b/tests/lib/Memcache/MemcachedTest.php @@ -24,7 +24,7 @@ public static function setUpBeforeClass() { } } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->instance = new \OC\Memcache\Memcached($this->getUniqueID()); } diff --git a/tests/lib/Memcache/RedisTest.php b/tests/lib/Memcache/RedisTest.php index 995793c3f672..88e8ed76971c 100644 --- a/tests/lib/Memcache/RedisTest.php +++ b/tests/lib/Memcache/RedisTest.php @@ -25,7 +25,7 @@ public static function setUpBeforeClass() { } } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->instance = new \OC\Memcache\Redis($this->getUniqueID()); } diff --git a/tests/lib/Migration/BackgroundRepairTest.php b/tests/lib/Migration/BackgroundRepairTest.php index 1395559098cd..1c815bace4dd 100644 --- a/tests/lib/Migration/BackgroundRepairTest.php +++ b/tests/lib/Migration/BackgroundRepairTest.php @@ -65,7 +65,7 @@ class BackgroundRepairTest extends TestCase { /** @var ILogger | \PHPUnit\Framework\MockObject\MockObject */ private $logger; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->jobList = $this->getMockBuilder('OC\BackgroundJob\JobList') diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index 58125d39f326..b1ab404ca575 100644 --- a/tests/lib/NavigationManagerTest.php +++ b/tests/lib/NavigationManagerTest.php @@ -26,7 +26,7 @@ class NavigationManagerTest extends TestCase { /** @var \OC\NavigationManager */ protected $navigationManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->navigationManager = new NavigationManager(); diff --git a/tests/lib/Notification/ActionTest.php b/tests/lib/Notification/ActionTest.php index faaffc38dcaa..48bfadbf1a5c 100644 --- a/tests/lib/Notification/ActionTest.php +++ b/tests/lib/Notification/ActionTest.php @@ -29,7 +29,7 @@ class ActionTest extends TestCase { /** @var IAction */ protected $action; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->action = new Action(); } diff --git a/tests/lib/Notification/ManagerTest.php b/tests/lib/Notification/ManagerTest.php index 94ba2ffd5c9c..9d17f70ca12c 100644 --- a/tests/lib/Notification/ManagerTest.php +++ b/tests/lib/Notification/ManagerTest.php @@ -38,7 +38,7 @@ class ManagerTest extends TestCase { /** @var EventDispatcherInterface */ protected $eventDispatcher; - public function setUp() { + public function setUp(): void { parent::setUp(); $eventMap = []; diff --git a/tests/lib/Notification/NotificationTest.php b/tests/lib/Notification/NotificationTest.php index 1d0ec99b3437..e0d0017f3d2c 100644 --- a/tests/lib/Notification/NotificationTest.php +++ b/tests/lib/Notification/NotificationTest.php @@ -29,7 +29,7 @@ class NotificationTest extends TestCase { /** @var INotification */ protected $notification; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->notification = new Notification(); } diff --git a/tests/lib/OCS/PrivateDataTest.php b/tests/lib/OCS/PrivateDataTest.php index 3f587fb7c562..c4caa1067f6a 100644 --- a/tests/lib/OCS/PrivateDataTest.php +++ b/tests/lib/OCS/PrivateDataTest.php @@ -32,7 +32,7 @@ class PrivateDataTest extends \Test\TestCase { private $appKey; - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OC::$server->getSession()->set('user_id', 'user1'); $this->appKey = $this->getUniqueID('app'); diff --git a/tests/lib/OCS/ProviderTest.php b/tests/lib/OCS/ProviderTest.php index d8470916ebed..2e6cdfda06dc 100644 --- a/tests/lib/OCS/ProviderTest.php +++ b/tests/lib/OCS/ProviderTest.php @@ -31,7 +31,7 @@ class ProviderTest extends \Test\TestCase { /** @var Provider */ private $ocsProvider; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->request = $this->getMockBuilder('\\OCP\\IRequest')->getMock(); diff --git a/tests/lib/Preview/BitmapTest.php b/tests/lib/Preview/BitmapTest.php index 1c5671610afe..2c808cffb787 100644 --- a/tests/lib/Preview/BitmapTest.php +++ b/tests/lib/Preview/BitmapTest.php @@ -29,7 +29,7 @@ * @package Test\Preview */ class BitmapTest extends Provider { - public function setUp() { + public function setUp(): void { parent::setUp(); $fileName = 'testimage.eps'; diff --git a/tests/lib/Preview/ImageTest.php b/tests/lib/Preview/ImageTest.php index 38be56cc7781..3488d8fa90bc 100644 --- a/tests/lib/Preview/ImageTest.php +++ b/tests/lib/Preview/ImageTest.php @@ -29,7 +29,7 @@ * @package Test\Preview */ class ImageTest extends Provider { - public function setUp() { + public function setUp(): void { parent::setUp(); $fileName = 'testimage.jpg'; diff --git a/tests/lib/Preview/MP3Test.php b/tests/lib/Preview/MP3Test.php index f30c141d9b4b..b02af7d0a32c 100644 --- a/tests/lib/Preview/MP3Test.php +++ b/tests/lib/Preview/MP3Test.php @@ -29,7 +29,7 @@ * @package Test\Preview */ class MP3Test extends Provider { - public function setUp() { + public function setUp(): void { parent::setUp(); $fileName = 'testimage.mp3'; diff --git a/tests/lib/Preview/MovieTest.php b/tests/lib/Preview/MovieTest.php index 043ceacc5234..c75cafbdbfe5 100644 --- a/tests/lib/Preview/MovieTest.php +++ b/tests/lib/Preview/MovieTest.php @@ -29,7 +29,7 @@ * @package Test\Preview */ class MovieTest extends Provider { - public function setUp() { + public function setUp(): void { $avconvBinary = \OC_Helper::findBinaryPath('avconv'); $ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg'); diff --git a/tests/lib/Preview/OfficeTest.php b/tests/lib/Preview/OfficeTest.php index 6488a53dc084..e9e26835c98d 100644 --- a/tests/lib/Preview/OfficeTest.php +++ b/tests/lib/Preview/OfficeTest.php @@ -29,7 +29,7 @@ * @package Test\Preview */ class OfficeTest extends Provider { - public function setUp() { + public function setUp(): void { $libreofficeBinary = \OC_Helper::findBinaryPath('libreoffice'); $openofficeBinary = ($libreofficeBinary) ? null : \OC_Helper::findBinaryPath('openoffice'); diff --git a/tests/lib/Preview/Provider.php b/tests/lib/Preview/Provider.php index 5bd962ca1508..ebc1ab6abd3e 100644 --- a/tests/lib/Preview/Provider.php +++ b/tests/lib/Preview/Provider.php @@ -48,7 +48,7 @@ abstract class Provider extends \Test\TestCase { /** @var \OC\Files\View */ protected $rootView; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $userManager = \OC::$server->getUserManager(); @@ -63,7 +63,7 @@ protected function setUp() { $this->userId = $userId; } - protected function tearDown() { + protected function tearDown(): void { $this->logout(); parent::tearDown(); diff --git a/tests/lib/Preview/SVGTest.php b/tests/lib/Preview/SVGTest.php index 9d129d280564..c9ba39edbf02 100644 --- a/tests/lib/Preview/SVGTest.php +++ b/tests/lib/Preview/SVGTest.php @@ -29,7 +29,7 @@ * @package Test\Preview */ class SVGTest extends Provider { - public function setUp() { + public function setUp(): void { $checkImagick = new \Imagick(); if (\count($checkImagick->queryFormats('SVG')) === 1) { parent::setUp(); diff --git a/tests/lib/Preview/TXTTest.php b/tests/lib/Preview/TXTTest.php index b3d0e96e35d4..f87ffe7916fd 100644 --- a/tests/lib/Preview/TXTTest.php +++ b/tests/lib/Preview/TXTTest.php @@ -29,7 +29,7 @@ * @package Test\Preview */ class TXTTest extends Provider { - public function setUp() { + public function setUp(): void { parent::setUp(); $fileName = 'lorem-big.txt'; diff --git a/tests/lib/PreviewManagerTest.php b/tests/lib/PreviewManagerTest.php index 7da3d352c803..6b8f4d55a0bb 100644 --- a/tests/lib/PreviewManagerTest.php +++ b/tests/lib/PreviewManagerTest.php @@ -57,7 +57,7 @@ class PreviewManagerTest extends TestCase { /** @var IPreview */ private $previewManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->user = $this->createUser(self::TEST_PREVIEW_USER1, self::TEST_PREVIEW_USER1); diff --git a/tests/lib/PreviewTest.php b/tests/lib/PreviewTest.php index 02be3d0d790b..d49972af2378 100644 --- a/tests/lib/PreviewTest.php +++ b/tests/lib/PreviewTest.php @@ -75,7 +75,7 @@ class PreviewTest extends TestCase { /** * Make sure your configuration file doesn't contain any additional providers */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->createUser(self::TEST_PREVIEW_USER1, self::TEST_PREVIEW_USER1); @@ -126,7 +126,7 @@ protected function setUp() { $this->prepareSample('testimage.gif', 64, 64); } - protected function tearDown() { + protected function tearDown(): void { $this->logout(); parent::tearDown(); diff --git a/tests/lib/PublicNamespace/ContactsTest.php b/tests/lib/PublicNamespace/ContactsTest.php index 079c780eec24..a0d7e3bad8a8 100644 --- a/tests/lib/PublicNamespace/ContactsTest.php +++ b/tests/lib/PublicNamespace/ContactsTest.php @@ -22,7 +22,7 @@ namespace Test\PublicNamespace; class ContactsTest extends \Test\TestCase { - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OCP\Contacts::clear(); } diff --git a/tests/lib/PublicNamespace/UtilTest.php b/tests/lib/PublicNamespace/UtilTest.php index 43d3eecd73f2..bdfb19965c08 100644 --- a/tests/lib/PublicNamespace/UtilTest.php +++ b/tests/lib/PublicNamespace/UtilTest.php @@ -22,7 +22,7 @@ namespace Test\PublicNamespace; class UtilTest extends \Test\TestCase { - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OCP\Contacts::clear(); } diff --git a/tests/lib/Repair/AppsTest.php b/tests/lib/Repair/AppsTest.php index 67db56a24c5e..eb1e45727b38 100644 --- a/tests/lib/Repair/AppsTest.php +++ b/tests/lib/Repair/AppsTest.php @@ -45,7 +45,7 @@ class AppsTest extends TestCase { /** @var \OC_Defaults | \PHPUnit\Framework\MockObject\MockObject */ private $defaults; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->appManager = $this->createMock(IAppManager::class); $this->defaults = $this->createMock(\OC_Defaults::class); diff --git a/tests/lib/Repair/CleanTagsTest.php b/tests/lib/Repair/CleanTagsTest.php index 959312e5a67b..c7806c82fbc1 100644 --- a/tests/lib/Repair/CleanTagsTest.php +++ b/tests/lib/Repair/CleanTagsTest.php @@ -34,7 +34,7 @@ class CleanTagsTest extends \Test\TestCase { /** @var IOutput */ private $outputMock; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->outputMock = $this->getMockBuilder('\OCP\Migration\IOutput') @@ -50,7 +50,7 @@ protected function setUp() { $this->cleanUpTables(); } - protected function tearDown() { + protected function tearDown(): void { $this->cleanUpTables(); parent::tearDown(); diff --git a/tests/lib/Repair/DisableExtraThemesTest.php b/tests/lib/Repair/DisableExtraThemesTest.php index eb00f18f6491..02bf2be36c0e 100644 --- a/tests/lib/Repair/DisableExtraThemesTest.php +++ b/tests/lib/Repair/DisableExtraThemesTest.php @@ -32,7 +32,7 @@ class DisableExtraThemesTest extends TestCase { /** @var IOutput|\PHPUnit\Framework\MockObject\MockObject */ protected $output; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); diff --git a/tests/lib/Repair/DropOldJobsTest.php b/tests/lib/Repair/DropOldJobsTest.php index 8f4a701c2623..e076ade39f40 100644 --- a/tests/lib/Repair/DropOldJobsTest.php +++ b/tests/lib/Repair/DropOldJobsTest.php @@ -22,7 +22,7 @@ class DropOldJobsTest extends \Test\TestCase { /** @var IJobList */ protected $jobList; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->jobList = \OC::$server->getJobList(); diff --git a/tests/lib/Repair/DropOldTablesTest.php b/tests/lib/Repair/DropOldTablesTest.php index 5e48685fefee..6be77ac26e5f 100644 --- a/tests/lib/Repair/DropOldTablesTest.php +++ b/tests/lib/Repair/DropOldTablesTest.php @@ -20,7 +20,7 @@ class DropOldTablesTest extends \Test\TestCase { /** @var \OCP\IDBConnection */ protected $connection; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); diff --git a/tests/lib/Repair/OldGroupMembershipSharesTest.php b/tests/lib/Repair/OldGroupMembershipSharesTest.php index 27434c71ad8d..ae00131d5e55 100644 --- a/tests/lib/Repair/OldGroupMembershipSharesTest.php +++ b/tests/lib/Repair/OldGroupMembershipSharesTest.php @@ -30,7 +30,7 @@ class OldGroupMembershipSharesTest extends \Test\TestCase { /** @var \OCP\IGroupManager|\PHPUnit\Framework\MockObject\MockObject */ protected $groupManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); /** \OCP\IGroupManager|\PHPUnit\Framework\MockObject\MockObject */ @@ -42,7 +42,7 @@ protected function setUp() { $this->deleteAllShares(); } - protected function tearDown() { + protected function tearDown(): void { $this->deleteAllShares(); parent::tearDown(); diff --git a/tests/lib/Repair/RemoveGetETagEntriesTest.php b/tests/lib/Repair/RemoveGetETagEntriesTest.php index 4991165c80e2..cd6f691f4eb3 100644 --- a/tests/lib/Repair/RemoveGetETagEntriesTest.php +++ b/tests/lib/Repair/RemoveGetETagEntriesTest.php @@ -36,7 +36,7 @@ class RemoveGetETagEntriesTest extends TestCase { /** @var \OCP\IDBConnection */ protected $connection; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); diff --git a/tests/lib/Repair/RemoveRootSharesTest.php b/tests/lib/Repair/RemoveRootSharesTest.php index cb32c11bd6c8..0f7041bcb7b7 100644 --- a/tests/lib/Repair/RemoveRootSharesTest.php +++ b/tests/lib/Repair/RemoveRootSharesTest.php @@ -51,7 +51,7 @@ class RemoveRootSharesTest extends \Test\TestCase { /** @var IRootFolder */ private $rootFolder; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->outputMock = $this->getMockBuilder('\OCP\Migration\IOutput') @@ -65,12 +65,12 @@ protected function setUp() { $this->repair = new RemoveRootShares($this->connection, $this->userManager, $this->rootFolder); } - protected function tearDown() { + protected function tearDown(): void { $qb = $this->connection->getQueryBuilder(); $qb->delete('share'); $qb->execute(); - return parent::tearDown(); + parent::tearDown(); } public function testRootSharesExist() { diff --git a/tests/lib/Repair/RepairCollationTest.php b/tests/lib/Repair/RepairCollationTest.php index 9e38515ecf68..945db7c11066 100644 --- a/tests/lib/Repair/RepairCollationTest.php +++ b/tests/lib/Repair/RepairCollationTest.php @@ -55,7 +55,7 @@ class RepairCollationTest extends TestCase { */ private $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -71,7 +71,7 @@ protected function setUp() { $this->repair = new TestCollationRepair($this->config, $this->connection); } - protected function tearDown() { + protected function tearDown(): void { $this->connection->getSchemaManager()->dropTable($this->tableName); parent::tearDown(); } diff --git a/tests/lib/Repair/RepairInnoDBTest.php b/tests/lib/Repair/RepairInnoDBTest.php index cf52184456a1..307a797326cc 100644 --- a/tests/lib/Repair/RepairInnoDBTest.php +++ b/tests/lib/Repair/RepairInnoDBTest.php @@ -27,7 +27,7 @@ class RepairInnoDBTest extends \Test\TestCase { /** @var string */ private $tableName; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -42,7 +42,7 @@ protected function setUp() { $this->repair = new \OC\Repair\InnoDB(); } - protected function tearDown() { + protected function tearDown(): void { $this->connection->getSchemaManager()->dropTable($this->tableName); parent::tearDown(); } diff --git a/tests/lib/Repair/RepairInvalidSharesTest.php b/tests/lib/Repair/RepairInvalidSharesTest.php index 71041e9a4fb3..a89d140c3be2 100644 --- a/tests/lib/Repair/RepairInvalidSharesTest.php +++ b/tests/lib/Repair/RepairInvalidSharesTest.php @@ -29,7 +29,7 @@ class RepairInvalidSharesTest extends TestCase { /** @var \OCP\IDBConnection */ private $connection; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->getMockBuilder('OCP\IConfig') @@ -47,7 +47,7 @@ protected function setUp() { $this->repair = new RepairInvalidShares($config, $this->connection); } - protected function tearDown() { + protected function tearDown(): void { $this->deleteAllShares(); parent::tearDown(); diff --git a/tests/lib/Repair/RepairMimeTypesTest.php b/tests/lib/Repair/RepairMimeTypesTest.php index 1816f588df48..f4d5c54a9588 100644 --- a/tests/lib/Repair/RepairMimeTypesTest.php +++ b/tests/lib/Repair/RepairMimeTypesTest.php @@ -32,7 +32,7 @@ class RepairMimeTypesTest extends \Test\TestCase { /** @var IMimeTypeLoader */ private $mimetypeLoader; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->savedMimetypeLoader = \OC::$server->getMimeTypeLoader(); @@ -52,7 +52,7 @@ protected function setUp() { $this->repair = new \OC\Repair\RepairMimeTypes($config); } - protected function tearDown() { + protected function tearDown(): void { $this->storage->getCache()->clear(); $sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?'; \OC_DB::executeAudited($sql, [$this->storage->getId()]); diff --git a/tests/lib/Repair/RepairMismatchFileCachePathTest.php b/tests/lib/Repair/RepairMismatchFileCachePathTest.php index 30c285118339..7a55035589f9 100644 --- a/tests/lib/Repair/RepairMismatchFileCachePathTest.php +++ b/tests/lib/Repair/RepairMismatchFileCachePathTest.php @@ -32,7 +32,7 @@ class RepairMismatchFileCachePathTest extends TestCase { private $connection; private $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -51,7 +51,7 @@ protected function setUp() { $this->repair->setCountOnly(false); } - protected function tearDown() { + protected function tearDown(): void { $qb = $this->connection->getQueryBuilder(); $qb->delete('filecache')->execute(); parent::tearDown(); diff --git a/tests/lib/Repair/RepairOrphanedSubshareTest.php b/tests/lib/Repair/RepairOrphanedSubshareTest.php index e93caa8e296a..ea759417ca99 100644 --- a/tests/lib/Repair/RepairOrphanedSubshareTest.php +++ b/tests/lib/Repair/RepairOrphanedSubshareTest.php @@ -44,14 +44,14 @@ class RepairOrphanedSubshareTest extends TestCase { /** @var IRepairStep */ private $repair; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); $this->repair = new RepairOrphanedSubshare($this->connection); $this->createUser('admin'); } - protected function tearDown() { + protected function tearDown(): void { $this->deleteAllShares(); $this->tearDownUserTrait(); parent::tearDown(); diff --git a/tests/lib/Repair/RepairSqliteAutoincrementTest.php b/tests/lib/Repair/RepairSqliteAutoincrementTest.php index ee5ab5419cd8..a838cb23d62a 100644 --- a/tests/lib/Repair/RepairSqliteAutoincrementTest.php +++ b/tests/lib/Repair/RepairSqliteAutoincrementTest.php @@ -36,7 +36,7 @@ class RepairSqliteAutoincrementTest extends \Test\TestCase { */ private $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -52,7 +52,7 @@ protected function setUp() { $this->repair = new \OC\Repair\SqliteAutoincrement($this->connection); } - protected function tearDown() { + protected function tearDown(): void { $this->connection->getSchemaManager()->dropTable($this->tableName); parent::tearDown(); } diff --git a/tests/lib/Repair/RepairSubSharesTest.php b/tests/lib/Repair/RepairSubSharesTest.php index 1eeee7e0654e..519e97049f0f 100644 --- a/tests/lib/Repair/RepairSubSharesTest.php +++ b/tests/lib/Repair/RepairSubSharesTest.php @@ -43,7 +43,7 @@ class RepairSubSharesTest extends TestCase { /** @var IRepairStep */ private $repair; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -51,7 +51,7 @@ protected function setUp() { $this->createUser('admin'); } - protected function tearDown() { + protected function tearDown(): void { $this->deleteAllUsersAndGroups(); $this->deleteAllShares(); parent::tearDown(); diff --git a/tests/lib/Repair/RepairUnmergedSharesTest.php b/tests/lib/Repair/RepairUnmergedSharesTest.php index 457d1aafe557..96682f7bbd76 100644 --- a/tests/lib/Repair/RepairUnmergedSharesTest.php +++ b/tests/lib/Repair/RepairUnmergedSharesTest.php @@ -55,7 +55,7 @@ class RepairUnmergedSharesTest extends TestCase { /** @var IGroupManager */ private $groupManager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $config = $this->getMockBuilder('OCP\IConfig') @@ -127,7 +127,7 @@ public function testDisabledVersions($version, $ran) { $this->repair->run($outputMock); } - protected function tearDown() { + protected function tearDown(): void { $this->deleteAllShares(); parent::tearDown(); diff --git a/tests/lib/RepairStepTest.php b/tests/lib/RepairStepTest.php index cdb1ecbef3ba..442b4e468d72 100644 --- a/tests/lib/RepairStepTest.php +++ b/tests/lib/RepairStepTest.php @@ -38,7 +38,7 @@ class RepairTest extends TestCase { /** @var string[] */ private $outputArray; - public function setUp() { + public function setUp(): void { parent::setUp(); $dispatcher = new EventDispatcher(); $this->repair = new \OC\Repair([], $dispatcher); diff --git a/tests/lib/Route/RouterTest.php b/tests/lib/Route/RouterTest.php index 2e8f54e1c5fe..c9fce4f6688f 100644 --- a/tests/lib/Route/RouterTest.php +++ b/tests/lib/Route/RouterTest.php @@ -40,7 +40,7 @@ class RouterTest extends \Test\TestCase { /** @var ILogger */ private $l; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->l = $this->createMock(ILogger::class); } diff --git a/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php b/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php index 0022d1a87380..7d554942884c 100644 --- a/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php +++ b/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php @@ -30,7 +30,7 @@ class ContentSecurityPolicyManagerTest extends TestCase { /** @var ContentSecurityPolicyManager */ private $contentSecurityPolicyManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->contentSecurityPolicyManager = new ContentSecurityPolicyManager(); } diff --git a/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php b/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php index 1d944fb8c936..b894dc93e1f0 100644 --- a/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php +++ b/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php @@ -27,7 +27,7 @@ class CsrfTokenGeneratorTest extends \Test\TestCase { /** @var \OC\Security\CSRF\CsrfTokenGenerator */ private $csrfTokenGenerator; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->random = $this->getMockBuilder('\OCP\Security\ISecureRandom') ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Security/CSRF/CsrfTokenManagerTest.php b/tests/lib/Security/CSRF/CsrfTokenManagerTest.php index 9600521647fe..bad88190a9d6 100644 --- a/tests/lib/Security/CSRF/CsrfTokenManagerTest.php +++ b/tests/lib/Security/CSRF/CsrfTokenManagerTest.php @@ -29,7 +29,7 @@ class CsrfTokenManagerTest extends \Test\TestCase { /** @var \OC\Security\CSRF\TokenStorage\SessionStorage */ private $storageInterface; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->tokenGenerator = $this->getMockBuilder('\OC\Security\CSRF\CsrfTokenGenerator') ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php b/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php index 89ae579ae5fb..e5ce01c91329 100644 --- a/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php +++ b/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php @@ -27,7 +27,7 @@ class SessionStorageTest extends \Test\TestCase { /** @var \OC\Security\CSRF\TokenStorage\SessionStorage */ private $sessionStorage; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->session = $this->getMockBuilder('\OCP\ISession') ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php index 76d97bd439de..59ffe72be033 100644 --- a/tests/lib/Security/CertificateManagerTest.php +++ b/tests/lib/Security/CertificateManagerTest.php @@ -24,7 +24,7 @@ class CertificateManagerTest extends \Test\TestCase { /** @var String */ private $username; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->username = $this->getUniqueID('', 20); diff --git a/tests/lib/Security/CertificateTest.php b/tests/lib/Security/CertificateTest.php index 6d8a8af52567..922d947fb526 100644 --- a/tests/lib/Security/CertificateTest.php +++ b/tests/lib/Security/CertificateTest.php @@ -32,7 +32,7 @@ class CertificateTest extends \Test\TestCase { /** @var Certificate That contains an expired certificate */ protected $expiredCertificate; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $goodCertificate = \file_get_contents(__DIR__ . '/../../data/certificates/goodCertificate.crt'); diff --git a/tests/lib/Security/CredentialsManagerTest.php b/tests/lib/Security/CredentialsManagerTest.php index 6230065dceeb..4164ad0f010c 100644 --- a/tests/lib/Security/CredentialsManagerTest.php +++ b/tests/lib/Security/CredentialsManagerTest.php @@ -36,7 +36,7 @@ class CredentialsManagerTest extends \Test\TestCase { /** @var CredentialsManager */ protected $manager; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->crypto = $this->createMock('\OCP\Security\ICrypto'); $this->dbConnection = $this->getMockBuilder('\OC\DB\Connection') diff --git a/tests/lib/Security/CryptoTest.php b/tests/lib/Security/CryptoTest.php index 6ee3bf5b3019..98bce3b3f2ab 100644 --- a/tests/lib/Security/CryptoTest.php +++ b/tests/lib/Security/CryptoTest.php @@ -22,7 +22,7 @@ public function defaultEncryptionProvider() { /** @var Crypto */ protected $crypto; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->crypto = new Crypto(\OC::$server->getConfig(), \OC::$server->getSecureRandom()); } diff --git a/tests/lib/Security/HasherTest.php b/tests/lib/Security/HasherTest.php index 658fbc6af109..53685a99188e 100644 --- a/tests/lib/Security/HasherTest.php +++ b/tests/lib/Security/HasherTest.php @@ -76,7 +76,7 @@ public function allHashProviders() { /** @var \OCP\IConfig */ protected $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder('\OCP\IConfig') diff --git a/tests/lib/Security/SecureRandomTest.php b/tests/lib/Security/SecureRandomTest.php index 4b368acc6739..51806cb1f89f 100644 --- a/tests/lib/Security/SecureRandomTest.php +++ b/tests/lib/Security/SecureRandomTest.php @@ -34,7 +34,7 @@ public static function charCombinations() { /** @var SecureRandom */ protected $rng; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->rng = new \OC\Security\SecureRandom(); } diff --git a/tests/lib/Security/TrustedDomainHelperTest.php b/tests/lib/Security/TrustedDomainHelperTest.php index 8cddf36aa98b..c001115a8ca8 100644 --- a/tests/lib/Security/TrustedDomainHelperTest.php +++ b/tests/lib/Security/TrustedDomainHelperTest.php @@ -18,7 +18,7 @@ class TrustedDomainHelperTest extends \Test\TestCase { /** @var IConfig */ protected $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock(); diff --git a/tests/lib/ServerTest.php b/tests/lib/ServerTest.php index a7c3085e7d11..7abe1c475589 100644 --- a/tests/lib/ServerTest.php +++ b/tests/lib/ServerTest.php @@ -133,7 +133,7 @@ class ServerTest extends TestCase { /** @var Server */ protected $server; - public function setUp() { + public function setUp(): void { parent::setUp(); $config = new Config(\OC::$configDir); $this->server = new Server('', $config); diff --git a/tests/lib/Session/CryptoSessionDataTest.php b/tests/lib/Session/CryptoSessionDataTest.php index 4d852ef41563..c294d8f25058 100644 --- a/tests/lib/Session/CryptoSessionDataTest.php +++ b/tests/lib/Session/CryptoSessionDataTest.php @@ -33,7 +33,7 @@ class CryptoSessionDataTest extends Session { /** @var \OCP\ISession */ protected $wrappedSession; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->wrappedSession = new \OC\Session\Memory(static::getUniqueID()); diff --git a/tests/lib/Session/CryptoWrappingTest.php b/tests/lib/Session/CryptoWrappingTest.php index 96ebeb564235..0e83122743a8 100644 --- a/tests/lib/Session/CryptoWrappingTest.php +++ b/tests/lib/Session/CryptoWrappingTest.php @@ -34,7 +34,7 @@ class CryptoWrappingTest extends TestCase { /** @var \OC\Session\CryptoSessionData */ protected $instance; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->wrappedSession = $this->getMockBuilder('OCP\ISession') diff --git a/tests/lib/Session/MemoryTest.php b/tests/lib/Session/MemoryTest.php index 1297bd162cec..6f0418d1c5f9 100644 --- a/tests/lib/Session/MemoryTest.php +++ b/tests/lib/Session/MemoryTest.php @@ -10,7 +10,7 @@ namespace Test\Session; class MemoryTest extends Session { - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->instance = new \OC\Session\Memory($this->getUniqueID()); } diff --git a/tests/lib/Session/Session.php b/tests/lib/Session/Session.php index e7f3ea0fd2ad..629ec813fd4f 100644 --- a/tests/lib/Session/Session.php +++ b/tests/lib/Session/Session.php @@ -15,7 +15,7 @@ abstract class Session extends \Test\TestCase { */ protected $instance; - protected function tearDown() { + protected function tearDown(): void { $this->instance->clear(); parent::tearDown(); } diff --git a/tests/lib/Settings/ManagerTest.php b/tests/lib/Settings/ManagerTest.php index 2642165c0b1d..06930ff4c382 100644 --- a/tests/lib/Settings/ManagerTest.php +++ b/tests/lib/Settings/ManagerTest.php @@ -41,7 +41,7 @@ class SettingsManagerTest extends TestCase { protected $certificateManager; protected $factory; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->l = $this->getMockBuilder('\OCP\IL10N')->getMock(); diff --git a/tests/lib/SetupTest.php b/tests/lib/SetupTest.php index a844e804b10a..3fadca623cc9 100644 --- a/tests/lib/SetupTest.php +++ b/tests/lib/SetupTest.php @@ -27,7 +27,7 @@ class SetupTest extends \Test\TestCase { /** @var \OCP\Security\ISecureRandom | \PHPUnit\Framework\MockObject\MockObject */ protected $random; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock('\OCP\IConfig'); diff --git a/tests/lib/Share/MailNotificationsTest.php b/tests/lib/Share/MailNotificationsTest.php index 185e737a480c..e90d439da722 100644 --- a/tests/lib/Share/MailNotificationsTest.php +++ b/tests/lib/Share/MailNotificationsTest.php @@ -64,7 +64,7 @@ class MailNotificationsTest extends TestCase { /** @var MailNotifications */ private $mailNotifications; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->shareManager = $this->createMock(IManager::class); diff --git a/tests/lib/Share/ShareTest.php b/tests/lib/Share/ShareTest.php index 5d64036ccee1..0b58e5886b18 100644 --- a/tests/lib/Share/ShareTest.php +++ b/tests/lib/Share/ShareTest.php @@ -48,7 +48,7 @@ class ShareTest extends \Test\TestCase { protected $dateInFuture; protected $dateInPast; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->user1 = $this->getUniqueID('user1_'); @@ -94,7 +94,7 @@ protected function setUp() { $this->dateInFuture = \date($dateFormat, $now + 20 * 60); } - protected function tearDown() { + protected function tearDown(): void { $query = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `item_type` = ?'); $query->execute(['test']); \OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', $this->resharing); diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index d3afb2c57f45..38fcfbb4e62c 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -61,7 +61,7 @@ class DefaultShareProviderTest extends TestCase { /** @var DefaultShareProvider */ protected $provider; - public function setUp() { + public function setUp(): void { $this->dbConn = \OC::$server->getDatabaseConnection(); $this->userManager = $this->createMock(IUserManager::class); $this->groupManager = $this->createMock(IGroupManager::class); @@ -80,7 +80,7 @@ public function setUp() { ); } - public function tearDown() { + public function tearDown(): void { $this->dbConn->getQueryBuilder()->delete('share')->execute(); $this->dbConn->getQueryBuilder()->delete('filecache')->execute(); $this->dbConn->getQueryBuilder()->delete('storages')->execute(); diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index 2034987cc43e..0980c2620507 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -94,7 +94,7 @@ class ManagerTest extends \Test\TestCase { /** @var IDBConnection | \PHPUnit\Framework\MockObject\MockObject */ protected $connection; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->logger = $this->createMock(ILogger::class); @@ -140,7 +140,7 @@ public function setUp() { $this->factory->setProvider($this->defaultProvider); } - public function tearDown() { + public function tearDown(): void { // clear legacy hook handlers \OC_Hook::clear('\OC\Share'); parent::tearDown(); diff --git a/tests/lib/Share20/ShareTest.php b/tests/lib/Share20/ShareTest.php index cb3cabb230b3..ef9140043a66 100644 --- a/tests/lib/Share20/ShareTest.php +++ b/tests/lib/Share20/ShareTest.php @@ -34,7 +34,7 @@ class ShareTest extends \Test\TestCase { /** @var \OCP\Share\IShare */ protected $share; - public function setUp() { + public function setUp(): void { $this->rootFolder = $this->createMock('\OCP\Files\IRootFolder'); $this->userManager = $this->createMock('OCP\IUserManager'); $this->share = new \OC\Share20\Share($this->rootFolder, $this->userManager); diff --git a/tests/lib/StreamWrappersTest.php b/tests/lib/StreamWrappersTest.php index 575f8b639297..19ab8d2e0404 100644 --- a/tests/lib/StreamWrappersTest.php +++ b/tests/lib/StreamWrappersTest.php @@ -35,7 +35,7 @@ public static function setUpBeforeClass() { \OC_App::disable('files_trashbin'); } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { if (self::$trashBinStatus) { \OC_App::enable('files_trashbin'); } diff --git a/tests/lib/SubAdminTest.php b/tests/lib/SubAdminTest.php index a9fa09a23be0..c199aa8bfc55 100644 --- a/tests/lib/SubAdminTest.php +++ b/tests/lib/SubAdminTest.php @@ -41,7 +41,7 @@ class SubAdminTest extends TestCase { /** @var \OCP\IGroup[] */ private $groups; - public function setup() { + public function setUp(): void { $this->users = []; $this->groups = []; @@ -83,7 +83,7 @@ public function setup() { ->execute(); } - public function tearDown() { + public function tearDown(): void { foreach ($this->users as $user) { $user->delete(); } diff --git a/tests/lib/SystemConfigTest.php b/tests/lib/SystemConfigTest.php index 85cf7e91868e..823e99a8a9d8 100644 --- a/tests/lib/SystemConfigTest.php +++ b/tests/lib/SystemConfigTest.php @@ -115,7 +115,7 @@ class SystemConfigTest extends TestCase { /** @var string */ private $randomTmpDir; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->randomTmpDir = \OC::$server->getTempManager()->getTemporaryFolder(); @@ -124,7 +124,7 @@ protected function setUp() { $this->config = new \OC\Config($this->randomTmpDir, 'testconfig.php'); } - protected function tearDown() { + protected function tearDown(): void { \unlink($this->configFile); parent::tearDown(); } diff --git a/tests/lib/SystemTag/SystemTagManagerTest.php b/tests/lib/SystemTag/SystemTagManagerTest.php index 983028795778..241b4b5d228c 100644 --- a/tests/lib/SystemTag/SystemTagManagerTest.php +++ b/tests/lib/SystemTag/SystemTagManagerTest.php @@ -48,7 +48,7 @@ class SystemTagManagerTest extends TestCase { */ private $dispatcher; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -66,7 +66,7 @@ public function setUp() { $this->pruneTagsTables(); } - public function tearDown() { + public function tearDown(): void { $this->pruneTagsTables(); parent::tearDown(); } diff --git a/tests/lib/SystemTag/SystemTagObjectMapperTest.php b/tests/lib/SystemTag/SystemTagObjectMapperTest.php index 4a682f9a5e53..b4d698360ff1 100644 --- a/tests/lib/SystemTag/SystemTagObjectMapperTest.php +++ b/tests/lib/SystemTag/SystemTagObjectMapperTest.php @@ -64,7 +64,7 @@ class SystemTagObjectMapperTest extends TestCase { */ private $tag3; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -108,7 +108,7 @@ public function setUp() { $this->tagMapper->assignTags('3', 'anothertype', $this->tag1->getId()); } - public function tearDown() { + public function tearDown(): void { $this->pruneTagsTables(); parent::tearDown(); } diff --git a/tests/lib/TagsTest.php b/tests/lib/TagsTest.php index ee2776f2d912..b7d43e53444c 100644 --- a/tests/lib/TagsTest.php +++ b/tests/lib/TagsTest.php @@ -44,7 +44,7 @@ class TagsTest extends TestCase { /** @var \OCP\ITagManager */ protected $tagMgr; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $userId = $this->getUniqueID('user_'); @@ -61,7 +61,7 @@ protected function setUp() { $this->tagMgr = new TagManager($this->tagMapper, $this->userSession); } - protected function tearDown() { + protected function tearDown(): void { $conn = \OC::$server->getDatabaseConnection(); $conn->executeQuery('DELETE FROM `*PREFIX*vcategory_to_object`'); $conn->executeQuery('DELETE FROM `*PREFIX*vcategory`'); diff --git a/tests/lib/TempManagerTest.php b/tests/lib/TempManagerTest.php index 4a6592a8f5d4..713047c3047d 100644 --- a/tests/lib/TempManagerTest.php +++ b/tests/lib/TempManagerTest.php @@ -24,7 +24,7 @@ public function log($level, $message, array $context = []) { class TempManagerTest extends \Test\TestCase { protected $baseDir = null; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->baseDir = $this->getManager()->getTempBaseDir() . $this->getUniqueID('/oc_tmp_test'); @@ -33,7 +33,7 @@ protected function setUp() { } } - protected function tearDown() { + protected function tearDown(): void { \OC_Helper::rmdirr($this->baseDir); $this->baseDir = null; parent::tearDown(); diff --git a/tests/lib/Template/BaseTest.php b/tests/lib/Template/BaseTest.php index 2b7868d77306..2138000a7b1e 100644 --- a/tests/lib/Template/BaseTest.php +++ b/tests/lib/Template/BaseTest.php @@ -19,7 +19,7 @@ class BaseTest extends \Test\TestCase { /** @var string */ protected $serverRoot; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->serverRoot = \OC::$SERVERROOT; $this->theme = $this->getMockBuilder(ITheme::class) diff --git a/tests/lib/Template/CSSResourceLocatorTest.php b/tests/lib/Template/CSSResourceLocatorTest.php index a5b227972dd4..9594cddc141a 100644 --- a/tests/lib/Template/CSSResourceLocatorTest.php +++ b/tests/lib/Template/CSSResourceLocatorTest.php @@ -23,7 +23,7 @@ class CSSResourceLocatorTest extends TestCase { protected $appRoot = '/var/www/apps'; protected $themeAppDir = 'theme-best'; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->logger = $this->createMock(ILogger::class); } diff --git a/tests/lib/Template/JSResourceLocatorTest.php b/tests/lib/Template/JSResourceLocatorTest.php index 052a8778dd5e..114a06067b91 100644 --- a/tests/lib/Template/JSResourceLocatorTest.php +++ b/tests/lib/Template/JSResourceLocatorTest.php @@ -23,7 +23,7 @@ class JSResourceLocatorTest extends TestCase { protected $appRoot = '/var/www/apps'; protected $themeAppDir = 'theme-best'; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->logger = $this->createMock(ILogger::class); } diff --git a/tests/lib/Template/ResourceLocatorTest.php b/tests/lib/Template/ResourceLocatorTest.php index 23741dc3e61c..1101dad4cf37 100644 --- a/tests/lib/Template/ResourceLocatorTest.php +++ b/tests/lib/Template/ResourceLocatorTest.php @@ -23,7 +23,7 @@ class ResourceLocatorTest extends \Test\TestCase { 'test2.js' ]; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->logger = $this->createMock('OCP\ILogger'); diff --git a/tests/lib/TemplateFunctionsTest.php b/tests/lib/TemplateFunctionsTest.php index 92d005ff6969..15c8829350e0 100644 --- a/tests/lib/TemplateFunctionsTest.php +++ b/tests/lib/TemplateFunctionsTest.php @@ -23,7 +23,7 @@ namespace Test; class TemplateFunctionsTest extends \Test\TestCase { - protected function setUp() { + protected function setUp(): void { parent::setUp(); $loader = new \OC\Autoloader([\OC::$SERVERROOT . '/lib']); diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index e58fd2ef43fc..1345bbbae338 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -101,7 +101,7 @@ protected function getTestTraits() { }); } - protected function setUp() { + protected function setUp(): void { // detect database access self::$wasDatabaseAllowed = true; if (!$this->IsDatabaseAccessAllowed()) { @@ -133,7 +133,7 @@ protected function setUp() { $_SERVER['REQUEST_METHOD'] = 'GET'; } - protected function tearDown() { + protected function tearDown(): void { // store testname in static attr for use in class teardown self::$lastTest = \get_class($this) . ':' . $this->getName(); @@ -219,7 +219,7 @@ protected static function getUniqueID($prefix = '', $length = 13) { ); } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { // fail if still in a transaction after test run if (self::$wasDatabaseAllowed && \OC::$server->getDatabaseConnection()->inTransaction()) { // This is bad. But we cannot fail the unit test since we are already diff --git a/tests/lib/Theme/ThemeServiceTest.php b/tests/lib/Theme/ThemeServiceTest.php index 0e048d0adbe7..8dd9393c4be5 100644 --- a/tests/lib/Theme/ThemeServiceTest.php +++ b/tests/lib/Theme/ThemeServiceTest.php @@ -17,7 +17,7 @@ class ThemeServiceTest extends \PHPUnit\Framework\TestCase { */ private $environmentHelper; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->appManager = $this->getMockBuilder(IAppManager::class) ->getMock(); diff --git a/tests/lib/Theme/ThemeTest.php b/tests/lib/Theme/ThemeTest.php index c44d3da0d29e..c66322828997 100644 --- a/tests/lib/Theme/ThemeTest.php +++ b/tests/lib/Theme/ThemeTest.php @@ -11,7 +11,7 @@ class ThemeTest extends \PHPUnit\Framework\TestCase { */ private $sut; - protected function setUp() { + protected function setUp(): void { $this->sut = new Theme(); parent::setUp(); } diff --git a/tests/lib/Updater/VersionCheckTest.php b/tests/lib/Updater/VersionCheckTest.php index c6e0243f33ac..f800e1c0c585 100644 --- a/tests/lib/Updater/VersionCheckTest.php +++ b/tests/lib/Updater/VersionCheckTest.php @@ -33,7 +33,7 @@ class VersionCheckTest extends TestCase { /** @var VersionCheck | \PHPUnit\Framework\MockObject\MockObject*/ private $updater; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor() diff --git a/tests/lib/UpdaterTest.php b/tests/lib/UpdaterTest.php index 7d83ea58f410..c8c5d55b99af 100644 --- a/tests/lib/UpdaterTest.php +++ b/tests/lib/UpdaterTest.php @@ -37,7 +37,7 @@ class UpdaterTest extends TestCase { /** @var Checker | \PHPUnit\Framework\MockObject\MockObject */ private $checker; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->getMockBuilder(IConfig::class) ->disableOriginalConstructor() diff --git a/tests/lib/UrlGeneratorTest.php b/tests/lib/UrlGeneratorTest.php index 32ef5a09b6eb..29f474a40c30 100644 --- a/tests/lib/UrlGeneratorTest.php +++ b/tests/lib/UrlGeneratorTest.php @@ -27,7 +27,7 @@ class UrlGeneratorTest extends TestCase { /** @var EnvironmentHelper | \PHPUnit\Framework\MockObject\MockObject */ private $environmentHelper; - public function setUp() { + public function setUp(): void { parent::setUp(); $config = $this->createMock(IConfig::class); $cacheFactory = $this->createMock(ICacheFactory::class); diff --git a/tests/lib/User/AccountMapperTest.php b/tests/lib/User/AccountMapperTest.php index a0efe85d28b0..00e7906a8f3b 100644 --- a/tests/lib/User/AccountMapperTest.php +++ b/tests/lib/User/AccountMapperTest.php @@ -72,7 +72,7 @@ public static function setUpBeforeClass() { } } - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); @@ -86,7 +86,7 @@ public function setUp() { ); } - public static function tearDownAfterClass() { + public static function tearDownAfterClass(): void { \OC::$server->getDatabaseConnection()->rollBack(); parent::tearDownAfterClass(); } diff --git a/tests/lib/User/BasicAuthModuleTest.php b/tests/lib/User/BasicAuthModuleTest.php index 05c1ffef5e65..3c63fc40a429 100644 --- a/tests/lib/User/BasicAuthModuleTest.php +++ b/tests/lib/User/BasicAuthModuleTest.php @@ -49,7 +49,7 @@ class BasicAuthModuleTest extends TestCase { /** @var ISession | \PHPUnit\Framework\MockObject\MockObject */ private $session; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); $this->logger = $this->createMock(ILogger::class); diff --git a/tests/lib/User/DatabaseTest.php b/tests/lib/User/DatabaseTest.php index 5ff0d46d3af6..deedc113b77a 100644 --- a/tests/lib/User/DatabaseTest.php +++ b/tests/lib/User/DatabaseTest.php @@ -39,12 +39,12 @@ public function getUser($prefix = 'test_') { return $user; } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->backend = new \OC\User\Database(); } - protected function tearDown() { + protected function tearDown(): void { if (!isset($this->users)) { return; } diff --git a/tests/lib/User/DummyTestCase.php b/tests/lib/User/DummyTestCase.php index b53f8cfda3dd..b05950390960 100644 --- a/tests/lib/User/DummyTestCase.php +++ b/tests/lib/User/DummyTestCase.php @@ -25,7 +25,7 @@ use Test\Util\User\Dummy; class DummyTestCase extends BackendTestCase { - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->backend = new Dummy(); } diff --git a/tests/lib/User/ManagerTest.php b/tests/lib/User/ManagerTest.php index 3c733fe9ba11..2ef49e30832b 100644 --- a/tests/lib/User/ManagerTest.php +++ b/tests/lib/User/ManagerTest.php @@ -44,7 +44,7 @@ class ManagerTest extends TestCase { */ protected $userSearch; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->overwriteService('EventDispatcher', new EventDispatcher()); diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php index 610160a75d57..27f1763c6442 100644 --- a/tests/lib/User/SessionTest.php +++ b/tests/lib/User/SessionTest.php @@ -61,7 +61,7 @@ class SessionTest extends TestCase { /** @var EventDispatcher */ protected $eventDispatcher; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->timeFactory = $this->createMock(ITimeFactory::class); diff --git a/tests/lib/User/Sync/AllUsersIteratorTest.php b/tests/lib/User/Sync/AllUsersIteratorTest.php index 5234cb90e029..7a5ccc2f23d7 100644 --- a/tests/lib/User/Sync/AllUsersIteratorTest.php +++ b/tests/lib/User/Sync/AllUsersIteratorTest.php @@ -42,7 +42,7 @@ class AllUsersIteratorTest extends TestCase { */ private $iterator; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->backend = $this->createMock(UserInterface::class); diff --git a/tests/lib/User/Sync/SeenUsersIteratorTest.php b/tests/lib/User/Sync/SeenUsersIteratorTest.php index c43050f1b059..d2287366a526 100644 --- a/tests/lib/User/Sync/SeenUsersIteratorTest.php +++ b/tests/lib/User/Sync/SeenUsersIteratorTest.php @@ -44,7 +44,7 @@ class SeenUsersIteratorTest extends TestCase { const TEST_BACKEND = 'TestBackend'; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->mapper = $this->createMock(AccountMapper::class); diff --git a/tests/lib/User/SyncServiceTest.php b/tests/lib/User/SyncServiceTest.php index 8c29f618849b..522380d5266c 100644 --- a/tests/lib/User/SyncServiceTest.php +++ b/tests/lib/User/SyncServiceTest.php @@ -47,7 +47,7 @@ class SyncServiceTest extends TestCase { /** @var AccountMapper | \PHPUnit\Framework\MockObject\MockObject */ private $mapper; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config = $this->createMock(IConfig::class); diff --git a/tests/lib/User/TokenAuthModuleTest.php b/tests/lib/User/TokenAuthModuleTest.php index 2098ded4f556..06e6008fdfee 100644 --- a/tests/lib/User/TokenAuthModuleTest.php +++ b/tests/lib/User/TokenAuthModuleTest.php @@ -45,7 +45,7 @@ class TokenAuthModuleTest extends TestCase { /** @var IProvider | \PHPUnit\Framework\MockObject\MockObject */ private $tokenProvider; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->manager = $this->createMock(IUserManager::class); $this->session = $this->createMock(ISession::class); diff --git a/tests/lib/User/UserTest.php b/tests/lib/User/UserTest.php index b17c568d6343..bb81ce8ff16e 100644 --- a/tests/lib/User/UserTest.php +++ b/tests/lib/User/UserTest.php @@ -55,7 +55,7 @@ class UserTest extends TestCase { /** @var Session | \PHPUnit\Framework\MockObject\MockObject */ private $sessionUser; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->accountMapper = $this->createMock(AccountMapper::class); $this->config = $this->createMock(IConfig::class); diff --git a/tests/lib/UtilCheckServerTest.php b/tests/lib/UtilCheckServerTest.php index dadcef5f8c9e..5cf6f5fa0938 100644 --- a/tests/lib/UtilCheckServerTest.php +++ b/tests/lib/UtilCheckServerTest.php @@ -34,7 +34,7 @@ protected function getConfig($systemOptions) { return $config; } - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->datadir = \OC::$server->getTempManager()->getTemporaryFolder(); @@ -43,7 +43,7 @@ protected function setUp() { \OC::$server->getSession()->set('checkServer_succeeded', false); } - protected function tearDown() { + protected function tearDown(): void { // clean up @\unlink($this->datadir . '/.ocdata'); parent::tearDown(); diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php index 841aa60f2f68..773575fedb8d 100644 --- a/tests/lib/UtilTest.php +++ b/tests/lib/UtilTest.php @@ -425,13 +425,13 @@ public function testCopySkeletonDirectoryNoReadAccessToFile() { $config->deleteSystemValue('skeletondirectory'); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); \OC_Util::$scripts = []; \OC_Util::$styles = []; } - protected function tearDown() { + protected function tearDown(): void { parent::tearDown(); \OC_Util::$scripts = []; diff --git a/tests/lib/legacy/AppTest.php b/tests/lib/legacy/AppTest.php index 9e6be33f5683..d1290bb53df5 100644 --- a/tests/lib/legacy/AppTest.php +++ b/tests/lib/legacy/AppTest.php @@ -28,7 +28,7 @@ class AppTest extends TestCase { private $appPath; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->appPath = __DIR__ . '/../../../apps/appinfotestapp'; @@ -43,7 +43,7 @@ protected function setUp() { \file_put_contents($infoXmlPath, $xml); } - protected function tearDown() { + protected function tearDown(): void { $this->restoreService('NavigationManager'); \OC::$server->getAppManager()->clearAppsCache(); if (\is_dir($this->appPath)) {