/** @var IUser|\PHPUnit_Framework_MockObject_MockObject */
private $user;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->logger = $this->createMock(ILogger::class);
/** @var IShareHelper|\PHPUnit_Framework_MockObject_MockObject */
protected $shareHelper;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->activityManager = $this->createMock(IManager::class);
* @package OCA\Comments\Tests\Unit\AppInfo
*/
class ApplicationTest extends TestCase {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OC::$server->getUserManager()->createUser('dummy', '456');
\OC::$server->getUserSession()->setUser(\OC::$server->getUserManager()->get('dummy'));
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC::$server->getUserManager()->get('dummy')->delete();
parent::tearDown();
}
/** @var CommentersSorter */
protected $sorter;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->commentsManager = $this->createMock(ICommentsManager::class);
/** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */
protected $urlGenerator;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->commentsManager = $this->createMock(ICommentsManager::class);
/** @var NotificationListener|\PHPUnit_Framework_MockObject_MockObject */
protected $notificationListener;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->activityListener = $this->getMockBuilder(ActivityListener::class)
/** @var JSSettingsHelper */
protected $helper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->c = $this->createMock(IServerContainer::class);
/** @var Listener */
protected $listener;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->notificationManager = $this->createMock(\OCP\Notification\IManager::class);
/** @var string */
protected $lc = 'tlh_KX';
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->l10nFactory = $this->createMock(IFactory::class);
/** @var IAvatarManager | \PHPUnit_Framework_MockObject_MockObject */
private $avatarManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->avatarManager = $this->createMock(IAvatarManager::class);
$this->home = new AvatarHome(['uri' => 'principals/users/admin'], $this->avatarManager);
/** @var \OCA\DAV\BackgroundJob\GenerateBirthdayCalendarBackgroundJob */
private $backgroundJob;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->dbConnection = $this->createMock(IDBConnection::class);
/** @var EventReminderJob|\PHPUnit\Framework\MockObject\MockObject */
private $backgroundJob;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->reminderService = $this->createMock(ReminderService::class);
/** @var \OCA\DAV\BackgroundJob\GenerateBirthdayCalendarBackgroundJob */
private $backgroundJob;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->birthdayService = $this->createMock(BirthdayService::class);
/** @var IJobList | \PHPUnit_Framework_MockObject_MockObject */
private $jobList;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->caldavBackend = $this->createMock(CalDavBackend::class);
/** @var RegisterRegenerateBirthdayCalendars */
private $backgroundJob;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->time = $this->createMock(ITimeFactory::class);
/** @var CalDavBackend | \PHPUnit_Framework_MockObject_MockObject */
private $calDavBackend;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->resourceManager = $this->createMock(IResourceManager::class);
$this->calDavBackend);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$query = self::$realDatabase->getQueryBuilder();
$query->delete('calendar_resources')->execute();
$query->delete('calendar_resources_md')->execute();
const UNIT_TEST_GROUP = 'principals/groups/caldav-unit-test-group';
const UNIT_TEST_GROUP2 = 'principals/groups/caldav-unit-test-group2';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
$this->cleanUpBackend();
}
- public function tearDown() {
+ public function tearDown(): void {
$this->cleanUpBackend();
parent::tearDown();
}
/** @var IUserSession|\PHPUnit_Framework_MockObject_MockObject */
protected $userSession;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->activityManager = $this->createMock(IManager::class);
$this->groupManager = $this->createMock(IGroupManager::class);
/** @var IFilter|\PHPUnit_Framework_MockObject_MockObject */
protected $filter;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->url = $this->createMock(IURLGenerator::class);
$l = $this->createMock(IL10N::class);
/** @var IFilter|\PHPUnit_Framework_MockObject_MockObject */
protected $filter;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->url = $this->createMock(IURLGenerator::class);
$l = $this->createMock(IL10N::class);
/** @var IProvider|Base|\PHPUnit_Framework_MockObject_MockObject */
protected $provider;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
$this->groupManager = $this->createMock(IGroupManager::class);
protected $response;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = $this->createMock(\Sabre\DAV\Server::class);
/** @var CalendarHome */
private $calendarHome;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->backend = $this->createMock(CalDavBackend::class);
/** @var CalDavBackend | \PHPUnit_Framework_MockObject_MockObject */
private $backend;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->calendar = $this->createMock(Calendar::class);
/** @var CalendarManager */
private $manager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->backend = $this->createMock(CalDavBackend::class);
$this->l10n = $this->createMock(IL10N::class);
/** @var IConfig */
protected $config;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->l10n = $this->getMockBuilder(IL10N::class)
->disableOriginalConstructor()->getMock();
/** @var Outbox */
private $outbox;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var Plugin */
private $plugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->plugin = new Plugin();
/** @var ILogger */
private $logger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$db = \OC::$server->getDatabaseConnection();
$this->l10n, $this->config);
}
- public function tearDown() {
+ public function tearDown(): void {
parent::tearDown();
if (is_null($this->backend)) {
/** @var IURLGenerator | \PHPUnit_Framework_MockObject_MockObject */
private $urlGenerator;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->
/** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
private $timeFactory;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$query = self::$realDatabase->getQueryBuilder();
$this->createRemindersTestSet();
}
- protected function tearDown() {
+ protected function tearDown(): void {
$query = self::$realDatabase->getQueryBuilder();
$query->delete('calendar_reminders')->execute();
$query->delete('calendarobjects')->execute();
*/
protected $user;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->logger = $this->createMock(ILogger::class);
/** @var IMailer|\PHPUnit\Framework\MockObject\MockObject */
private $mailer;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->mailer = $this->createMock(IMailer::class);
/** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
private $timeFactory;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/**
* @throws \OCP\AppFramework\QueryException
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->providerManager = new NotificationProviderManager();
/** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
protected $timeFactory;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->urlGenerator = $this->createMock(IURLGenerator::class);
END:VCALENDAR
EOD;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->backend = $this->createMock(Backend::class);
/** @var string */
protected $expectedCUType;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userSession = $this->createMock(IUserSession::class);
$this->proxyMapper = $this->createMock(ProxyMapper::class);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$query = self::$realDatabase->getQueryBuilder();
$query->delete('calendar_resources')->execute();
use OCA\DAV\CalDAV\ResourceBooking\ResourcePrincipalBackend;
Class ResourcePrincipalBackendTest extends AbstractPrincipalBackendTest {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->principalBackend = new ResourcePrincipalBackend(self::$realDatabase,
use OCA\DAV\CalDAV\ResourceBooking\RoomPrincipalBackend;
Class RoomPrincipalBackendTest extends AbstractPrincipalBackendTest {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->principalBackend = new RoomPrincipalBackend(self::$realDatabase,
class IMipPluginTest extends TestCase {
- public function setUp() {
+ public function setUp(): void {
$this->mailMessage = $this->createMock(IMessage::class);
$this->mailMessage->method('setFrom')->willReturn($this->mailMessage);
$this->mailMessage->method('setReplyTo')->willReturn($this->mailMessage);
/** @var Server|\PHPUnit_Framework_MockObject_MockObject */
private $server;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = $this->createMock(Server::class);
/** @var \OCA\DAV\CalDAV\Search\SearchPlugin $plugin */
protected $plugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = $this->createMock(\Sabre\DAV\Server::class);
/** @var VCard | \PHPUnit_Framework_MockObject_MockObject */
private $vCard;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->addressBookInfo = [
/** @var IL10N | \PHPUnit_Framework_MockObject_MockObject */
private $l10n;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->calDav = $this->createMock(CalDavBackend::class);
'N:TestNoUID;;;;'.PHP_EOL.
'END:VCARD';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
$this->tearDown();
}
- public function tearDown() {
+ public function tearDown(): void {
parent::tearDown();
if (is_null($this->backend)) {
/** @var AccountManager | PHPUnit_Framework_MockObject_MockObject */
private $accountManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->accountManager = $this->createMock(AccountManager::class);
/** @var PhotoCache|\PHPUnit_Framework_MockObject_MockObject */
private $cache;
- function setUp() {
+ function setUp(): void {
parent::setUp();
$this->request = $this->createMock(RequestInterface::class);
/** @var IShareable | \PHPUnit_Framework_MockObject_MockObject */
private $book;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
/** @var Auth | \PHPUnit_Framework_MockObject_MockObject $authBackend */
const USERNAME = 'username';
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
/** @var MoveCalendar */
private $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
*/
class RemoveInvalidSharesTest extends TestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$db = \OC::$server->getDatabaseConnection();
protected $logger;
protected $userSession;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->commentsManager = $this->getMockBuilder(ICommentsManager::class)
/** @var CommentsPluginImplementation */
private $plugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->tree = $this->getMockBuilder(Tree::class)
->disableOriginalConstructor()
/** @var IUserSession|\PHPUnit_Framework_MockObject_MockObject */
protected $userSession;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->commentsManager = $this->getMockBuilder(ICommentsManager::class)
protected $childMap = [];
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->commentsManager = $this->getMockBuilder(ICommentsManager::class)
/** @var \OCP\IUser|\PHPUnit_Framework_MockObject_MockObject */
protected $user;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->user = $this->getMockBuilder(IUser::class)
/** @var string */
private $oldUser;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->session = $this->getMockBuilder(ISession::class)
$this->oldUser = \OC_User::getUser();
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC_User::setIncognitoMode(false);
// Set old user
/** @var Throttler */
private $throttler;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->session = $this->getMockBuilder(ISession::class)
->disableOriginalConstructor()->getMock();
/** @var BearerAuth */
private $bearerAuth;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userSession = $this->createMock(\OC\User\Session::class);
/** @var BlockLegacyClientPlugin */
private $blockLegacyClientVersionPlugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)
protected $userSession;
protected $server;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->commentsManager = $this->getMockBuilder(ICommentsManager::class)
/** @var Server */
private $server;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = new \Sabre\DAV\Server();
$this->plugin = new CopyEtagHeaderPlugin();
*/
private $user;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = new \Sabre\DAV\Server();
$this->tree = $this->getMockBuilder(Tree::class)
);
}
- public function tearDown() {
+ public function tearDown(): void {
$connection = \OC::$server->getDatabaseConnection();
$deleteStatement = $connection->prepare(
'DELETE FROM `*PREFIX*properties`' .
/** @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');
/** @var DummyGetResponsePlugin */
private $dummyGetResponsePlugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->dummyGetResponsePlugin = new DummyGetResponsePlugin();
/** @var FakeLockerPlugin */
private $fakeLockerPlugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->fakeLockerPlugin = new FakeLockerPlugin();
}
/** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */
protected $config;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
unset($_SERVER['HTTP_OC_CHUNKED']);
unset($_SERVER['CONTENT_LENGTH']);
$this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
}
- public function tearDown() {
+ public function tearDown(): void {
$userManager = \OC::$server->getUserManager();
$userManager->get($this->user)->delete();
unset($_SERVER['HTTP_OC_CHUNKED']);
*/
private $previewManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = $this->getMockBuilder(Server::class)
->disableOriginalConstructor()
/** @var IAppManager|\PHPUnit_Framework_MockObject_MockObject * */
private $appManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->tree = $this->getMockBuilder(Tree::class)
->disableOriginalConstructor()
/** @var MaintenancePlugin */
private $maintenancePlugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
/** @var ProxyMapper | \PHPUnit_Framework_MockObject_MockObject */
private $proxyMapper;
- public function setUp() {
+ public function setUp(): void {
$this->userManager = $this->createMock(IUserManager::class);
$this->groupManager = $this->createMock(IGroupManager::class);
$this->shareManager = $this->createMock(IManager::class);
* @package OCA\DAV\Tests\unit\Connector\Sabre\RequestTest
*/
class PartFileInRootUploadTest extends UploadTest {
- protected function setUp() {
+ protected function setUp(): void {
$config = \OC::$server->getConfig();
$mockConfig = $this->getMockBuilder(IConfig::class)
->disableOriginalConstructor()
parent::setUp();
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->restoreService('AllConfig');
- return parent::tearDown();
+ parent::tearDown();
}
}
return $stream;
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
unset($_SERVER['HTTP_OC_CHUNKED']);
*/
private $plugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = new \Sabre\DAV\Server();
$this->tree = $this->createMock(Tree::class);
*/
private $plugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = new \Sabre\DAV\Server();
$this->tree = $this->getMockBuilder(Tree::class)
/** @var BirthdayCalendarController|\PHPUnit_Framework_MockObject_MockObject */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var DirectController */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->rootFolder = $this->createMock(IRootFolder::class);
/** @var InvitationResponseServer|\PHPUnit_Framework_MockObject_MockObject */
private $responseServer;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->dbConnection = $this->createMock(IDBConnection::class);
/** @var CustomPropertiesBackend | \PHPUnit_Framework_MockObject_MockObject */
private $backend;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->tree = $this->createMock(Tree::class);
/** @var GroupPrincipalBackend */
private $connector;
- public function setUp() {
+ public function setUp(): void {
$this->groupManager = $this->createMock(IGroupManager::class);
$this->userSession = $this->createMock(IUserSession::class);
$this->shareManager = $this->createMock(IManager::class);
/** @var EventDispatcherInterface | \PHPUnit_Framework_MockObject_MockObject */
private $eventDispatcher;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->eventDispatcher = $this->createMock(EventDispatcherInterface::class);
$this->l10n = $this->createMock(IL10N::class);
/** @var IShareable | \PHPUnit_Framework_MockObject_MockObject */
private $book;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
/** @var Auth | \PHPUnit_Framework_MockObject_MockObject $authBackend */
/** @var DirectFile */
private $directFile;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->direct = Direct::fromParams([
/** @var DirectHome */
private $directHome;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->directMapper = $this->createMock(DirectMapper::class);
/** @var Directory|\PHPUnit_Framework_MockObject_MockObject */
private $davFolder;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->user = $this->createMock(IUser::class);
/** @var ResponseInterface|\PHPUnit_Framework_MockObject_MockObject */
private $response;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->view = $this->createMock(View::class);
END:VEVENT
END:VCALENDAR';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->logger = $this->createMock(ILogger::class);
/** @var RefreshWebcalJobRegistrar */
private $migration;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->db = $this->createMock(IDBConnection::class);
/** @var RegenerateBirthdayCalendars */
private $migration;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->jobList = $this->createMock(IJobList::class);
/** @var AppleProvisioningNode */
private $node;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->timeFactory = $this->createMock(ITimeFactory::class);
/** @var AppleProvisioningPlugin */
protected $plugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = $this->createMock(\Sabre\DAV\Server::class);
/** @var CalDAVSettings */
private $settings;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
*/
private $user;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tagManager = $this->getMockBuilder(ISystemTagManager::class)
*/
private $user;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tagManager = $this->getMockBuilder(ISystemTagManager::class)
*/
private $plugin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->tree = $this->getMockBuilder(Tree::class)
->disableOriginalConstructor()
*/
private $user;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tagManager = $this->getMockBuilder(ISystemTagManager::class)
*/
private $user;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tagManager = $this->getMockBuilder(ISystemTagManager::class)
*/
private $userFolder;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tagManager = $this->getMockBuilder(ISystemTagManager::class)
/** @var ResponseInterface | \PHPUnit_Framework_MockObject_MockObject */
private $response;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = $this->getMockBuilder('\Sabre\DAV\Server')
/** @var \Symfony\Component\Console\Input\InputInterface | \PHPUnit_Framework_MockObject_MockObject */
protected $input;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->util = $this->getMockBuilder(Util::class)
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->requestMock = $this->getMockBuilder(IRequest::class)
/** @var \OCA\Encryption\Util|\PHPUnit_Framework_MockObject_MockObject */
private $utilMock;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
/** @var StatusController */
protected $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
/** @var Crypt */
private $crypt;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->logger = $this->getMockBuilder(ILogger::class)
/** @var QuestionHelper | \PHPUnit_Framework_MockObject_MockObject */
protected $questionHelper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->util = $this->getMockBuilder(Util::class)
/** @var EncryptAll */
protected $encryptAll;
- function setUp() {
+ function setUp(): void {
parent::setUp();
$this->setupUser = $this->getMockBuilder(Setup::class)
->disableOriginalConstructor()->getMock();
/** @var \OCP\Files\Storage|\PHPUnit_Framework_MockObject_MockObject */
private $storageMock;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->storageMock = $this->getMockBuilder(Storage::class)
/**
*
*/
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
parent::setUpBeforeClass();
// have to make instance static to preserve data between tests
self::$instance = new HookManager();
$this->assertNull($userHooks->setPassphrase($this->params));
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->loggerMock = $this->createMock(ILogger::class);
$this->keyManagerMock = $this->getMockBuilder(KeyManager::class)
/** @var \OCP\IConfig|\PHPUnit_Framework_MockObject_MockObject */
private $configMock;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userId = 'user1';
$this->systemKeyId = 'systemKeyId';
['/', 'testkey', 'admin']));
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->user = $this->createMock(IUser::class);
/**
*
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->sessionMock = $this->createMock(ISession::class);
$this->instance = new Session($this->sessionMock);
}
- protected function tearDown() {
+ protected function tearDown(): void {
self::$tempStorage = [];
parent::tearDown();
}
/** @var ISession */
private $session;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->l = $this->getMockBuilder(IL10N::class)->getMock();
*/
private $instance;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$logMock = $this->createMock(ILogger::class);
$userSessionMock = $this->getMockBuilder(IUserSession::class)
$this->assertTrue($this->instance->userHasFiles('admin'));
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->mountMock = $this->createMock(IMountPoint::class);
$this->filesMock = $this->createMock(View::class);
/** @var CloudIdManager */
private $cloudIdManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)
/** @var ICloudIdManager */
private $cloudIdManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)->disableOriginalConstructor()->getMock();
/** @var ICloudFederationShare|\PHPUnit_Framework_MockObject_MockObject */
private $cloudFederationShare;
- protected function setUp() {
+ protected function setUp(): void {
$this->share = $this->getMockBuilder(IShare::class)->getMock();
$this->federatedShareProvider = $this->getMockBuilder('OCA\FederatedFileSharing\FederatedShareProvider')
/** @var \PHPUnit_Framework_MockObject_MockObject|ICloudFederationProviderManager */
private $cloudFederationProviderManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$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() {
/** @var ICloudFederationFactory|\PHPUnit_Framework_MockObject_MockObject */
private $cloudFederationFactory;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->jobList = $this->getMockBuilder('OCP\BackgroundJob\IJobList')->getMock();
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
private $gsConfig;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->federatedShareProvider = $this->createMock(FederatedShareProvider::class);
$this->gsConfig = $this->createMock(IConfig::class);
const TEST_FILES_SHARING_API_USER1 = "test-share-user1";
const TEST_FILES_SHARING_API_USER2 = "test-share-user2";
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
parent::setUpBeforeClass();
// reset backend
$backend->createUser(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER2);
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
//login as user1
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) {
/** @var int */
private $expectedTokenLength = 15;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->secureRandom = $this->getMockBuilder(ISecureRandom::class)->getMock();
/** @var GetSharedSecret */
private $getSharedSecret;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->httpClientService = $this->createMock(IClientService::class);
/** @var RequestSharedSecret */
private $requestSharedSecret;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->httpClientService = $this->createMock(IClientService::class);
/** @var int simulated timestamp */
private $currentTime = 1234567;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var \PHPUnit_Framework_MockObject_MockObject | \OCA\Federation\TrustedServers */
private $trustedServers;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)->getMock();
/** @var string */
private $dbTable = 'trusted_servers';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$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();
/** @var Hooks */
private $hooks;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->trustedServers = $this->getMockBuilder('OCA\Federation\TrustedServers')
/** @var \PHPUnit_Framework_MockObject_MockObject | SettingsController */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->logger = $this->getMockBuilder(ILogger::class)->getMock();
/** @var TrustedServers */
private $trustedServers;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->trustedServers = $this->getMockBuilder('\OCA\Federation\TrustedServers')->disableOriginalConstructor()->getMock();
$this->admin = new Admin(
/** @var \PHPUnit_Framework_MockObject_MockObject | DiscoveryService */
private $discoveryService;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->discoveryService = $this->getMockBuilder(DiscoveryService::class)
/** @var \PHPUnit_Framework_MockObject_MockObject|ITimeFactory */
private $timeFactory;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->dbHandler = $this->getMockBuilder(DbHandler::class)
/** @var IEventMerger|\PHPUnit_Framework_MockObject_MockObject */
protected $eventMerger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->l10nFactory = $this->createMock(IFactory::class);
/** @var \OCP\IDBConnection */
protected $connection;
- protected function setup() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
}
/** @var ScanFiles */
private $scanFiles;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
*/
private $user1;
- protected function setup() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$this->command = new DeleteOrphanedFiles($this->connection);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$userManager = \OC::$server->getUserManager();
$user1 = $userManager->get($this->user1);
if($user1) {
/** @var Folder|\PHPUnit_Framework_MockObject_MockObject */
private $userFolder;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)
/** @var Helper|\PHPUnit_Framework_MockObject_MockObject */
private $activityHelper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)->getMock();
$this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)->getMock();
*/
private $tagger;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->user = static::getUniqueID('user');
$this->activityManager = $this->createMock(IManager::class);
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC_User::setUserId('');
$user = \OC::$server->getUserManager()->get($this->user);
if ($user !== null) { $user->delete(); }
*/
private $instance;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->l10n = $this->createMock(IL10N::class);
$this->credentialsManager = $this->createMock(ICredentialsManager::class);
/** @var UserPlaceholderHandler */
protected $handler;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->user = $this->createMock(IUser::class);
/** @var AjaxController */
private $ajaxController;
- public function setUp() {
+ public function setUp(): void {
$this->request = $this->createMock(IRequest::class);
$this->rsa = $this->getMockBuilder('\\OCA\\Files_External\\Lib\\Auth\\PublicKey\\RSA')
->disableOriginalConstructor()
use OCP\IRequest;
class GlobalStoragesControllerTest extends StoragesControllerTest {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->service = $this->getMockBuilder('\OCA\Files_External\Service\GlobalStoragesService')
->disableOriginalConstructor()
*/
protected $service;
- public function setUp() {
+ public function setUp(): void {
\OC_Mount_Config::$skipTest = true;
}
- public function tearDown() {
+ public function tearDown(): void {
\OC_Mount_Config::$skipTest = false;
}
*/
private $oldAllowedBackends;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->service = $this->getMockBuilder('\OCA\Files_External\Service\UserStoragesService')
->disableOriginalConstructor()
/** @var \OCP\IConfig|\PHPUnit_Framework_MockObject_MockObject */
protected $config;
- protected function setUp() {
+ protected function setUp(): void {
$this->config = $this->createMock(IConfig::class);
}
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);
}
* @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();
}
*/
protected $mountCache;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->dbConfig = new CleaningDBConfig(\OC::$server->getDatabaseConnection(), \OC::$server->getCrypto());
self::$hookCalls = array();
->willReturn($containerMock);
}
- public function tearDown() {
+ public function tearDown(): void {
\OC_Mount_Config::$skipTest = false;
self::$hookCalls = array();
if ($this->dbConfig) {
const GROUP_ID = 'test_group';
const GROUP_ID2 = 'test_group2';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->globalStoragesService = $this->service;
*/
protected $globalStoragesService;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->globalStoragesService = new GlobalStoragesService($this->backendService, $this->dbConfig, $this->mountCache);
/** @var GlobalAuth|\PHPUnit_Framework_MockObject_MockObject */
private $globalAuth;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->encryptionManager = $this->createMock(IManager::class);
$this->globalStoragesService = $this->createMock(GlobalStoragesService::class);
/** @var Section */
private $section;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)->disableOriginalConstructor()->getMock();
$this->l = $this->getMockBuilder(IL10N::class)->disableOriginalConstructor()->getMock();
private $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = include('files_external/tests/config.amazons3.php');
$this->instance = new AmazonS3($this->config);
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->instance) {
$this->instance->rmdir('');
}
class FtpTest extends \Test\Files\Storage\Storage {
private $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$id = $this->getUniqueID();
$this->instance->mkdir('/');
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->instance) {
\OCP\Files::rmdirr($this->instance->constructUrl(''));
}
private $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$id = $this->getUniqueID();
$this->instance->mkdir('/');
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->instance) {
$this->instance->rmdir('/');
}
class SFTP_KeyTest extends \Test\Files\Storage\Storage {
private $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$id = $this->getUniqueID();
$this->instance->mkdir('/');
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->instance) {
$this->instance->rmdir('/');
}
private $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$id = $this->getUniqueID();
$this->instance->mkdir('/');
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->instance) {
$this->instance->rmdir('/');
}
*/
protected $instance;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$id = $this->getUniqueID();
$this->instance->mkdir('/');
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->instance) {
$this->instance->rmdir('');
}
*/
protected $instance;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = include('files_external/tests/config.swift.php');
$this->instance = new Swift($this->config);
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->instance) {
try {
$container = $this->instance->getContainer();
*/
class WebdavTest extends \Test\Files\Storage\Storage {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$id = $this->getUniqueID();
$this->instance->mkdir('/');
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->instance) {
$this->instance->rmdir('/');
}
/** @var string */
private $subsubfolder;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups', 'no');
$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);
/** @var \OCP\Share\IManager */
protected $shareManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->shareManager = \OC::$server->getShareManager();
$this->sharedCache = $this->sharedStorage->getCache();
}
- protected function tearDown() {
+ protected function tearDown(): void {
if($this->sharedCache) {
$this->sharedCache->clear();
}
/** @var ShareRecipientSorter */
protected $sorter;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->shareManager = $this->createMock(IManager::class);
['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();
$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')));
}
}
- return parent::tearDown();
+ parent::tearDown();
}
private function doesStorageExist($numericId) {
/** @var IClientService */
private $clientService;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder('\\OCP\\IRequest')
->disableOriginalConstructor()->getMock();
/** @var PublicPreviewController */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->previewManager = $this->createMock(IPreview::class);
/** @var IServerContainer|\PHPUnit_Framework_MockObject_MockObject */
private $serverContainer;
- protected function setUp() {
+ protected function setUp(): void {
$this->shareManager = $this->createMock(IManager::class);
$this->shareManager
->expects($this->any())
/** @var IL10N */
private $l10n;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->appName = 'files_sharing';
$this->loginAsUser($this->user);
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC_Util::tearDownFS();
\OC_User::setUserId('');
Filesystem::tearDown();
private $shareManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->shareManager = $this->createMock(ShareManager::class);
/** @var ISearch|\PHPUnit_Framework_MockObject_MockObject */
protected $collaboratorSearch;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->uid = 'test123';
*/
private $user2;
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
$appManager = \OC::$server->getAppManager();
self::$trashBinStatus = $appManager->isEnabledForUser('files_trashbin');
$appManager->disableApp('files_trashbin');
\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();
$this->job = new DeleteOrphanedSharesJob();
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->connection->executeUpdate('DELETE FROM `*PREFIX*share`');
$userManager = \OC::$server->getUserManager();
*/
private $user2;
- protected function setup() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$this->job = new ExpireSharesJob();
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->connection->executeUpdate('DELETE FROM `*PREFIX*share`');
$userManager = \OC::$server->getUserManager();
/** @var ICloudIdManager */
private $cloudIdManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->cloudIdManager = new CloudIdManager();
);
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->cache) {
$this->cache->clear();
}
private $user;
private $testMountProvider;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->uid = $this->getUniqueID('user');
/** @var \OC\Files\Cache\Cache|\PHPUnit_Framework_MockObject_MockObject */
protected $cache;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->storage = $this->getMockBuilder('\OCA\Files_Sharing\External\Storage')
private $ownerUid;
private $recipientUid;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userBackend = new \Test\Util\User\Dummy();
$this->assertTrue(Filesystem::file_exists('bar.txt'));
}
- public function tearDown() {
+ public function tearDown(): void {
\OC::$server->getUserManager()->removeBackend($this->userBackend);
parent::tearDown();
}
/** @var OCSShareAPIMiddleware */
private $middleware;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->shareManager = $this->createMock(IManager::class);
/** @var ShareInfoMiddleware */
private $middleware;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->shareManager = $this->createMock(ShareManager::class);
/** @var IRequest | \PHPUnit_Framework_MockObject_MockObject */
private $request;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
private $table = 'share';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$this->cleanDB();
}
- public function tearDown() {
+ public function tearDown(): void {
parent::tearDown();
$this->cleanDB();
}
/** @var ILogger | \PHPUnit_Framework_MockObject_MockObject */
private $logger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
/** @var Cache */
private $ownerCache;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
$this->sharedCacheRestrictedShare = $this->sharedStorageRestrictedShare->getCache();
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->sharedCache) {
$this->sharedCache->clear();
}
protected $fileIds = []; // [$user=>[$path=>$id]]
protected $fileEtags = []; // [$id=>$etag]
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
parent::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');
private static $tempStorage;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->folder = self::TEST_FOLDER_NAME;
$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);
/** @var IUserManager */
private $userManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->folder = '/folder_share_storage_test';
$this->userManager = \OC::$server->getUserManager();
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->view) {
if ($this->view->file_exists($this->folder)) {
$this->view->unlink($this->folder);
*/
class SharedStorageTest extends TestCase {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OCA\Files_Trashbin\Trashbin::registerHooks();
$this->folder = '/folder_share_storage_test';
$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);
/** @var \OCP\Files\IRootFolder */
protected $rootFolder;
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
parent::setUpBeforeClass();
$application = new Application();
\OC::$server->getGroupManager()->addBackend($groupBackend);
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
//login as user1
$this->rootFolder = \OC::$server->getRootFolder();
}
- protected function tearDown() {
+ protected function tearDown(): void {
$qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$qb->delete('share');
$qb->execute();
parent::tearDown();
}
- 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) { $user->delete(); }
private static $tempStorage;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OCP\Util::connectHook('OC_Filesystem', 'post_delete', '\OCA\Files_Sharing\Hooks', 'unshareChildren');
$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);
}
const TEST_FOLDER_NAME = '/folder_share_updater_test';
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
parent::setUpBeforeClass();
\OCA\Files_Sharing\Helper::registerHooks();
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->folder = self::TEST_FOLDER_NAME;
$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);
/** @var \OCP\Share\IShare */
private $_share;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
$this->sharedCache = $this->sharedStorage->getCache();
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->sharedCache) {
$this->sharedCache->clear();
}
/** @var Capabilities */
private $capabilities;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->capabilities = new Capabilities();
}
/** @var string */
protected $user0 = 'user0';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')
->disableOriginalConstructor()->getMock();
/** @var IUserSession|\PHPUnit_Framework_MockObject_MockObject */
private $userSession;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->rootFolder = $this->createMock(IRootFolder::class);
*/
private $userView;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OC_Hook::clear();
$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();
$user = \OC::$server->getUserManager()->get($this->user);
*/
private $rootView;
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
parent::setUpBeforeClass();
$appManager = \OC::$server->getAppManager();
}
- public static function tearDownAfterClass() {
+ public static function tearDownAfterClass(): void {
// cleanup test user
$user = \OC::$server->getUserManager()->get(self::TEST_TRASHBIN_USER1);
if ($user !== null) {
parent::tearDownAfterClass();
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OC::$server->getAppManager()->enableApp('files_trashbin');
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');
/** @var \PHPUnit_Framework_MockObject_MockObject | IRootFolder */
protected $rootFolder;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')
/** @var IVersionManager|\PHPUnit_Framework_MockObject_MockObject */
private $versionManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->rootFolder = $this->createMock(IRootFolder::class);
*/
private $rootView;
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
parent::setUpBeforeClass();
$application = new \OCA\Files_Sharing\AppInfo\Application();
self::loginHelper(self::TEST_VERSIONS_USER, true);
}
- public static function tearDownAfterClass() {
+ public static function tearDownAfterClass(): void {
// cleanup test user
$user = \OC::$server->getUserManager()->get(self::TEST_VERSIONS_USER);
if ($user !== null) { $user->delete(); }
parent::tearDownAfterClass();
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$config = \OC::$server->getConfig();
}
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->restoreService('AllConfig');
if ($this->rootView) {
/** @var IL10N */
private $l;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var OauthApiController */
private $oauthApiController;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var SettingsController */
private $settingsController;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var AccessTokenMapper */
private $accessTokenMapper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->accessTokenMapper = new AccessTokenMapper(\OC::$server->getDatabaseConnection());
}
/** @var ClientMapper */
private $clientMapper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->clientMapper = new ClientMapper(\OC::$server->getDatabaseConnection());
}
/** @var ClientMapper|MockObject */
private $clientMapper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->initialStateService = $this->createMock(IInitialStateService::class);
/** @var IAppConfig|\PHPUnit_Framework_MockObject_MockObject */
private $appConfig;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var IUserSession */
private $userSession;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->appManager = \OC::$server->getAppManager();
protected $api;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var RemoteWipe|MockObject */
private $remoteWipe;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
/** @var IControllerMethodReflector|\PHPUnit_Framework_MockObject_MockObject */
private $reflector;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->reflector = $this->createMock(IControllerMethodReflector::class);
/** @var IGroupManager */
protected $groupManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = \OC::$server->getUserManager();
return count($users) == 1 ? reset($users) : $users;
}
- protected function tearDown() {
+ protected function tearDown(): void {
foreach($this->users as $user) {
$user->delete();
}
/** @var SecurityFilter */
private $filter;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->urlGenerator = $this->createMock(IURLGenerator::class);
/** @var SecurityProvider */
private $provider;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->l10n = $this->createMock(IFactory::class);
/** @var SecuritySetting */
private $setting;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->l10n = $this->createMock(IL10N::class);
/** @var IAppContainer */
protected $container;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->app = new Application();
$this->container = $this->app->getContainer();
/** @var string */
private $adminUid = 'lololo';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
\OC::$server->getGroupManager()->createGroup('admin')->addUser($user);
}
- public function tearDown() {
+ public function tearDown(): void {
\OC::$server->getUserManager()->get($this->adminUid)->delete();
parent::tearDown();
/** @var ILogger|MockObject */
private $logger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
private $remoteWipe;
private $uid = 'jane';
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var ICertificateManager */
private $systemCertificateManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)->getMock();
*/
private $dirsToRemove = [];
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)
/** @var MailSettingsController */
private $mailController;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->l = $this->createMock(IL10N::class);
/** @var TwoFactorSettingsController */
private $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var IEncryptionModule | \PHPUnit_Framework_MockObject_MockObject */
private $encryptionModule;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
/** @var \OCA\Settings\Mailer\NewUserMailHelper */
private $newUserMailHelper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->defaults = $this->createMock(Defaults::class);
/** @var IL10N */
private $l10n;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->reflector = $this->getMockBuilder(ControllerMethodReflector::class)
->disableOriginalConstructor()->getMock();
/** @var Security\Authtokens */
private $section;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->authTokenProvider = $this->createMock(IAuthTokenProvider::class);
/** @var IConfig */
private $config;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
/** @var IInitialStateService|MockObject */
private $initialState;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->manager = $this->getMockBuilder(Manager::class)->disableOriginalConstructor()->getMock();
$this->userManager = $this->getMockBuilder(IUserManager::class)->getMock();
/** @var IConfig */
private $config;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var IManager|\PHPUnit_Framework_MockObject_MockObject */
private $shareManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
$this->l10n = $this->getMockBuilder(IL10N::class)->getMock();
/** @var Security */
private $section;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->initialStateService = $this->createMock(IInitialStateService::class);
/** @var Capabilities */
private $capabilities;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->capabilities = new Capabilities();
/** @var SettingsManager | \PHPUnit_Framework_MockObject_MockObject */
private $settingsManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->settingsManager = $this->getMockBuilder(SettingsManager::class)
/** @var CapabilitiesManager | \PHPUnit_Framework_MockObject_MockObject */
private $capabilitiesManager;
- public function setUp() {
+ public function setUp(): void {
parent::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() {
/** @var Setting */
private $setting;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->l = $this->createMock(IL10N::class);
/** @var Admin */
private $admin;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->admin = new Admin();
/** @var Capabilities */
protected $capabilities;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->theming = $this->createMock(ThemingDefaults::class);
/** @var ImageManager */
private $imageManager;
- public function setUp() {
+ public function setUp(): void {
$this->request = $this->createMock(IRequest::class);
$this->themingDefaults = $this->createMock(ThemingDefaults::class);
$this->iconBuilder = $this->createMock(IconBuilder::class);
/** @var IURLGenerator */
private $urlGenerator;
- public function setUp() {
+ public function setUp(): void {
$this->request = $this->createMock(IRequest::class);
$this->config = $this->createMock(IConfig::class);
$this->themingDefaults = $this->createMock(ThemingDefaults::class);
$this->imageManager
);
- return parent::setUp();
+ parent::setUp();
}
public function dataUpdateStylesheetSuccess() {
/** @var IAppManager */
protected $appManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */
private $logger;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
$this->appData = $this->createMock(IAppData::class);
/** @var \OCP\AppFramework\IAppContainer */
protected $container;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->app = new App('theming');
$this->container = $this->app->getContainer();
/** @var IL10N */
private $l10n;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
$this->l10n = $this->createMock(IL10N::class);
/** @var Section */
private $section;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->url = $this->createMock(IURLGenerator::class);
$this->l = $this->createMock(IL10N::class);
/** @var INavigationManager|\PHPUnit_Framework_MockObject_MockObject */
private $navigationManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
$this->l10n = $this->createMock(IL10N::class);
/** @var IAppManager */
protected $appManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
$this->appData = $this->createMock(IAppData::class);
$qb->execute();
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->db = \OC::$server->getDatabaseConnection();
$this->resetDB();
}
- protected function tearDown() {
+ protected function tearDown(): void {
parent::tearDown();
$this->resetDB();
/** @var IManager|\PHPUnit_Framework_MockObject_MockObject */
private $notificationManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->storage = \OC::$server->query(BackupCodeStorage::class);
/** @var Provider */
private $provider;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->l10n = $this->createMock(IFactory::class);
/** @var CheckBackupCodes */
private $checkBackupCodes;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
/** @var RememberBackupCodesJob */
private $job;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->registry = $this->createMock(IRegistry::class);
/** @var SettingsController */
private $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)->getMock();
/** @var ActivityPublisher */
private $listener;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->activityManager = $this->createMock(IManager::class);
/** @var ClearNotifications */
private $listener;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->notificationManager = $this->createMock(IManager::class);
/** @var ProviderDisabled */
private $listener;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->registy = $this->createMock(IRegistry::class);
/** @var ProviderEnabled */
private $listener;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->registy = $this->createMock(IRegistry::class);
/** @var RegistryUpdater */
private $listener;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->registry = $this->createMock(IRegistry::class);
/** @var CheckBackupCodes */
private $checkBackupsCodes;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->jobList = $this->createMock(IJobList::class);
/** @var IL10N|MockObject */
protected $l;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->l = $this->createMock(IL10N::class);
/** @var BackupCodesProvider */
private $provider;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->appName = "twofactor_backupcodes";
/** @var BackupCodeStorage */
private $storage;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->mapper = $this->createMock(BackupCodeMapper::class);
/** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */
private $l10n;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var Installer|\PHPUnit_Framework_MockObject_MockObject */
protected $installer;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var IGroupManager|\PHPUnit_Framework_MockObject_MockObject */
protected $groupManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->urlGenerator = $this->createMock(IURLGenerator::class);
/** @var ResetTokenBackgroundJob */
private $resetTokenBackgroundJob;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
/** @var IRegistry|\PHPUnit_Framework_MockObject_MockObject */
private $subscriptionRegistry;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var UpdateChecker */
private $updateChecker;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->updater = $this->createMock(VersionCheck::class);
/** @var Access */
private $access;
- public function setUp() {
+ public function setUp(): void {
$this->connection = $this->createMock(Connection::class);
$this->ldap = $this->createMock(LDAP::class);
$this->userManager = $this->createMock(Manager::class);
/** @var Configuration */
protected $configuration;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->configuration = new Configuration('t01', false);
}
/** @var Connection */
protected $connection;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->ldap = $this->createMock(ILDAPWrapper::class);
/** @var Helper */
private $helper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
*
* @throws \Exception
*/
- public function setUp() {
+ public function setUp(): void {
require_once __DIR__ . '/../../../../lib/base.php';
\OC_App::loadApps(['user_ldap']);
/** @var AccessFactory|\PHPUnit_Framework_MockObject_MockObject */
protected $accessFactory;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->helper = $this->createMock(Helper::class);
*/
class LDAPProviderTest extends \Test\TestCase {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
}
/** @var LDAP|\PHPUnit_Framework_MockObject_MockObject */
private $ldap;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->ldap = $this->getMockBuilder(LDAP::class)
->setMethods(['invokeLDAPMethod'])
/** @var bool */
protected $isUser = true;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->ldap = $this->createMock(LDAP::class);
* @group DB
*/
class UUIDFixGroupTest extends AbstractUUIDFixTest {
- public function setUp() {
+ public function setUp(): void {
$this->isUser = false;
parent::setUp();
/** @var UUIDFixInsert */
protected $job;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->jobList = $this->createMock(IJobList::class);
* @group DB
*/
class UUIDFixUserTest extends AbstractUUIDFixTest {
- public function setUp() {
+ public function setUp(): void {
$this->isUser = true;
parent::setUp();
/** @var IL10N */
private $l10n;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->l10n = $this->getMockBuilder(IL10N::class)->getMock();
/** @var Section */
private $section;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->url = $this->createMock(IURLGenerator::class);
$this->l = $this->createMock(IL10N::class);
/** @var UserMapping|\PHPUnit_Framework_MockObject_MockObject */
protected $mapping;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
// no mocks for those as tests go against DB
$this->dui = new DeletedUsersIndex($this->config, $this->db, $this->mapping);
}
- public function tearDown() {
+ public function tearDown(): void {
$this->config->deleteAppFromAllUsers('user_ldap');
- return parent::tearDown();
+ parent::tearDown();
}
public function testMarkAndFetchUser() {
/** @var Manager */
protected $manager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->access = $this->createMock(Access::class);
/** @var User */
protected $user;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->connection = $this->createMock(Connection::class);
/** @var Manager|\PHPUnit_Framework_MockObject_MockObject */
protected $userManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OC_User::clearBackends();
/** @var UserPluginManager|\PHPUnit_Framework_MockObject_MockObject */
private $userPluginManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->ldapWrapper = $this->createMock(ILDAPWrapper::class);
* @package OCA\User_LDAP\Tests
*/
class WizardTest extends TestCase {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
//we need to make sure the consts are defined, otherwise tests will fail
//on systems without php5_ldap
return $l;
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)
return $l;
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->timeFactory = $this->getMockBuilder('OCP\AppFramework\Utility\ITimeFactory')
/** @var RequestUserAgent */
protected $check;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var MockObject|L10N */
protected $l;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->db = \OC::$server->getDatabaseConnection();
$this->clearTables();
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->clearTables();
parent::tearDown();
}
/** @var CommandTester */
private $commandTester;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$command = new Disable(
/** @var CommandTester */
private $commandTester;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$command = new Enable(
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$config = $this->config = $this->getMockBuilder(IConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$config = $this->config = $this->getMockBuilder(IConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$config = $this->config = $this->getMockBuilder(IConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$systemConfig = $this->systemConfig = $this->getMockBuilder(SystemConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$systemConfig = $this->systemConfig = $this->getMockBuilder(SystemConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$systemConfig = $this->systemConfig = $this->getMockBuilder(SystemConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$systemConfig = $this->systemConfig = $this->getMockBuilder(SystemConfig::class)
/** @var \OCP\UserInterface | \PHPUnit_Framework_MockObject_MockObject */
protected $userInterface;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->view = $this->getMockBuilder(View::class)->getMock();
/** @var \PHPUnit_Framework_MockObject_MockObject | \OC\Encryption\DecryptAll */
protected $decryptAll;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$config = $this->config = $this->getMockBuilder(IConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$config = $this->config = $this->getMockBuilder(IConfig::class)
/** @var EncryptAll */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->manager = $this->getMockBuilder(IManager::class)
/** @var OutputInterface|\PHPUnit_Framework_MockObject_MockObject */
private $output;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->groupManager = $this->createMock(IGroupManager::class);
/** @var OutputInterface|\PHPUnit_Framework_MockObject_MockObject */
private $output;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->groupManager = $this->createMock(IGroupManager::class);
/** @var OutputInterface|\PHPUnit_Framework_MockObject_MockObject */
private $output;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->groupManager = $this->createMock(IGroupManager::class);
/** @var OutputInterface|\PHPUnit_Framework_MockObject_MockObject */
private $output;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->groupManager = $this->createMock(IGroupManager::class);
/** @var OutputInterface|\PHPUnit_Framework_MockObject_MockObject */
private $output;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->groupManager = $this->createMock(IGroupManager::class);
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$config = $this->config = $this->getMockBuilder(IConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$config = $this->config = $this->getMockBuilder(IConfig::class)
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->detector = $this->getMockBuilder(Detection::class)
*
* @return void
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)
->getMock();
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->detector = $this->createMock(Detection::class);
/** @var CommandTester */
private $cmd;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->registry = $this->createMock(IRegistry::class);
/** @var CommandTester */
private $command;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->providerManager = $this->createMock(ProviderManager::class);
/** @var CommandTester */
private $command;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->providerManager = $this->createMock(ProviderManager::class);
/** @var CommandTester */
private $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->mandatoryTwoFactor = $this->createMock(MandatoryTwoFactor::class);
/** @var CommandTester|MockObject */
private $cmd;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->registry = $this->createMock(IRegistry::class);
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$userManager = $this->userManager = $this->getMockBuilder(IUserManager::class)
/** @var Disable */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
/** @var Disable */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
/** @var \Symfony\Component\Console\Command\Command */
protected $command;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$userManager = $this->userManager = $this->getMockBuilder(IUserManager::class)
/** @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(IUserManager::class)
/** @var AppPasswordController */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->session = $this->createMock(ISession::class);
/** @var AutoCompleteController */
protected $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
/** @var IRequest $request */
/** @var TimeFactory|\PHPUnit_Framework_MockObject_MockObject */
private $timeFactory;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->avatarManager = $this->getMockBuilder('OCP\IAvatarManager')->getMock();
$this->avatarFile->method('getEtag')->willReturn('my etag');
}
- public function tearDown() {
+ public function tearDown(): void {
parent::tearDown();
}
/** @var CsrfTokenManager|PHPUnit_Framework_MockObject_MockObject */
private $tokenManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var ChangePasswordController */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(\OC\User\Manager::class);
/** @var ClientFlowLoginController */
private $clientFlowLoginController;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var ClientFlowLoginV2Controller */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var ContactsMenuController */
private $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var CssController */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
/** @var Factory|\PHPUnit_Framework_MockObject_MockObject $factory */
/**
* Sets up the test environment.
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->logger = $this->getMockBuilder(ILogger::class)->getMock();
/** @var IRequest|\PHPUnit_Framework_MockObject_MockObject */
private $request;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
/** @var Factory|\PHPUnit_Framework_MockObject_MockObject $factory */
/** @var IInitialStateService|MockObject */
private $initialStateService;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
$this->userManager = $this->createMock(\OC\User\Manager::class);
/** @var IInitialStateService|\PHPUnit_Framework_MockObject_MockObject */
private $initialStateService;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->existingUser = $this->createMock(IUser::class);
/** @var NavigationController */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var OCSController */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var PreviewController|\PHPUnit_Framework_MockObject_MockObject */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->rootFolder = $this->createMock(IRootFolder::class);
/** @var TwoFactorChallengeController|PHPUnit_Framework_MockObject_MockObject */
private $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var UserController */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
/** @var WipeController */
private $controller;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->remoteWipe = $this->createMock(RemoteWipe::class);
/** @var Controller */
private $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->twoFactorManager = $this->getMockBuilder(Manager::class)
* @throws \Exception if the Nextcloud test server can not be reset or
* started again.
*/
- public function setUp() {
+ public function setUp(): void {
// Ensure that previous Apache server is not running (as cleanUp may not
// have been called).
$this->stopApacheServer();
* @throws \Exception if the Nextcloud test server can not be reset or
* started again.
*/
- public function setUp() {
+ public function setUp(): void {
// Ensure that previous PHP server is not running (as cleanUp may not
// have been called).
$this->killPhpServer();
/** @var string accounts table name */
private $table = 'accounts';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->eventDispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')
->disableOriginalConstructor()->getMock();
$this->jobList = $this->getMockBuilder(IJobList::class)->getMock();
}
- public function tearDown() {
+ public function tearDown(): void {
parent::tearDown();
$query = $this->connection->getQueryBuilder();
$query->delete($this->table)->execute();
/** @var Hooks | \PHPUnit_Framework_MockObject_MockObject */
private $hooks;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->logger = $this->createMock(ILogger::class);
/** @var IValidator|\PHPUnit_Framework_MockObject_MockObject */
protected $validator;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var IAppManager */
protected $manager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userSession = $this->createMock(IUserSession::class);
/** @var array */
protected $bundleAppIds;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->l10n = $this->createMock(IL10N::class);
$this->l10n->method('t')
/** @var BundleFetcher */
private $bundleFetcher;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->l10n = $this->createMock(IL10N::class);
use OC\App\AppStore\Bundles\CoreBundle;
class CoreBundleTest extends BundleBase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->bundle = new CoreBundle($this->l10n);
$this->bundleIdentifier = 'CoreBundle';
use OC\App\AppStore\Bundles\EducationBundle;
class EducationBundleTest extends BundleBase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->bundle = new EducationBundle($this->l10n);
$this->bundleIdentifier = 'EducationBundle';
use OC\App\AppStore\Bundles\EnterpriseBundle;
class EnterpriseBundleTest extends BundleBase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->bundle = new EnterpriseBundle($this->l10n);
$this->bundleIdentifier = 'EnterpriseBundle';
use OC\App\AppStore\Bundles\GroupwareBundle;
class GroupwareBundleTest extends BundleBase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->bundle = new GroupwareBundle($this->l10n);
$this->bundleIdentifier = 'GroupwareBundle';
use OC\App\AppStore\Bundles\SocialSharingBundle;
class SocialSharingBundleTest extends BundleBase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->bundle = new SocialSharingBundle($this->l10n);
$this->bundleIdentifier = 'SocialSharingBundle';
EOD;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
/** @var Factory|PHPUnit_Framework_MockObject_MockObject $factory */
use OC\App\AppStore\Fetcher\CategoryFetcher;
class CategoryFetcherTest extends FetcherBase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->fileName = 'categories.json';
$this->endpoint = 'https://apps.nextcloud.com/api/v1/categories.json';
/** @var string */
protected $endpoint;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->appDataFactory = $this->createMock(Factory::class);
$this->appData = $this->createMock(AppData::class);
/** @var VersionParser */
private $versionParser;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->versionParser = new VersionParser();
}
/** @var InfoChecker */
protected $infoChecker;
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
\OC::$APPSROOTS[] = [
'path' => \OC::$SERVERROOT . '/tests/apps',
'url' => '/apps-test',
];
}
- public static function tearDownAfterClass() {
+ public static function tearDownAfterClass(): void {
// remove last element
array_pop(\OC::$APPSROOTS);
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->infoChecker = new InfoChecker();
}
/** @var CompareVersion */
private $compare;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->compare = new CompareVersion();
/** @var DependencyAnalyzer */
private $analyser;
- public function setUp() {
+ public function setUp(): void {
$this->platformMock = $this->getMockBuilder(Platform::class)
->disableOriginalConstructor()
->getMock();
/** @var OC\Cache\CappedMemoryCache */
private static $cache;
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
self::$cache = new OC\Cache\CappedMemoryCache();
}
protected $originalConfig;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
])->execute();
}
- public function tearDown() {
+ public function tearDown(): void {
$sql = $this->connection->getQueryBuilder();
$sql->delete('appconfig');
$sql->execute();
private $controllerMethod;
private $appPath;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', array());
}
- protected function tearDown() {
+ protected function tearDown(): void {
rrmdir($this->appPath);
parent::tearDown();
}
private $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
private $controller;
private $app;
- protected function setUp(){
+ protected function setUp(): void {
parent::setUp();
$request = new Request(
private $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
private $entity;
- protected function setUp(){
+ protected function setUp(): void {
parent::setUp();
$this->entity = new TestEntity();
}
*/
private $mapper;
- protected function setUp(){
+ protected function setUp(): void {
parent::setUp();
$this->mapper = new ExampleMapper($this->db);
}
* 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(
/**
* @throws \ReflectionException
*/
- protected function setUp() {
+ protected function setUp(): void {
$this->db = $this->getMockBuilder(IDBConnection::class)
->disableOriginalConstructor()
/** @var DIContainer|\PHPUnit_Framework_MockObject_MockObject */
private $container;
- protected function setUp(){
+ protected function setUp(): void {
parent::setUp();
$this->container = $this->getMockBuilder(DIContainer::class)
->setMethods(['isAdminUser'])
/** @var ServerContainer */
private $server;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->server = new ServerContainer();
/** @var ContentSecurityPolicy */
private $contentSecurityPolicy;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->contentSecurityPolicy = new ContentSecurityPolicy();
}
*/
private $response;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->response = new DataResponse();
}
private $http;
private $reflector;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->controllerMethod = 'test';
*/
protected $response;
- protected function setUp(){
+ protected function setUp(): void {
parent::setUp();
$this->response = new ChildDownloadResponse('file', 'content');
}
/** @var EmptyContentSecurityPolicy */
private $contentSecurityPolicy;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->contentSecurityPolicy = new EmptyContentSecurityPolicy();
}
/** @var EmptyFeaturePolicy */
private $policy;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->policy = new EmptyFeaturePolicy();
}
/** @var EmptyFeaturePolicy */
private $policy;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->policy = new FeaturePolicy();
}
/** @var FileDisplayResponse */
private $response;
- public function setup() {
+ public function setUp(): void {
$this->file = $this->getMockBuilder('OCP\Files\File')
->getMock();
*/
private $http;
- protected function setUp(){
+ protected function setUp(): void {
parent::setUp();
$this->server = array();
*/
private $json;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->json = new JSONResponse();
}
*/
protected $response;
- protected function setUp(){
+ protected function setUp(): void {
parent::setUp();
$this->response = new RedirectResponse('/url');
}
/** @var CsrfTokenManager */
protected $csrfTokenManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
if (in_array('fakeinput', stream_get_wrappers())) {
->disableOriginalConstructor()->getMock();
}
- protected function tearDown() {
+ protected function tearDown(): void {
stream_wrapper_unregister('fakeinput');
parent::tearDown();
}
*/
private $childResponse;
- protected function setUp(){
+ protected function setUp(): void {
parent::setUp();
$this->childResponse = new Response();
}
/** @var IOutput */
private $output;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->output = $this->getMockBuilder('OCP\\AppFramework\\Http\\IOutput')
->disableOriginalConstructor()
*/
private $tpl;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tpl = new TemplateResponse('app', 'home');
/** @var AdditionalScriptsMiddleware */
private $middleWare;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->dispatcher = $this->createMock(EventDispatcherInterface::class);
*/
private $dispatcher;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->dispatcher = new MiddlewareDispatcher();
/** @var Response */
private $response;
- protected function setUp(){
+ protected function setUp(): void {
parent::setUp();
$this->middleware = new ChildMiddleware();
*/
private $request;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)
private $middleware;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var BruteForceMiddleware */
private $bruteForceMiddleware;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->reflector = $this->createMock(ControllerMethodReflector::class);
/** @var Controller */
private $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->reflector = new ControllerMethodReflector();
$this->session = $this->createMock(Session::class);
/** @var ContentSecurityPolicyNonceManager|MockObject */
private $cspNonceManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->controller = $this->createMock(Controller::class);
/** @var FeaturePolicyManager|MockObject */
private $manager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->controller = $this->createMock(Controller::class);
/** @var ITimeFactory|\PHPUnit_Framework_MockObject_MockObject */
private $timeFactory;
- protected function setUp() {
+ protected function setUp(): void {
$this->reflector = new ControllerMethodReflector();
$this->session = $this->createMock(ISession::class);
$this->userSession = $this->createMock(IUserSession::class);
/** @var RateLimitingMiddleware */
private $rateLimitingMiddleware;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var ControllerMethodReflector|\PHPUnit_Framework_MockObject_MockObject */
private $reflector;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(Request::class);
/** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */
private $l10n;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->controller = $this->createMock(Controller::class);
/** @var Controller */
private $controller;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->reflector = new ControllerMethodReflector();
private $container;
- public function setUp() {
+ public function setUp(): void {
$this->container = new SimpleContainer();
}
/** @var IEventListener */
private $listener;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->activityManager = $this->createMock(IActivityManager::class);
/** @var IEventListener */
private $listener;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->mailer = $this->createMock(IMailer::class);
/** @var IEventListener */
private $listener;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->notificationManager = $this->createMock(INotificationManager::class);
/** @var ALoginCommand */
protected $cmd;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var IConfig|MockObject */
private $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var Session|MockObject */
private $session;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->session = $this->createMock(Session::class);
/** @var Session|MockObject */
private $userSession;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var IUserManager|MockObject */
private $userManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
/** @var Session|MockObject */
private $userSession;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userSession = $this->createMock(Session::class);
/** @var ILogger|MockObject */
private $logger;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->logger = $this->createMock(ILogger::class);
/** @var IUserManager|MockObject */
private $userManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(Manager::class);
/** @var ISession|MockObject */
private $session;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var IURLGenerator|MockObject */
private $urlGenerator;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->twoFactorManager = $this->createMock(Manager::class);
/** @var Manager|MockObject */
private $userManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(Manager::class);
/** @var ISession|MockObject */
private $session;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->session = $this->createMock(ISession::class);
/** @var ILogger|MockObject */
private $logger;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
/** @var Credentials */
private $credentials;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->uid = 'user123';
/** @var Store */
private $store;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->session = $this->createMock(ISession::class);
private $job;
private $tokenProvider;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tokenProvider = $this->getMockBuilder(Manager::class)
private $dbConnection;
private $time;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->dbConnection = OC::$server->getDatabaseConnection();
/** @var int */
private $time;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->mapper = $this->createMock(DefaultTokenMapper::class);
/** @var Manager */
private $manager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->publicKeyTokenProvider = $this->createMock(PublicKeyTokenProvider::class);
/** @var int */
private $time;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->dbConnection = OC::$server->getDatabaseConnection();
/** @var int */
private $time;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->mapper = $this->createMock(PublicKeyTokenMapper::class);
/** @var RemoteWipe */
private $remoteWipe;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tokenProvider = $this->createMock(IProvider::class);
/** @var ProviderUserAssignmentDao */
private $dao;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->dbConn = OC::$server->getDatabaseConnection();
/** @var EventDispatcherInterface|MockObject */
private $eventDispatcher;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->user = $this->createMock(IUser::class);
/** @var MandatoryTwoFactor */
private $mandatoryTwoFactor;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var ProviderLoader */
private $loader;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->appManager = $this->createMock(IAppManager::class);
/** @var ProviderManager */
private $providerManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->providerLoader = $this->createMock(ProviderLoader::class);
/** @var Registry */
private $registry;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->dao = $this->createMock(ProviderUserAssignmentDao::class);
*/
private $loader;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->loader = new \OC\AutoLoader([]);
}
/** @var AvatarManager | \PHPUnit_Framework_MockObject_MockObject */
private $avatarManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(Manager::class);
/** @var \OCP\IConfig|\PHPUnit_Framework_MockObject_MockObject */
private $config;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->folder = $this->createMock(SimpleFolder::class);
/** @var \OCP\AppFramework\Utility\ITimeFactory|\PHPUnit_Framework_MockObject_MockObject */
protected $timeFactory;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
class JobTest extends \Test\TestCase {
private $run = false;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->run = false;
}
*/
private $jobList;
- protected function setup() {
+ protected function setUp(): void {
parent::setUp();
$this->jobList = new DummyJobList();
/** @var ITimeFactory */
private $time;
- protected function setup() {
+ protected function setUp(): void {
parent::setUp();
$this->jobList = new DummyJobList();
* @package Test\Cache
*/
class CappedMemoryCacheTest extends TestCache {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->instance = new \OC\Cache\CappedMemoryCache();
}
//$this->skipUnless(OC_User::isLoggedIn());
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
//clear all proxies and hooks so we can do clean testing
$this->instance->set('hack', 'hack');
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->instance) {
$this->instance->remove('hack', 'hack');
}
*/
protected $instance;
- protected function tearDown() {
+ protected function tearDown(): void {
if($this->instance) {
$this->instance->clear();
}
/** @var Manager */
private $manager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->manager = new Manager();
/** @var IServerContainer */
private $server;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->server = $this->createMock(IServerContainer::class);
/** @var IServerContainer */
private $server;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->server = $this->createMock(IServerContainer::class);
/** @var ILogger */
private $logger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->logger = $this->getMockBuilder(ILogger::class)->getMock();
$this->manager = new CapabilitiesManager($this->logger);
/** @var IUser|\PHPUnit_Framework_MockObject_MockObject */
protected $user;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */
protected $logger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userSession = $this->createMock(IUserSession::class);
/** @var IUserSession|\PHPUnit_Framework_MockObject_MockObject */
protected $userSession;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var SearchResult */
protected $searchResult;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(IUserManager::class);
/** @var ISearch */
protected $search;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->container = $this->createMock(IContainer::class);
/** @var ISearch */
protected $search;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->container = $this->createMock(IContainer::class);
/** @var IUser|\PHPUnit_Framework_MockObject_MockObject */
protected $user;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
*/
abstract protected function createBus();
- public function setUp() {
+ public function setUp(): void {
self::$lastCommand = '';
}
private $jobList;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->jobList = new DummyJobList();
/** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */
private $urlGenerator;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->checker = $this->createMock(Checker::class);
$this->fileAccessHelper = $this->createMock(FileAccessHelper::class);
/** @var SignCore */
private $signCore;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->checker = $this->createMock(Checker::class);
$this->fileAccessHelper = $this->createMock(FileAccessHelper::class);
/** @var IDBConnection */
private $connection;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
/** @var string */
private $randomTmpDir;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->randomTmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
$this->config = new \OC\Config($this->randomTmpDir, 'testconfig.php');
}
- protected function tearDown() {
+ protected function tearDown(): void {
unlink($this->configFile);
parent::tearDown();
}
/** @var ActionFactory */
private $actionFactory;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->actionFactory = new ActionFactory();
/** @var ActionProviderStore */
private $actionProviderStore;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->serverContainer = $this->createMock(IServerContainer::class);
private $action;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->action = new LinkAction();
/** @var IConfig|PHPUnit_Framework_MockObject_MockObject */
private $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->contactsManager = $this->createMock(IManager::class);
/** @var Entry */
private $entry;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->entry = new Entry();
/** @var Manager */
private $manager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->contactsStore = $this->createMock(ContactsStore::class);
/** @var EMailProvider */
private $provider;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->actionFactory = $this->createMock(IActionFactory::class);
/** @var \OC\ContactsManager */
private $cm;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->cm = new \OC\ContactsManager();
}
*/
private $connection;
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
self::dropTestTable();
parent::setUpBeforeClass();
}
- public static function tearDownAfterClass() {
+ public static function tearDownAfterClass(): void {
self::dropTestTable();
parent::tearDownAfterClass();
}
}
}
- 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');
}
/** @var ITempManager */
protected $tempManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tempManager = \OC::$server->getTempManager();
$this->table2 = $r.'cntcts_cards';
}
- protected function tearDown() {
+ protected function tearDown(): void {
unlink($this->schema_file);
unlink($this->schema_file2);
protected static $schema_file;
protected $test_prefix;
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
self::$schema_file = \OC::$server->getTempManager()->getTemporaryFile();
}
*/
private $text_table;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$dbFile = \OC::$SERVERROOT.'/tests/data/db_structure.xml';
$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);
*/
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') {
/** @var \PHPUnit_Framework_MockObject_MockObject | IDBConnection $db */
private $db;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->db = $this->createMock(Connection::class);
/** @var string */
private $tableNameTmp;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = \OC::$server->getConfig();
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));
/** @var string */
private $tableName;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$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();
}
/** @var \Doctrine\DBAL\Connection|\OCP\IDBConnection */
protected $connection;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
/** @var \Doctrine\DBAL\Connection|\OCP\IDBConnection */
protected $connection;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
/** @var \Doctrine\DBAL\Connection|\OCP\IDBConnection */
protected $connection;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
/** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */
protected $logger;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
/** @var QuoteHelper */
protected $helper;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->helper = new QuoteHelper();
private $schemaFile;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->schemaFile = \OC::$server->getTempManager()->getTemporaryFile();
$this->testPrefix= strtolower($this->getUniqueID($this->config->getSystemValue('dbtableprefix', 'oc_'), 3));
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->manager->removeDBStructure($this->schemaFile);
parent::tearDown();
}
/** @var string */
private $tableName;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$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();
}
static protected $defaultTimeZone;
- public static function setUpBeforeClass() {
+ public static function setUpBeforeClass(): void {
parent::setUpBeforeClass();
self::$defaultTimeZone = date_default_timezone_get();
date_default_timezone_set('UTC');
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->getL10N('lib', 'en'));
}
/** @var \OC\Diagnostics\EventLogger */
private $logger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->logger = new EventLogger();
/** @var \OC\Diagnostics\QueryLogger */
private $logger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->logger = new QueryLogger();
/** @var DecryptAll */
protected $instance;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userManager = $this->getMockBuilder(IUserManager::class)
/** @var \PHPUnit_Framework_MockObject_MockObject | \OC\Memcache\ArrayCache */
private $arrayCache;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->arrayCache = $this->createMock(ArrayCache::class);
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $config;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->util = $this->getMockBuilder('OC\Encryption\Util')
/** @var ArrayCache|\PHPUnit_Framework_MockObject_MockObject */
private $arrayCache;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
$this->logger = $this->createMock(ILogger::class);
/** @var \OC\Encryption\File | \PHPUnit_Framework_MockObject_MockObject */
private $fileHelper;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->view = $this->getMockBuilder(View::class)
/** @var \OC\Encryption\Util */
private $util;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
/** @var CloudIdManager */
private $cloudIdManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->cloudIdManager = new CloudIdManager();
}
/** @var IAppData */
private $appData;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->rootFolder = $this->createMock(IRootFolder::class);
/** @var Factory */
private $factory;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->rootFolder = $this->createMock(IRootFolder::class);
$this->cache->remove("sub");
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->cache) {
$this->cache->clear();
}
parent::tearDown();
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->storage = new \OC\Files\Storage\Temporary(array());
*/
private $user;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->user = new DummyUser('foo', \OC::$server->getTempManager()->getTemporaryFolder());
* @group DB
*/
class MoveFromCacheTraitTest extends CacheTest {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->storage = new \OC\Files\Storage\Temporary(array());
/** @var IStorage */
private $storage;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->storage = new Temporary();
$this->storage->mkdir('foo/bar');
/** @var integer */
private $numericStorageId;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->builder = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$this->mimetypeLoader = $this->createMock(IMimeTypeLoader::class);
->where($this->builder->expr()->eq('storage', new Literal($this->numericStorageId)));
}
- public function tearDown() {
+ public function tearDown(): void {
parent::tearDown();
$builder = \OC::$server->getDatabaseConnection()->getQueryBuilder();
*/
private $cache;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->storage = new \OC\Files\Storage\Temporary(array());
$this->cache = new \OC\Files\Cache\Cache($this->storage);
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->cache) {
$this->cache->clear();
}
private static $user;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->storage = new \OC\Files\Storage\Temporary(array());
\OC_Hook::clear('OC_Filesystem');
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->cache) {
$this->cache->clear();
}
*/
protected $updater;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->loginAsUser();
$this->cache = $this->storage->getCache();
}
- protected function tearDown() {
+ protected function tearDown(): void {
Filesystem::clearMounts();
$this->logout();
*/
private $storages = array();
- 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();
$ids = $cache->getAll();
*/
protected $sourceCache;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->storage->mkdir('foo');
$this->sourceCache = $this->cache;
*/
protected $sourceCache;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->storage->mkdir('foo');
$this->sourceCache = $this->cache;
private $fileIds = [];
- public function setUp() {
+ public function setUp(): void {
$this->fileIds = [];
$this->connection = \OC::$server->getDatabaseConnection();
$this->userManager = new Manager($this->createMock(IConfig::class), $this->createMock(EventDispatcherInterface::class));
$this->cache = new \OC\Files\Config\UserMountCache($this->connection, $this->userManager, $this->createMock(Log::class));
}
- public function tearDown() {
+ public function tearDown(): void {
$builder = $this->connection->getQueryBuilder();
$builder->delete('mounts')->execute();
*/
private $userBackend;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OC_Hook::clear('OC_Filesystem', 'setup');
\OC_User::useBackend($this->userBackend);
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC::$server->getConfig()->setSystemValue('datadirectory', $this->datadir);
$this->logout();
private $config;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->createUser('foo', 'foo');
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
return array('datadir' => $dir);
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$userBackend = new \Test\Util\User\Dummy();
$userBackend->createUser(self::TEST_FILESYSTEM_USER1, self::TEST_FILESYSTEM_USER1);
$this->loginAsUser();
}
- protected function tearDown() {
+ protected function tearDown(): void {
foreach ($this->tmpDirs as $dir) {
\OC_Helper::rmdirr($dir);
}
*/
private $manager;
- protected function setup() {
+ protected function setUp(): void {
parent::setUp();
$this->manager = new \OC\Files\Mount\Manager();
}
/** @var IStorageFactory|\PHPUnit_Framework_MockObject_MockObject */
protected $loader;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
*/
private $userId;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userId = $this->getUniqueID();
$this->createUser($this->userId, 'pass');
$this->eventDispatcher = \OC::$server->getEventDispatcher();
}
- public function tearDown() {
+ public function tearDown(): void {
parent::tearDown();
\OC_Hook::clear('OC_Filesystem');
\OC_Util::tearDownFS();
*/
private $view;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$manager = \OC\Files\Filesystem::getMountManager();
$this->root->mount($subStorage, '/substorage/');
}
- protected function tearDown() {
+ protected function tearDown(): void {
foreach ($this->storages as $storage) {
$storage->getCache()->clear();
}
/** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */
protected $userManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->user = $this->createMock(IUser::class);
/** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */
private $userManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->user = $this->createMock(IUser::class);
/** @var \OC\Files\ObjectStore\NoopScanner $scanner */
private $scanner;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->storage = new \OC\Files\Storage\Temporary(array());
*/
private $objectStorage;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$baseStorage = new Temporary();
$this->instance = new ObjectStoreStorageOverwrite($config);
}
- protected function tearDown() {
+ protected function tearDown(): void {
if (is_null($this->instance)) {
return;
}
*/
private $view;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->view = new View();
}
/** @var SimpleFile */
private $simpleFile;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->file = $this->createMock(File::class);
/** @var SimpleFolder */
private $simpleFolder;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->folder = $this->createMock(Folder::class);
*/
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();
}
*/
class CopyDirectoryTest extends Storage {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->instance = new CopyDirectoryStorage([]);
}
*/
private $user;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
$this->instance = new \OC\Files\Storage\Home(array('user' => $this->user));
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC_Helper::rmdirr($this->tmpDir);
parent::tearDown();
}
*/
private $tmpDir;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
$this->instance = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC_Helper::rmdirr($this->tmpDir);
parent::tearDown();
}
/** @var Availability */
protected $wrapper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->storageCache = $this->createMock(StorageCache::class);
*/
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([
]);
}
- public function tearDown() {
+ public function tearDown(): void {
$this->sourceStorage->cleanUp();
parent::tearDown();
}
/** @var integer dummy unencrypted size */
private $dummySize = -1;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
*/
private $sourceStorage;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->sourceStorage = new \OC\Files\Storage\Temporary(array());
$this->sourceStorage->mkdir('foo');
));
}
- public function tearDown() {
+ public function tearDown(): void {
// test that nothing outside our jail is touched
$contents = array();
$dh = $this->sourceStorage->opendir('');
*/
private $sourceStorage;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->sourceStorage = new \OC\Files\Storage\Temporary(array());
$this->instance = $this->getMaskedStorage(Constants::PERMISSION_ALL);
}
- public function tearDown() {
+ public function tearDown(): void {
$this->sourceStorage->cleanUp();
parent::tearDown();
}
*/
private $tmpDir;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
$this->instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 10000000));
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC_Helper::rmdirr($this->tmpDir);
parent::tearDown();
}
*/
private $tmpDir;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
$this->instance = new \OC\Files\Storage\Wrapper\Wrapper(array('storage' => $storage));
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC_Helper::rmdirr($this->tmpDir);
parent::tearDown();
}
/** @var Detection */
private $detection;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->detection = new Detection(
\OC::$server->getURLGenerator(),
/** @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(
*/
private $userBackend;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userBackend = new \Test\Util\User\Dummy();
$this->loginAsUser();
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->logout();
\OC::$server->getUserManager()->removeBackend($this->userBackend);
parent::tearDown();
/** @var \OC\Files\Storage\Storage */
private $tempStorage;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OC_Hook::clear();
$this->tempStorage = null;
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC_User::setUserId($this->user);
foreach ($this->storages as $storage) {
$cache = $storage->getCache();
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
private $config;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
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);
}
* @group DB
*/
class Dummy extends Backend {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->backend=new \Test\Util\Group\Dummy();
}
/** @var EventDispatcherInterface|MockObject */
protected $dispatcher;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->dispatcher = $this->createMock(EventDispatcherInterface::class);
}
/** @var ILogger|MockObject */
protected $logger;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->userManager = $this->createMock(Manager::class);
/** @var bool */
private $isAdmin = true;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->groupManager = $this->getMockBuilder('\OC\Group\Manager')
->disableOriginalConstructor()
/** @var \OC\Files\Storage\Storage */
private $storage;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->user = $this->getUniqueID('user_');
$this->storageMock = null;
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->user = null;
if ($this->storageMock) {
*/
protected $emitter;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->emitter = new DummyEmitter();
}
//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();
/** @var array */
private $defaultRequestOptions;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
$this->guzzleClient = $this->getMockBuilder(\GuzzleHttp\Client::class)
/** @var GuzzleResponse */
private $guzzleResponse;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->guzzleResponse = new GuzzleResponse(1337);
}
use OCP\IConfig;
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');
/** @var InitialStateService */
private $service;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->service = new InitialStateService(
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
private $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->appFetcher = $this->createMock(AppFetcher::class);
);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$installer = new Installer(
\OC::$server->getAppFetcher(),
\OC::$server->getHTTPClientService(),
/** @var \OC\Files\Type\Detection|\PHPUnit_Framework_MockObject_MockObject */
private $mimeTypeDetector;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->environmentHelper = $this->createMock(EnvironmentHelper::class);
$this->fileAccessHelper = $this->createMock(FileAccessHelper::class);
/** @var AppLocator */
private $locator;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->locator = new AppLocator();
}
/** @var EnvironmentHelper */
private $environmentHelper;
- public function setUp() {
+ public function setUp(): void {
$this->environmentHelper = new EnvironmentHelper();
- return parent::setUp();
+ parent::setUp();
}
public function testGetServerRoot() {
/** @var FileAccessHelper */
private $fileAccessHelper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->fileAccessHelper = new FileAccessHelper();
}
/** @var ExcludeFileByNameFilterIterator|\PHPUnit\Framework\MockObject\MockObject */
protected $filter;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->filter = $this->getMockBuilder(ExcludeFileByNameFilterIterator::class)
->disableOriginalConstructor()
/** @var string */
protected $serverRoot;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)
/** @var LanguageIterator */
protected $iterator;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->user = $this->createMock(IUser::class);
/** @var \OC\LargeFileHelper */
protected $helper;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->helper = new \OC\LargeFileHelper();
}
class LargeFileHelperTest extends TestCase {
protected $helper;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->helper = new \OC\LargeFileHelper;
}
/** @var string */
private $originalWebRoot;
- public function setUp() {
+ public function setUp(): void {
$this->originalWebRoot = \OC::$WEBROOT;
}
- public function tearDown() {
+ public function tearDown(): void {
// Reset webRoot
\OC::$WEBROOT = $this->originalWebRoot;
}
protected $currentTime;
- public function setUp() {
+ public function setUp(): void {
$this->currentTime = time();
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->timeFactory->expects($this->any())
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();
}
*/
abstract protected function getInstance();
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->instance = $this->getInstance();
}
return new \OC\Lock\MemcacheLockingProvider($this->memcache);
}
- public function tearDown() {
+ public function tearDown(): void {
$this->memcache->clear();
parent::tearDown();
}
class NoFSTest extends \Test\TestCase {
use UserTrait;
- public function tearDown() {
+ public function tearDown(): void {
$token = new DefaultToken();
$token->setScope([
'filesystem' => true
]);
\OC::$server->getLockdownManager()->setToken($token);
- return parent::tearDown();
+ parent::tearDown();
}
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$token = new DefaultToken();
$token->setScope([
/** @var NullCache */
private $cache;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->cache = new NullCache();
/** @var NullStorage */
private $storage;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->storage = new NullStorage([]);
class LockdownManagerTest extends TestCase {
private $sessionCallback;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->sessionCallback = function() {
/** @var File */
protected $logFile;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$config = \OC::$server->getSystemConfig();
$this->restore_logfile = $config->getValue("logfile");
$config->setValue("logfile", $config->getValue('datadirectory') . "/logtest.log");
$this->logFile = new File($config->getValue('datadirectory') . '/logtest.log', '', $config);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$config = \OC::$server->getSystemConfig();
if (isset($this->restore_logfile)) {
$config->getValue("logfile", $this->restore_logfile);
/** @var SystemConfig|\PHPUnit_Framework_MockObject_MockObject */
protected $systemConfig;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->c = $this->createMock(IServerContainer::class);
/** @var array */
private $logs = [];
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->logs = [];
/** @var EMailTemplate */
private $emailTemplate;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->defaults = $this->createMock(Defaults::class);
/** @var Mailer */
private $mailer;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
);
}
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->swiftMessage = $this->getMockBuilder('\Swift_Message')
namespace Test\Memcache;
class APCuTest extends Cache {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
if(!\OC\Memcache\APCu::isAvailable()) {
namespace Test\Memcache;
class ArrayCacheTest extends Cache {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->instance = new \OC\Memcache\ArrayCache('');
}
}
- protected function tearDown() {
+ protected function tearDown(): void {
if ($this->instance) {
$this->instance->clear();
}
namespace Test\Memcache;
class MemcachedTest extends Cache {
- static public function setUpBeforeClass() {
+ static public function setUpBeforeClass(): void {
parent::setUpBeforeClass();
if (!\OC\Memcache\Memcached::isAvailable()) {
}
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->instance = new \OC\Memcache\Memcached($this->getUniqueID());
}
namespace Test\Memcache;
class RedisTest extends Cache {
- static public function setUpBeforeClass() {
+ static public function setUpBeforeClass(): void {
parent::setUpBeforeClass();
if (!\OC\Memcache\Redis::isAvailable()) {
}
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->instance = new \OC\Memcache\Redis($this->getUniqueID());
}
/** @var EventDispatcherInterface|\PHPUnit_Framework_MockObject_MockObject $dispatcher */
private $dispatcher;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->jobList = $this->getMockBuilder('OC\BackgroundJob\JobList')
/** @var \OC\NavigationManager */
protected $navigationManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->appManager = $this->createMock(AppManager::class);
/** @var IAction */
protected $action;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->action = new Action();
}
/** @var ILogger|MockObject */
protected $logger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->validator = $this->createMock(IValidator::class);
$this->logger = $this->createMock(ILogger::class);
/** @var IValidator|\PHPUnit_Framework_MockObject_MockObject */
protected $validator;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->validator = $this->createMock(IValidator::class);
$this->notification = new Notification($this->validator);
/** @var IDiscoveryService */
private $discoveryService;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->cacheFactory = $this->getMockBuilder(ICacheFactory::class)->getMock();
/** @var Provider */
private $ocsProvider;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder('\\OCP\\IRequest')->getMock();
/** @var IRootFolder */
private $rootFolder;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->userId = $this->getUniqueID();
$this->rootFolder = \OC::$server->getRootFolder();
}
- public function tearDown() {
+ public function tearDown(): void {
if ($this->trashEnabled) {
$appManager = \OC::$server->getAppManager();
$appManager->enableApp('files_trashbin');
$this->logout();
- return parent::tearDown();
+ parent::tearDown();
}
private function setup11Previews(): array {
*/
class BitmapTest extends Provider {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$fileName = 'testimage.eps';
/** @var Generator */
private $generator;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
*/
class HEICTest extends Provider {
- public function setUp() {
+ public function setUp(): void {
if ( !in_array("HEIC", \Imagick::queryFormats("HEI*")) ) {
$this->markTestSkipped('ImageMagick is not HEIC aware. Skipping tests');
} else {
*/
class ImageTest extends Provider {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$fileName = 'testimage.jpg';
*/
class MP3Test extends Provider {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$fileName = 'testimage.mp3';
*/
class MovieTest extends Provider {
- public function setUp() {
+ public function setUp(): void {
$avconvBinary = \OC_Helper::findBinaryPath('avconv');
$ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg');
*/
class OfficeTest extends Provider {
- public function setUp() {
+ public function setUp(): void {
$libreofficeBinary = \OC_Helper::findBinaryPath('libreoffice');
$openofficeBinary = ($libreofficeBinary) ? null : \OC_Helper::findBinaryPath('openoffice');
/** @var \OC\Files\Storage\Storage */
protected $storage;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$userManager = \OC::$server->getUserManager();
$this->userId = $userId;
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->logout();
parent::tearDown();
*/
class SVGTest extends Provider {
- public function setUp() {
+ public function setUp(): void {
$checkImagick = new \Imagick();
if (count($checkImagick->queryFormats('SVG')) === 1) {
parent::setUp();
*/
class TXTTest extends Provider {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$fileName = 'lorem-big.txt';
/** @var IInstanceFactory */
private $instanceFactory;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->instanceFactory = new InstanceFactory(new ArrayCache(), $this->getClientService());
/** @var ICache */
private $cache;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->cache = new ArrayCache();
/** @var IOutput */
private $outputMock;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->outputMock = $this->getMockBuilder('\OCP\Migration\IOutput')
$this->cleanUpTables();
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->cleanUpTables();
parent::tearDown();
/** @var IOutput */
private $outputMock;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->outputMock = $this->createMock(IOutput::class);
/** @var ClearGeneratedAvatarCache */
protected $repair;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->outputMock = $this->createMock(IOutput::class);
/** @var FixMountStorages */
private $repair;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->db = \OC::$server->getDatabaseConnection();
/** @var \OCP\IGroupManager|\PHPUnit_Framework_MockObject_MockObject */
protected $groupManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
/** \OCP\IGroupManager|\PHPUnit_Framework_MockObject_MockObject */
$this->deleteAllShares();
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->deleteAllShares();
parent::tearDown();
/** @var ILogger */
private $logger;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$this->repair = new TestCollationRepair($this->config, $this->logger, $this->connection, false);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->connection->getSchemaManager()->dropTable($this->tableName);
parent::tearDown();
}
/** @var \OCP\IDBConnection */
private $connection;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$config = $this->getMockBuilder(IConfig::class)
$this->repair = new RepairInvalidShares($config, $this->connection);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->deleteAllShares();
parent::tearDown();
/** @var IMimeTypeLoader */
private $mimetypeLoader;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->savedMimetypeLoader = \OC::$server->getMimeTypeLoader();
$this->repair = new \OC\Repair\RepairMimeTypes($config);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->storage->getCache()->clear();
$qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
*/
private $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$this->repair = new \OC\Repair\SqliteAutoincrement($this->connection);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->connection->getSchemaManager()->dropTable($this->tableName);
parent::tearDown();
}
/** @var string[] */
private $outputArray;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$dispatcher = new EventDispatcher();
$this->repair = new \OC\Repair([], $dispatcher);
/** @var Throttler|\PHPUnit_Framework_MockObject_MockObject */
private $throttler;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
private $config;
- public function setUp() {
+ public function setUp(): void {
$this->dbConnection = $this->createMock(IDBConnection::class);
$this->logger = $this->createMock(ILogger::class);
$this->config = $this->createMock(IConfig::class);
/** @var ContentSecurityPolicyManager */
private $contentSecurityPolicyManager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->dispatcher = \OC::$server->query(IEventDispatcher::class);
$this->contentSecurityPolicyManager = new ContentSecurityPolicyManager($this->dispatcher);
/** @var ContentSecurityPolicyNonceManager */
private $nonceManager;
- public function setUp() {
+ public function setUp(): void {
$this->csrfTokenManager = $this->createMock(CsrfTokenManager::class);
$this->request = $this->createMock(Request::class);
$this->nonceManager = new ContentSecurityPolicyNonceManager(
/** @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();
/** @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();
/** @var \OC\Security\CSRF\TokenStorage\SessionStorage */
private $sessionStorage;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->session = $this->getMockBuilder(ISession::class)
->disableOriginalConstructor()->getMock();
/** @var ISecureRandom */
private $random;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->username = $this->getUniqueID('', 20);
);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$user = \OC::$server->getUserManager()->get($this->username);
if ($user !== null) {
$user->delete();
/** @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');
/** @var CredentialsManager */
protected $manager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->crypto = $this->createMock(ICrypto::class);
$this->dbConnection = $this->getMockBuilder('\OC\DB\Connection')
/** @var Crypto */
protected $crypto;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->crypto = new Crypto(\OC::$server->getConfig(), \OC::$server->getSecureRandom());
}
/** @var FeaturePolicyManager */
private $manager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->dispatcher = \OC::$server->query(IEventDispatcher::class);
$this->manager = new FeaturePolicyManager($this->dispatcher);
/** @var IConfig */
protected $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var Key */
private $key;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->key = new Key('public', 'private');
/** @var ILogger|MockObject */
private $logger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
/** @var Factory|\PHPUnit_Framework_MockObject_MockObject $factory */
/** @var Signer */
private $signer;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->key = new Key($this->public, $this->private);
/** @var MemoryCache */
private $memoryCache;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->cacheFactory = $this->createMock(ICacheFactory::class);
/** @var Limiter */
private $limiter;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->timeFactory = $this->createMock(ITimeFactory::class);
/** @var SecureRandom */
protected $rng;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->rng = new \OC\Security\SecureRandom();
}
/** @var IConfig */
protected $config;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
protected $server;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$config = new \OC\Config(\OC::$configDir);
$this->server = new \OC\Server('', $config);
/** @var \OCP\ISession */
protected $wrappedSession;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->wrappedSession = new \OC\Session\Memory($this->getUniqueID());
/** @var \OC\Session\CryptoSessionData */
protected $instance;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->wrappedSession = $this->getMockBuilder(ISession::class)
class MemoryTest extends Session {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->instance = new \OC\Session\Memory($this->getUniqueID());
}
*/
protected $instance;
- protected function tearDown() {
+ protected function tearDown(): void {
$this->instance->clear();
parent::tearDown();
}
/** @var IServerContainer|\PHPUnit_Framework_MockObject_MockObject */
private $container;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->logger = $this->createMock(ILogger::class);
/** @var Installer|\PHPUnit_Framework_MockObject_MockObject */
protected $installer;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(SystemConfig::class);
/** @var IUserManager */
protected $userManager;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->groupManager = \OC::$server->getGroupManager();
$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(array('test'));
\OC::$server->getConfig()->setAppValue('core', 'shareapi_allow_resharing', $this->resharing);
/** @var \PHPUnit_Framework_MockObject_MockObject|IURLGenerator */
protected $urlGenerator;
- public function setUp() {
+ public function setUp(): void {
$this->dbConn = \OC::$server->getDatabaseConnection();
$this->userManager = $this->createMock(IUserManager::class);
$this->groupManager = $this->createMock(IGroupManager::class);
);
}
- 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();
/** @var Manager */
private $manager;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->eventDispatcher = new EventDispatcher();
/** @var \OC_Defaults|MockObject */
protected $defaults;
- public function setUp() {
+ public function setUp(): void {
$this->logger = $this->createMock(ILogger::class);
$this->config = $this->createMock(IConfig::class);
/** @var ShareHelper */
private $helper;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->manager = $this->createMock(IManager::class);
/** @var \OCP\Share\IShare */
protected $share;
- public function setUp() {
+ public function setUp(): void {
$this->rootFolder = $this->createMock(IRootFolder::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->share = new \OC\Share20\Share($this->rootFolder, $this->userManager);
/** @var \OCP\IGroup[] */
private $groups;
- public function setup() {
+ public function setUp(): void {
$this->users = [];
$this->groups = [];
->execute();
}
- public function tearDown() {
+ public function tearDown(): void {
foreach($this->users as $user) {
$user->delete();
}
/** @var Registry */
private $registry;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->registry = new Registry();
/** @var Registry */
private $registry;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->registry = new Registry();
*/
private $dispatcher;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$this->pruneTagsTables();
}
- public function tearDown() {
+ public function tearDown(): void {
$this->pruneTagsTables();
parent::tearDown();
}
*/
private $tag3;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();
$this->tagMapper->assignTags('3', 'anothertype', $this->tag1->getId());
}
- public function tearDown() {
+ public function tearDown(): void {
$this->pruneTagsTables();
parent::tearDown();
}
/** @var \OCP\ITagManager */
protected $tagMgr;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OC_User::clearBackends();
}
- 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`');
protected $baseDir = null;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->baseDir = $this->getManager()->getTempBaseDir() . $this->getUniqueID('/oc_tmp_test');
}
}
- protected function tearDown() {
+ protected function tearDown(): void {
\OC_Helper::rmdirr($this->baseDir);
$this->baseDir = null;
parent::tearDown();
/** @var ITimeFactory|\PHPUnit_Framework_MockObject_MockObject */
private $timeFactory;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->logger = $this->createMock(ILogger::class);
/** @var ITimeFactory|\PHPUnit_Framework_MockObject_MockObject */
private $timeFactory;
- protected function setUp() {
+ protected function setUp(): void {
$this->logger = $this->createMock(ILogger::class);
$this->appData = $this->createMock(AppData::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
/** @var ICacheFactory|\PHPUnit_Framework_MockObject_MockObject */
protected $cacheFactory;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->appData = $this->createMock(IAppData::class);
/** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */
protected $logger;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->appData = $this->createMock(IAppData::class);
/** @var \PHPUnit_Framework_MockObject_MockObject */
protected $logger;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->logger = $this->createMock(ILogger::class);
}
/** @var ITimeFactory|\PHPUnit_Framework_MockObject_MockObject */
protected $timeFactory;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->logger = $this->createMock(ILogger::class);
$this->appData = $this->createMock(AppData::class);
class TemplateFunctionsTest extends \Test\TestCase {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$loader = new \OC\Autoloader([\OC::$SERVERROOT . '/lib']);
});
}
- protected function setUp() {
+ protected function setUp(): void {
// overwrite the command bus with one we can run ourselves
$this->commandBus = new QueueBus();
$this->overwriteService('AsyncCommandBus', $this->commandBus);
}
}
- protected function onNotSuccessfulTest(\Throwable $t) {
+ protected function onNotSuccessfulTest(\Throwable $t): void {
$this->restoreAllServices();
// restore database connection
parent::onNotSuccessfulTest($t);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->restoreAllServices();
// restore database connection
);
}
- public static function tearDownAfterClass() {
+ public static function tearDownAfterClass(): void {
if (!self::$wasDatabaseAllowed && self::$realDatabase !== null) {
// in case an error is thrown in a test, PHPUnit jumps straight to tearDownAfterClass,
// so we need the database again
abstract protected function registerStorageWrapper($name, $wrapper);
// from phpunit
- abstract protected function markTestSkipped($reason = '');
- abstract protected function assertTrue($condition, $message = '');
+ abstract protected function markTestSkipped(string $message = ''): void;
+ abstract protected function assertTrue($condition, string $message = ''): void;
private $encryptionWasEnabled;
/** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */
protected $logger;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->clientService = $this->createMock(IClientService::class);
/** @var VersionCheck | \PHPUnit_Framework_MockObject_MockObject*/
private $updater;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)
->disableOriginalConstructor()
/** @var Installer|\PHPUnit_Framework_MockObject_MockObject */
private $installer;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)
->disableOriginalConstructor()
/** @var string */
private $originalWebRoot;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
$this->cacheFactory = $this->createMock(ICacheFactory::class);
$this->originalWebRoot = \OC::$WEBROOT;
}
- public function tearDown() {
+ public function tearDown(): void {
// Reset webRoot
\OC::$WEBROOT = $this->originalWebRoot;
}
return $user;
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->eventDispatcher = $this->createMock(IEventDispatcher::class);
$this->backend=new \OC\User\Database($this->eventDispatcher);
}
- protected function tearDown() {
+ protected function tearDown(): void {
if(!isset($this->users)) {
return;
}
namespace Test\User;
class Dummy extends Backend {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->backend=new \Test\Util\User\Dummy();
}
/** @var EventDispatcherInterface */
private $dispatcher;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
/** @var IEventDispatcher|MockObject */
private $dispatcher;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->timeFactory = $this->createMock(ITimeFactory::class);
/** @var EventDispatcherInterface|MockObject */
protected $dispatcher;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->dispatcher = $this->createMock(EventDispatcherInterface::class);
}
return $config;
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->datadir = \OC::$server->getTempManager()->getTemporaryFolder();
\OC::$server->getSession()->set('checkServer_succeeded', false);
}
- protected function tearDown() {
+ protected function tearDown(): void {
// clean up
@unlink($this->datadir . '/.ocdata');
parent::tearDown();
$this->assertNotEmpty($errors);
}
- 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 = [];
<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="bootstrap.php"
- strict="true"
verbose="true"
backupGlobals="false"
timeoutForSmallTests="900"
use TestListenerDefaultImplementation;
- public function endTest(Test $test, $time) {
+ public function endTest(Test $test, float $time): void {
// reopen the session - only allowed for memory session
if (\OC::$server->getSession() instanceof Memory) {
/** @var $session Memory */