aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2024-09-15 22:32:31 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2024-09-15 22:32:31 +0200
commit49dd79eabb2b8902559a7a4e8f8fcad54f46b604 (patch)
tree2af18db46ba463368dc4461d7436fb69577923de /tests
parent4281ce6fa1bb8235426099d720734d2394bec203 (diff)
downloadnextcloud-server-49dd79eabb2b8902559a7a4e8f8fcad54f46b604.tar.gz
nextcloud-server-49dd79eabb2b8902559a7a4e8f8fcad54f46b604.zip
refactor: Add void return type to PHPUnit test methods
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests')
-rw-r--r--tests/Core/Command/Config/App/DeleteConfigTest.php2
-rw-r--r--tests/Core/Command/Config/App/GetConfigTest.php2
-rw-r--r--tests/Core/Command/Config/App/SetConfigTest.php2
-rw-r--r--tests/Core/Command/Config/ImportTest.php12
-rw-r--r--tests/Core/Command/Config/ListConfigsTest.php2
-rw-r--r--tests/Core/Command/Config/System/DeleteConfigTest.php4
-rw-r--r--tests/Core/Command/Config/System/GetConfigTest.php2
-rw-r--r--tests/Core/Command/Config/System/SetConfigTest.php8
-rw-r--r--tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php20
-rw-r--r--tests/Core/Command/Encryption/DecryptAllTest.php6
-rw-r--r--tests/Core/Command/Encryption/DisableTest.php2
-rw-r--r--tests/Core/Command/Encryption/EnableTest.php2
-rw-r--r--tests/Core/Command/Encryption/EncryptAllTest.php6
-rw-r--r--tests/Core/Command/Encryption/SetDefaultModuleTest.php4
-rw-r--r--tests/Core/Command/Group/AddTest.php4
-rw-r--r--tests/Core/Command/Group/AddUserTest.php6
-rw-r--r--tests/Core/Command/Group/DeleteTest.php8
-rw-r--r--tests/Core/Command/Group/InfoTest.php4
-rw-r--r--tests/Core/Command/Group/ListCommandTest.php4
-rw-r--r--tests/Core/Command/Group/RemoveUserTest.php6
-rw-r--r--tests/Core/Command/Log/FileTest.php8
-rw-r--r--tests/Core/Command/Log/ManageTest.php20
-rw-r--r--tests/Core/Command/Maintenance/DataFingerprintTest.php2
-rw-r--r--tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php8
-rw-r--r--tests/Core/Command/Maintenance/ModeTest.php2
-rw-r--r--tests/Core/Command/Maintenance/UpdateTheme.php2
-rw-r--r--tests/Core/Command/Preview/RepairTest.php2
-rw-r--r--tests/Core/Command/SystemTag/AddTest.php4
-rw-r--r--tests/Core/Command/SystemTag/DeleteTest.php4
-rw-r--r--tests/Core/Command/SystemTag/EditTest.php6
-rw-r--r--tests/Core/Command/SystemTag/ListCommandTest.php2
-rw-r--r--tests/Core/Command/TwoFactorAuth/CleanupTest.php2
-rw-r--r--tests/Core/Command/TwoFactorAuth/DisableTest.php6
-rw-r--r--tests/Core/Command/TwoFactorAuth/EnableTest.php6
-rw-r--r--tests/Core/Command/TwoFactorAuth/EnforceTest.php12
-rw-r--r--tests/Core/Command/TwoFactorAuth/StateTest.php6
-rw-r--r--tests/Core/Command/User/AuthTokens/DeleteTest.php12
-rw-r--r--tests/Core/Command/User/DeleteTest.php4
-rw-r--r--tests/Core/Command/User/DisableTest.php4
-rw-r--r--tests/Core/Command/User/EnableTest.php4
-rw-r--r--tests/Core/Command/User/LastSeenTest.php4
-rw-r--r--tests/Core/Command/User/SettingTest.php12
-rw-r--r--tests/Core/Controller/AppPasswordControllerTest.php14
-rw-r--r--tests/Core/Controller/AutoCompleteControllerTest.php2
-rw-r--r--tests/Core/Controller/AvatarControllerTest.php46
-rw-r--r--tests/Core/Controller/ChangePasswordControllerTest.php10
-rw-r--r--tests/Core/Controller/ClientFlowLoginControllerTest.php20
-rw-r--r--tests/Core/Controller/ClientFlowLoginV2ControllerTest.php26
-rw-r--r--tests/Core/Controller/ContactsMenuControllerTest.php6
-rw-r--r--tests/Core/Controller/CssControllerTest.php10
-rw-r--r--tests/Core/Controller/GuestAvatarControllerTest.php2
-rw-r--r--tests/Core/Controller/JsControllerTest.php10
-rw-r--r--tests/Core/Controller/LoginControllerTest.php24
-rw-r--r--tests/Core/Controller/LostControllerTest.php36
-rw-r--r--tests/Core/Controller/NavigationControllerTest.php8
-rw-r--r--tests/Core/Controller/OCSControllerTest.php14
-rw-r--r--tests/Core/Controller/PreviewControllerTest.php18
-rw-r--r--tests/Core/Controller/TwoFactorChallengeControllerTest.php18
-rw-r--r--tests/Core/Controller/UserControllerTest.php2
-rw-r--r--tests/Core/Controller/WipeControllerTest.php4
-rw-r--r--tests/Core/Data/LoginFlowV2CredentialsTest.php6
-rw-r--r--tests/Core/Middleware/TwoFactorMiddlewareTest.php18
-rw-r--r--tests/Core/Service/LoginFlowV2ServiceUnitTest.php26
-rw-r--r--tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php10
-rw-r--r--tests/Test/Repair/Owncloud/CleanPreviewsTest.php6
-rw-r--r--tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php4
-rw-r--r--tests/lib/Accounts/AccountManagerTest.php6
-rw-r--r--tests/lib/Accounts/AccountPropertyCollectionTest.php16
-rw-r--r--tests/lib/Accounts/AccountPropertyTest.php14
-rw-r--r--tests/lib/Accounts/AccountTest.php12
-rw-r--r--tests/lib/Accounts/HooksTest.php2
-rw-r--r--tests/lib/Activity/ManagerTest.php20
-rw-r--r--tests/lib/AllConfigTest.php30
-rw-r--r--tests/lib/App/AppManagerTest.php50
-rw-r--r--tests/lib/App/AppStore/Bundles/BundleBase.php6
-rw-r--r--tests/lib/App/AppStore/Bundles/BundleFetcherTest.php6
-rw-r--r--tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php6
-rw-r--r--tests/lib/App/AppStore/Fetcher/AppFetcherTest.php10
-rw-r--r--tests/lib/App/AppStore/Fetcher/CategoryFetcherTest.php4
-rw-r--r--tests/lib/App/AppStore/Fetcher/FetcherBase.php18
-rw-r--r--tests/lib/App/AppStore/Version/VersionParserTest.php6
-rw-r--r--tests/lib/App/AppStore/Version/VersionTest.php4
-rw-r--r--tests/lib/App/CompareVersionTest.php6
-rw-r--r--tests/lib/App/DependencyAnalyzerTest.php12
-rw-r--r--tests/lib/App/InfoParserTest.php4
-rw-r--r--tests/lib/App/PlatformRepositoryTest.php2
-rw-r--r--tests/lib/AppConfigTest.php8
-rw-r--r--tests/lib/AppFramework/AppTest.php20
-rw-r--r--tests/lib/AppFramework/Controller/ApiControllerTest.php2
-rw-r--r--tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php8
-rw-r--r--tests/lib/AppFramework/Controller/ControllerTest.php14
-rw-r--r--tests/lib/AppFramework/Controller/OCSControllerTest.php10
-rw-r--r--tests/lib/AppFramework/Controller/PublicShareControllerTest.php4
-rw-r--r--tests/lib/AppFramework/Db/EntityTest.php46
-rw-r--r--tests/lib/AppFramework/Db/QBMapperTest.php6
-rw-r--r--tests/lib/AppFramework/DependencyInjection/DIContainerTest.php12
-rw-r--r--tests/lib/AppFramework/DependencyInjection/DIIntergrationTests.php8
-rw-r--r--tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php126
-rw-r--r--tests/lib/AppFramework/Http/DataResponseTest.php8
-rw-r--r--tests/lib/AppFramework/Http/DispatcherTest.php20
-rw-r--r--tests/lib/AppFramework/Http/DownloadResponseTest.php4
-rw-r--r--tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php120
-rw-r--r--tests/lib/AppFramework/Http/EmptyFeaturePolicyTest.php26
-rw-r--r--tests/lib/AppFramework/Http/FeaturePolicyTest.php26
-rw-r--r--tests/lib/AppFramework/Http/FileDisplayResponseTest.php10
-rw-r--r--tests/lib/AppFramework/Http/HttpTest.php6
-rw-r--r--tests/lib/AppFramework/Http/JSONResponseTest.php14
-rw-r--r--tests/lib/AppFramework/Http/OutputTest.php6
-rw-r--r--tests/lib/AppFramework/Http/PublicTemplateResponseTest.php10
-rw-r--r--tests/lib/AppFramework/Http/RedirectResponseTest.php4
-rw-r--r--tests/lib/AppFramework/Http/RequestTest.php140
-rw-r--r--tests/lib/AppFramework/Http/ResponseTest.php42
-rw-r--r--tests/lib/AppFramework/Http/StreamResponseTest.php8
-rw-r--r--tests/lib/AppFramework/Http/TemplateResponseTest.php12
-rw-r--r--tests/lib/AppFramework/Middleware/AdditionalScriptsMiddlewareTest.php10
-rw-r--r--tests/lib/AppFramework/Middleware/CompressionMiddlewareTest.php10
-rw-r--r--tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php22
-rw-r--r--tests/lib/AppFramework/Middleware/NotModifiedMiddlewareTest.php2
-rw-r--r--tests/lib/AppFramework/Middleware/OCSMiddlewareTest.php8
-rw-r--r--tests/lib/AppFramework/Middleware/PublicShare/PublicShareMiddlewareTest.php24
-rw-r--r--tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php6
-rw-r--r--tests/lib/AppFramework/Middleware/Security/CSPMiddlewareTest.php6
-rw-r--r--tests/lib/AppFramework/Middleware/Security/FeaturePolicyMiddlewareTest.php4
-rw-r--r--tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php10
-rw-r--r--tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php12
-rw-r--r--tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php12
-rw-r--r--tests/lib/AppFramework/Routing/RoutingTest.php42
-rw-r--r--tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php28
-rw-r--r--tests/lib/AppFramework/Utility/SimpleContainerTest.php32
-rw-r--r--tests/lib/AppTest.php14
-rw-r--r--tests/lib/Archive/TestBase.php18
-rw-r--r--tests/lib/Authentication/Events/RemoteWipeFinishedTest.php2
-rw-r--r--tests/lib/Authentication/Events/RemoteWipeStartedTest.php2
-rw-r--r--tests/lib/Authentication/Listeners/RemoteWipeActivityListenerTest.php8
-rw-r--r--tests/lib/Authentication/Listeners/RemoteWipeEmailListenerTest.php18
-rw-r--r--tests/lib/Authentication/Listeners/RemoteWipeNotificationsListenerTest.php6
-rw-r--r--tests/lib/Authentication/Login/ClearLostPasswordTokensCommandTest.php2
-rw-r--r--tests/lib/Authentication/Login/CompleteLoginCommandTest.php2
-rw-r--r--tests/lib/Authentication/Login/CreateSessionTokenCommandTest.php4
-rw-r--r--tests/lib/Authentication/Login/EmailLoginCommandTest.php12
-rw-r--r--tests/lib/Authentication/Login/FinishRememberedLoginCommandTest.php6
-rw-r--r--tests/lib/Authentication/Login/LoggedInCheckCommandTest.php4
-rw-r--r--tests/lib/Authentication/Login/PreLoginHookCommandTest.php2
-rw-r--r--tests/lib/Authentication/Login/SetUserTimezoneCommandTest.php4
-rw-r--r--tests/lib/Authentication/Login/TwoFactorCommandTest.php16
-rw-r--r--tests/lib/Authentication/Login/UidLoginCommandTest.php4
-rw-r--r--tests/lib/Authentication/Login/UpdateLastPasswordConfirmCommandTest.php2
-rw-r--r--tests/lib/Authentication/Login/UserDisabledCheckCommandTest.php6
-rw-r--r--tests/lib/Authentication/LoginCredentials/CredentialsTest.php6
-rw-r--r--tests/lib/Authentication/LoginCredentials/StoreTest.php20
-rw-r--r--tests/lib/Authentication/Token/ManagerTest.php50
-rw-r--r--tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php28
-rw-r--r--tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php50
-rw-r--r--tests/lib/Authentication/Token/PublicKeyTokenTest.php4
-rw-r--r--tests/lib/Authentication/Token/RemoteWipeTest.php6
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php12
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/EnforcementStateTest.php8
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/ManagerTest.php44
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/MandatoryTwoFactorTest.php18
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php6
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php12
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/ProviderSetTest.php10
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/RegistryTest.php10
-rw-r--r--tests/lib/AutoLoaderTest.php14
-rw-r--r--tests/lib/Avatar/AvatarManagerTest.php8
-rw-r--r--tests/lib/Avatar/GuestAvatarTest.php4
-rw-r--r--tests/lib/Avatar/UserAvatarTest.php24
-rw-r--r--tests/lib/BackgroundJob/JobListTest.php22
-rw-r--r--tests/lib/BackgroundJob/JobTest.php4
-rw-r--r--tests/lib/BackgroundJob/QueuedJobTest.php2
-rw-r--r--tests/lib/BackgroundJob/TimedJobTest.php6
-rw-r--r--tests/lib/Cache/CappedMemoryCacheTest.php6
-rw-r--r--tests/lib/Cache/FileCacheTest.php6
-rw-r--r--tests/lib/Cache/TestCache.php4
-rw-r--r--tests/lib/Calendar/ManagerTest.php12
-rw-r--r--tests/lib/CapabilitiesManagerTest.php14
-rw-r--r--tests/lib/Collaboration/Collaborators/GroupPluginTest.php2
-rw-r--r--tests/lib/Collaboration/Collaborators/LookupPluginTest.php10
-rw-r--r--tests/lib/Collaboration/Collaborators/MailPluginTest.php4
-rw-r--r--tests/lib/Collaboration/Collaborators/RemotePluginTest.php6
-rw-r--r--tests/lib/Collaboration/Collaborators/SearchResultTest.php4
-rw-r--r--tests/lib/Collaboration/Collaborators/SearchTest.php2
-rw-r--r--tests/lib/Collaboration/Collaborators/UserPluginTest.php6
-rw-r--r--tests/lib/Command/AsyncBusTest.php22
-rw-r--r--tests/lib/Command/Integrity/SignAppTest.php14
-rw-r--r--tests/lib/Command/Integrity/SignCoreTest.php12
-rw-r--r--tests/lib/Comments/CommentTest.php12
-rw-r--r--tests/lib/Comments/ManagerTest.php88
-rw-r--r--tests/lib/ConfigTest.php18
-rw-r--r--tests/lib/Contacts/ContactsMenu/ActionFactoryTest.php4
-rw-r--r--tests/lib/Contacts/ContactsMenu/ActionProviderStoreTest.php6
-rw-r--r--tests/lib/Contacts/ContactsMenu/Actions/LinkActionTest.php12
-rw-r--r--tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php34
-rw-r--r--tests/lib/Contacts/ContactsMenu/EntryTest.php12
-rw-r--r--tests/lib/Contacts/ContactsMenu/ManagerTest.php10
-rw-r--r--tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php4
-rw-r--r--tests/lib/ContactsManagerTest.php20
-rw-r--r--tests/lib/DB/ConnectionFactoryTest.php2
-rw-r--r--tests/lib/DB/MigrationsTest.php48
-rw-r--r--tests/lib/DB/MigratorTest.php14
-rw-r--r--tests/lib/DB/OCPostgreSqlPlatformTest.php2
-rw-r--r--tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php10
-rw-r--r--tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php30
-rw-r--r--tests/lib/DB/QueryBuilder/FunctionBuilderTest.php32
-rw-r--r--tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php10
-rw-r--r--tests/lib/DB/QueryBuilder/QueryBuilderTest.php74
-rw-r--r--tests/lib/DB/QueryBuilder/QuoteHelperTest.php4
-rw-r--r--tests/lib/DB/QueryBuilder/Sharded/SharedQueryBuilderTest.php14
-rw-r--r--tests/lib/DateTimeFormatterTest.php10
-rw-r--r--tests/lib/Diagnostics/EventLoggerTest.php2
-rw-r--r--tests/lib/Diagnostics/QueryLoggerTest.php2
-rw-r--r--tests/lib/DirectEditing/ManagerTest.php12
-rw-r--r--tests/lib/Encryption/DecryptAllTest.php14
-rw-r--r--tests/lib/Encryption/EncryptionWrapperTest.php2
-rw-r--r--tests/lib/Encryption/Keys/StorageTest.php36
-rw-r--r--tests/lib/Encryption/ManagerTest.php20
-rw-r--r--tests/lib/Encryption/UpdateTest.php6
-rw-r--r--tests/lib/Encryption/UtilTest.php16
-rw-r--r--tests/lib/ErrorHandlerTest.php2
-rw-r--r--tests/lib/Federation/CloudIdTest.php2
-rw-r--r--tests/lib/Files/AppData/AppDataTest.php6
-rw-r--r--tests/lib/Files/AppData/FactoryTest.php2
-rw-r--r--tests/lib/Files/Cache/CacheTest.php52
-rw-r--r--tests/lib/Files/Cache/HomeCacheTest.php4
-rw-r--r--tests/lib/Files/Cache/LocalRootScannerTest.php4
-rw-r--r--tests/lib/Files/Cache/PropagatorTest.php10
-rw-r--r--tests/lib/Files/Cache/ScannerTest.php36
-rw-r--r--tests/lib/Files/Cache/SearchBuilderTest.php2
-rw-r--r--tests/lib/Files/Cache/UpdaterLegacyTest.php16
-rw-r--r--tests/lib/Files/Cache/UpdaterTest.php18
-rw-r--r--tests/lib/Files/Cache/WatcherTest.php10
-rw-r--r--tests/lib/Files/Cache/Wrapper/CacheJailTest.php26
-rw-r--r--tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php6
-rw-r--r--tests/lib/Files/Config/UserMountCacheTest.php30
-rw-r--r--tests/lib/Files/EtagTest.php2
-rw-r--r--tests/lib/Files/FileInfoTest.php4
-rw-r--r--tests/lib/Files/FilesystemTest.php32
-rw-r--r--tests/lib/Files/Mount/ManagerTest.php4
-rw-r--r--tests/lib/Files/Mount/MountPointTest.php4
-rw-r--r--tests/lib/Files/Mount/MountTest.php6
-rw-r--r--tests/lib/Files/Mount/ObjectHomeMountProviderTest.php14
-rw-r--r--tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php4
-rw-r--r--tests/lib/Files/Mount/RootMountProviderTest.php6
-rw-r--r--tests/lib/Files/Node/FileTest.php20
-rw-r--r--tests/lib/Files/Node/FolderTest.php46
-rw-r--r--tests/lib/Files/Node/HookConnectorTest.php6
-rw-r--r--tests/lib/Files/Node/IntegrationTest.php4
-rw-r--r--tests/lib/Files/Node/NodeTest.php54
-rw-r--r--tests/lib/Files/Node/RootTest.php12
-rw-r--r--tests/lib/Files/ObjectStore/AzureTest.php2
-rw-r--r--tests/lib/Files/ObjectStore/MapperTest.php2
-rw-r--r--tests/lib/Files/ObjectStore/ObjectStoreScannerTest.php6
-rw-r--r--tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php24
-rw-r--r--tests/lib/Files/ObjectStore/ObjectStoreTest.php14
-rw-r--r--tests/lib/Files/ObjectStore/S3Test.php8
-rw-r--r--tests/lib/Files/ObjectStore/SwiftTest.php2
-rw-r--r--tests/lib/Files/PathVerificationTest.php10
-rw-r--r--tests/lib/Files/Search/QueryOptimizer/CombinedTests.php10
-rw-r--r--tests/lib/Files/Search/QueryOptimizer/FlattenNestedBoolTest.php2
-rw-r--r--tests/lib/Files/Search/QueryOptimizer/MergeDistributiveOperationsTest.php10
-rw-r--r--tests/lib/Files/Search/QueryOptimizer/OrEqualsToInTest.php10
-rw-r--r--tests/lib/Files/Search/SearchIntegrationTest.php2
-rw-r--r--tests/lib/Files/SimpleFS/InMemoryFileTest.php18
-rw-r--r--tests/lib/Files/SimpleFS/SimpleFileTest.php22
-rw-r--r--tests/lib/Files/SimpleFS/SimpleFolderTest.php16
-rw-r--r--tests/lib/Files/Storage/CommonTest.php10
-rw-r--r--tests/lib/Files/Storage/HomeTest.php6
-rw-r--r--tests/lib/Files/Storage/LocalTest.php24
-rw-r--r--tests/lib/Files/Storage/Storage.php78
-rw-r--r--tests/lib/Files/Storage/StorageFactoryTest.php6
-rw-r--r--tests/lib/Files/Storage/Wrapper/AvailabilityTest.php12
-rw-r--r--tests/lib/Files/Storage/Wrapper/EncodingTest.php26
-rw-r--r--tests/lib/Files/Storage/Wrapper/EncryptionTest.php30
-rw-r--r--tests/lib/Files/Storage/Wrapper/JailTest.php4
-rw-r--r--tests/lib/Files/Storage/Wrapper/KnownMtimeTest.php2
-rw-r--r--tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php32
-rw-r--r--tests/lib/Files/Storage/Wrapper/QuotaTest.php36
-rw-r--r--tests/lib/Files/Storage/Wrapper/WrapperTest.php2
-rw-r--r--tests/lib/Files/Stream/EncryptionTest.php12
-rw-r--r--tests/lib/Files/Stream/HashWrapperTest.php2
-rw-r--r--tests/lib/Files/Stream/QuotaTest.php28
-rw-r--r--tests/lib/Files/Type/DetectionTest.php2
-rw-r--r--tests/lib/Files/Type/LoaderTest.php8
-rw-r--r--tests/lib/Files/Utils/ScannerTest.php12
-rw-r--r--tests/lib/Files/ViewTest.php162
-rw-r--r--tests/lib/GlobalScale/ConfigTest.php4
-rw-r--r--tests/lib/Group/Backend.php10
-rw-r--r--tests/lib/Group/GroupTest.php34
-rw-r--r--tests/lib/Group/ManagerTest.php60
-rw-r--r--tests/lib/Group/MetaDataTest.php8
-rw-r--r--tests/lib/HelperStorageTest.php14
-rw-r--r--tests/lib/Hooks/BasicEmitterTest.php36
-rw-r--r--tests/lib/Http/Client/DnsPinMiddlewareTest.php16
-rw-r--r--tests/lib/Http/Client/NegativeDnsCacheTest.php2
-rw-r--r--tests/lib/Http/Client/ResponseTest.php8
-rw-r--r--tests/lib/ImageTest.php38
-rw-r--r--tests/lib/InfoXmlTest.php2
-rw-r--r--tests/lib/InstallerTest.php20
-rw-r--r--tests/lib/IntegrityCheck/CheckerTest.php58
-rw-r--r--tests/lib/IntegrityCheck/Helpers/AppLocatorTest.php4
-rw-r--r--tests/lib/IntegrityCheck/Helpers/EnvironmentHelperTest.php4
-rw-r--r--tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php10
-rw-r--r--tests/lib/L10N/L10nTest.php22
-rw-r--r--tests/lib/L10N/LanguageIteratorTest.php2
-rw-r--r--tests/lib/LargeFileHelperGetFileSizeTest.php4
-rw-r--r--tests/lib/LargeFileHelperTest.php8
-rw-r--r--tests/lib/LegacyHelperTest.php14
-rw-r--r--tests/lib/Lock/DBLockingProviderTest.php4
-rw-r--r--tests/lib/Lock/LockingProvider.php46
-rw-r--r--tests/lib/Lock/NonCachingDBLockingProviderTest.php2
-rw-r--r--tests/lib/Lockdown/Filesystem/NoFSTest.php2
-rw-r--r--tests/lib/Lockdown/Filesystem/NullCacheTest.php40
-rw-r--r--tests/lib/Lockdown/Filesystem/NullStorageTest.php72
-rw-r--r--tests/lib/Lockdown/LockdownManagerTest.php6
-rw-r--r--tests/lib/Log/ExceptionSerializerTest.php4
-rw-r--r--tests/lib/Log/FileTest.php4
-rw-r--r--tests/lib/Log/LogFactoryTest.php10
-rw-r--r--tests/lib/LoggerTest.php4
-rw-r--r--tests/lib/Mail/EMailTemplateTest.php8
-rw-r--r--tests/lib/Mail/MailerTest.php22
-rw-r--r--tests/lib/Mail/MessageTest.php30
-rw-r--r--tests/lib/Memcache/APCuTest.php4
-rw-r--r--tests/lib/Memcache/Cache.php42
-rw-r--r--tests/lib/Memcache/CasTraitTest.php4
-rw-r--r--tests/lib/Memcache/FactoryTest.php4
-rw-r--r--tests/lib/Memcache/MemcachedTest.php2
-rw-r--r--tests/lib/Memcache/RedisTest.php6
-rw-r--r--tests/lib/MemoryInfoTest.php4
-rw-r--r--tests/lib/Migration/BackgroundRepairTest.php8
-rw-r--r--tests/lib/NaturalSortTest.php4
-rw-r--r--tests/lib/NavigationManagerTest.php16
-rw-r--r--tests/lib/Notification/ActionTest.php18
-rw-r--r--tests/lib/Notification/NotificationTest.php62
-rw-r--r--tests/lib/OCS/DiscoveryServiceTest.php4
-rw-r--r--tests/lib/OCS/ProviderTest.php8
-rw-r--r--tests/lib/Preview/BackgroundCleanupJobTest.php6
-rw-r--r--tests/lib/Preview/GeneratorTest.php14
-rw-r--r--tests/lib/Preview/Provider.php2
-rw-r--r--tests/lib/PublicNamespace/UtilTest.php2
-rw-r--r--tests/lib/Remote/Api/OCSTest.php6
-rw-r--r--tests/lib/Remote/InstanceTest.php8
-rw-r--r--tests/lib/Repair/CleanTagsTest.php2
-rw-r--r--tests/lib/Repair/ClearFrontendCachesTest.php2
-rw-r--r--tests/lib/Repair/ClearGeneratedAvatarCacheTest.php2
-rw-r--r--tests/lib/Repair/OldGroupMembershipSharesTest.php2
-rw-r--r--tests/lib/Repair/RepairCollationTest.php2
-rw-r--r--tests/lib/Repair/RepairDavSharesTest.php2
-rw-r--r--tests/lib/Repair/RepairInvalidSharesTest.php4
-rw-r--r--tests/lib/Repair/RepairMimeTypesTest.php8
-rw-r--r--tests/lib/RepairTest.php8
-rw-r--r--tests/lib/RichObjectStrings/DefinitionsTest.php4
-rw-r--r--tests/lib/RichObjectStrings/ValidatorTest.php2
-rw-r--r--tests/lib/Security/Bruteforce/ThrottlerTest.php4
-rw-r--r--tests/lib/Security/CSP/AddContentSecurityPolicyEventTest.php2
-rw-r--r--tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php6
-rw-r--r--tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php4
-rw-r--r--tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php4
-rw-r--r--tests/lib/Security/CSRF/CsrfTokenManagerTest.php16
-rw-r--r--tests/lib/Security/CSRF/CsrfTokenTest.php6
-rw-r--r--tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php14
-rw-r--r--tests/lib/Security/CertificateManagerTest.php14
-rw-r--r--tests/lib/Security/CertificateTest.php20
-rw-r--r--tests/lib/Security/CredentialsManagerTest.php2
-rw-r--r--tests/lib/Security/CryptoTest.php16
-rw-r--r--tests/lib/Security/Events/GenerateSecurePasswordEventTest.php6
-rw-r--r--tests/lib/Security/Events/ValidatePasswordPolicyEventTest.php4
-rw-r--r--tests/lib/Security/FeaturePolicy/AddFeaturePolicyEventTest.php2
-rw-r--r--tests/lib/Security/FeaturePolicy/FeaturePolicyManagerTest.php4
-rw-r--r--tests/lib/Security/HasherTest.php24
-rw-r--r--tests/lib/Security/IdentityProof/KeyTest.php4
-rw-r--r--tests/lib/Security/IdentityProof/ManagerTest.php10
-rw-r--r--tests/lib/Security/IdentityProof/SignerTest.php8
-rw-r--r--tests/lib/Security/Normalizer/IpAddressTest.php4
-rw-r--r--tests/lib/Security/RateLimiting/Backend/MemoryCacheBackendTest.php8
-rw-r--r--tests/lib/Security/RateLimiting/LimiterTest.php8
-rw-r--r--tests/lib/Security/SecureRandomTest.php10
-rw-r--r--tests/lib/Security/TrustedDomainHelperTest.php6
-rw-r--r--tests/lib/Security/VerificationToken/VerificationTokenTest.php20
-rw-r--r--tests/lib/ServerTest.php6
-rw-r--r--tests/lib/Session/CryptoWrappingTest.php2
-rw-r--r--tests/lib/Session/MemoryTest.php2
-rw-r--r--tests/lib/Session/Session.php16
-rw-r--r--tests/lib/Settings/ManagerTest.php18
-rw-r--r--tests/lib/Settings/SectionTest.php6
-rw-r--r--tests/lib/SetupTest.php10
-rw-r--r--tests/lib/Share/HelperTest.php4
-rw-r--r--tests/lib/Share/ShareTest.php4
-rw-r--r--tests/lib/Share20/DefaultShareProviderTest.php94
-rw-r--r--tests/lib/Share20/LegacyHooksTest.php12
-rw-r--r--tests/lib/Share20/ManagerTest.php230
-rw-r--r--tests/lib/Share20/ShareByMailProviderTest.php4
-rw-r--r--tests/lib/Share20/ShareHelperTest.php8
-rw-r--r--tests/lib/Share20/ShareTest.php14
-rw-r--r--tests/lib/SubAdminTest.php28
-rw-r--r--tests/lib/Support/Subscription/RegistryTest.php22
-rw-r--r--tests/lib/SystemTag/SystemTagManagerTest.php36
-rw-r--r--tests/lib/SystemTag/SystemTagObjectMapperTest.php34
-rw-r--r--tests/lib/TagsTest.php24
-rw-r--r--tests/lib/TaskProcessing/TaskProcessingTest.php28
-rw-r--r--tests/lib/TempManagerTest.php22
-rw-r--r--tests/lib/Template/CSSResourceLocatorTest.php2
-rw-r--r--tests/lib/Template/JSCombinerTest.php36
-rw-r--r--tests/lib/Template/JSResourceLocatorTest.php6
-rw-r--r--tests/lib/Template/ResourceLocatorTest.php6
-rw-r--r--tests/lib/TemplateFunctionsTest.php50
-rw-r--r--tests/lib/TextProcessing/TextProcessingTest.php14
-rw-r--r--tests/lib/Updater/ChangesCheckTest.php16
-rw-r--r--tests/lib/Updater/ReleaseMetadataTest.php4
-rw-r--r--tests/lib/Updater/VersionCheckTest.php14
-rw-r--r--tests/lib/UpdaterTest.php2
-rw-r--r--tests/lib/UrlGeneratorTest.php22
-rw-r--r--tests/lib/User/Backend.php6
-rw-r--r--tests/lib/User/DatabaseTest.php10
-rw-r--r--tests/lib/User/ManagerTest.php56
-rw-r--r--tests/lib/User/SessionTest.php50
-rw-r--r--tests/lib/User/UserTest.php68
-rw-r--r--tests/lib/UtilCheckServerTest.php16
-rw-r--r--tests/lib/UtilTest.php42
418 files changed, 3112 insertions, 3112 deletions
diff --git a/tests/Core/Command/Config/App/DeleteConfigTest.php b/tests/Core/Command/Config/App/DeleteConfigTest.php
index 643c7ca3ca1..ebbbb15e1b6 100644
--- a/tests/Core/Command/Config/App/DeleteConfigTest.php
+++ b/tests/Core/Command/Config/App/DeleteConfigTest.php
@@ -80,7 +80,7 @@ class DeleteConfigTest extends TestCase {
* @param int $expectedReturn
* @param string $expectedMessage
*/
- public function testDelete($configName, $configExists, $checkIfExists, $expectedReturn, $expectedMessage) {
+ public function testDelete($configName, $configExists, $checkIfExists, $expectedReturn, $expectedMessage): void {
$this->config->expects(($checkIfExists) ? $this->once() : $this->never())
->method('getAppKeys')
->with('app-name')
diff --git a/tests/Core/Command/Config/App/GetConfigTest.php b/tests/Core/Command/Config/App/GetConfigTest.php
index 150fceca92f..c1a6265db40 100644
--- a/tests/Core/Command/Config/App/GetConfigTest.php
+++ b/tests/Core/Command/Config/App/GetConfigTest.php
@@ -94,7 +94,7 @@ class GetConfigTest extends TestCase {
* @param int $expectedReturn
* @param string $expectedMessage
*/
- public function testGet($configName, $value, $configExists, $defaultValue, $hasDefault, $outputFormat, $expectedReturn, $expectedMessage) {
+ public function testGet($configName, $value, $configExists, $defaultValue, $hasDefault, $outputFormat, $expectedReturn, $expectedMessage): void {
if (!$expectedReturn) {
if ($configExists) {
$this->config->expects($this->once())
diff --git a/tests/Core/Command/Config/App/SetConfigTest.php b/tests/Core/Command/Config/App/SetConfigTest.php
index 6563dd13fc2..1d599bf3234 100644
--- a/tests/Core/Command/Config/App/SetConfigTest.php
+++ b/tests/Core/Command/Config/App/SetConfigTest.php
@@ -72,7 +72,7 @@ class SetConfigTest extends TestCase {
* @param bool $updated
* @param string $expectedMessage
*/
- public function testSet($configName, $newValue, $configExists, $updateOnly, $updated, $expectedMessage) {
+ public function testSet($configName, $newValue, $configExists, $updateOnly, $updated, $expectedMessage): void {
$this->config->expects($this->any())
->method('hasKey')
->with('app-name', $configName)
diff --git a/tests/Core/Command/Config/ImportTest.php b/tests/Core/Command/Config/ImportTest.php
index 91485955e60..0077f84f82b 100644
--- a/tests/Core/Command/Config/ImportTest.php
+++ b/tests/Core/Command/Config/ImportTest.php
@@ -53,7 +53,7 @@ class ImportTest extends TestCase {
*
* @param mixed $configValue
*/
- public function testValidateAppsArray($configValue) {
+ public function testValidateAppsArray($configValue): void {
$this->invokePrivate($this->command, 'validateAppsArray', [['app' => ['name' => $configValue]]]);
$this->assertTrue(true, 'Asserting that no exception is thrown');
}
@@ -72,7 +72,7 @@ class ImportTest extends TestCase {
*
* @param mixed $configValue
*/
- public function testValidateAppsArrayThrows($configValue) {
+ public function testValidateAppsArrayThrows($configValue): void {
try {
$this->invokePrivate($this->command, 'validateAppsArray', [['app' => ['name' => $configValue]]]);
$this->fail('Did not throw expected UnexpectedValueException');
@@ -102,7 +102,7 @@ class ImportTest extends TestCase {
*
* @param mixed $configValue
*/
- public function testCheckTypeRecursively($configValue) {
+ public function testCheckTypeRecursively($configValue): void {
$this->invokePrivate($this->command, 'checkTypeRecursively', [$configValue, 'name']);
$this->assertTrue(true, 'Asserting that no exception is thrown');
}
@@ -121,7 +121,7 @@ class ImportTest extends TestCase {
*
* @param mixed $configValue
*/
- public function testCheckTypeRecursivelyThrows($configValue) {
+ public function testCheckTypeRecursivelyThrows($configValue): void {
try {
$this->invokePrivate($this->command, 'checkTypeRecursively', [$configValue, 'name']);
$this->fail('Did not throw expected UnexpectedValueException');
@@ -143,7 +143,7 @@ class ImportTest extends TestCase {
*
* @param array $configArray
*/
- public function testValidateArray($configArray) {
+ public function testValidateArray($configArray): void {
$this->invokePrivate($this->command, 'validateArray', [$configArray]);
$this->assertTrue(true, 'Asserting that no exception is thrown');
}
@@ -162,7 +162,7 @@ class ImportTest extends TestCase {
* @param mixed $configArray
* @param string $expectedException
*/
- public function testValidateArrayThrows($configArray, $expectedException) {
+ public function testValidateArrayThrows($configArray, $expectedException): void {
try {
$this->invokePrivate($this->command, 'validateArray', [$configArray]);
$this->fail('Did not throw expected UnexpectedValueException');
diff --git a/tests/Core/Command/Config/ListConfigsTest.php b/tests/Core/Command/Config/ListConfigsTest.php
index 8b6fdf39192..0cee870d45c 100644
--- a/tests/Core/Command/Config/ListConfigsTest.php
+++ b/tests/Core/Command/Config/ListConfigsTest.php
@@ -262,7 +262,7 @@ class ListConfigsTest extends TestCase {
* @param bool $private
* @param string $expected
*/
- public function testList($app, $systemConfigs, $systemConfigMap, $appConfig, $private, $expected) {
+ public function testList($app, $systemConfigs, $systemConfigMap, $appConfig, $private, $expected): void {
$this->systemConfig->expects($this->any())
->method('getKeys')
->willReturn($systemConfigs);
diff --git a/tests/Core/Command/Config/System/DeleteConfigTest.php b/tests/Core/Command/Config/System/DeleteConfigTest.php
index 9b5b018687e..872079ef4c2 100644
--- a/tests/Core/Command/Config/System/DeleteConfigTest.php
+++ b/tests/Core/Command/Config/System/DeleteConfigTest.php
@@ -80,7 +80,7 @@ class DeleteConfigTest extends TestCase {
* @param int $expectedReturn
* @param string $expectedMessage
*/
- public function testDelete($configName, $configExists, $checkIfExists, $expectedReturn, $expectedMessage) {
+ public function testDelete($configName, $configExists, $checkIfExists, $expectedReturn, $expectedMessage): void {
$this->systemConfig->expects(($checkIfExists) ? $this->once() : $this->never())
->method('getKeys')
->willReturn($configExists ? [$configName] : []);
@@ -175,7 +175,7 @@ class DeleteConfigTest extends TestCase {
* @param int $expectedReturn
* @param string $expectedMessage
*/
- public function testArrayDelete(array $configNames, $configKeyExists, $checkIfKeyExists, $configValue, $updateValue, $expectedReturn, $expectedMessage) {
+ public function testArrayDelete(array $configNames, $configKeyExists, $checkIfKeyExists, $configValue, $updateValue, $expectedReturn, $expectedMessage): void {
$this->systemConfig->expects(($checkIfKeyExists) ? $this->once() : $this->never())
->method('getKeys')
->willReturn($configKeyExists ? [$configNames[0]] : []);
diff --git a/tests/Core/Command/Config/System/GetConfigTest.php b/tests/Core/Command/Config/System/GetConfigTest.php
index db96331680b..f05d0e384ee 100644
--- a/tests/Core/Command/Config/System/GetConfigTest.php
+++ b/tests/Core/Command/Config/System/GetConfigTest.php
@@ -99,7 +99,7 @@ class GetConfigTest extends TestCase {
* @param int $expectedReturn
* @param string $expectedMessage
*/
- public function testGet($configNames, $value, $configExists, $defaultValue, $hasDefault, $outputFormat, $expectedReturn, $expectedMessage) {
+ public function testGet($configNames, $value, $configExists, $defaultValue, $hasDefault, $outputFormat, $expectedReturn, $expectedMessage): void {
if (is_array($configNames)) {
$configName = $configNames[0];
} else {
diff --git a/tests/Core/Command/Config/System/SetConfigTest.php b/tests/Core/Command/Config/System/SetConfigTest.php
index d5c54a5e720..2905af5c3d7 100644
--- a/tests/Core/Command/Config/System/SetConfigTest.php
+++ b/tests/Core/Command/Config/System/SetConfigTest.php
@@ -55,7 +55,7 @@ class SetConfigTest extends TestCase {
* @param mixed $existingData
* @param mixed $expectedValue
*/
- public function testSet($configNames, $newValue, $existingData, $expectedValue) {
+ public function testSet($configNames, $newValue, $existingData, $expectedValue): void {
$this->systemConfig->expects($this->once())
->method('setValue')
->with($configNames[0], $expectedValue);
@@ -88,7 +88,7 @@ class SetConfigTest extends TestCase {
/**
* @dataProvider setUpdateOnlyProvider
*/
- public function testSetUpdateOnly($configNames, $existingData) {
+ public function testSetUpdateOnly($configNames, $existingData): void {
$this->expectException(\UnexpectedValueException::class);
$this->systemConfig->expects($this->never())
@@ -135,7 +135,7 @@ class SetConfigTest extends TestCase {
/**
* @dataProvider castValueProvider
*/
- public function testCastValue($value, $type, $expectedValue) {
+ public function testCastValue($value, $type, $expectedValue): void {
$this->assertSame($expectedValue,
$this->invokePrivate($this->command, 'castValue', [$value, $type])
);
@@ -156,7 +156,7 @@ class SetConfigTest extends TestCase {
/**
* @dataProvider castValueInvalidProvider
*/
- public function testCastValueInvalid($value, $type) {
+ public function testCastValueInvalid($value, $type): void {
$this->expectException(\InvalidArgumentException::class);
$this->invokePrivate($this->command, 'castValue', [$value, $type]);
diff --git a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
index 85271565192..b124a27f9ab 100644
--- a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
+++ b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
@@ -79,7 +79,7 @@ class ChangeKeyStorageRootTest extends TestCase {
/**
* @dataProvider dataTestExecute
*/
- public function testExecute($newRoot, $answer, $successMoveKey) {
+ public function testExecute($newRoot, $answer, $successMoveKey): void {
$changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot')
->setConstructorArgs(
[
@@ -132,7 +132,7 @@ class ChangeKeyStorageRootTest extends TestCase {
];
}
- public function testMoveAllKeys() {
+ public function testMoveAllKeys(): void {
/** @var \OC\Core\Command\Encryption\ChangeKeyStorageRoot $changeKeyStorageRoot */
$changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot')
->setConstructorArgs(
@@ -152,7 +152,7 @@ class ChangeKeyStorageRootTest extends TestCase {
$this->invokePrivate($changeKeyStorageRoot, 'moveAllKeys', ['oldRoot', 'newRoot', $this->outputInterface]);
}
- public function testPrepareNewRoot() {
+ public function testPrepareNewRoot(): void {
$this->view->expects($this->once())->method('is_dir')->with('newRoot')
->willReturn(true);
@@ -169,7 +169,7 @@ class ChangeKeyStorageRootTest extends TestCase {
* @param bool $dirExists
* @param bool $couldCreateFile
*/
- public function testPrepareNewRootException($dirExists, $couldCreateFile) {
+ public function testPrepareNewRootException($dirExists, $couldCreateFile): void {
$this->expectException(\Exception::class);
$this->view->expects($this->once())->method('is_dir')->with('newRoot')
@@ -194,7 +194,7 @@ class ChangeKeyStorageRootTest extends TestCase {
* @param bool $targetExists
* @param bool $executeRename
*/
- public function testMoveSystemKeys($dirExists, $targetExists, $executeRename) {
+ public function testMoveSystemKeys($dirExists, $targetExists, $executeRename): void {
$changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot')
->setConstructorArgs(
[
@@ -231,7 +231,7 @@ class ChangeKeyStorageRootTest extends TestCase {
}
- public function testMoveUserKeys() {
+ public function testMoveUserKeys(): void {
$changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot')
->setConstructorArgs(
[
@@ -261,7 +261,7 @@ class ChangeKeyStorageRootTest extends TestCase {
* @param bool $targetExists
* @param bool $shouldRename
*/
- public function testMoveUserEncryptionFolder($userExists, $isDir, $targetExists, $shouldRename) {
+ public function testMoveUserEncryptionFolder($userExists, $isDir, $targetExists, $shouldRename): void {
$changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot')
->setConstructorArgs(
[
@@ -309,7 +309,7 @@ class ChangeKeyStorageRootTest extends TestCase {
/**
* @dataProvider dataTestPrepareParentFolder
*/
- public function testPrepareParentFolder($path, $pathExists) {
+ public function testPrepareParentFolder($path, $pathExists): void {
$this->view->expects($this->any())->method('file_exists')
->willReturnCallback(
function ($fileExistsPath) use ($path, $pathExists) {
@@ -341,7 +341,7 @@ class ChangeKeyStorageRootTest extends TestCase {
];
}
- public function testTargetExists() {
+ public function testTargetExists(): void {
$this->view->expects($this->once())->method('file_exists')->with('path')
->willReturn(false);
@@ -351,7 +351,7 @@ class ChangeKeyStorageRootTest extends TestCase {
}
- public function testTargetExistsException() {
+ public function testTargetExistsException(): void {
$this->expectException(\Exception::class);
$this->view->expects($this->once())->method('file_exists')->with('path')
diff --git a/tests/Core/Command/Encryption/DecryptAllTest.php b/tests/Core/Command/Encryption/DecryptAllTest.php
index 46cd2cfc4bc..6ed4cbbea99 100644
--- a/tests/Core/Command/Encryption/DecryptAllTest.php
+++ b/tests/Core/Command/Encryption/DecryptAllTest.php
@@ -70,7 +70,7 @@ class DecryptAllTest extends TestCase {
->with('files_trashbin')->willReturn(true);
}
- public function testMaintenanceAndTrashbin() {
+ public function testMaintenanceAndTrashbin(): void {
// on construct we enable single-user-mode and disable the trash bin
// on destruct we disable single-user-mode again and enable the trash bin
$this->config->expects($this->exactly(2))
@@ -108,7 +108,7 @@ class DecryptAllTest extends TestCase {
/**
* @dataProvider dataTestExecute
*/
- public function testExecute($encryptionEnabled, $continue) {
+ public function testExecute($encryptionEnabled, $continue): void {
$instance = new DecryptAll(
$this->encryptionManager,
$this->appManager,
@@ -162,7 +162,7 @@ class DecryptAllTest extends TestCase {
}
- public function testExecuteFailure() {
+ public function testExecuteFailure(): void {
$this->expectException(\Exception::class);
$instance = new DecryptAll(
diff --git a/tests/Core/Command/Encryption/DisableTest.php b/tests/Core/Command/Encryption/DisableTest.php
index 6c962399e11..913d03a8850 100644
--- a/tests/Core/Command/Encryption/DisableTest.php
+++ b/tests/Core/Command/Encryption/DisableTest.php
@@ -52,7 +52,7 @@ class DisableTest extends TestCase {
* @param bool $isUpdating
* @param string $expectedString
*/
- public function testDisable($oldStatus, $isUpdating, $expectedString) {
+ public function testDisable($oldStatus, $isUpdating, $expectedString): void {
$this->config->expects($this->once())
->method('getAppValue')
->with('core', 'encryption_enabled', $this->anything())
diff --git a/tests/Core/Command/Encryption/EnableTest.php b/tests/Core/Command/Encryption/EnableTest.php
index b535c80b0a8..2d463452add 100644
--- a/tests/Core/Command/Encryption/EnableTest.php
+++ b/tests/Core/Command/Encryption/EnableTest.php
@@ -65,7 +65,7 @@ class EnableTest extends TestCase {
* @param string $expectedString
* @param string $expectedDefaultModuleString
*/
- public function testEnable($oldStatus, $defaultModule, $availableModules, $isUpdating, $expectedString, $expectedDefaultModuleString) {
+ public function testEnable($oldStatus, $defaultModule, $availableModules, $isUpdating, $expectedString, $expectedDefaultModuleString): void {
if ($isUpdating) {
$this->config->expects($this->once())
->method('setAppValue')
diff --git a/tests/Core/Command/Encryption/EncryptAllTest.php b/tests/Core/Command/Encryption/EncryptAllTest.php
index 994aa43a938..933f919ba7f 100644
--- a/tests/Core/Command/Encryption/EncryptAllTest.php
+++ b/tests/Core/Command/Encryption/EncryptAllTest.php
@@ -67,7 +67,7 @@ class EncryptAllTest extends TestCase {
$this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
}
- public function testEncryptAll() {
+ public function testEncryptAll(): void {
// trash bin needs to be disabled in order to avoid adding dummy files to the users
// trash bin which gets deleted during the encryption process
$this->appManager->expects($this->once())->method('disableApp')->with('files_trashbin');
@@ -89,7 +89,7 @@ class EncryptAllTest extends TestCase {
/**
* @dataProvider dataTestExecute
*/
- public function testExecute($answer, $askResult) {
+ public function testExecute($answer, $askResult): void {
$command = new EncryptAll($this->encryptionManager, $this->appManager, $this->config, $this->questionHelper);
$this->encryptionManager->expects($this->once())->method('isEnabled')->willReturn(true);
@@ -115,7 +115,7 @@ class EncryptAllTest extends TestCase {
}
- public function testExecuteException() {
+ public function testExecuteException(): void {
$this->expectException(\Exception::class);
$command = new EncryptAll($this->encryptionManager, $this->appManager, $this->config, $this->questionHelper);
diff --git a/tests/Core/Command/Encryption/SetDefaultModuleTest.php b/tests/Core/Command/Encryption/SetDefaultModuleTest.php
index 9c4259fb04e..0a2c2a81c28 100644
--- a/tests/Core/Command/Encryption/SetDefaultModuleTest.php
+++ b/tests/Core/Command/Encryption/SetDefaultModuleTest.php
@@ -60,7 +60,7 @@ class SetDefaultModuleTest extends TestCase {
* @param bool $updateSuccess
* @param string $expectedString
*/
- public function testSetDefaultModule($oldModule, $newModule, $updateModule, $updateSuccess, $expectedString) {
+ public function testSetDefaultModule($oldModule, $newModule, $updateModule, $updateSuccess, $expectedString): void {
$this->consoleInput->expects($this->once())
->method('getArgument')
->with('module')
@@ -98,7 +98,7 @@ class SetDefaultModuleTest extends TestCase {
* @param bool $updateSuccess
* @param string $expectedString
*/
- public function testMaintenanceMode($oldModule, $newModule, $updateModule, $updateSuccess, $expectedString) {
+ public function testMaintenanceMode($oldModule, $newModule, $updateModule, $updateSuccess, $expectedString): void {
$this->consoleInput->expects($this->never())
->method('getArgument')
->with('module')
diff --git a/tests/Core/Command/Group/AddTest.php b/tests/Core/Command/Group/AddTest.php
index 76ef4a74f6a..c953199766f 100644
--- a/tests/Core/Command/Group/AddTest.php
+++ b/tests/Core/Command/Group/AddTest.php
@@ -43,7 +43,7 @@ class AddTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function testGroupExists() {
+ public function testGroupExists(): void {
$gid = 'myGroup';
$group = $this->createMock(IGroup::class);
$this->groupManager->method('get')
@@ -59,7 +59,7 @@ class AddTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testAdd() {
+ public function testAdd(): void {
$gid = 'myGroup';
$group = $this->createMock(IGroup::class);
$group->method('getGID')
diff --git a/tests/Core/Command/Group/AddUserTest.php b/tests/Core/Command/Group/AddUserTest.php
index 8c8f4902a16..4bbf54f7b3f 100644
--- a/tests/Core/Command/Group/AddUserTest.php
+++ b/tests/Core/Command/Group/AddUserTest.php
@@ -51,7 +51,7 @@ class AddUserTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function testNoGroup() {
+ public function testNoGroup(): void {
$this->groupManager->method('get')
->with('myGroup')
->willReturn(null);
@@ -63,7 +63,7 @@ class AddUserTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testNoUser() {
+ public function testNoUser(): void {
$group = $this->createMock(IGroup::class);
$this->groupManager->method('get')
->with('myGroup')
@@ -80,7 +80,7 @@ class AddUserTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testAdd() {
+ public function testAdd(): void {
$group = $this->createMock(IGroup::class);
$this->groupManager->method('get')
->with('myGroup')
diff --git a/tests/Core/Command/Group/DeleteTest.php b/tests/Core/Command/Group/DeleteTest.php
index fe1aaff64bc..4b4f16feb76 100644
--- a/tests/Core/Command/Group/DeleteTest.php
+++ b/tests/Core/Command/Group/DeleteTest.php
@@ -36,7 +36,7 @@ class DeleteTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function testDoesNotExists() {
+ public function testDoesNotExists(): void {
$gid = 'myGroup';
$this->input->method('getArgument')
->willReturnCallback(function ($arg) use ($gid) {
@@ -58,7 +58,7 @@ class DeleteTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testDeleteAdmin() {
+ public function testDeleteAdmin(): void {
$gid = 'admin';
$this->input->method('getArgument')
->willReturnCallback(function ($arg) use ($gid) {
@@ -77,7 +77,7 @@ class DeleteTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testDeleteFailed() {
+ public function testDeleteFailed(): void {
$gid = 'myGroup';
$this->input->method('getArgument')
->willReturnCallback(function ($arg) use ($gid) {
@@ -103,7 +103,7 @@ class DeleteTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testDelete() {
+ public function testDelete(): void {
$gid = 'myGroup';
$this->input->method('getArgument')
->willReturnCallback(function ($arg) use ($gid) {
diff --git a/tests/Core/Command/Group/InfoTest.php b/tests/Core/Command/Group/InfoTest.php
index 6f5a9cce02b..869b6741866 100644
--- a/tests/Core/Command/Group/InfoTest.php
+++ b/tests/Core/Command/Group/InfoTest.php
@@ -39,7 +39,7 @@ class InfoTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function testDoesNotExists() {
+ public function testDoesNotExists(): void {
$gid = 'myGroup';
$this->input->method('getArgument')
->willReturnCallback(function ($arg) use ($gid) {
@@ -59,7 +59,7 @@ class InfoTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testInfo() {
+ public function testInfo(): void {
$gid = 'myGroup';
$this->input->method('getArgument')
->willReturnCallback(function ($arg) use ($gid) {
diff --git a/tests/Core/Command/Group/ListCommandTest.php b/tests/Core/Command/Group/ListCommandTest.php
index a995bdc0b20..93d472af388 100644
--- a/tests/Core/Command/Group/ListCommandTest.php
+++ b/tests/Core/Command/Group/ListCommandTest.php
@@ -40,7 +40,7 @@ class ListCommandTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function testExecute() {
+ public function testExecute(): void {
$group1 = $this->createMock(IGroup::class);
$group1->method('getGID')->willReturn('group1');
$group2 = $this->createMock(IGroup::class);
@@ -109,7 +109,7 @@ class ListCommandTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testInfo() {
+ public function testInfo(): void {
$group1 = $this->createMock(IGroup::class);
$group1->method('getGID')->willReturn('group1');
$group1->method('getDisplayName')->willReturn('Group 1');
diff --git a/tests/Core/Command/Group/RemoveUserTest.php b/tests/Core/Command/Group/RemoveUserTest.php
index 47c782b6f44..98fe41784f1 100644
--- a/tests/Core/Command/Group/RemoveUserTest.php
+++ b/tests/Core/Command/Group/RemoveUserTest.php
@@ -51,7 +51,7 @@ class RemoveUserTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function testNoGroup() {
+ public function testNoGroup(): void {
$this->groupManager->method('get')
->with('myGroup')
->willReturn(null);
@@ -63,7 +63,7 @@ class RemoveUserTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testNoUser() {
+ public function testNoUser(): void {
$group = $this->createMock(IGroup::class);
$this->groupManager->method('get')
->with('myGroup')
@@ -80,7 +80,7 @@ class RemoveUserTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testAdd() {
+ public function testAdd(): void {
$group = $this->createMock(IGroup::class);
$this->groupManager->method('get')
->with('myGroup')
diff --git a/tests/Core/Command/Log/FileTest.php b/tests/Core/Command/Log/FileTest.php
index 35db7c6d718..08ff01e019d 100644
--- a/tests/Core/Command/Log/FileTest.php
+++ b/tests/Core/Command/Log/FileTest.php
@@ -36,7 +36,7 @@ class FileTest extends TestCase {
$this->command = new File($config);
}
- public function testEnable() {
+ public function testEnable(): void {
$this->config->method('getSystemValue')->willReturnArgument(1);
$this->consoleInput->method('getOption')
->willReturnMap([
@@ -49,7 +49,7 @@ class FileTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testChangeFile() {
+ public function testChangeFile(): void {
$this->config->method('getSystemValue')->willReturnArgument(1);
$this->consoleInput->method('getOption')
->willReturnMap([
@@ -74,7 +74,7 @@ class FileTest extends TestCase {
/**
* @dataProvider changeRotateSizeProvider
*/
- public function testChangeRotateSize($optionValue, $configValue) {
+ public function testChangeRotateSize($optionValue, $configValue): void {
$this->config->method('getSystemValue')->willReturnArgument(1);
$this->consoleInput->method('getOption')
->willReturnMap([
@@ -87,7 +87,7 @@ class FileTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testGetConfiguration() {
+ public function testGetConfiguration(): void {
$this->config->method('getSystemValue')
->willReturnMap([
['log_type', 'file', 'log_type_value'],
diff --git a/tests/Core/Command/Log/ManageTest.php b/tests/Core/Command/Log/ManageTest.php
index 5cba6dd626f..b354bb17076 100644
--- a/tests/Core/Command/Log/ManageTest.php
+++ b/tests/Core/Command/Log/ManageTest.php
@@ -36,7 +36,7 @@ class ManageTest extends TestCase {
$this->command = new Manage($config);
}
- public function testChangeBackend() {
+ public function testChangeBackend(): void {
$this->consoleInput->method('getOption')
->willReturnMap([
['backend', 'syslog']
@@ -48,7 +48,7 @@ class ManageTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testChangeLevel() {
+ public function testChangeLevel(): void {
$this->consoleInput->method('getOption')
->willReturnMap([
['level', 'debug']
@@ -60,7 +60,7 @@ class ManageTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testChangeTimezone() {
+ public function testChangeTimezone(): void {
$this->consoleInput->method('getOption')
->willReturnMap([
['timezone', 'UTC']
@@ -73,14 +73,14 @@ class ManageTest extends TestCase {
}
- public function testValidateBackend() {
+ public function testValidateBackend(): void {
$this->expectException(\InvalidArgumentException::class);
self::invokePrivate($this->command, 'validateBackend', ['notabackend']);
}
- public function testValidateTimezone() {
+ public function testValidateTimezone(): void {
$this->expectException(\Exception::class);
// this might need to be changed when humanity colonises Mars
@@ -102,14 +102,14 @@ class ManageTest extends TestCase {
/**
* @dataProvider convertLevelStringProvider
*/
- public function testConvertLevelString($levelString, $expectedInt) {
+ public function testConvertLevelString($levelString, $expectedInt): void {
$this->assertEquals($expectedInt,
self::invokePrivate($this->command, 'convertLevelString', [$levelString])
);
}
- public function testConvertLevelStringInvalid() {
+ public function testConvertLevelStringInvalid(): void {
$this->expectException(\InvalidArgumentException::class);
self::invokePrivate($this->command, 'convertLevelString', ['abc']);
@@ -128,20 +128,20 @@ class ManageTest extends TestCase {
/**
* @dataProvider convertLevelNumberProvider
*/
- public function testConvertLevelNumber($levelNum, $expectedString) {
+ public function testConvertLevelNumber($levelNum, $expectedString): void {
$this->assertEquals($expectedString,
self::invokePrivate($this->command, 'convertLevelNumber', [$levelNum])
);
}
- public function testConvertLevelNumberInvalid() {
+ public function testConvertLevelNumberInvalid(): void {
$this->expectException(\InvalidArgumentException::class);
self::invokePrivate($this->command, 'convertLevelNumber', [11]);
}
- public function testGetConfiguration() {
+ public function testGetConfiguration(): void {
$this->config->expects($this->exactly(3))
->method('getSystemValue')
->withConsecutive(
diff --git a/tests/Core/Command/Maintenance/DataFingerprintTest.php b/tests/Core/Command/Maintenance/DataFingerprintTest.php
index 03cf37b8f48..3d56d891bef 100644
--- a/tests/Core/Command/Maintenance/DataFingerprintTest.php
+++ b/tests/Core/Command/Maintenance/DataFingerprintTest.php
@@ -39,7 +39,7 @@ class DataFingerprintTest extends TestCase {
$this->command = new DataFingerprint($this->config, $this->timeFactory);
}
- public function testSetFingerPrint() {
+ public function testSetFingerPrint(): void {
$this->timeFactory->expects($this->once())
->method('getTime')
->willReturn(42);
diff --git a/tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php b/tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php
index a4169907167..d8c82de19ac 100644
--- a/tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php
+++ b/tests/Core/Command/Maintenance/Mimetype/UpdateDBTest.php
@@ -46,7 +46,7 @@ class UpdateDBTest extends TestCase {
$this->command = new UpdateDB($this->detector, $this->loader);
}
- public function testNoop() {
+ public function testNoop(): void {
$this->consoleInput->method('getOption')
->with('repair-filecache')
->willReturn(false);
@@ -74,7 +74,7 @@ class UpdateDBTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testAddMimetype() {
+ public function testAddMimetype(): void {
$this->consoleInput->method('getOption')
->with('repair-filecache')
->willReturn(false);
@@ -115,7 +115,7 @@ class UpdateDBTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testSkipComments() {
+ public function testSkipComments(): void {
$this->detector->expects($this->once())
->method('getAllMappings')
->willReturn([
@@ -127,7 +127,7 @@ class UpdateDBTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testRepairFilecache() {
+ public function testRepairFilecache(): void {
$this->consoleInput->method('getOption')
->with('repair-filecache')
->willReturn(true);
diff --git a/tests/Core/Command/Maintenance/ModeTest.php b/tests/Core/Command/Maintenance/ModeTest.php
index 08ca1762da1..59b8bbfc045 100644
--- a/tests/Core/Command/Maintenance/ModeTest.php
+++ b/tests/Core/Command/Maintenance/ModeTest.php
@@ -124,7 +124,7 @@ class ModeTest extends TestCase {
bool $currentMaintenanceState,
$expectedMaintenanceState,
string $expectedOutput
- ) {
+ ): void {
$this->config->expects($this->any())
->method('getSystemValueBool')
->willReturn($currentMaintenanceState);
diff --git a/tests/Core/Command/Maintenance/UpdateTheme.php b/tests/Core/Command/Maintenance/UpdateTheme.php
index 25229b8997a..41b95d358d3 100644
--- a/tests/Core/Command/Maintenance/UpdateTheme.php
+++ b/tests/Core/Command/Maintenance/UpdateTheme.php
@@ -42,7 +42,7 @@ class UpdateThemeTest extends TestCase {
$this->command = new UpdateTheme($this->detector, $this->cacheFactory);
}
- public function testThemeUpdate() {
+ public function testThemeUpdate(): void {
$this->consoleInput->method('getOption')
->with('maintenance:theme:update')
->willReturn(true);
diff --git a/tests/Core/Command/Preview/RepairTest.php b/tests/Core/Command/Preview/RepairTest.php
index 4717ee05f09..e54f4dde3ad 100644
--- a/tests/Core/Command/Preview/RepairTest.php
+++ b/tests/Core/Command/Preview/RepairTest.php
@@ -116,7 +116,7 @@ class RepairTest extends TestCase {
/**
* @dataProvider emptyTestDataProvider
*/
- public function testEmptyExecute($directoryNames, $expectedOutput) {
+ public function testEmptyExecute($directoryNames, $expectedOutput): void {
$previewFolder = $this->getMockBuilder(Folder::class)
->getMock();
$directories = array_map(function ($element) {
diff --git a/tests/Core/Command/SystemTag/AddTest.php b/tests/Core/Command/SystemTag/AddTest.php
index 921b875dc4e..4dd0df7ffe0 100644
--- a/tests/Core/Command/SystemTag/AddTest.php
+++ b/tests/Core/Command/SystemTag/AddTest.php
@@ -40,7 +40,7 @@ class AddTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function testExecute() {
+ public function testExecute(): void {
$tagId = '42';
$tagName = 'wichtig';
$tagAccess = 'public';
@@ -82,7 +82,7 @@ class AddTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testAlreadyExists() {
+ public function testAlreadyExists(): void {
$tagId = '42';
$tagName = 'wichtig';
$tagAccess = 'public';
diff --git a/tests/Core/Command/SystemTag/DeleteTest.php b/tests/Core/Command/SystemTag/DeleteTest.php
index a2ec3767272..78d073db6d6 100644
--- a/tests/Core/Command/SystemTag/DeleteTest.php
+++ b/tests/Core/Command/SystemTag/DeleteTest.php
@@ -39,7 +39,7 @@ class DeleteTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function testExecute() {
+ public function testExecute(): void {
$tagId = 69;
$this->input->method('getArgument')
@@ -57,7 +57,7 @@ class DeleteTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testNotFound() {
+ public function testNotFound(): void {
$tagId = 69;
$this->input->method('getArgument')
diff --git a/tests/Core/Command/SystemTag/EditTest.php b/tests/Core/Command/SystemTag/EditTest.php
index 90a7df00753..1857da25ab0 100644
--- a/tests/Core/Command/SystemTag/EditTest.php
+++ b/tests/Core/Command/SystemTag/EditTest.php
@@ -40,7 +40,7 @@ class EditTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function testExecute() {
+ public function testExecute(): void {
$tagId = '5';
$tagName = 'unwichtige Dateien';
$newTagName = 'moderat wichtige Dateien';
@@ -93,7 +93,7 @@ class EditTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testAlreadyExists() {
+ public function testAlreadyExists(): void {
$tagId = '5';
$tagName = 'unwichtige Dateien';
$tagUserVisible = false;
@@ -157,7 +157,7 @@ class EditTest extends TestCase {
$this->invokePrivate($this->command, 'execute', [$this->input, $this->output]);
}
- public function testNotFound() {
+ public function testNotFound(): void {
$tagId = '404';
$this->input->method('getArgument')
diff --git a/tests/Core/Command/SystemTag/ListCommandTest.php b/tests/Core/Command/SystemTag/ListCommandTest.php
index c7e213a782c..9f4c4072ffc 100644
--- a/tests/Core/Command/SystemTag/ListCommandTest.php
+++ b/tests/Core/Command/SystemTag/ListCommandTest.php
@@ -39,7 +39,7 @@ class ListCommandTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function testExecute() {
+ public function testExecute(): void {
$tag1 = $this->createMock(ISystemTag::class);
$tag1->method('getId')->willReturn('1');
$tag1->method('getName')->willReturn('public_tag');
diff --git a/tests/Core/Command/TwoFactorAuth/CleanupTest.php b/tests/Core/Command/TwoFactorAuth/CleanupTest.php
index 040bc08a858..1d4731ff0c2 100644
--- a/tests/Core/Command/TwoFactorAuth/CleanupTest.php
+++ b/tests/Core/Command/TwoFactorAuth/CleanupTest.php
@@ -36,7 +36,7 @@ class CleanupTest extends TestCase {
$this->cmd = new CommandTester($cmd);
}
- public function testCleanup() {
+ public function testCleanup(): void {
$this->registry->expects($this->once())
->method('cleanUp')
->with('u2f');
diff --git a/tests/Core/Command/TwoFactorAuth/DisableTest.php b/tests/Core/Command/TwoFactorAuth/DisableTest.php
index b123d09848a..ab6b10f8964 100644
--- a/tests/Core/Command/TwoFactorAuth/DisableTest.php
+++ b/tests/Core/Command/TwoFactorAuth/DisableTest.php
@@ -37,7 +37,7 @@ class DisableTest extends TestCase {
$this->command = new CommandTester($cmd);
}
- public function testInvalidUID() {
+ public function testInvalidUID(): void {
$this->userManager->expects($this->once())
->method('get')
->with('nope')
@@ -52,7 +52,7 @@ class DisableTest extends TestCase {
$this->assertStringContainsString('Invalid UID', $this->command->getDisplay());
}
- public function testEnableNotSupported() {
+ public function testEnableNotSupported(): void {
$user = $this->createMock(IUser::class);
$this->userManager->expects($this->once())
->method('get')
@@ -72,7 +72,7 @@ class DisableTest extends TestCase {
$this->assertStringContainsString('The provider does not support this operation', $this->command->getDisplay());
}
- public function testEnabled() {
+ public function testEnabled(): void {
$user = $this->createMock(IUser::class);
$this->userManager->expects($this->once())
->method('get')
diff --git a/tests/Core/Command/TwoFactorAuth/EnableTest.php b/tests/Core/Command/TwoFactorAuth/EnableTest.php
index f78085e72a1..7c34d6692c5 100644
--- a/tests/Core/Command/TwoFactorAuth/EnableTest.php
+++ b/tests/Core/Command/TwoFactorAuth/EnableTest.php
@@ -37,7 +37,7 @@ class EnableTest extends TestCase {
$this->command = new CommandTester($cmd);
}
- public function testInvalidUID() {
+ public function testInvalidUID(): void {
$this->userManager->expects($this->once())
->method('get')
->with('nope')
@@ -52,7 +52,7 @@ class EnableTest extends TestCase {
$this->assertStringContainsString('Invalid UID', $this->command->getDisplay());
}
- public function testEnableNotSupported() {
+ public function testEnableNotSupported(): void {
$user = $this->createMock(IUser::class);
$this->userManager->expects($this->once())
->method('get')
@@ -72,7 +72,7 @@ class EnableTest extends TestCase {
$this->assertStringContainsString('The provider does not support this operation', $this->command->getDisplay());
}
- public function testEnabled() {
+ public function testEnabled(): void {
$user = $this->createMock(IUser::class);
$this->userManager->expects($this->once())
->method('get')
diff --git a/tests/Core/Command/TwoFactorAuth/EnforceTest.php b/tests/Core/Command/TwoFactorAuth/EnforceTest.php
index e709ca2c55a..03118772377 100644
--- a/tests/Core/Command/TwoFactorAuth/EnforceTest.php
+++ b/tests/Core/Command/TwoFactorAuth/EnforceTest.php
@@ -32,7 +32,7 @@ class EnforceTest extends TestCase {
$this->command = new CommandTester($command);
}
- public function testEnforce() {
+ public function testEnforce(): void {
$this->mandatoryTwoFactor->expects($this->once())
->method('setState')
->with($this->equalTo(new EnforcementState(true)));
@@ -49,7 +49,7 @@ class EnforceTest extends TestCase {
$this->assertStringContainsString('Two-factor authentication is enforced for all users', $display);
}
- public function testEnforceForOneGroup() {
+ public function testEnforceForOneGroup(): void {
$this->mandatoryTwoFactor->expects($this->once())
->method('setState')
->with($this->equalTo(new EnforcementState(true, ['twofactorers'])));
@@ -67,7 +67,7 @@ class EnforceTest extends TestCase {
$this->assertStringContainsString('Two-factor authentication is enforced for members of the group(s) twofactorers', $display);
}
- public function testEnforceForAllExceptOneGroup() {
+ public function testEnforceForAllExceptOneGroup(): void {
$this->mandatoryTwoFactor->expects($this->once())
->method('setState')
->with($this->equalTo(new EnforcementState(true, [], ['yoloers'])));
@@ -85,7 +85,7 @@ class EnforceTest extends TestCase {
$this->assertStringContainsString('Two-factor authentication is enforced for all users, except members of yoloers', $display);
}
- public function testDisableEnforced() {
+ public function testDisableEnforced(): void {
$this->mandatoryTwoFactor->expects($this->once())
->method('setState')
->with(new EnforcementState(false));
@@ -102,7 +102,7 @@ class EnforceTest extends TestCase {
$this->assertStringContainsString('Two-factor authentication is not enforced', $display);
}
- public function testCurrentStateEnabled() {
+ public function testCurrentStateEnabled(): void {
$this->mandatoryTwoFactor->expects($this->once())
->method('getState')
->willReturn(new EnforcementState(true));
@@ -114,7 +114,7 @@ class EnforceTest extends TestCase {
$this->assertStringContainsString('Two-factor authentication is enforced for all users', $display);
}
- public function testCurrentStateDisabled() {
+ public function testCurrentStateDisabled(): void {
$this->mandatoryTwoFactor->expects($this->once())
->method('getState')
->willReturn(new EnforcementState(false));
diff --git a/tests/Core/Command/TwoFactorAuth/StateTest.php b/tests/Core/Command/TwoFactorAuth/StateTest.php
index 1d97d152a21..f4ca3c4e031 100644
--- a/tests/Core/Command/TwoFactorAuth/StateTest.php
+++ b/tests/Core/Command/TwoFactorAuth/StateTest.php
@@ -37,7 +37,7 @@ class StateTest extends TestCase {
$this->cmd = new CommandTester($cmd);
}
- public function testWrongUID() {
+ public function testWrongUID(): void {
$this->cmd->execute([
'uid' => 'nope',
]);
@@ -46,7 +46,7 @@ class StateTest extends TestCase {
$this->assertStringContainsString('Invalid UID', $output);
}
- public function testStateNoProvidersActive() {
+ public function testStateNoProvidersActive(): void {
$user = $this->createMock(IUser::class);
$this->userManager->expects($this->once())
->method('get')
@@ -69,7 +69,7 @@ class StateTest extends TestCase {
$this->assertStringContainsString('Two-factor authentication is not enabled for user eldora', $output);
}
- public function testStateOneProviderActive() {
+ public function testStateOneProviderActive(): void {
$user = $this->createMock(IUser::class);
$this->userManager->expects($this->once())
->method('get')
diff --git a/tests/Core/Command/User/AuthTokens/DeleteTest.php b/tests/Core/Command/User/AuthTokens/DeleteTest.php
index bd82475b206..8588c1d5d54 100644
--- a/tests/Core/Command/User/AuthTokens/DeleteTest.php
+++ b/tests/Core/Command/User/AuthTokens/DeleteTest.php
@@ -37,7 +37,7 @@ class DeleteTest extends TestCase {
$this->command = new Delete($tokenProvider);
}
- public function testDeleteTokenById() {
+ public function testDeleteTokenById(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
->withConsecutive(['uid'], ['id'])
@@ -56,7 +56,7 @@ class DeleteTest extends TestCase {
$this->assertSame(Command::SUCCESS, $result);
}
- public function testDeleteTokenByIdRequiresTokenId() {
+ public function testDeleteTokenByIdRequiresTokenId(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
->withConsecutive(['uid'], ['id'])
@@ -75,7 +75,7 @@ class DeleteTest extends TestCase {
$this->assertSame(Command::FAILURE, $result);
}
- public function testDeleteTokensLastUsedBefore() {
+ public function testDeleteTokensLastUsedBefore(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
->withConsecutive(['uid'], ['id'])
@@ -94,7 +94,7 @@ class DeleteTest extends TestCase {
$this->assertSame(Command::SUCCESS, $result);
}
- public function testLastUsedBeforeAcceptsIso8601Expanded() {
+ public function testLastUsedBeforeAcceptsIso8601Expanded(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
->withConsecutive(['uid'], ['id'])
@@ -113,7 +113,7 @@ class DeleteTest extends TestCase {
$this->assertSame(Command::SUCCESS, $result);
}
- public function testLastUsedBeforeAcceptsYmd() {
+ public function testLastUsedBeforeAcceptsYmd(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
->withConsecutive(['uid'], ['id'])
@@ -132,7 +132,7 @@ class DeleteTest extends TestCase {
$this->assertSame(Command::SUCCESS, $result);
}
- public function testIdAndLastUsedBeforeAreMutuallyExclusive() {
+ public function testIdAndLastUsedBeforeAreMutuallyExclusive(): void {
$this->consoleInput->expects($this->exactly(2))
->method('getArgument')
->withConsecutive(['uid'], ['id'])
diff --git a/tests/Core/Command/User/DeleteTest.php b/tests/Core/Command/User/DeleteTest.php
index 74b98b0246a..42244412d9f 100644
--- a/tests/Core/Command/User/DeleteTest.php
+++ b/tests/Core/Command/User/DeleteTest.php
@@ -52,7 +52,7 @@ class DeleteTest extends TestCase {
* @param bool $deleteSuccess
* @param string $expectedString
*/
- public function testValidUser($deleteSuccess, $expectedString) {
+ public function testValidUser($deleteSuccess, $expectedString): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$user->expects($this->once())
->method('delete')
@@ -75,7 +75,7 @@ class DeleteTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testInvalidUser() {
+ public function testInvalidUser(): void {
$this->userManager->expects($this->once())
->method('get')
->with('user')
diff --git a/tests/Core/Command/User/DisableTest.php b/tests/Core/Command/User/DisableTest.php
index a080eb9379a..1e464ca93a5 100644
--- a/tests/Core/Command/User/DisableTest.php
+++ b/tests/Core/Command/User/DisableTest.php
@@ -34,7 +34,7 @@ class DisableTest extends TestCase {
$this->command = new Disable($this->userManager);
}
- public function testValidUser() {
+ public function testValidUser(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->once())
->method('setEnabled')
@@ -57,7 +57,7 @@ class DisableTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testInvalidUser() {
+ public function testInvalidUser(): void {
$this->userManager->expects($this->once())
->method('get')
->with('user')
diff --git a/tests/Core/Command/User/EnableTest.php b/tests/Core/Command/User/EnableTest.php
index 39af10f2ef3..b590530d93d 100644
--- a/tests/Core/Command/User/EnableTest.php
+++ b/tests/Core/Command/User/EnableTest.php
@@ -34,7 +34,7 @@ class EnableTest extends TestCase {
$this->command = new Enable($this->userManager);
}
- public function testValidUser() {
+ public function testValidUser(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->once())
->method('setEnabled')
@@ -57,7 +57,7 @@ class EnableTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testInvalidUser() {
+ public function testInvalidUser(): void {
$this->userManager->expects($this->once())
->method('get')
->with('user')
diff --git a/tests/Core/Command/User/LastSeenTest.php b/tests/Core/Command/User/LastSeenTest.php
index 1146c0664d4..014c981112e 100644
--- a/tests/Core/Command/User/LastSeenTest.php
+++ b/tests/Core/Command/User/LastSeenTest.php
@@ -51,7 +51,7 @@ class LastSeenTest extends TestCase {
* @param int $lastSeen
* @param string $expectedString
*/
- public function testValidUser($lastSeen, $expectedString) {
+ public function testValidUser($lastSeen, $expectedString): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$user->expects($this->once())
->method('getLastLogin')
@@ -74,7 +74,7 @@ class LastSeenTest extends TestCase {
self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]);
}
- public function testInvalidUser() {
+ public function testInvalidUser(): void {
$this->userManager->expects($this->once())
->method('get')
->with('user')
diff --git a/tests/Core/Command/User/SettingTest.php b/tests/Core/Command/User/SettingTest.php
index 7be9bd27ecb..6848b0bb350 100644
--- a/tests/Core/Command/User/SettingTest.php
+++ b/tests/Core/Command/User/SettingTest.php
@@ -185,7 +185,7 @@ class SettingTest extends TestCase {
* @param mixed $user
* @param string $expectedException
*/
- public function testCheckInput($arguments, $options, $parameterOptions, $user, $expectedException) {
+ public function testCheckInput($arguments, $options, $parameterOptions, $user, $expectedException): void {
$this->consoleInput->expects($this->any())
->method('getArgument')
->willReturnMap($arguments);
@@ -214,7 +214,7 @@ class SettingTest extends TestCase {
}
}
- public function testCheckInputExceptionCatch() {
+ public function testCheckInputExceptionCatch(): void {
$command = $this->getCommand(['checkInput']);
$command->expects($this->once())
->method('checkInput')
@@ -244,7 +244,7 @@ class SettingTest extends TestCase {
* @param string $expectedLine
* @param int $expectedReturn
*/
- public function testExecuteDelete($value, $errorIfNotExists, $expectedLine, $expectedReturn) {
+ public function testExecuteDelete($value, $errorIfNotExists, $expectedLine, $expectedReturn): void {
$command = $this->getCommand([
'writeArrayInOutputFormat',
'checkInput',
@@ -308,7 +308,7 @@ class SettingTest extends TestCase {
* @param string $expectedLine
* @param int $expectedReturn
*/
- public function testExecuteSet($value, $updateOnly, $expectedLine, $expectedReturn) {
+ public function testExecuteSet($value, $updateOnly, $expectedLine, $expectedReturn): void {
$command = $this->getCommand([
'writeArrayInOutputFormat',
'checkInput',
@@ -375,7 +375,7 @@ class SettingTest extends TestCase {
* @param string $expectedLine
* @param int $expectedReturn
*/
- public function testExecuteGet($value, $defaultValue, $expectedLine, $expectedReturn) {
+ public function testExecuteGet($value, $defaultValue, $expectedLine, $expectedReturn): void {
$command = $this->getCommand([
'writeArrayInOutputFormat',
'checkInput',
@@ -425,7 +425,7 @@ class SettingTest extends TestCase {
$this->assertEquals($expectedReturn, $this->invokePrivate($command, 'execute', [$this->consoleInput, $this->consoleOutput]));
}
- public function testExecuteList() {
+ public function testExecuteList(): void {
$command = $this->getCommand([
'writeArrayInOutputFormat',
'checkInput',
diff --git a/tests/Core/Controller/AppPasswordControllerTest.php b/tests/Core/Controller/AppPasswordControllerTest.php
index 6b7b023ab2e..f0246561145 100644
--- a/tests/Core/Controller/AppPasswordControllerTest.php
+++ b/tests/Core/Controller/AppPasswordControllerTest.php
@@ -86,7 +86,7 @@ class AppPasswordControllerTest extends TestCase {
);
}
- public function testGetAppPasswordWithAppPassword() {
+ public function testGetAppPasswordWithAppPassword(): void {
$this->session->method('exists')
->with('app_password')
->willReturn(true);
@@ -96,7 +96,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->getAppPassword();
}
- public function testGetAppPasswordNoLoginCreds() {
+ public function testGetAppPasswordNoLoginCreds(): void {
$this->session->method('exists')
->with('app_password')
->willReturn(false);
@@ -108,7 +108,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->getAppPassword();
}
- public function testGetAppPassword() {
+ public function testGetAppPassword(): void {
$credentials = $this->createMock(ICredentials::class);
$this->session->method('exists')
@@ -149,7 +149,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->getAppPassword();
}
- public function testGetAppPasswordNoPassword() {
+ public function testGetAppPasswordNoPassword(): void {
$credentials = $this->createMock(ICredentials::class);
$this->session->method('exists')
@@ -190,7 +190,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->getAppPassword();
}
- public function testDeleteAppPasswordNoAppPassword() {
+ public function testDeleteAppPasswordNoAppPassword(): void {
$this->session->method('exists')
->with('app_password')
->willReturn(false);
@@ -200,7 +200,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->deleteAppPassword();
}
- public function testDeleteAppPasswordFails() {
+ public function testDeleteAppPasswordFails(): void {
$this->session->method('exists')
->with('app_password')
->willReturn(true);
@@ -217,7 +217,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->deleteAppPassword();
}
- public function testDeleteAppPasswordSuccess() {
+ public function testDeleteAppPasswordSuccess(): void {
$this->session->method('exists')
->with('app_password')
->willReturn(true);
diff --git a/tests/Core/Controller/AutoCompleteControllerTest.php b/tests/Core/Controller/AutoCompleteControllerTest.php
index 2b82342276b..23bd03be7af 100644
--- a/tests/Core/Controller/AutoCompleteControllerTest.php
+++ b/tests/Core/Controller/AutoCompleteControllerTest.php
@@ -156,7 +156,7 @@ class AutoCompleteControllerTest extends TestCase {
/**
* @dataProvider searchDataProvider
*/
- public function testGet(array $searchResults, array $expected, string $searchTerm, ?string $itemType, ?string $itemId, ?string $sorter) {
+ public function testGet(array $searchResults, array $expected, string $searchTerm, ?string $itemType, ?string $itemId, ?string $sorter): void {
$this->collaboratorSearch->expects($this->once())
->method('search')
->willReturn([$searchResults, false]);
diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php
index 41c16bc4c3f..3a1123c940b 100644
--- a/tests/Core/Controller/AvatarControllerTest.php
+++ b/tests/Core/Controller/AvatarControllerTest.php
@@ -128,7 +128,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Fetch an avatar if a user has no avatar
*/
- public function testGetAvatarNoAvatar() {
+ public function testGetAvatarNoAvatar(): void {
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
$this->avatarMock->method('getFile')->will($this->throwException(new NotFoundException()));
$response = $this->avatarController->getAvatar('userId', 32);
@@ -140,7 +140,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Fetch the user's avatar
*/
- public function testGetAvatar() {
+ public function testGetAvatar(): void {
$this->avatarMock->method('getFile')->willReturn($this->avatarFile);
$this->avatarManager->method('getAvatar')->with('userId')->willReturn($this->avatarMock);
$this->avatarMock->expects($this->once())
@@ -161,7 +161,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Fetch the user's avatar
*/
- public function testGetGeneratedAvatar() {
+ public function testGetGeneratedAvatar(): void {
$this->avatarMock->method('getFile')->willReturn($this->avatarFile);
$this->avatarManager->method('getAvatar')->with('userId')->willReturn($this->avatarMock);
@@ -179,7 +179,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Fetch the avatar of a non-existing user
*/
- public function testGetAvatarNoUser() {
+ public function testGetAvatarNoUser(): void {
$this->avatarManager
->method('getAvatar')
->with('userDoesNotExist')
@@ -276,7 +276,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Remove an avatar
*/
- public function testDeleteAvatar() {
+ public function testDeleteAvatar(): void {
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
$response = $this->avatarController->deleteAvatar();
@@ -286,7 +286,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test what happens if the removing of the avatar fails
*/
- public function testDeleteAvatarException() {
+ public function testDeleteAvatarException(): void {
$this->avatarMock->method('remove')->will($this->throwException(new \Exception('foo')));
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
@@ -300,7 +300,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Trying to get a tmp avatar when it is not available. 404
*/
- public function testTmpAvatarNoTmp() {
+ public function testTmpAvatarNoTmp(): void {
$response = $this->avatarController->getTmpAvatar();
$this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus());
}
@@ -308,7 +308,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Fetch tmp avatar
*/
- public function testTmpAvatarValid() {
+ public function testTmpAvatarValid(): void {
$this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$response = $this->avatarController->getTmpAvatar();
@@ -319,7 +319,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* When trying to post a new avatar a path or image should be posted.
*/
- public function testPostAvatarNoPathOrImage() {
+ public function testPostAvatarNoPathOrImage(): void {
$response = $this->avatarController->postAvatar(null);
$this->assertEquals(Http::STATUS_BAD_REQUEST, $response->getStatus());
@@ -328,7 +328,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test a correct post of an avatar using POST
*/
- public function testPostAvatarFile() {
+ public function testPostAvatarFile(): void {
//Create temp file
$fileName = tempnam('', 'avatarTest');
$copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.jpg', $fileName);
@@ -353,7 +353,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test invalid post os an avatar using POST
*/
- public function testPostAvatarInvalidFile() {
+ public function testPostAvatarInvalidFile(): void {
//Create request return
$reqRet = ['error' => [1], 'tmp_name' => ['foo']];
$this->request->method('getUploadedFile')->willReturn($reqRet);
@@ -366,7 +366,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Check what happens when we upload a GIF
*/
- public function testPostAvatarFileGif() {
+ public function testPostAvatarFileGif(): void {
//Create temp file
$fileName = tempnam('', 'avatarTest');
$copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.gif', $fileName);
@@ -390,7 +390,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test posting avatar from existing file
*/
- public function testPostAvatarFromFile() {
+ public function testPostAvatarFromFile(): void {
//Mock node API call
$file = $this->getMockBuilder('OCP\Files\File')
->disableOriginalConstructor()->getMock();
@@ -414,7 +414,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test posting avatar from existing folder
*/
- public function testPostAvatarFromNoFile() {
+ public function testPostAvatarFromNoFile(): void {
$file = $this->getMockBuilder('OCP\Files\Node')->getMock();
$userFolder = $this->getMockBuilder('OCP\Files\Folder')->getMock();
$this->rootFolder->method('getUserFolder')->with('userid')->willReturn($userFolder);
@@ -430,7 +430,7 @@ class AvatarControllerTest extends \Test\TestCase {
$this->assertEquals(['data' => ['message' => 'Please select a file.']], $response->getData());
}
- public function testPostAvatarInvalidType() {
+ public function testPostAvatarInvalidType(): void {
$file = $this->getMockBuilder('OCP\Files\File')
->disableOriginalConstructor()->getMock();
$file->expects($this->never())
@@ -446,7 +446,7 @@ class AvatarControllerTest extends \Test\TestCase {
$this->assertEquals($expectedResponse, $this->avatarController->postAvatar('avatar.jpg'));
}
- public function testPostAvatarNotPermittedException() {
+ public function testPostAvatarNotPermittedException(): void {
$file = $this->getMockBuilder('OCP\Files\File')
->disableOriginalConstructor()->getMock();
$file->expects($this->once())
@@ -466,7 +466,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test what happens if the upload of the avatar fails
*/
- public function testPostAvatarException() {
+ public function testPostAvatarException(): void {
$this->cache->expects($this->once())
->method('set')
->will($this->throwException(new \Exception('foo')));
@@ -493,7 +493,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test invalid crop argument
*/
- public function testPostCroppedAvatarInvalidCrop() {
+ public function testPostCroppedAvatarInvalidCrop(): void {
$response = $this->avatarController->postCroppedAvatar([]);
$this->assertEquals(Http::STATUS_BAD_REQUEST, $response->getStatus());
@@ -502,7 +502,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test no tmp avatar to crop
*/
- public function testPostCroppedAvatarNoTmpAvatar() {
+ public function testPostCroppedAvatarNoTmpAvatar(): void {
$response = $this->avatarController->postCroppedAvatar(['x' => 0, 'y' => 0, 'w' => 10, 'h' => 10]);
$this->assertEquals(Http::STATUS_BAD_REQUEST, $response->getStatus());
@@ -511,7 +511,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test with non square crop
*/
- public function testPostCroppedAvatarNoSquareCrop() {
+ public function testPostCroppedAvatarNoSquareCrop(): void {
$this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->avatarMock->method('set')->will($this->throwException(new \OC\NotSquareException));
@@ -524,7 +524,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Check for proper reply on proper crop argument
*/
- public function testPostCroppedAvatarValidCrop() {
+ public function testPostCroppedAvatarValidCrop(): void {
$this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
$response = $this->avatarController->postCroppedAvatar(['x' => 0, 'y' => 0, 'w' => 10, 'h' => 10]);
@@ -536,7 +536,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test what happens if the cropping of the avatar fails
*/
- public function testPostCroppedAvatarException() {
+ public function testPostCroppedAvatarException(): void {
$this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->avatarMock->method('set')->will($this->throwException(new \Exception('foo')));
@@ -553,7 +553,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Check for proper reply on proper crop argument
*/
- public function testFileTooBig() {
+ public function testFileTooBig(): void {
$fileName = \OC::$SERVERROOT.'/tests/data/testimage.jpg';
//Create request return
$reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [21 * 1024 * 1024]];
diff --git a/tests/Core/Controller/ChangePasswordControllerTest.php b/tests/Core/Controller/ChangePasswordControllerTest.php
index 93fb4196d35..a806b091477 100644
--- a/tests/Core/Controller/ChangePasswordControllerTest.php
+++ b/tests/Core/Controller/ChangePasswordControllerTest.php
@@ -60,7 +60,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
);
}
- public function testChangePersonalPasswordWrongPassword() {
+ public function testChangePersonalPasswordWrongPassword(): void {
$this->userSession->expects($this->once())
->method('getLoginName')
->willReturn($this->loginName);
@@ -82,7 +82,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
$this->assertEquals($expects, $actual);
}
- public function testChangePersonalPasswordCommonPassword() {
+ public function testChangePersonalPasswordCommonPassword(): void {
$this->userSession->expects($this->once())
->method('getLoginName')
->willReturn($this->loginName);
@@ -109,7 +109,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
$this->assertEquals($expects, $actual);
}
- public function testChangePersonalPasswordNoNewPassword() {
+ public function testChangePersonalPasswordNoNewPassword(): void {
$this->userSession->expects($this->once())
->method('getLoginName')
->willReturn($this->loginName);
@@ -132,7 +132,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
$this->assertEquals($expects, $res->getData());
}
- public function testChangePersonalPasswordCantSetPassword() {
+ public function testChangePersonalPasswordCantSetPassword(): void {
$this->userSession->expects($this->once())
->method('getLoginName')
->willReturn($this->loginName);
@@ -159,7 +159,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
$this->assertEquals($expects, $actual);
}
- public function testChangePersonalPassword() {
+ public function testChangePersonalPassword(): void {
$this->userSession->expects($this->once())
->method('getLoginName')
->willReturn($this->loginName);
diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php
index 98f09f0f18c..a38f73c85a6 100644
--- a/tests/Core/Controller/ClientFlowLoginControllerTest.php
+++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php
@@ -102,7 +102,7 @@ class ClientFlowLoginControllerTest extends TestCase {
);
}
- public function testShowAuthPickerPageNoClientOrOauthRequest() {
+ public function testShowAuthPickerPageNoClientOrOauthRequest(): void {
$expected = new StandaloneTemplateResponse(
'core',
'error',
@@ -121,7 +121,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->showAuthPickerPage());
}
- public function testShowAuthPickerPageWithOcsHeader() {
+ public function testShowAuthPickerPageWithOcsHeader(): void {
$this->request
->method('getHeader')
->withConsecutive(
@@ -183,7 +183,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->showAuthPickerPage());
}
- public function testShowAuthPickerPageWithOauth() {
+ public function testShowAuthPickerPageWithOauth(): void {
$this->request
->method('getHeader')
->withConsecutive(
@@ -253,7 +253,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->showAuthPickerPage('MyClientIdentifier'));
}
- public function testGenerateAppPasswordWithInvalidToken() {
+ public function testGenerateAppPasswordWithInvalidToken(): void {
$this->session
->expects($this->once())
->method('get')
@@ -276,7 +276,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken'));
}
- public function testGenerateAppPasswordWithSessionNotAvailableException() {
+ public function testGenerateAppPasswordWithSessionNotAvailableException(): void {
$this->session
->expects($this->once())
->method('get')
@@ -296,7 +296,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken'));
}
- public function testGenerateAppPasswordWithInvalidTokenException() {
+ public function testGenerateAppPasswordWithInvalidTokenException(): void {
$this->session
->expects($this->once())
->method('get')
@@ -321,7 +321,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken'));
}
- public function testGeneratePasswordWithPassword() {
+ public function testGeneratePasswordWithPassword(): void {
$this->session
->expects($this->once())
->method('get')
@@ -405,7 +405,7 @@ class ClientFlowLoginControllerTest extends TestCase {
* ["https://example.com/redirect.php?hello=world", "https://example.com/redirect.php?hello=world&state=MyOauthState&code=MyAccessCode"]
*
*/
- public function testGeneratePasswordWithPasswordForOauthClient($redirectUri, $redirectUrl) {
+ public function testGeneratePasswordWithPasswordForOauthClient($redirectUri, $redirectUrl): void {
$this->session
->method('get')
->withConsecutive(
@@ -490,7 +490,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken', 'MyClientIdentifier'));
}
- public function testGeneratePasswordWithoutPassword() {
+ public function testGeneratePasswordWithoutPassword(): void {
$this->session
->expects($this->once())
->method('get')
@@ -621,7 +621,7 @@ class ClientFlowLoginControllerTest extends TestCase {
* @param string $protocol
* @param string $expected
*/
- public function testGeneratePasswordWithHttpsProxy(array $headers, $protocol, $expected) {
+ public function testGeneratePasswordWithHttpsProxy(array $headers, $protocol, $expected): void {
$this->session
->expects($this->once())
->method('get')
diff --git a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php
index eefa2982c74..093b8a3442d 100644
--- a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php
+++ b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php
@@ -70,7 +70,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
);
}
- public function testPollInvalid() {
+ public function testPollInvalid(): void {
$this->loginFlowV2Service->method('poll')
->with('token')
->willThrowException(new LoginFlowV2NotFoundException());
@@ -81,7 +81,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_NOT_FOUND, $result->getStatus());
}
- public function testPollValid() {
+ public function testPollValid(): void {
$creds = new LoginFlowV2Credentials('server', 'login', 'pass');
$this->loginFlowV2Service->method('poll')
->with('token')
@@ -93,7 +93,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_OK, $result->getStatus());
}
- public function testLandingInvalid() {
+ public function testLandingInvalid(): void {
$this->session->expects($this->never())
->method($this->anything());
@@ -107,7 +107,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertInstanceOf(Http\StandaloneTemplateResponse::class, $result);
}
- public function testLandingValid() {
+ public function testLandingValid(): void {
$this->session->expects($this->once())
->method('set')
->with('client.flow.v2.login.token', 'token');
@@ -127,7 +127,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame('https://server/path', $result->getRedirectURL());
}
- public function testShowAuthPickerNoLoginToken() {
+ public function testShowAuthPickerNoLoginToken(): void {
$this->session->method('get')
->willReturn(null);
@@ -136,7 +136,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testShowAuthPickerInvalidLoginToken() {
+ public function testShowAuthPickerInvalidLoginToken(): void {
$this->session->method('get')
->with('client.flow.v2.login.token')
->willReturn('loginToken');
@@ -150,7 +150,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testShowAuthPickerValidLoginToken() {
+ public function testShowAuthPickerValidLoginToken(): void {
$this->session->method('get')
->with('client.flow.v2.login.token')
->willReturn('loginToken');
@@ -176,7 +176,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testGrantPageInvalidStateToken() {
+ public function testGrantPageInvalidStateToken(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
return null;
@@ -186,7 +186,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testGrantPageInvalidLoginToken() {
+ public function testGrantPageInvalidLoginToken(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
if ($name === 'client.flow.v2.state.token') {
@@ -206,7 +206,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testGrantPageValid() {
+ public function testGrantPageValid(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
if ($name === 'client.flow.v2.state.token') {
@@ -236,7 +236,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
}
- public function testGenerateAppPasswordInvalidStateToken() {
+ public function testGenerateAppPasswordInvalidStateToken(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
return null;
@@ -246,7 +246,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testGenerateAppPassworInvalidLoginToken() {
+ public function testGenerateAppPassworInvalidLoginToken(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
if ($name === 'client.flow.v2.state.token') {
@@ -266,7 +266,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testGenerateAppPassworValid() {
+ public function testGenerateAppPassworValid(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
if ($name === 'client.flow.v2.state.token') {
diff --git a/tests/Core/Controller/ContactsMenuControllerTest.php b/tests/Core/Controller/ContactsMenuControllerTest.php
index d688ea6682f..aa20e6726e2 100644
--- a/tests/Core/Controller/ContactsMenuControllerTest.php
+++ b/tests/Core/Controller/ContactsMenuControllerTest.php
@@ -35,7 +35,7 @@ class ContactsMenuControllerTest extends TestCase {
$this->controller = new ContactsMenuController($request, $this->userSession, $this->contactsManager);
}
- public function testIndex() {
+ public function testIndex(): void {
$user = $this->createMock(IUser::class);
$entries = [
$this->createMock(IEntry::class),
@@ -54,7 +54,7 @@ class ContactsMenuControllerTest extends TestCase {
$this->assertEquals($entries, $response);
}
- public function testFindOne() {
+ public function testFindOne(): void {
$user = $this->createMock(IUser::class);
$entry = $this->createMock(IEntry::class);
$this->userSession->expects($this->once())
@@ -70,7 +70,7 @@ class ContactsMenuControllerTest extends TestCase {
$this->assertEquals($entry, $response);
}
- public function testFindOne404() {
+ public function testFindOne404(): void {
$user = $this->createMock(IUser::class);
$this->userSession->expects($this->once())
->method('getUser')
diff --git a/tests/Core/Controller/CssControllerTest.php b/tests/Core/Controller/CssControllerTest.php
index 8064f36cddb..cae6f7989c4 100644
--- a/tests/Core/Controller/CssControllerTest.php
+++ b/tests/Core/Controller/CssControllerTest.php
@@ -56,7 +56,7 @@ class CssControllerTest extends TestCase {
);
}
- public function testNoCssFolderForApp() {
+ public function testNoCssFolderForApp(): void {
$this->appData->method('getFolder')
->with('myapp')
->willThrowException(new NotFoundException());
@@ -67,7 +67,7 @@ class CssControllerTest extends TestCase {
}
- public function testNoCssFile() {
+ public function testNoCssFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$this->appData->method('getFolder')
->with('myapp')
@@ -81,7 +81,7 @@ class CssControllerTest extends TestCase {
$this->assertInstanceOf(NotFoundResponse::class, $result);
}
- public function testGetFile() {
+ public function testGetFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$file->method('getName')->willReturn('my name');
@@ -105,7 +105,7 @@ class CssControllerTest extends TestCase {
$this->assertEquals($expected, $result);
}
- public function testGetGzipFile() {
+ public function testGetGzipFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$gzipFile = $this->createMock(ISimpleFile::class);
$gzipFile->method('getName')->willReturn('my name');
@@ -134,7 +134,7 @@ class CssControllerTest extends TestCase {
$this->assertEquals($expected, $result);
}
- public function testGetGzipFileNotFound() {
+ public function testGetGzipFileNotFound(): void {
$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$file->method('getName')->willReturn('my name');
diff --git a/tests/Core/Controller/GuestAvatarControllerTest.php b/tests/Core/Controller/GuestAvatarControllerTest.php
index b2f60665948..1ad9e49f858 100644
--- a/tests/Core/Controller/GuestAvatarControllerTest.php
+++ b/tests/Core/Controller/GuestAvatarControllerTest.php
@@ -71,7 +71,7 @@ class GuestAvatarControllerTest extends \Test\TestCase {
/**
* Tests getAvatar returns the guest avatar.
*/
- public function testGetAvatar() {
+ public function testGetAvatar(): void {
$this->avatarManager->expects($this->once())
->method('getGuestAvatar')
->with('Peter')
diff --git a/tests/Core/Controller/JsControllerTest.php b/tests/Core/Controller/JsControllerTest.php
index 5aa853e4ed0..1500ed6eacf 100644
--- a/tests/Core/Controller/JsControllerTest.php
+++ b/tests/Core/Controller/JsControllerTest.php
@@ -56,7 +56,7 @@ class JsControllerTest extends TestCase {
);
}
- public function testNoCssFolderForApp() {
+ public function testNoCssFolderForApp(): void {
$this->appData->method('getFolder')
->with('myapp')
->willThrowException(new NotFoundException());
@@ -67,7 +67,7 @@ class JsControllerTest extends TestCase {
}
- public function testNoCssFile() {
+ public function testNoCssFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$this->appData->method('getFolder')
->with('myapp')
@@ -81,7 +81,7 @@ class JsControllerTest extends TestCase {
$this->assertInstanceOf(NotFoundResponse::class, $result);
}
- public function testGetFile() {
+ public function testGetFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$file->method('getName')->willReturn('my name');
@@ -105,7 +105,7 @@ class JsControllerTest extends TestCase {
$this->assertEquals($expected, $result);
}
- public function testGetGzipFile() {
+ public function testGetGzipFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$gzipFile = $this->createMock(ISimpleFile::class);
$gzipFile->method('getName')->willReturn('my name');
@@ -134,7 +134,7 @@ class JsControllerTest extends TestCase {
$this->assertEquals($expected, $result);
}
- public function testGetGzipFileNotFound() {
+ public function testGetGzipFileNotFound(): void {
$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$file->method('getName')->willReturn('my name');
diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php
index 50ecbe5e19c..a5ff6fd61a5 100644
--- a/tests/Core/Controller/LoginControllerTest.php
+++ b/tests/Core/Controller/LoginControllerTest.php
@@ -129,7 +129,7 @@ class LoginControllerTest extends TestCase {
);
}
- public function testLogoutWithoutToken() {
+ public function testLogoutWithoutToken(): void {
$this->request
->expects($this->once())
->method('getCookie')
@@ -156,7 +156,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->loginController->logout());
}
- public function testLogoutNoClearSiteData() {
+ public function testLogoutNoClearSiteData(): void {
$this->request
->expects($this->once())
->method('getCookie')
@@ -179,7 +179,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->loginController->logout());
}
- public function testLogoutWithToken() {
+ public function testLogoutWithToken(): void {
$this->request
->expects($this->once())
->method('getCookie')
@@ -216,7 +216,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->loginController->logout());
}
- public function testShowLoginFormForLoggedInUsers() {
+ public function testShowLoginFormForLoggedInUsers(): void {
$this->userSession
->expects($this->once())
->method('isLoggedIn')
@@ -230,7 +230,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', ''));
}
- public function testShowLoginFormWithErrorsInSession() {
+ public function testShowLoginFormWithErrorsInSession(): void {
$this->userSession
->expects($this->once())
->method('isLoggedIn')
@@ -285,7 +285,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', ''));
}
- public function testShowLoginFormForFlowAuth() {
+ public function testShowLoginFormForFlowAuth(): void {
$this->userSession
->expects($this->once())
->method('isLoggedIn')
@@ -332,7 +332,7 @@ class LoginControllerTest extends TestCase {
* @dataProvider passwordResetDataProvider
*/
public function testShowLoginFormWithPasswordResetOption($canChangePassword,
- $expectedResult) {
+ $expectedResult): void {
$this->userSession
->expects($this->once())
->method('isLoggedIn')
@@ -381,7 +381,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $this->loginController->showLoginForm('LdapUser', ''));
}
- public function testShowLoginFormForUserNamed0() {
+ public function testShowLoginFormForUserNamed0(): void {
$this->userSession
->expects($this->once())
->method('isLoggedIn')
@@ -468,7 +468,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $response);
}
- public function testLoginWithValidCredentials() {
+ public function testLoginWithValidCredentials(): void {
$user = 'MyUserName';
$password = 'secret';
$loginChain = $this->createMock(LoginChain::class);
@@ -523,7 +523,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $response);
}
- public function testLoginWithoutPassedCsrfCheckAndLoggedIn() {
+ public function testLoginWithoutPassedCsrfCheckAndLoggedIn(): void {
/** @var IUser|MockObject $user */
$user = $this->createMock(IUser::class);
$user->expects($this->any())
@@ -560,7 +560,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $response);
}
- public function testLoginWithValidCredentialsAndRedirectUrl() {
+ public function testLoginWithValidCredentialsAndRedirectUrl(): void {
$user = 'MyUserName';
$password = 'secret';
$redirectUrl = 'https://next.cloud/apps/mail';
@@ -594,7 +594,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $response);
}
- public function testToNotLeakLoginName() {
+ public function testToNotLeakLoginName(): void {
$loginChain = $this->createMock(LoginChain::class);
$this->request
->expects($this->once())
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php
index 7e9d085a291..2a99c9f9d16 100644
--- a/tests/Core/Controller/LostControllerTest.php
+++ b/tests/Core/Controller/LostControllerTest.php
@@ -138,7 +138,7 @@ class LostControllerTest extends TestCase {
);
}
- public function testResetFormTokenError() {
+ public function testResetFormTokenError(): void {
$this->userManager->method('get')
->with('ValidTokenUser')
->willReturn($this->existingUser);
@@ -160,7 +160,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testResetFormValidToken() {
+ public function testResetFormValidToken(): void {
$this->userManager->method('get')
->with('ValidTokenUser')
->willReturn($this->existingUser);
@@ -188,7 +188,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testEmailUnsuccessful() {
+ public function testEmailUnsuccessful(): void {
$existingUser = 'ExistingUser';
$nonExistingUser = 'NonExistingUser';
$this->userManager
@@ -230,7 +230,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testEmailSuccessful() {
+ public function testEmailSuccessful(): void {
$this->userManager
->expects($this->any())
->method('get')
@@ -287,7 +287,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testEmailWithMailSuccessful() {
+ public function testEmailWithMailSuccessful(): void {
$this->userManager
->expects($this->any())
->method('get')
@@ -349,7 +349,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testEmailCantSendException() {
+ public function testEmailCantSendException(): void {
$this->userManager
->expects($this->any())
->method('get')
@@ -409,7 +409,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testSetPasswordUnsuccessful() {
+ public function testSetPasswordUnsuccessful(): void {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('encryptedData');
@@ -435,7 +435,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSetPasswordSuccessful() {
+ public function testSetPasswordSuccessful(): void {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('encryptedData');
@@ -463,7 +463,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSetPasswordExpiredToken() {
+ public function testSetPasswordExpiredToken(): void {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('encryptedData');
@@ -482,7 +482,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSetPasswordInvalidDataInDb() {
+ public function testSetPasswordInvalidDataInDb(): void {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('invalidEncryptedData');
@@ -502,7 +502,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testIsSetPasswordWithoutTokenFailing() {
+ public function testIsSetPasswordWithoutTokenFailing(): void {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('aValidtoken');
@@ -521,7 +521,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSetPasswordForDisabledUser() {
+ public function testSetPasswordForDisabledUser(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->any())
->method('isEnabled')
@@ -551,7 +551,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSendEmailNoEmail() {
+ public function testSendEmailNoEmail(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->any())
->method('isEnabled')
@@ -574,7 +574,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testSetPasswordEncryptionDontProceedPerUserKey() {
+ public function testSetPasswordEncryptionDontProceedPerUserKey(): void {
/** @var IEncryptionModule|MockObject $encryptionModule */
$encryptionModule = $this->createMock(IEncryptionModule::class);
$encryptionModule->expects($this->once())->method('needDetailedAccessList')->willReturn(true);
@@ -587,7 +587,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSetPasswordDontProceedMasterKey() {
+ public function testSetPasswordDontProceedMasterKey(): void {
$encryptionModule = $this->createMock(IEncryptionModule::class);
$encryptionModule->expects($this->once())->method('needDetailedAccessList')->willReturn(false);
$this->encryptionManager->expects($this->once())->method('getEncryptionModules')
@@ -615,7 +615,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testTwoUsersWithSameEmail() {
+ public function testTwoUsersWithSameEmail(): void {
$user1 = $this->createMock(IUser::class);
$user1->expects($this->any())
->method('getEMailAddress')
@@ -707,7 +707,7 @@ class LostControllerTest extends TestCase {
$this->assertInstanceOf(IUser::class, $result);
}
- public function testTrimEmailInput() {
+ public function testTrimEmailInput(): void {
$this->userManager
->expects($this->once())
->method('getByEmail')
@@ -724,7 +724,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testUsernameInput() {
+ public function testUsernameInput(): void {
$this->userManager
->expects($this->once())
->method('get')
diff --git a/tests/Core/Controller/NavigationControllerTest.php b/tests/Core/Controller/NavigationControllerTest.php
index 0d7c91d3034..4995bd2fed0 100644
--- a/tests/Core/Controller/NavigationControllerTest.php
+++ b/tests/Core/Controller/NavigationControllerTest.php
@@ -48,7 +48,7 @@ class NavigationControllerTest extends TestCase {
];
}
/** @dataProvider dataGetNavigation */
- public function testGetAppNavigation($absolute) {
+ public function testGetAppNavigation($absolute): void {
$this->navigationManager->expects($this->once())
->method('getAll')
->with('link')
@@ -77,7 +77,7 @@ class NavigationControllerTest extends TestCase {
}
/** @dataProvider dataGetNavigation */
- public function testGetSettingsNavigation($absolute) {
+ public function testGetSettingsNavigation($absolute): void {
$this->navigationManager->expects($this->once())
->method('getAll')
->with('settings')
@@ -108,7 +108,7 @@ class NavigationControllerTest extends TestCase {
}
}
- public function testGetAppNavigationEtagMatch() {
+ public function testGetAppNavigationEtagMatch(): void {
$navigation = [ ['id' => 'files', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ];
$this->request->expects($this->once())
->method('getHeader')
@@ -123,7 +123,7 @@ class NavigationControllerTest extends TestCase {
$this->assertEquals(Http::STATUS_NOT_MODIFIED, $actual->getStatus());
}
- public function testGetSettingsNavigationEtagMatch() {
+ public function testGetSettingsNavigationEtagMatch(): void {
$navigation = [ ['id' => 'logout', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ];
$this->request->expects($this->once())
->method('getHeader')
diff --git a/tests/Core/Controller/OCSControllerTest.php b/tests/Core/Controller/OCSControllerTest.php
index 19b87a97359..6fc5f54b8ef 100644
--- a/tests/Core/Controller/OCSControllerTest.php
+++ b/tests/Core/Controller/OCSControllerTest.php
@@ -68,7 +68,7 @@ class OCSControllerTest extends TestCase {
return new DataResponse($data);
}
- public function testGetCapabilities() {
+ public function testGetCapabilities(): void {
$this->userSession->expects($this->once())
->method('isLoggedIn')
->willReturn(true);
@@ -101,7 +101,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->getCapabilities());
}
- public function testGetCapabilitiesPublic() {
+ public function testGetCapabilitiesPublic(): void {
$this->userSession->expects($this->once())
->method('isLoggedIn')
->willReturn(false);
@@ -135,7 +135,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->getCapabilities());
}
- public function testPersonCheckValid() {
+ public function testPersonCheckValid(): void {
$this->userManager->method('checkPassword')
->with(
$this->equalTo('user'),
@@ -150,7 +150,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->personCheck('user', 'pass'));
}
- public function testPersonInvalid() {
+ public function testPersonInvalid(): void {
$this->userManager->method('checkPassword')
->with(
$this->equalTo('user'),
@@ -162,7 +162,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->personCheck('user', 'wrongpass'));
}
- public function testPersonNoLogin() {
+ public function testPersonNoLogin(): void {
$this->userManager->method('checkPassword')
->with(
$this->equalTo('user'),
@@ -173,7 +173,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->personCheck('', ''));
}
- public function testGetIdentityProofWithNotExistingUser() {
+ public function testGetIdentityProofWithNotExistingUser(): void {
$this->userManager
->expects($this->once())
->method('get')
@@ -184,7 +184,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->getIdentityProof('NotExistingUser'));
}
- public function testGetIdentityProof() {
+ public function testGetIdentityProof(): void {
$user = $this->createMock(IUser::class);
$key = $this->createMock(Key::class);
$this->userManager
diff --git a/tests/Core/Controller/PreviewControllerTest.php b/tests/Core/Controller/PreviewControllerTest.php
index 7c9a32eae38..4274f15e8ed 100644
--- a/tests/Core/Controller/PreviewControllerTest.php
+++ b/tests/Core/Controller/PreviewControllerTest.php
@@ -49,28 +49,28 @@ class PreviewControllerTest extends \Test\TestCase {
);
}
- public function testInvalidFile() {
+ public function testInvalidFile(): void {
$res = $this->controller->getPreview('');
$expected = new DataResponse([], Http::STATUS_BAD_REQUEST);
$this->assertEquals($expected, $res);
}
- public function testInvalidWidth() {
+ public function testInvalidWidth(): void {
$res = $this->controller->getPreview('file', 0);
$expected = new DataResponse([], Http::STATUS_BAD_REQUEST);
$this->assertEquals($expected, $res);
}
- public function testInvalidHeight() {
+ public function testInvalidHeight(): void {
$res = $this->controller->getPreview('file', 10, 0);
$expected = new DataResponse([], Http::STATUS_BAD_REQUEST);
$this->assertEquals($expected, $res);
}
- public function testFileNotFound() {
+ public function testFileNotFound(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
@@ -86,7 +86,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $res);
}
- public function testNotAFile() {
+ public function testNotAFile(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
@@ -103,7 +103,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $res);
}
- public function testNoPreviewAndNoIcon() {
+ public function testNoPreviewAndNoIcon(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
@@ -124,7 +124,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $res);
}
- public function testForbiddenFile() {
+ public function testForbiddenFile(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
@@ -148,7 +148,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $res);
}
- public function testNoPreview() {
+ public function testNoPreview(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
@@ -180,7 +180,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $res);
}
- public function testValidPreview() {
+ public function testValidPreview(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php
index 3e99c2cad14..11e18bd622a 100644
--- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php
+++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php
@@ -75,7 +75,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
->willReturn('logoutAttribute');
}
- public function testSelectChallenge() {
+ public function testSelectChallenge(): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$p1 = $this->createMock(IActivatableAtLogin::class);
$p1->method('getId')->willReturn('p1');
@@ -109,7 +109,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->selectChallenge('/some/url'));
}
- public function testShowChallenge() {
+ public function testShowChallenge(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
$provider->method('getId')->willReturn('myprovider');
@@ -160,7 +160,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->showChallenge('myprovider', '/re/dir/ect/url'));
}
- public function testShowInvalidChallenge() {
+ public function testShowInvalidChallenge(): void {
$user = $this->createMock(IUser::class);
$providerSet = new ProviderSet([], false);
@@ -181,7 +181,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->showChallenge('myprovider', 'redirect/url'));
}
- public function testSolveChallenge() {
+ public function testSolveChallenge(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
@@ -206,7 +206,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->solveChallenge('myprovider', 'token'));
}
- public function testSolveValidChallengeAndRedirect() {
+ public function testSolveValidChallengeAndRedirect(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
@@ -231,7 +231,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->solveChallenge('myprovider', 'token', 'redirect%20url'));
}
- public function testSolveChallengeInvalidProvider() {
+ public function testSolveChallengeInvalidProvider(): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$this->userSession->expects($this->once())
@@ -251,7 +251,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->solveChallenge('myprovider', 'token'));
}
- public function testSolveInvalidChallenge() {
+ public function testSolveInvalidChallenge(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
@@ -285,7 +285,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->solveChallenge('myprovider', 'token', '/url'));
}
- public function testSolveChallengeTwoFactorException() {
+ public function testSolveChallengeTwoFactorException(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
$exception = new TwoFactorException('2FA failed');
@@ -353,7 +353,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $response);
}
- public function testSetUpInvalidProvider() {
+ public function testSetUpInvalidProvider(): void {
$user = $this->createMock(IUser::class);
$this->userSession->expects($this->once())
->method('getUser')
diff --git a/tests/Core/Controller/UserControllerTest.php b/tests/Core/Controller/UserControllerTest.php
index 09a22913fdc..979c723dd85 100644
--- a/tests/Core/Controller/UserControllerTest.php
+++ b/tests/Core/Controller/UserControllerTest.php
@@ -31,7 +31,7 @@ class UserControllerTest extends TestCase {
);
}
- public function testGetDisplayNames() {
+ public function testGetDisplayNames(): void {
$user = $this->createMock(IUser::class);
$user->method('getDisplayName')
->willReturn('FooDisplay Name');
diff --git a/tests/Core/Controller/WipeControllerTest.php b/tests/Core/Controller/WipeControllerTest.php
index f07fe4c9282..2cd315db5bf 100644
--- a/tests/Core/Controller/WipeControllerTest.php
+++ b/tests/Core/Controller/WipeControllerTest.php
@@ -50,7 +50,7 @@ class WipeControllerTest extends TestCase {
*
* @dataProvider dataTest
*/
- public function testCheckWipe(bool $valid, bool $couldPerform, bool $result) {
+ public function testCheckWipe(bool $valid, bool $couldPerform, bool $result): void {
if (!$valid) {
$this->remoteWipe->method('start')
->with('mytoken')
@@ -79,7 +79,7 @@ class WipeControllerTest extends TestCase {
*
* @dataProvider dataTest
*/
- public function testWipeDone(bool $valid, bool $couldPerform, bool $result) {
+ public function testWipeDone(bool $valid, bool $couldPerform, bool $result): void {
if (!$valid) {
$this->remoteWipe->method('finish')
->with('mytoken')
diff --git a/tests/Core/Data/LoginFlowV2CredentialsTest.php b/tests/Core/Data/LoginFlowV2CredentialsTest.php
index 0bb32f1c967..41575f33a9c 100644
--- a/tests/Core/Data/LoginFlowV2CredentialsTest.php
+++ b/tests/Core/Data/LoginFlowV2CredentialsTest.php
@@ -20,20 +20,20 @@ class LoginFlowV2CredentialsTest extends TestCase {
$this->fixture = new LoginFlowV2Credentials('server', 'login', 'pass');
}
- public function testImplementsJsonSerializable() {
+ public function testImplementsJsonSerializable(): void {
$this->assertTrue($this->fixture instanceof JsonSerializable);
}
/**
* Test getter functions.
*/
- public function testGetter() {
+ public function testGetter(): void {
$this->assertEquals('server', $this->fixture->getServer());
$this->assertEquals('login', $this->fixture->getLoginName());
$this->assertEquals('pass', $this->fixture->getAppPassword());
}
- public function testJsonSerialize() {
+ public function testJsonSerialize(): void {
$this->assertEquals(
[
'server' => 'server',
diff --git a/tests/Core/Middleware/TwoFactorMiddlewareTest.php b/tests/Core/Middleware/TwoFactorMiddlewareTest.php
index a245845a674..6b8bf1c76e0 100644
--- a/tests/Core/Middleware/TwoFactorMiddlewareTest.php
+++ b/tests/Core/Middleware/TwoFactorMiddlewareTest.php
@@ -82,7 +82,7 @@ class TwoFactorMiddlewareTest extends TestCase {
$this->controller = $this->createMock(Controller::class);
}
- public function testBeforeControllerNotLoggedIn() {
+ public function testBeforeControllerNotLoggedIn(): void {
$this->userSession->expects($this->once())
->method('isLoggedIn')
->willReturn(false);
@@ -93,7 +93,7 @@ class TwoFactorMiddlewareTest extends TestCase {
$this->middleware->beforeController($this->controller, 'index');
}
- public function testBeforeSetupController() {
+ public function testBeforeSetupController(): void {
$user = $this->createMock(IUser::class);
$controller = $this->createMock(ALoginSetupController::class);
$this->userSession->expects($this->any())
@@ -108,7 +108,7 @@ class TwoFactorMiddlewareTest extends TestCase {
$this->middleware->beforeController($controller, 'create');
}
- public function testBeforeControllerNoTwoFactorCheckNeeded() {
+ public function testBeforeControllerNoTwoFactorCheckNeeded(): void {
$user = $this->createMock(IUser::class);
$this->userSession->expects($this->once())
@@ -126,7 +126,7 @@ class TwoFactorMiddlewareTest extends TestCase {
}
- public function testBeforeControllerTwoFactorAuthRequired() {
+ public function testBeforeControllerTwoFactorAuthRequired(): void {
$this->expectException(TwoFactorAuthRequiredException::class);
$user = $this->createMock(IUser::class);
@@ -150,7 +150,7 @@ class TwoFactorMiddlewareTest extends TestCase {
}
- public function testBeforeControllerUserAlreadyLoggedIn() {
+ public function testBeforeControllerUserAlreadyLoggedIn(): void {
$this->expectException(UserAlreadyLoggedInException::class);
$user = $this->createMock(IUser::class);
@@ -179,7 +179,7 @@ class TwoFactorMiddlewareTest extends TestCase {
$this->middleware->beforeController($twoFactorChallengeController, 'index');
}
- public function testAfterExceptionTwoFactorAuthRequired() {
+ public function testAfterExceptionTwoFactorAuthRequired(): void {
$ex = new TwoFactorAuthRequiredException();
$this->urlGenerator->expects($this->once())
@@ -191,7 +191,7 @@ class TwoFactorMiddlewareTest extends TestCase {
$this->assertEquals($expected, $this->middleware->afterException($this->controller, 'index', $ex));
}
- public function testAfterException() {
+ public function testAfterException(): void {
$ex = new UserAlreadyLoggedInException();
$this->urlGenerator->expects($this->once())
@@ -203,7 +203,7 @@ class TwoFactorMiddlewareTest extends TestCase {
$this->assertEquals($expected, $this->middleware->afterException($this->controller, 'index', $ex));
}
- public function testRequires2FASetupDoneAnnotated() {
+ public function testRequires2FASetupDoneAnnotated(): void {
$user = $this->createMock(IUser::class);
$this->reflector
@@ -250,7 +250,7 @@ class TwoFactorMiddlewareTest extends TestCase {
/**
* @dataProvider dataRequires2FASetupDone
*/
- public function testRequires2FASetupDone(array $providers, bool $missingProviders, bool $expectEception) {
+ public function testRequires2FASetupDone(array $providers, bool $missingProviders, bool $expectEception): void {
$user = $this->createMock(IUser::class);
$this->reflector
diff --git a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php
index 2e6407d4c00..2fb61a2ef08 100644
--- a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php
+++ b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php
@@ -127,7 +127,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
* Tests for poll
*/
- public function testPollApptokenCouldNotBeDecrypted() {
+ public function testPollApptokenCouldNotBeDecrypted(): void {
$this->expectException(LoginFlowV2NotFoundException::class);
$this->expectExceptionMessage('Apptoken could not be decrypted');
@@ -148,7 +148,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
$this->subjectUnderTest->poll('');
}
- public function testPollInvalidToken() {
+ public function testPollInvalidToken(): void {
$this->expectException(LoginFlowV2NotFoundException::class);
$this->expectExceptionMessage('Invalid token');
@@ -159,14 +159,14 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
$this->subjectUnderTest->poll('');
}
- public function testPollTokenNotYetReady() {
+ public function testPollTokenNotYetReady(): void {
$this->expectException(LoginFlowV2NotFoundException::class);
$this->expectExceptionMessage('Token not yet ready');
$this->subjectUnderTest->poll('');
}
- public function testPollRemoveDataFromDb() {
+ public function testPollRemoveDataFromDb(): void {
[$encrypted, $privateKey] = $this->getOpenSSLEncryptedPublicAndPrivateKey('test_pass');
$this->crypto->expects($this->once())
@@ -208,7 +208,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
* Tests for getByLoginToken
*/
- public function testGetByLoginToken() {
+ public function testGetByLoginToken(): void {
$loginFlowV2 = new LoginFlowV2();
$loginFlowV2->setLoginName('test_login');
$loginFlowV2->setServer('test_server');
@@ -226,7 +226,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
$this->assertEquals('test', $result->getAppPassword());
}
- public function testGetByLoginTokenLoginTokenInvalid() {
+ public function testGetByLoginTokenLoginTokenInvalid(): void {
$this->expectException(LoginFlowV2NotFoundException::class);
$this->expectExceptionMessage('Login token invalid');
@@ -241,7 +241,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
* Tests for startLoginFlow
*/
- public function testStartLoginFlow() {
+ public function testStartLoginFlow(): void {
$loginFlowV2 = new LoginFlowV2();
$this->mapper->expects($this->once())
@@ -254,7 +254,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
$this->assertTrue($this->subjectUnderTest->startLoginFlow('test_token'));
}
- public function testStartLoginFlowDoesNotExistException() {
+ public function testStartLoginFlowDoesNotExistException(): void {
$this->mapper->expects($this->once())
->method('getByLoginToken')
->willThrowException(new DoesNotExistException(''));
@@ -266,7 +266,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
* If an exception not of type DoesNotExistException is thrown,
* it is expected that it is not being handled by startLoginFlow.
*/
- public function testStartLoginFlowException() {
+ public function testStartLoginFlowException(): void {
$this->expectException(Exception::class);
$this->mapper->expects($this->once())
@@ -280,7 +280,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
* Tests for flowDone
*/
- public function testFlowDone() {
+ public function testFlowDone(): void {
[,, $publicKey] = $this->getOpenSSLEncryptedPublicAndPrivateKey('test_pass');
$loginFlowV2 = new LoginFlowV2();
@@ -340,7 +340,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
$this->assertEquals('server', $loginFlowV2->getServer());
}
- public function testFlowDoneDoesNotExistException() {
+ public function testFlowDoneDoesNotExistException(): void {
$this->mapper->expects($this->once())
->method('getByLoginToken')
->willThrowException(new DoesNotExistException(''));
@@ -354,7 +354,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
$this->assertFalse($result);
}
- public function testFlowDonePasswordlessTokenException() {
+ public function testFlowDonePasswordlessTokenException(): void {
$this->tokenProvider->expects($this->once())
->method('getToken')
->willThrowException(new InvalidTokenException(''));
@@ -372,7 +372,7 @@ class LoginFlowV2ServiceUnitTest extends TestCase {
* Tests for createTokens
*/
- public function testCreateTokens() {
+ public function testCreateTokens(): void {
$this->config->expects($this->exactly(2))
->method('getSystemValue')
->willReturn($this->returnCallback(function ($key) {
diff --git a/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php b/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php
index 2138004c3dc..64db9459390 100644
--- a/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php
+++ b/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php
@@ -55,7 +55,7 @@ class CleanPreviewsBackgroundJobTest extends TestCase {
);
}
- public function testCleanupPreviewsUnfinished() {
+ public function testCleanupPreviewsUnfinished(): void {
$userFolder = $this->createMock(Folder::class);
$userRoot = $this->createMock(Folder::class);
$thumbnailFolder = $this->createMock(Folder::class);
@@ -100,7 +100,7 @@ class CleanPreviewsBackgroundJobTest extends TestCase {
$this->job->run(['uid' => 'myuid']);
}
- public function testCleanupPreviewsFinished() {
+ public function testCleanupPreviewsFinished(): void {
$userFolder = $this->createMock(Folder::class);
$userRoot = $this->createMock(Folder::class);
$thumbnailFolder = $this->createMock(Folder::class);
@@ -143,7 +143,7 @@ class CleanPreviewsBackgroundJobTest extends TestCase {
}
- public function testNoUserFolder() {
+ public function testNoUserFolder(): void {
$this->rootFolder->method('getUserFolder')
->with($this->equalTo('myuid'))
->willThrowException(new NotFoundException());
@@ -158,7 +158,7 @@ class CleanPreviewsBackgroundJobTest extends TestCase {
$this->job->run(['uid' => 'myuid']);
}
- public function testNoThumbnailFolder() {
+ public function testNoThumbnailFolder(): void {
$userFolder = $this->createMock(Folder::class);
$userRoot = $this->createMock(Folder::class);
@@ -182,7 +182,7 @@ class CleanPreviewsBackgroundJobTest extends TestCase {
$this->job->run(['uid' => 'myuid']);
}
- public function testNotPermittedToDelete() {
+ public function testNotPermittedToDelete(): void {
$userFolder = $this->createMock(Folder::class);
$userRoot = $this->createMock(Folder::class);
$thumbnailFolder = $this->createMock(Folder::class);
diff --git a/tests/Test/Repair/Owncloud/CleanPreviewsTest.php b/tests/Test/Repair/Owncloud/CleanPreviewsTest.php
index 10d2e5d216c..02f257a89b3 100644
--- a/tests/Test/Repair/Owncloud/CleanPreviewsTest.php
+++ b/tests/Test/Repair/Owncloud/CleanPreviewsTest.php
@@ -41,11 +41,11 @@ class CleanPreviewsTest extends TestCase {
);
}
- public function testGetName() {
+ public function testGetName(): void {
$this->assertSame('Add preview cleanup background jobs', $this->repair->getName());
}
- public function testRun() {
+ public function testRun(): void {
$user1 = $this->createMock(IUser::class);
$user1->method('getUID')
->willReturn('user1');
@@ -92,7 +92,7 @@ class CleanPreviewsTest extends TestCase {
}
- public function testRunAlreadyDoone() {
+ public function testRunAlreadyDoone(): void {
$this->userManager->expects($this->never())
->method($this->anything());
diff --git a/tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php b/tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php
index 879223bed4c..5bfd2e1e6d0 100644
--- a/tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php
+++ b/tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php
@@ -33,7 +33,7 @@ class UpdateLanguageCodesTest extends TestCase {
$this->config = $this->createMock(IConfig::class);
}
- public function testRun() {
+ public function testRun(): void {
$users = [
['userid' => 'user1', 'configvalue' => 'fi_FI'],
['userid' => 'user2', 'configvalue' => 'de'],
@@ -131,7 +131,7 @@ class UpdateLanguageCodesTest extends TestCase {
}
}
- public function testSecondRun() {
+ public function testSecondRun(): void {
/** @var IOutput|\PHPUnit_Framework_MockObject_MockObject $outputMock */
$outputMock = $this->createMock(IOutput::class);
$outputMock->expects($this->never())
diff --git a/tests/lib/Accounts/AccountManagerTest.php b/tests/lib/Accounts/AccountManagerTest.php
index 219e32f8c01..ee3c8df0a70 100644
--- a/tests/lib/Accounts/AccountManagerTest.php
+++ b/tests/lib/Accounts/AccountManagerTest.php
@@ -474,7 +474,7 @@ class AccountManagerTest extends TestCase {
* @dataProvider dataTrueFalse
*
*/
- public function testUpdateUser(array $newData, array $oldData, bool $insertNew, bool $updateExisting) {
+ public function testUpdateUser(array $newData, array $oldData, bool $insertNew, bool $updateExisting): void {
$accountManager = $this->getInstance(['getUser', 'insertNewUser', 'updateExistingUser']);
/** @var IUser $user */
$user = $this->createMock(IUser::class);
@@ -516,7 +516,7 @@ class AccountManagerTest extends TestCase {
];
}
- public function testAddMissingDefaults() {
+ public function testAddMissingDefaults(): void {
$user = $this->createMock(IUser::class);
$this->config
@@ -635,7 +635,7 @@ class AccountManagerTest extends TestCase {
$this->assertSame($expected, $result);
}
- public function testGetAccount() {
+ public function testGetAccount(): void {
$accountManager = $this->getInstance(['getUser']);
/** @var IUser $user */
$user = $this->createMock(IUser::class);
diff --git a/tests/lib/Accounts/AccountPropertyCollectionTest.php b/tests/lib/Accounts/AccountPropertyCollectionTest.php
index 83a39dca94f..fa4db10d3d9 100644
--- a/tests/lib/Accounts/AccountPropertyCollectionTest.php
+++ b/tests/lib/Accounts/AccountPropertyCollectionTest.php
@@ -40,7 +40,7 @@ class AccountPropertyCollectionTest extends TestCase {
return $mock;
}
- public function testSetAndGetProperties() {
+ public function testSetAndGetProperties(): void {
$propsBefore = $this->collection->getProperties();
$this->assertIsArray($propsBefore);
$this->assertEmpty($propsBefore);
@@ -57,7 +57,7 @@ class AccountPropertyCollectionTest extends TestCase {
$this->assertCount(count($props), $propsAfter);
}
- public function testSetPropertiesMixedInvalid() {
+ public function testSetPropertiesMixedInvalid(): void {
$props = [
$this->makePropertyMock(self::COLLECTION_NAME),
$this->makePropertyMock('sneaky_property'),
@@ -68,7 +68,7 @@ class AccountPropertyCollectionTest extends TestCase {
$this->collection->setProperties($props);
}
- public function testAddProperty() {
+ public function testAddProperty(): void {
$props = [
$this->makePropertyMock(self::COLLECTION_NAME),
$this->makePropertyMock(self::COLLECTION_NAME),
@@ -84,7 +84,7 @@ class AccountPropertyCollectionTest extends TestCase {
$this->assertNotFalse(array_search($additionalProperty, $propsAfter, true));
}
- public function testAddPropertyInvalid() {
+ public function testAddPropertyInvalid(): void {
$props = [
$this->makePropertyMock(self::COLLECTION_NAME),
$this->makePropertyMock(self::COLLECTION_NAME),
@@ -106,7 +106,7 @@ class AccountPropertyCollectionTest extends TestCase {
}
}
- public function testRemoveProperty() {
+ public function testRemoveProperty(): void {
$additionalProperty = $this->makePropertyMock(self::COLLECTION_NAME);
$props = [
$this->makePropertyMock(self::COLLECTION_NAME),
@@ -125,7 +125,7 @@ class AccountPropertyCollectionTest extends TestCase {
$this->assertFalse(array_search($additionalProperty, $propsAfter, true));
}
- public function testRemovePropertyNotFound() {
+ public function testRemovePropertyNotFound(): void {
$additionalProperty = $this->makePropertyMock(self::COLLECTION_NAME);
$props = [
$this->makePropertyMock(self::COLLECTION_NAME),
@@ -142,7 +142,7 @@ class AccountPropertyCollectionTest extends TestCase {
$this->assertCount(count($propsBefore), $propsAfter);
}
- public function testRemovePropertyByValue() {
+ public function testRemovePropertyByValue(): void {
$additionalProperty = $this->makePropertyMock(self::COLLECTION_NAME);
$additionalProperty->expects($this->any())
->method('getValue')
@@ -169,7 +169,7 @@ class AccountPropertyCollectionTest extends TestCase {
$this->assertFalse(array_search($additionalPropertyTwo, $propsAfter, true));
}
- public function testRemovePropertyByValueNotFound() {
+ public function testRemovePropertyByValueNotFound(): void {
$additionalProperty = $this->makePropertyMock(self::COLLECTION_NAME);
$additionalProperty->expects($this->any())
->method('getValue')
diff --git a/tests/lib/Accounts/AccountPropertyTest.php b/tests/lib/Accounts/AccountPropertyTest.php
index f8aefccdbaa..5df66eaa117 100644
--- a/tests/lib/Accounts/AccountPropertyTest.php
+++ b/tests/lib/Accounts/AccountPropertyTest.php
@@ -16,7 +16,7 @@ use Test\TestCase;
* @package Test\Accounts
*/
class AccountPropertyTest extends TestCase {
- public function testConstructor() {
+ public function testConstructor(): void {
$accountProperty = new AccountProperty(
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
@@ -30,7 +30,7 @@ class AccountPropertyTest extends TestCase {
$this->assertEquals(IAccountManager::VERIFIED, $accountProperty->getVerified());
}
- public function testSetValue() {
+ public function testSetValue(): void {
$accountProperty = new AccountProperty(
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
@@ -43,7 +43,7 @@ class AccountPropertyTest extends TestCase {
$this->assertEquals('https://example.org', $actualReturn->getValue());
}
- public function testSetScope() {
+ public function testSetScope(): void {
$accountProperty = new AccountProperty(
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
@@ -77,7 +77,7 @@ class AccountPropertyTest extends TestCase {
/**
* @dataProvider scopesProvider
*/
- public function testSetScopeMapping(string $storedScope, ?string $returnedScope) {
+ public function testSetScopeMapping(string $storedScope, ?string $returnedScope): void {
if ($returnedScope === null) {
$this->expectException(\InvalidArgumentException::class);
}
@@ -91,7 +91,7 @@ class AccountPropertyTest extends TestCase {
$this->assertEquals($returnedScope, $accountProperty->getScope());
}
- public function testSetVerified() {
+ public function testSetVerified(): void {
$accountProperty = new AccountProperty(
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
@@ -104,7 +104,7 @@ class AccountPropertyTest extends TestCase {
$this->assertEquals(IAccountManager::NOT_VERIFIED, $actualReturn->getVerified());
}
- public function testSetVerificationData() {
+ public function testSetVerificationData(): void {
$accountProperty = new AccountProperty(
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
@@ -118,7 +118,7 @@ class AccountPropertyTest extends TestCase {
$this->assertEquals($token, $actualReturn->getVerificationData());
}
- public function testJsonSerialize() {
+ public function testJsonSerialize(): void {
$accountProperty = new AccountProperty(
IAccountManager::PROPERTY_WEBSITE,
'https://example.com',
diff --git a/tests/lib/Accounts/AccountTest.php b/tests/lib/Accounts/AccountTest.php
index d9242b073af..34653bd864a 100644
--- a/tests/lib/Accounts/AccountTest.php
+++ b/tests/lib/Accounts/AccountTest.php
@@ -19,13 +19,13 @@ use Test\TestCase;
* @package Test\Accounts
*/
class AccountTest extends TestCase {
- public function testConstructor() {
+ public function testConstructor(): void {
$user = $this->createMock(IUser::class);
$account = new Account($user);
$this->assertEquals($user, $account->getUser());
}
- public function testSetProperty() {
+ public function testSetProperty(): void {
$user = $this->createMock(IUser::class);
$property = new AccountProperty(IAccountManager::PROPERTY_WEBSITE, 'https://example.com', IAccountManager::SCOPE_PUBLISHED, IAccountManager::NOT_VERIFIED, '');
$account = new Account($user);
@@ -33,7 +33,7 @@ class AccountTest extends TestCase {
$this->assertEquals($property, $account->getProperty(IAccountManager::PROPERTY_WEBSITE));
}
- public function testGetAndGetAllProperties() {
+ public function testGetAndGetAllProperties(): void {
$user = $this->createMock(IUser::class);
$properties = [
IAccountManager::PROPERTY_WEBSITE => new AccountProperty(IAccountManager::PROPERTY_WEBSITE, 'https://example.com', IAccountManager::SCOPE_PUBLISHED, IAccountManager::NOT_VERIFIED, ''),
@@ -53,7 +53,7 @@ class AccountTest extends TestCase {
$this->assertEquals(array_values($properties), \iterator_to_array($account->getAllProperties()));
}
- public function testSetAllPropertiesFromJson() {
+ public function testSetAllPropertiesFromJson(): void {
$user = $this->createMock(IUser::class);
$properties = [
IAccountManager::PROPERTY_DISPLAYNAME => new AccountProperty(IAccountManager::PROPERTY_DISPLAYNAME, 'Steve', IAccountManager::SCOPE_FEDERATED, IAccountManager::NOT_VERIFIED, ''),
@@ -78,7 +78,7 @@ class AccountTest extends TestCase {
$this->assertEquals($properties, $account->jsonSerialize());
}
- public function testGetFilteredProperties() {
+ public function testGetFilteredProperties(): void {
$user = $this->createMock(IUser::class);
$properties = [
IAccountManager::PROPERTY_WEBSITE => new AccountProperty(IAccountManager::PROPERTY_WEBSITE, 'https://example.com', IAccountManager::SCOPE_PUBLISHED, IAccountManager::NOT_VERIFIED, ''),
@@ -124,7 +124,7 @@ class AccountTest extends TestCase {
);
}
- public function testJsonSerialize() {
+ public function testJsonSerialize(): void {
$user = $this->createMock(IUser::class);
$properties = [
IAccountManager::PROPERTY_WEBSITE => new AccountProperty(IAccountManager::PROPERTY_WEBSITE, 'https://example.com', IAccountManager::SCOPE_PUBLISHED, IAccountManager::NOT_VERIFIED, ''),
diff --git a/tests/lib/Accounts/HooksTest.php b/tests/lib/Accounts/HooksTest.php
index df9420140d3..75772089f43 100644
--- a/tests/lib/Accounts/HooksTest.php
+++ b/tests/lib/Accounts/HooksTest.php
@@ -51,7 +51,7 @@ class HooksTest extends TestCase {
* @param $setDisplayName
* @param $error
*/
- public function testChangeUserHook($params, $data, $setEmail, $setDisplayName, $error) {
+ public function testChangeUserHook($params, $data, $setEmail, $setDisplayName, $error): void {
if ($error) {
$this->accountManager->expects($this->never())->method('updateAccount');
} else {
diff --git a/tests/lib/Activity/ManagerTest.php b/tests/lib/Activity/ManagerTest.php
index 223021fa66a..bb73aea4f6d 100644
--- a/tests/lib/Activity/ManagerTest.php
+++ b/tests/lib/Activity/ManagerTest.php
@@ -56,14 +56,14 @@ class ManagerTest extends TestCase {
$this->assertNotEmpty(self::invokePrivate($this->activityManager, 'getConsumers'));
}
- public function testGetConsumers() {
+ public function testGetConsumers(): void {
$consumers = self::invokePrivate($this->activityManager, 'getConsumers');
$this->assertNotEmpty($consumers);
}
- public function testGetConsumersInvalidConsumer() {
+ public function testGetConsumersInvalidConsumer(): void {
$this->expectException(\InvalidArgumentException::class);
$this->activityManager->registerConsumer(function () {
@@ -90,7 +90,7 @@ class ManagerTest extends TestCase {
* @param string $token
* @param array $users
*/
- public function testGetUserFromTokenThrowInvalidToken($token, $users) {
+ public function testGetUserFromTokenThrowInvalidToken($token, $users): void {
$this->expectException(\UnexpectedValueException::class);
$this->mockRSSToken($token, $token, $users);
@@ -112,7 +112,7 @@ class ManagerTest extends TestCase {
* @param string $token
* @param string $expected
*/
- public function testGetUserFromToken($userLoggedIn, $token, $expected) {
+ public function testGetUserFromToken($userLoggedIn, $token, $expected): void {
if ($userLoggedIn !== null) {
$this->mockUserSession($userLoggedIn);
}
@@ -152,7 +152,7 @@ class ManagerTest extends TestCase {
}
- public function testPublishExceptionNoApp() {
+ public function testPublishExceptionNoApp(): void {
$this->expectException(IncompleteActivityException::class);
$event = $this->activityManager->generateEvent();
@@ -160,7 +160,7 @@ class ManagerTest extends TestCase {
}
- public function testPublishExceptionNoType() {
+ public function testPublishExceptionNoType(): void {
$this->expectException(IncompleteActivityException::class);
$event = $this->activityManager->generateEvent();
@@ -169,7 +169,7 @@ class ManagerTest extends TestCase {
}
- public function testPublishExceptionNoAffectedUser() {
+ public function testPublishExceptionNoAffectedUser(): void {
$this->expectException(IncompleteActivityException::class);
$event = $this->activityManager->generateEvent();
@@ -179,7 +179,7 @@ class ManagerTest extends TestCase {
}
- public function testPublishExceptionNoSubject() {
+ public function testPublishExceptionNoSubject(): void {
$this->expectException(IncompleteActivityException::class);
$event = $this->activityManager->generateEvent();
@@ -201,7 +201,7 @@ class ManagerTest extends TestCase {
* @param string|null $author
* @param string $expected
*/
- public function testPublish($author, $expected) {
+ public function testPublish($author, $expected): void {
if ($author !== null) {
$authorObject = $this->getMockBuilder(IUser::class)
->disableOriginalConstructor()
@@ -239,7 +239,7 @@ class ManagerTest extends TestCase {
$this->activityManager->publish($event);
}
- public function testPublishAllManually() {
+ public function testPublishAllManually(): void {
$event = $this->activityManager->generateEvent();
$event->setApp('test_app')
->setType('test_type')
diff --git a/tests/lib/AllConfigTest.php b/tests/lib/AllConfigTest.php
index 73a62c6b8f2..f8b2e8e857f 100644
--- a/tests/lib/AllConfigTest.php
+++ b/tests/lib/AllConfigTest.php
@@ -37,7 +37,7 @@ class AllConfigTest extends \Test\TestCase {
return new \OC\AllConfig($systemConfig, $connection);
}
- public function testDeleteUserValue() {
+ public function testDeleteUserValue(): void {
$config = $this->getConfig();
// preparation - add something to the database
@@ -58,7 +58,7 @@ class AllConfigTest extends \Test\TestCase {
$this->assertEquals(0, $actualCount, 'There was one value in the database and after the tests there should be no entry left.');
}
- public function testSetUserValue() {
+ public function testSetUserValue(): void {
$selectAllSQL = 'SELECT `userid`, `appid`, `configkey`, `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?';
$config = $this->getConfig();
@@ -91,7 +91,7 @@ class AllConfigTest extends \Test\TestCase {
$config->deleteUserValue('userSet', 'appSet', 'keySet');
}
- public function testSetUserValueWithPreCondition() {
+ public function testSetUserValueWithPreCondition(): void {
$config = $this->getConfig();
$selectAllSQL = 'SELECT `userid`, `appid`, `configkey`, `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?';
@@ -138,7 +138,7 @@ class AllConfigTest extends \Test\TestCase {
* @dataProvider dataSetUserValueUnexpectedValue
* @param mixed $value
*/
- public function testSetUserValueUnexpectedValue($value) {
+ public function testSetUserValueUnexpectedValue($value): void {
$this->expectException(\UnexpectedValueException::class);
$config = $this->getConfig();
@@ -146,7 +146,7 @@ class AllConfigTest extends \Test\TestCase {
}
- public function testSetUserValueWithPreConditionFailure() {
+ public function testSetUserValueWithPreConditionFailure(): void {
$this->expectException(\OCP\PreConditionNotMetException::class);
$config = $this->getConfig();
@@ -218,7 +218,7 @@ class AllConfigTest extends \Test\TestCase {
$config->deleteUserValue('userPreCond1', 'appPreCond', 'keyPreCond');
}
- public function testSetUserValueUnchanged() {
+ public function testSetUserValueUnchanged(): void {
// TODO - FIXME until the dependency injection is handled properly (in AllConfig)
$this->markTestSkipped('Skipped because this is just testable if database connection can be injected');
@@ -243,7 +243,7 @@ class AllConfigTest extends \Test\TestCase {
$config->setUserValue('userSetUnchanged', 'appSetUnchanged', 'keySetUnchanged', 'valueSetUnchanged');
}
- public function testGetUserValue() {
+ public function testGetUserValue(): void {
$config = $this->getConfig();
// setup - it therefore relies on the successful execution of the previous test
@@ -281,7 +281,7 @@ class AllConfigTest extends \Test\TestCase {
$this->assertEquals(0, count($result));
}
- public function testGetUserKeys() {
+ public function testGetUserKeys(): void {
$config = $this->getConfig();
// preparation - add something to the database
@@ -312,7 +312,7 @@ class AllConfigTest extends \Test\TestCase {
$this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
}
- public function testGetUserKeysAllInts() {
+ public function testGetUserKeysAllInts(): void {
$config = $this->getConfig();
// preparation - add something to the database
@@ -337,7 +337,7 @@ class AllConfigTest extends \Test\TestCase {
$this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
}
- public function testGetUserValueDefault() {
+ public function testGetUserValueDefault(): void {
$config = $this->getConfig();
$this->assertEquals('', $config->getUserValue('userGetUnset', 'appGetUnset', 'keyGetUnset'));
@@ -345,7 +345,7 @@ class AllConfigTest extends \Test\TestCase {
$this->assertEquals('foobar', $config->getUserValue('userGetUnset', 'appGetUnset', 'keyGetUnset', 'foobar'));
}
- public function testGetUserValueForUsers() {
+ public function testGetUserValueForUsers(): void {
$config = $this->getConfig();
// preparation - add something to the database
@@ -386,7 +386,7 @@ class AllConfigTest extends \Test\TestCase {
$this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
}
- public function testDeleteAllUserValues() {
+ public function testDeleteAllUserValues(): void {
$config = $this->getConfig();
// preparation - add something to the database
@@ -420,7 +420,7 @@ class AllConfigTest extends \Test\TestCase {
$this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
}
- public function testDeleteAppFromAllUsers() {
+ public function testDeleteAppFromAllUsers(): void {
$config = $this->getConfig();
// preparation - add something to the database
@@ -463,7 +463,7 @@ class AllConfigTest extends \Test\TestCase {
$this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
}
- public function testGetUsersForUserValue() {
+ public function testGetUsersForUserValue(): void {
// mock the check for the database to run the correct SQL statements for each database type
$systemConfig = $this->getMockBuilder('\OC\SystemConfig')
->disableOriginalConstructor()
@@ -494,7 +494,7 @@ class AllConfigTest extends \Test\TestCase {
$this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
}
- public function testGetUsersForUserValueCaseInsensitive() {
+ public function testGetUsersForUserValueCaseInsensitive(): void {
// mock the check for the database to run the correct SQL statements for each database type
$systemConfig = $this->createMock(SystemConfig::class);
$config = $this->getConfig($systemConfig);
diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php
index ac470c00335..5c79a75bf0d 100644
--- a/tests/lib/App/AppManagerTest.php
+++ b/tests/lib/App/AppManagerTest.php
@@ -142,7 +142,7 @@ class AppManagerTest extends TestCase {
/**
* @dataProvider dataGetAppIcon
*/
- public function testGetAppIcon($callback, ?bool $dark, string|null $expected) {
+ public function testGetAppIcon($callback, ?bool $dark, string|null $expected): void {
$this->urlGenerator->expects($this->atLeastOnce())
->method('imagePath')
->willReturnCallback($callback);
@@ -229,7 +229,7 @@ class AppManagerTest extends TestCase {
];
}
- public function testEnableApp() {
+ public function testEnableApp(): void {
// making sure "files_trashbin" is disabled
if ($this->manager->isEnabledForUser('files_trashbin')) {
$this->manager->disableApp('files_trashbin');
@@ -239,13 +239,13 @@ class AppManagerTest extends TestCase {
$this->assertEquals('yes', $this->appConfig->getValue('files_trashbin', 'enabled', 'no'));
}
- public function testDisableApp() {
+ public function testDisableApp(): void {
$this->eventDispatcher->expects($this->once())->method('dispatchTyped')->with(new AppDisableEvent('files_trashbin'));
$this->manager->disableApp('files_trashbin');
$this->assertEquals('no', $this->appConfig->getValue('files_trashbin', 'enabled', 'no'));
}
- public function testNotEnableIfNotInstalled() {
+ public function testNotEnableIfNotInstalled(): void {
try {
$this->manager->enableApp('some_random_name_which_i_hope_is_not_an_app');
$this->assertFalse(true, 'If this line is reached the expected exception is not thrown.');
@@ -259,7 +259,7 @@ class AppManagerTest extends TestCase {
));
}
- public function testEnableAppForGroups() {
+ public function testEnableAppForGroups(): void {
$group1 = $this->createMock(IGroup::class);
$group1->method('getGID')
->willReturn('group1');
@@ -312,7 +312,7 @@ class AppManagerTest extends TestCase {
*
* @param array $appInfo
*/
- public function testEnableAppForGroupsAllowedTypes(array $appInfo) {
+ public function testEnableAppForGroupsAllowedTypes(array $appInfo): void {
$group1 = $this->createMock(IGroup::class);
$group1->method('getGID')
->willReturn('group1');
@@ -370,7 +370,7 @@ class AppManagerTest extends TestCase {
* @param string $type
*
*/
- public function testEnableAppForGroupsForbiddenTypes($type) {
+ public function testEnableAppForGroupsForbiddenTypes($type): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('test can\'t be enabled for groups.');
@@ -416,17 +416,17 @@ class AppManagerTest extends TestCase {
$manager->enableAppForGroups('test', $groups);
}
- public function testIsInstalledEnabled() {
+ public function testIsInstalledEnabled(): void {
$this->appConfig->setValue('test', 'enabled', 'yes');
$this->assertTrue($this->manager->isInstalled('test'));
}
- public function testIsInstalledDisabled() {
+ public function testIsInstalledDisabled(): void {
$this->appConfig->setValue('test', 'enabled', 'no');
$this->assertFalse($this->manager->isInstalled('test'));
}
- public function testIsInstalledEnabledForGroups() {
+ public function testIsInstalledEnabledForGroups(): void {
$this->appConfig->setValue('test', 'enabled', '["foo"]');
$this->assertTrue($this->manager->isInstalled('test'));
}
@@ -439,23 +439,23 @@ class AppManagerTest extends TestCase {
return $user;
}
- public function testIsEnabledForUserEnabled() {
+ public function testIsEnabledForUserEnabled(): void {
$this->appConfig->setValue('test', 'enabled', 'yes');
$user = $this->newUser('user1');
$this->assertTrue($this->manager->isEnabledForUser('test', $user));
}
- public function testIsEnabledForUserDisabled() {
+ public function testIsEnabledForUserDisabled(): void {
$this->appConfig->setValue('test', 'enabled', 'no');
$user = $this->newUser('user1');
$this->assertFalse($this->manager->isEnabledForUser('test', $user));
}
- public function testGetAppPath() {
+ public function testGetAppPath(): void {
$this->assertEquals(\OC::$SERVERROOT . '/apps/files', $this->manager->getAppPath('files'));
}
- public function testGetAppPathSymlink() {
+ public function testGetAppPathSymlink(): void {
$fakeAppDirname = sha1(uniqid('test', true));
$fakeAppPath = sys_get_temp_dir() . '/' . $fakeAppDirname;
$fakeAppLink = \OC::$SERVERROOT . '/' . $fakeAppDirname;
@@ -484,12 +484,12 @@ class AppManagerTest extends TestCase {
$this->assertEquals($fakeAppLink . '/test-test-app', $generatedAppPath);
}
- public function testGetAppPathFail() {
+ public function testGetAppPathFail(): void {
$this->expectException(AppPathNotFoundException::class);
$this->manager->getAppPath('testnotexisting');
}
- public function testIsEnabledForUserEnabledForGroup() {
+ public function testIsEnabledForUserEnabledForGroup(): void {
$user = $this->newUser('user1');
$this->groupManager->expects($this->once())
->method('getUserGroupIds')
@@ -500,7 +500,7 @@ class AppManagerTest extends TestCase {
$this->assertTrue($this->manager->isEnabledForUser('test', $user));
}
- public function testIsEnabledForUserDisabledForGroup() {
+ public function testIsEnabledForUserDisabledForGroup(): void {
$user = $this->newUser('user1');
$this->groupManager->expects($this->once())
->method('getUserGroupIds')
@@ -511,12 +511,12 @@ class AppManagerTest extends TestCase {
$this->assertFalse($this->manager->isEnabledForUser('test', $user));
}
- public function testIsEnabledForUserLoggedOut() {
+ public function testIsEnabledForUserLoggedOut(): void {
$this->appConfig->setValue('test', 'enabled', '["foo"]');
$this->assertFalse($this->manager->isEnabledForUser('test'));
}
- public function testIsEnabledForUserLoggedIn() {
+ public function testIsEnabledForUserLoggedIn(): void {
$user = $this->newUser('user1');
$this->userSession->expects($this->once())
@@ -531,7 +531,7 @@ class AppManagerTest extends TestCase {
$this->assertTrue($this->manager->isEnabledForUser('test'));
}
- public function testGetInstalledApps() {
+ public function testGetInstalledApps(): void {
$this->appConfig->setValue('test1', 'enabled', 'yes');
$this->appConfig->setValue('test2', 'enabled', 'no');
$this->appConfig->setValue('test3', 'enabled', '["foo"]');
@@ -554,7 +554,7 @@ class AppManagerTest extends TestCase {
$this->assertEquals($apps, $this->manager->getInstalledApps());
}
- public function testGetAppsForUser() {
+ public function testGetAppsForUser(): void {
$user = $this->newUser('user1');
$this->groupManager->expects($this->any())
->method('getUserGroupIds')
@@ -584,7 +584,7 @@ class AppManagerTest extends TestCase {
$this->assertEquals($enabled, $this->manager->getEnabledAppsForUser($user));
}
- public function testGetAppsNeedingUpgrade() {
+ public function testGetAppsNeedingUpgrade(): void {
/** @var AppManager|MockObject $manager */
$manager = $this->getMockBuilder(AppManager::class)
->setConstructorArgs([
@@ -642,7 +642,7 @@ class AppManagerTest extends TestCase {
$this->assertEquals('test4', $apps[1]['id']);
}
- public function testGetIncompatibleApps() {
+ public function testGetIncompatibleApps(): void {
/** @var AppManager|MockObject $manager */
$manager = $this->getMockBuilder(AppManager::class)
->setConstructorArgs([
@@ -694,7 +694,7 @@ class AppManagerTest extends TestCase {
$this->assertEquals('test3', $apps[1]['id']);
}
- public function testGetEnabledAppsForGroup() {
+ public function testGetEnabledAppsForGroup(): void {
$group = $this->createMock(IGroup::class);
$group->expects($this->any())
->method('getGID')
@@ -723,7 +723,7 @@ class AppManagerTest extends TestCase {
$this->assertEquals($enabled, $this->manager->getEnabledAppsForGroup($group));
}
- public function testGetAppRestriction() {
+ public function testGetAppRestriction(): void {
$this->appConfig->setValue('test1', 'enabled', 'yes');
$this->appConfig->setValue('test2', 'enabled', 'no');
$this->appConfig->setValue('test3', 'enabled', '["foo"]');
diff --git a/tests/lib/App/AppStore/Bundles/BundleBase.php b/tests/lib/App/AppStore/Bundles/BundleBase.php
index 4c31c49cdb1..28fb8a7736b 100644
--- a/tests/lib/App/AppStore/Bundles/BundleBase.php
+++ b/tests/lib/App/AppStore/Bundles/BundleBase.php
@@ -31,15 +31,15 @@ abstract class BundleBase extends TestCase {
});
}
- public function testGetIdentifier() {
+ public function testGetIdentifier(): void {
$this->assertSame($this->bundleIdentifier, $this->bundle->getIdentifier());
}
- public function testGetName() {
+ public function testGetName(): void {
$this->assertSame($this->bundleName, $this->bundle->getName());
}
- public function testGetAppIdentifiers() {
+ public function testGetAppIdentifiers(): void {
$this->assertSame($this->bundleAppIds, $this->bundle->getAppIdentifiers());
}
}
diff --git a/tests/lib/App/AppStore/Bundles/BundleFetcherTest.php b/tests/lib/App/AppStore/Bundles/BundleFetcherTest.php
index 484b81b5197..225dd78a1b4 100644
--- a/tests/lib/App/AppStore/Bundles/BundleFetcherTest.php
+++ b/tests/lib/App/AppStore/Bundles/BundleFetcherTest.php
@@ -32,7 +32,7 @@ class BundleFetcherTest extends TestCase {
);
}
- public function testGetBundles() {
+ public function testGetBundles(): void {
$expected = [
new EnterpriseBundle($this->l10n),
new HubBundle($this->l10n),
@@ -44,13 +44,13 @@ class BundleFetcherTest extends TestCase {
$this->assertEquals($expected, $this->bundleFetcher->getBundles());
}
- public function testGetBundleByIdentifier() {
+ public function testGetBundleByIdentifier(): void {
$this->assertEquals(new EnterpriseBundle($this->l10n), $this->bundleFetcher->getBundleByIdentifier('EnterpriseBundle'));
$this->assertEquals(new GroupwareBundle($this->l10n), $this->bundleFetcher->getBundleByIdentifier('GroupwareBundle'));
}
- public function testGetBundleByIdentifierWithException() {
+ public function testGetBundleByIdentifierWithException(): void {
$this->expectException(\BadMethodCallException::class);
$this->expectExceptionMessage('Bundle with specified identifier does not exist');
diff --git a/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php b/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php
index 82f40043971..fdc8b45cf70 100644
--- a/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php
+++ b/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php
@@ -34,7 +34,7 @@ class AppDiscoverFetcherTest extends FetcherBase {
);
}
- public function testAppstoreDisabled() {
+ public function testAppstoreDisabled(): void {
$this->config
->method('getSystemValueBool')
->willReturnCallback(function ($var, $default) {
@@ -50,7 +50,7 @@ class AppDiscoverFetcherTest extends FetcherBase {
$this->assertEquals([], $this->fetcher->get());
}
- public function testNoInternet() {
+ public function testNoInternet(): void {
$this->config
->method('getSystemValueBool')
->willReturnCallback(function ($var, $default) {
@@ -74,7 +74,7 @@ class AppDiscoverFetcherTest extends FetcherBase {
/**
* @dataProvider dataGetETag
*/
- public function testGetEtag(string|null $expected, bool $throws, string $content = '') {
+ public function testGetEtag(string|null $expected, bool $throws, string $content = ''): void {
$folder = $this->createMock(ISimpleFolder::class);
if (!$throws) {
$file = $this->createMock(ISimpleFile::class);
diff --git a/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php b/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
index 9a04c11a1f3..61fe24be1a9 100644
--- a/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
+++ b/tests/lib/App/AppStore/Fetcher/AppFetcherTest.php
@@ -1856,7 +1856,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
->willReturn('stable');
}
- public function testGetWithFilter() {
+ public function testGetWithFilter(): void {
$this->config->method('getSystemValueString')
->willReturnCallback(function ($key, $default) {
if ($key === 'version') {
@@ -1939,7 +1939,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
$this->assertEquals(self::$expectedResponse['data'], $this->fetcher->get());
}
- public function testAppstoreDisabled() {
+ public function testAppstoreDisabled(): void {
$this->config
->method('getSystemValueString')
->willReturnCallback(function ($var, $default) {
@@ -1966,7 +1966,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
}
- public function testNoInternet() {
+ public function testNoInternet(): void {
$this->config
->method('getSystemValueString')
->willReturnCallback(function ($var, $default) {
@@ -1994,7 +1994,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
$this->assertEquals([], $this->fetcher->get());
}
- public function testSetVersion() {
+ public function testSetVersion(): void {
$this->config->method('getSystemValueString')
->willReturnCallback(function ($key, $default) {
if ($key === 'version') {
@@ -2078,7 +2078,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
$this->assertEquals(self::$expectedResponse['data'], $this->fetcher->get());
}
- public function testGetAppsAllowlist() {
+ public function testGetAppsAllowlist(): void {
$this->config->method('getSystemValueString')
->willReturnCallback(function ($key, $default) {
if ($key === 'version') {
diff --git a/tests/lib/App/AppStore/Fetcher/CategoryFetcherTest.php b/tests/lib/App/AppStore/Fetcher/CategoryFetcherTest.php
index b7dbf6eccd8..0beb68bf03a 100644
--- a/tests/lib/App/AppStore/Fetcher/CategoryFetcherTest.php
+++ b/tests/lib/App/AppStore/Fetcher/CategoryFetcherTest.php
@@ -24,7 +24,7 @@ class CategoryFetcherTest extends FetcherBase {
);
}
- public function testAppstoreDisabled() {
+ public function testAppstoreDisabled(): void {
$this->config
->method('getSystemValueBool')
->willReturnCallback(function ($var, $default) {
@@ -40,7 +40,7 @@ class CategoryFetcherTest extends FetcherBase {
$this->assertEquals([], $this->fetcher->get());
}
- public function testNoInternet() {
+ public function testNoInternet(): void {
$this->config
->method('getSystemValueBool')
->willReturnCallback(function ($var, $default) {
diff --git a/tests/lib/App/AppStore/Fetcher/FetcherBase.php b/tests/lib/App/AppStore/Fetcher/FetcherBase.php
index f2bc981d4a6..95129b3114d 100644
--- a/tests/lib/App/AppStore/Fetcher/FetcherBase.php
+++ b/tests/lib/App/AppStore/Fetcher/FetcherBase.php
@@ -59,7 +59,7 @@ abstract class FetcherBase extends TestCase {
$this->registry = $this->createMock(IRegistry::class);
}
- public function testGetWithAlreadyExistingFileAndUpToDateTimestampAndVersion() {
+ public function testGetWithAlreadyExistingFileAndUpToDateTimestampAndVersion(): void {
$this->config
->method('getSystemValueString')
->willReturnCallback(function ($var, $default) {
@@ -100,7 +100,7 @@ abstract class FetcherBase extends TestCase {
$this->assertSame($expected, $this->fetcher->get());
}
- public function testGetWithNotExistingFileAndUpToDateTimestampAndVersion() {
+ public function testGetWithNotExistingFileAndUpToDateTimestampAndVersion(): void {
$this->config
->method('getSystemValueString')
->willReturnCallback(function ($var, $default) {
@@ -175,7 +175,7 @@ abstract class FetcherBase extends TestCase {
$this->assertSame($expected, $this->fetcher->get());
}
- public function testGetWithAlreadyExistingFileAndOutdatedTimestamp() {
+ public function testGetWithAlreadyExistingFileAndOutdatedTimestamp(): void {
$this->config->method('getSystemValueString')
->willReturnCallback(function ($key, $default) {
if ($key === 'version') {
@@ -249,7 +249,7 @@ abstract class FetcherBase extends TestCase {
$this->assertSame($expected, $this->fetcher->get());
}
- public function testGetWithAlreadyExistingFileAndNoVersion() {
+ public function testGetWithAlreadyExistingFileAndNoVersion(): void {
$this->config
->method('getSystemValueString')
->willReturnCallback(function ($var, $default) {
@@ -322,7 +322,7 @@ abstract class FetcherBase extends TestCase {
$this->assertSame($expected, $this->fetcher->get());
}
- public function testGetWithAlreadyExistingFileAndOutdatedVersion() {
+ public function testGetWithAlreadyExistingFileAndOutdatedVersion(): void {
$this->config
->method('getSystemValueString')
->willReturnCallback(function ($var, $default) {
@@ -394,7 +394,7 @@ abstract class FetcherBase extends TestCase {
$this->assertSame($expected, $this->fetcher->get());
}
- public function testGetWithExceptionInClient() {
+ public function testGetWithExceptionInClient(): void {
$this->config->method('getSystemValueString')
->willReturnArgument(1);
$this->config->method('getSystemValueBool')
@@ -430,7 +430,7 @@ abstract class FetcherBase extends TestCase {
$this->assertSame([], $this->fetcher->get());
}
- public function testGetMatchingETag() {
+ public function testGetMatchingETag(): void {
$this->config->method('getSystemValueString')
->willReturnCallback(function ($key, $default) {
if ($key === 'version') {
@@ -509,7 +509,7 @@ abstract class FetcherBase extends TestCase {
$this->assertSame($expected, $this->fetcher->get());
}
- public function testGetNoMatchingETag() {
+ public function testGetNoMatchingETag(): void {
$this->config->method('getSystemValueString')
->willReturnCallback(function ($key, $default) {
if ($key === 'version') {
@@ -594,7 +594,7 @@ abstract class FetcherBase extends TestCase {
}
- public function testFetchAfterUpgradeNoETag() {
+ public function testFetchAfterUpgradeNoETag(): void {
$this->config->method('getSystemValueString')
->willReturnCallback(function ($key, $default) {
if ($key === 'version') {
diff --git a/tests/lib/App/AppStore/Version/VersionParserTest.php b/tests/lib/App/AppStore/Version/VersionParserTest.php
index c461bf7c6cf..5bd9ee16b39 100644
--- a/tests/lib/App/AppStore/Version/VersionParserTest.php
+++ b/tests/lib/App/AppStore/Version/VersionParserTest.php
@@ -62,12 +62,12 @@ class VersionParserTest extends TestCase {
* @param Version $expected
*/
public function testGetVersion($input,
- Version $expected) {
+ Version $expected): void {
$this->assertEquals($expected, $this->versionParser->getVersion($input));
}
- public function testGetVersionException() {
+ public function testGetVersionException(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Version cannot be parsed: BogusVersion');
@@ -75,7 +75,7 @@ class VersionParserTest extends TestCase {
}
- public function testGetVersionExceptionWithMultiple() {
+ public function testGetVersionExceptionWithMultiple(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Version cannot be parsed: >=8.2 <=9.1a');
diff --git a/tests/lib/App/AppStore/Version/VersionTest.php b/tests/lib/App/AppStore/Version/VersionTest.php
index 68da79fdc8d..7fece37cf5f 100644
--- a/tests/lib/App/AppStore/Version/VersionTest.php
+++ b/tests/lib/App/AppStore/Version/VersionTest.php
@@ -10,12 +10,12 @@ use OC\App\AppStore\Version\Version;
use Test\TestCase;
class VersionTest extends TestCase {
- public function testGetMinimumVersion() {
+ public function testGetMinimumVersion(): void {
$version = new Version('9', '10');
$this->assertSame('9', $version->getMinimumVersion());
}
- public function testGetMaximumVersion() {
+ public function testGetMaximumVersion(): void {
$version = new Version('9', '10');
$this->assertSame('10', $version->getMaximumVersion());
}
diff --git a/tests/lib/App/CompareVersionTest.php b/tests/lib/App/CompareVersionTest.php
index b9af3a96b22..0d020428fed 100644
--- a/tests/lib/App/CompareVersionTest.php
+++ b/tests/lib/App/CompareVersionTest.php
@@ -58,21 +58,21 @@ class CompareVersionTest extends TestCase {
* @dataProvider comparisonData
*/
public function testComparison(string $actualVersion, string $requiredVersion,
- string $comparator, bool $expected) {
+ string $comparator, bool $expected): void {
$isCompatible = $this->compare->isCompatible($actualVersion, $requiredVersion,
$comparator);
$this->assertEquals($expected, $isCompatible);
}
- public function testInvalidServerVersion() {
+ public function testInvalidServerVersion(): void {
$actualVersion = '13';
$this->expectException(InvalidArgumentException::class);
$this->compare->isCompatible($actualVersion, '13.0.0');
}
- public function testInvalidRequiredVersion() {
+ public function testInvalidRequiredVersion(): void {
$actualVersion = '13.0.0';
$this->expectException(InvalidArgumentException::class);
diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php
index 7572fd67c8c..31eeb77d7e5 100644
--- a/tests/lib/App/DependencyAnalyzerTest.php
+++ b/tests/lib/App/DependencyAnalyzerTest.php
@@ -74,7 +74,7 @@ class DependencyAnalyzerTest extends TestCase {
* @param string $maxVersion
* @param string $intSize
*/
- public function testPhpVersion($expectedMissing, $minVersion, $maxVersion, $intSize) {
+ public function testPhpVersion($expectedMissing, $minVersion, $maxVersion, $intSize): void {
$app = [
'dependencies' => [
'php' => []
@@ -100,7 +100,7 @@ class DependencyAnalyzerTest extends TestCase {
* @param $expectedMissing
* @param $databases
*/
- public function testDatabases($expectedMissing, $databases) {
+ public function testDatabases($expectedMissing, $databases): void {
$app = [
'dependencies' => [
]
@@ -120,7 +120,7 @@ class DependencyAnalyzerTest extends TestCase {
* @param string $expectedMissing
* @param string|null $commands
*/
- public function testCommand($expectedMissing, $commands) {
+ public function testCommand($expectedMissing, $commands): void {
$app = [
'dependencies' => [
]
@@ -139,7 +139,7 @@ class DependencyAnalyzerTest extends TestCase {
* @param $expectedMissing
* @param $libs
*/
- public function testLibs($expectedMissing, $libs) {
+ public function testLibs($expectedMissing, $libs): void {
$app = [
'dependencies' => [
]
@@ -159,7 +159,7 @@ class DependencyAnalyzerTest extends TestCase {
* @param $expectedMissing
* @param $oss
*/
- public function testOS($expectedMissing, $oss) {
+ public function testOS($expectedMissing, $oss): void {
$app = [
'dependencies' => []
];
@@ -178,7 +178,7 @@ class DependencyAnalyzerTest extends TestCase {
* @param $expectedMissing
* @param $oc
*/
- public function testOC($expectedMissing, $oc) {
+ public function testOC($expectedMissing, $oc): void {
$app = [
'dependencies' => []
];
diff --git a/tests/lib/App/InfoParserTest.php b/tests/lib/App/InfoParserTest.php
index 9affe3ff9ae..914741d05b1 100644
--- a/tests/lib/App/InfoParserTest.php
+++ b/tests/lib/App/InfoParserTest.php
@@ -34,14 +34,14 @@ class InfoParserTest extends TestCase {
/**
* @dataProvider providesInfoXml
*/
- public function testParsingValidXmlWithoutCache($expectedJson, $xmlFile) {
+ public function testParsingValidXmlWithoutCache($expectedJson, $xmlFile): void {
$this->parserTest($expectedJson, $xmlFile);
}
/**
* @dataProvider providesInfoXml
*/
- public function testParsingValidXmlWithCache($expectedJson, $xmlFile) {
+ public function testParsingValidXmlWithCache($expectedJson, $xmlFile): void {
$this->parserTest($expectedJson, $xmlFile, self::$cache);
}
diff --git a/tests/lib/App/PlatformRepositoryTest.php b/tests/lib/App/PlatformRepositoryTest.php
index e1eb7b16b40..921d24159c9 100644
--- a/tests/lib/App/PlatformRepositoryTest.php
+++ b/tests/lib/App/PlatformRepositoryTest.php
@@ -14,7 +14,7 @@ class PlatformRepositoryTest extends \Test\TestCase {
* @param $expected
* @param $input
*/
- public function testVersion($input, $expected) {
+ public function testVersion($input, $expected): void {
$pr = new OC\App\PlatformRepository();
$normalizedVersion = $pr->normalizeVersion($input);
$this->assertEquals($expected, $normalizedVersion);
diff --git a/tests/lib/AppConfigTest.php b/tests/lib/AppConfigTest.php
index 891b40c4c12..e6929484dc5 100644
--- a/tests/lib/AppConfigTest.php
+++ b/tests/lib/AppConfigTest.php
@@ -438,7 +438,7 @@ class AppConfigTest extends TestCase {
$this->assertSame('value', $config->getValueString('non-sensitive-app', 'non-lazy-key', 'default', lazy: true));
}
- public function testGetValueInt() {
+ public function testGetValueInt(): void {
$config = $this->generateAppConfig();
$this->assertSame(42, $config->getValueInt('typed', 'int', 0));
}
@@ -448,7 +448,7 @@ class AppConfigTest extends TestCase {
$this->assertSame(1, $config->getValueInt('typed-1', 'int', 1));
}
- public function testGetValueIntOnNonExistentKeyReturnsDefault() {
+ public function testGetValueIntOnNonExistentKeyReturnsDefault(): void {
$config = $this->generateAppConfig();
$this->assertSame(2, $config->getValueInt('typed', 'int-2', 2));
}
@@ -459,7 +459,7 @@ class AppConfigTest extends TestCase {
$config->getValueInt('typed', 'float');
}
- public function testGetValueFloat() {
+ public function testGetValueFloat(): void {
$config = $this->generateAppConfig();
$this->assertSame(3.14, $config->getValueFloat('typed', 'float', 0));
}
@@ -469,7 +469,7 @@ class AppConfigTest extends TestCase {
$this->assertSame(1.11, $config->getValueFloat('typed-1', 'float', 1.11));
}
- public function testGetValueFloatOnNonExistentKeyReturnsDefault() {
+ public function testGetValueFloatOnNonExistentKeyReturnsDefault(): void {
$config = $this->generateAppConfig();
$this->assertSame(2.22, $config->getValueFloat('typed', 'float-2', 2.22));
}
diff --git a/tests/lib/AppFramework/AppTest.php b/tests/lib/AppFramework/AppTest.php
index 48f95564a22..3c535a4bf7a 100644
--- a/tests/lib/AppFramework/AppTest.php
+++ b/tests/lib/AppFramework/AppTest.php
@@ -71,7 +71,7 @@ class AppTest extends \Test\TestCase {
}
- public function testControllerNameAndMethodAreBeingPassed() {
+ public function testControllerNameAndMethodAreBeingPassed(): void {
$return = ['HTTP/2.0 200 OK', [], [], null, new Response()];
$this->dispatcher->expects($this->once())
->method('dispatch')
@@ -87,19 +87,19 @@ class AppTest extends \Test\TestCase {
}
- public function testBuildAppNamespace() {
+ public function testBuildAppNamespace(): void {
$ns = App::buildAppNamespace('someapp');
$this->assertEquals('OCA\Someapp', $ns);
}
- public function testBuildAppNamespaceCore() {
+ public function testBuildAppNamespaceCore(): void {
$ns = App::buildAppNamespace('someapp', 'OC\\');
$this->assertEquals('OC\Someapp', $ns);
}
- public function testBuildAppNamespaceInfoXml() {
+ public function testBuildAppNamespaceInfoXml(): void {
$ns = App::buildAppNamespace('namespacetestapp', 'OCA\\');
$this->assertEquals('OCA\NameSpaceTestApp', $ns);
}
@@ -111,7 +111,7 @@ class AppTest extends \Test\TestCase {
}
- public function testOutputIsPrinted() {
+ public function testOutputIsPrinted(): void {
$return = ['HTTP/2.0 200 OK', [], [], $this->output, new Response()];
$this->dispatcher->expects($this->once())
->method('dispatch')
@@ -134,7 +134,7 @@ class AppTest extends \Test\TestCase {
/**
* @dataProvider dataNoOutput
*/
- public function testNoOutput(string $statusCode) {
+ public function testNoOutput(string $statusCode): void {
$return = [$statusCode, [], [], $this->output, new Response()];
$this->dispatcher->expects($this->once())
->method('dispatch')
@@ -150,7 +150,7 @@ class AppTest extends \Test\TestCase {
}
- public function testCallbackIsCalled() {
+ public function testCallbackIsCalled(): void {
$mock = $this->getMockBuilder('OCP\AppFramework\Http\ICallbackResponse')
->getMock();
@@ -165,7 +165,7 @@ class AppTest extends \Test\TestCase {
App::main($this->controllerName, $this->controllerMethod, $this->container, []);
}
- public function testCoreApp() {
+ public function testCoreApp(): void {
$this->container['AppName'] = 'core';
$this->container['OC\Core\Controller\Foo'] = $this->controller;
$this->container['urlParams'] = ['_route' => 'not-profiler'];
@@ -183,7 +183,7 @@ class AppTest extends \Test\TestCase {
App::main('Foo', $this->controllerMethod, $this->container);
}
- public function testSettingsApp() {
+ public function testSettingsApp(): void {
$this->container['AppName'] = 'settings';
$this->container['OCA\Settings\Controller\Foo'] = $this->controller;
$this->container['urlParams'] = ['_route' => 'not-profiler'];
@@ -201,7 +201,7 @@ class AppTest extends \Test\TestCase {
App::main('Foo', $this->controllerMethod, $this->container);
}
- public function testApp() {
+ public function testApp(): void {
$this->container['AppName'] = 'bar';
$this->container['OCA\Bar\Controller\Foo'] = $this->controller;
$this->container['urlParams'] = ['_route' => 'not-profiler'];
diff --git a/tests/lib/AppFramework/Controller/ApiControllerTest.php b/tests/lib/AppFramework/Controller/ApiControllerTest.php
index 6dea9938225..9dd980f975f 100644
--- a/tests/lib/AppFramework/Controller/ApiControllerTest.php
+++ b/tests/lib/AppFramework/Controller/ApiControllerTest.php
@@ -21,7 +21,7 @@ class ApiControllerTest extends \Test\TestCase {
/** @var ChildApiController */
protected $controller;
- public function testCors() {
+ public function testCors(): void {
$request = new Request(
['server' => ['HTTP_ORIGIN' => 'test']],
$this->createMock(IRequestId::class),
diff --git a/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php b/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php
index bec1b7a2a63..d6e0321023e 100644
--- a/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php
+++ b/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php
@@ -51,13 +51,13 @@ class AuthPublicShareControllerTest extends \Test\TestCase {
])->getMock();
}
- public function testShowAuthenticate() {
+ public function testShowAuthenticate(): void {
$expects = new TemplateResponse('core', 'publicshareauth', [], 'guest');
$this->assertEquals($expects, $this->controller->showAuthenticate());
}
- public function testAuthenticateAuthenticated() {
+ public function testAuthenticateAuthenticated(): void {
$this->controller->method('isAuthenticated')
->willReturn(true);
@@ -74,7 +74,7 @@ class AuthPublicShareControllerTest extends \Test\TestCase {
$this->assertSame('myLink!', $result->getRedirectURL());
}
- public function testAuthenticateInvalidPassword() {
+ public function testAuthenticateInvalidPassword(): void {
$this->controller->setToken('token');
$this->controller->method('isPasswordProtected')
->willReturn(true);
@@ -94,7 +94,7 @@ class AuthPublicShareControllerTest extends \Test\TestCase {
$this->assertEquals($expects, $result);
}
- public function testAuthenticateValidPassword() {
+ public function testAuthenticateValidPassword(): void {
$this->controller->setToken('token');
$this->controller->method('isPasswordProtected')
->willReturn(true);
diff --git a/tests/lib/AppFramework/Controller/ControllerTest.php b/tests/lib/AppFramework/Controller/ControllerTest.php
index 7a6b3460947..7c466e3a5b7 100644
--- a/tests/lib/AppFramework/Controller/ControllerTest.php
+++ b/tests/lib/AppFramework/Controller/ControllerTest.php
@@ -79,21 +79,21 @@ class ControllerTest extends \Test\TestCase {
}
- public function testFormatResonseInvalidFormat() {
+ public function testFormatResonseInvalidFormat(): void {
$this->expectException(\DomainException::class);
$this->controller->buildResponse(null, 'test');
}
- public function testFormat() {
+ public function testFormat(): void {
$response = $this->controller->buildResponse(['hi'], 'json');
$this->assertEquals(['hi'], $response->getData());
}
- public function testFormatDataResponseJSON() {
+ public function testFormatDataResponseJSON(): void {
$expectedHeaders = [
'test' => 'something',
'Cache-Control' => 'no-cache, no-store, must-revalidate',
@@ -113,7 +113,7 @@ class ControllerTest extends \Test\TestCase {
}
- public function testCustomFormatter() {
+ public function testCustomFormatter(): void {
$response = $this->controller->custom('hi');
$response = $this->controller->buildResponse($response, 'json');
@@ -121,14 +121,14 @@ class ControllerTest extends \Test\TestCase {
}
- public function testDefaultResponderToJSON() {
+ public function testDefaultResponderToJSON(): void {
$responder = $this->controller->getResponderByHTTPHeader('*/*');
$this->assertEquals('json', $responder);
}
- public function testResponderAcceptHeaderParsed() {
+ public function testResponderAcceptHeaderParsed(): void {
$responder = $this->controller->getResponderByHTTPHeader(
'*/*, application/tom, application/json'
);
@@ -137,7 +137,7 @@ class ControllerTest extends \Test\TestCase {
}
- public function testResponderAcceptHeaderParsedUpperCase() {
+ public function testResponderAcceptHeaderParsedUpperCase(): void {
$responder = $this->controller->getResponderByHTTPHeader(
'*/*, apPlication/ToM, application/json'
);
diff --git a/tests/lib/AppFramework/Controller/OCSControllerTest.php b/tests/lib/AppFramework/Controller/OCSControllerTest.php
index ea86c01a364..027881074c9 100644
--- a/tests/lib/AppFramework/Controller/OCSControllerTest.php
+++ b/tests/lib/AppFramework/Controller/OCSControllerTest.php
@@ -20,7 +20,7 @@ class ChildOCSController extends OCSController {
class OCSControllerTest extends \Test\TestCase {
- public function testCors() {
+ public function testCors(): void {
$request = new Request(
[
'server' => [
@@ -45,7 +45,7 @@ class OCSControllerTest extends \Test\TestCase {
}
- public function testXML() {
+ public function testXML(): void {
$controller = new ChildOCSController('app', new Request(
[],
$this->createMock(IRequestId::class),
@@ -74,7 +74,7 @@ class OCSControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $response->render());
}
- public function testJSON() {
+ public function testJSON(): void {
$controller = new ChildOCSController('app', new Request(
[],
$this->createMock(IRequestId::class),
@@ -91,7 +91,7 @@ class OCSControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $response->render());
}
- public function testXMLV2() {
+ public function testXMLV2(): void {
$controller = new ChildOCSController('app', new Request(
[],
$this->createMock(IRequestId::class),
@@ -118,7 +118,7 @@ class OCSControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $response->render());
}
- public function testJSONV2() {
+ public function testJSONV2(): void {
$controller = new ChildOCSController('app', new Request(
[],
$this->createMock(IRequestId::class),
diff --git a/tests/lib/AppFramework/Controller/PublicShareControllerTest.php b/tests/lib/AppFramework/Controller/PublicShareControllerTest.php
index be28843b03f..f8430d42ef1 100644
--- a/tests/lib/AppFramework/Controller/PublicShareControllerTest.php
+++ b/tests/lib/AppFramework/Controller/PublicShareControllerTest.php
@@ -50,7 +50,7 @@ class PublicShareControllerTest extends \Test\TestCase {
$this->session = $this->createMock(ISession::class);
}
- public function testGetToken() {
+ public function testGetToken(): void {
$controller = new TestController('app', $this->request, $this->session, 'hash', false);
$controller->setToken('test');
@@ -73,7 +73,7 @@ class PublicShareControllerTest extends \Test\TestCase {
/**
* @dataProvider dataIsAuthenticated
*/
- public function testIsAuthenticatedNotPasswordProtected(bool $protected, string $token1, string $token2, string $hash1, string $hash2, bool $expected) {
+ public function testIsAuthenticatedNotPasswordProtected(bool $protected, string $token1, string $token2, string $hash1, string $hash2, bool $expected): void {
$controller = new TestController('app', $this->request, $this->session, $hash2, $protected);
$this->session->method('get')
diff --git a/tests/lib/AppFramework/Db/EntityTest.php b/tests/lib/AppFramework/Db/EntityTest.php
index a521b480f8f..c426faa757d 100644
--- a/tests/lib/AppFramework/Db/EntityTest.php
+++ b/tests/lib/AppFramework/Db/EntityTest.php
@@ -59,7 +59,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testResetUpdatedFields() {
+ public function testResetUpdatedFields(): void {
$entity = new TestEntity();
$entity->setId(3);
$entity->resetUpdatedFields();
@@ -68,7 +68,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testFromRow() {
+ public function testFromRow(): void {
$row = [
'pre_name' => 'john',
'email' => 'john@something.com'
@@ -80,7 +80,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testGetSetId() {
+ public function testGetSetId(): void {
$id = 3;
$this->entity->setId(3);
@@ -88,28 +88,28 @@ class EntityTest extends \Test\TestCase {
}
- public function testColumnToPropertyNoReplacement() {
+ public function testColumnToPropertyNoReplacement(): void {
$column = 'my';
$this->assertEquals('my',
$this->entity->columnToProperty($column));
}
- public function testColumnToProperty() {
+ public function testColumnToProperty(): void {
$column = 'my_attribute';
$this->assertEquals('myAttribute',
$this->entity->columnToProperty($column));
}
- public function testPropertyToColumnNoReplacement() {
+ public function testPropertyToColumnNoReplacement(): void {
$property = 'my';
$this->assertEquals('my',
$this->entity->propertyToColumn($property));
}
- public function testSetterMarksFieldUpdated() {
+ public function testSetterMarksFieldUpdated(): void {
$this->entity->setId(3);
$this->assertContains('id', array_keys($this->entity->getUpdatedFields()));
@@ -117,7 +117,7 @@ class EntityTest extends \Test\TestCase {
- public function testCallShouldOnlyWorkForGetterSetter() {
+ public function testCallShouldOnlyWorkForGetterSetter(): void {
$this->expectException(\BadFunctionCallException::class);
$this->entity->something();
@@ -125,21 +125,21 @@ class EntityTest extends \Test\TestCase {
- public function testGetterShouldFailIfAttributeNotDefined() {
+ public function testGetterShouldFailIfAttributeNotDefined(): void {
$this->expectException(\BadFunctionCallException::class);
$this->entity->getTest();
}
- public function testSetterShouldFailIfAttributeNotDefined() {
+ public function testSetterShouldFailIfAttributeNotDefined(): void {
$this->expectException(\BadFunctionCallException::class);
$this->entity->setTest();
}
- public function testFromRowShouldNotAssignEmptyArray() {
+ public function testFromRowShouldNotAssignEmptyArray(): void {
$row = [];
$entity2 = new TestEntity();
@@ -148,7 +148,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testIdGetsConvertedToInt() {
+ public function testIdGetsConvertedToInt(): void {
$row = ['id' => '4'];
$this->entity = TestEntity::fromRow($row);
@@ -156,7 +156,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testSetType() {
+ public function testSetType(): void {
$row = ['testId' => '4'];
$this->entity = TestEntity::fromRow($row);
@@ -164,7 +164,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testFromParams() {
+ public function testFromParams(): void {
$params = [
'testId' => 4,
'email' => 'john@doe'
@@ -177,7 +177,7 @@ class EntityTest extends \Test\TestCase {
$this->assertTrue($entity instanceof TestEntity);
}
- public function testSlugify() {
+ public function testSlugify(): void {
$entity = new TestEntity();
$entity->setName('Slugify this!');
$this->assertEquals('slugify-this', $entity->slugify('name'));
@@ -186,20 +186,20 @@ class EntityTest extends \Test\TestCase {
}
- public function testSetterCasts() {
+ public function testSetterCasts(): void {
$entity = new TestEntity();
$entity->setId('3');
$this->assertSame(3, $entity->getId());
}
- public function testSetterDoesNotCastOnNull() {
+ public function testSetterDoesNotCastOnNull(): void {
$entity = new TestEntity();
$entity->setId(null);
$this->assertSame(null, $entity->getId());
}
- public function testSetterConvertsResourcesToStringProperly() {
+ public function testSetterConvertsResourcesToStringProperly(): void {
$string = 'Definitely a string';
$stream = fopen('php://memory', 'r+');
fwrite($stream, $string);
@@ -212,7 +212,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testGetFieldTypes() {
+ public function testGetFieldTypes(): void {
$entity = new TestEntity();
$this->assertEquals([
'id' => 'integer',
@@ -224,20 +224,20 @@ class EntityTest extends \Test\TestCase {
}
- public function testGetItInt() {
+ public function testGetItInt(): void {
$entity = new TestEntity();
$entity->setId(3);
$this->assertEquals('integer', gettype($entity->getId()));
}
- public function testFieldsNotMarkedUpdatedIfNothingChanges() {
+ public function testFieldsNotMarkedUpdatedIfNothingChanges(): void {
$entity = new TestEntity('hey');
$entity->setName('hey');
$this->assertEquals(0, count($entity->getUpdatedFields()));
}
- public function testIsGetter() {
+ public function testIsGetter(): void {
$entity = new TestEntity();
$entity->setTrueOrFalse(false);
$entity->setAnotherBool(false);
@@ -246,7 +246,7 @@ class EntityTest extends \Test\TestCase {
}
- public function testIsGetterShoudFailForOtherType() {
+ public function testIsGetterShoudFailForOtherType(): void {
$this->expectException(\BadFunctionCallException::class);
$entity = new TestEntity();
diff --git a/tests/lib/AppFramework/Db/QBMapperTest.php b/tests/lib/AppFramework/Db/QBMapperTest.php
index 1f5250b1456..f08beca05ca 100644
--- a/tests/lib/AppFramework/Db/QBMapperTest.php
+++ b/tests/lib/AppFramework/Db/QBMapperTest.php
@@ -108,7 +108,7 @@ class QBMapperTest extends \Test\TestCase {
}
- public function testInsertEntityParameterTypeMapping() {
+ public function testInsertEntityParameterTypeMapping(): void {
$entity = new QBTestEntity();
$entity->setIntProp(123);
$entity->setBoolProp(true);
@@ -145,7 +145,7 @@ class QBMapperTest extends \Test\TestCase {
}
- public function testUpdateEntityParameterTypeMapping() {
+ public function testUpdateEntityParameterTypeMapping(): void {
$entity = new QBTestEntity();
$entity->setId(789);
$entity->setIntProp(123);
@@ -195,7 +195,7 @@ class QBMapperTest extends \Test\TestCase {
}
- public function testGetParameterTypeForProperty() {
+ public function testGetParameterTypeForProperty(): void {
$entity = new QBTestEntity();
$intType = $this->mapper->getParameterTypeForPropertyForTest($entity, 'intProp');
diff --git a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php
index 94264f0de02..f3d2cff1ffd 100644
--- a/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php
+++ b/tests/lib/AppFramework/DependencyInjection/DIContainerTest.php
@@ -35,24 +35,24 @@ class DIContainerTest extends \Test\TestCase {
}
- public function testProvidesRequest() {
+ public function testProvidesRequest(): void {
$this->assertTrue(isset($this->container['Request']));
}
- public function testProvidesMiddlewareDispatcher() {
+ public function testProvidesMiddlewareDispatcher(): void {
$this->assertTrue(isset($this->container['MiddlewareDispatcher']));
}
- public function testProvidesAppName() {
+ public function testProvidesAppName(): void {
$this->assertTrue(isset($this->container['AppName']));
}
- public function testAppNameIsSetCorrectly() {
+ public function testAppNameIsSetCorrectly(): void {
$this->assertEquals('name', $this->container['AppName']);
}
- public function testMiddlewareDispatcherIncludesSecurityMiddleware() {
+ public function testMiddlewareDispatcherIncludesSecurityMiddleware(): void {
$this->container['Request'] = new Request(
['method' => 'GET'],
$this->createMock(IRequestId::class),
@@ -135,7 +135,7 @@ class DIContainerTest extends \Test\TestCase {
$this->fail('Bootstrap registered middleware not found');
}
- public function testInvalidAppClass() {
+ public function testInvalidAppClass(): void {
$this->expectException(QueryException::class);
$this->container->query('\OCA\Name\Foo');
}
diff --git a/tests/lib/AppFramework/DependencyInjection/DIIntergrationTests.php b/tests/lib/AppFramework/DependencyInjection/DIIntergrationTests.php
index ad126ad99e2..54c691d2392 100644
--- a/tests/lib/AppFramework/DependencyInjection/DIIntergrationTests.php
+++ b/tests/lib/AppFramework/DependencyInjection/DIIntergrationTests.php
@@ -48,7 +48,7 @@ class DIIntergrationTests extends TestCase {
$this->container = new DIContainer('App1', [], $this->server);
}
- public function testInjectFromServer() {
+ public function testInjectFromServer(): void {
$this->server->registerService(Interface1::class, function () {
return new ClassA1();
});
@@ -64,7 +64,7 @@ class DIIntergrationTests extends TestCase {
$this->assertSame(ClassA1::class, get_class($res->interface1));
}
- public function testInjectDepFromServer() {
+ public function testInjectDepFromServer(): void {
$this->server->registerService(Interface1::class, function () {
return new ClassA1();
});
@@ -80,7 +80,7 @@ class DIIntergrationTests extends TestCase {
$this->assertSame(ClassA1::class, get_class($res->interface1));
}
- public function testOverwriteDepFromServer() {
+ public function testOverwriteDepFromServer(): void {
$this->server->registerService(Interface1::class, function () {
return new ClassA1();
});
@@ -100,7 +100,7 @@ class DIIntergrationTests extends TestCase {
$this->assertSame(ClassA2::class, get_class($res->interface1));
}
- public function testIgnoreOverwriteInServerClass() {
+ public function testIgnoreOverwriteInServerClass(): void {
$this->server->registerService(Interface1::class, function () {
return new ClassA1();
});
diff --git a/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php b/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php
index 465f9ee0a07..aa2b29418e4 100644
--- a/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php
+++ b/tests/lib/AppFramework/Http/ContentSecurityPolicyTest.php
@@ -23,19 +23,19 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->contentSecurityPolicy = new ContentSecurityPolicy();
}
- public function testGetPolicyDefault() {
+ public function testGetPolicyDefault(): void {
$defaultPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->assertSame($defaultPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyScriptDomainValid() {
+ public function testGetPolicyScriptDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self' www.nextcloud.com;style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedScriptDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyScriptDomainValidMultiple() {
+ public function testGetPolicyScriptDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self' www.nextcloud.com www.nextcloud.org;style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedScriptDomain('www.nextcloud.com');
@@ -43,7 +43,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowScriptDomain() {
+ public function testGetPolicyDisallowScriptDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedScriptDomain('www.nextcloud.com');
@@ -51,7 +51,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowScriptDomainMultiple() {
+ public function testGetPolicyDisallowScriptDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self' www.nextcloud.com;style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedScriptDomain('www.nextcloud.com');
@@ -59,7 +59,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowScriptDomainMultipleStacked() {
+ public function testGetPolicyDisallowScriptDomainMultipleStacked(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedScriptDomain('www.nextcloud.com');
@@ -67,21 +67,21 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyScriptDisallowEval() {
+ public function testGetPolicyScriptDisallowEval(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->allowEvalScript(false);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStyleDomainValid() {
+ public function testGetPolicyStyleDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' www.nextcloud.com 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStyleDomainValidMultiple() {
+ public function testGetPolicyStyleDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' www.nextcloud.com www.nextcloud.org 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
@@ -89,7 +89,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowStyleDomain() {
+ public function testGetPolicyDisallowStyleDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
@@ -97,7 +97,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowStyleDomainMultiple() {
+ public function testGetPolicyDisallowStyleDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' www.nextcloud.com 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
@@ -105,7 +105,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowStyleDomainMultipleStacked() {
+ public function testGetPolicyDisallowStyleDomainMultipleStacked(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
@@ -113,35 +113,35 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStyleAllowInline() {
+ public function testGetPolicyStyleAllowInline(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->allowInlineStyle(true);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStyleAllowInlineWithDomain() {
+ public function testGetPolicyStyleAllowInlineWithDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' www.nextcloud.com 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStyleDisallowInline() {
+ public function testGetPolicyStyleDisallowInline(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->allowInlineStyle(false);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyImageDomainValid() {
+ public function testGetPolicyImageDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob: www.nextcloud.com;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedImageDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyImageDomainValidMultiple() {
+ public function testGetPolicyImageDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob: www.nextcloud.com www.nextcloud.org;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedImageDomain('www.nextcloud.com');
@@ -149,7 +149,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowImageDomain() {
+ public function testGetPolicyDisallowImageDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedImageDomain('www.nextcloud.com');
@@ -157,7 +157,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowImageDomainMultiple() {
+ public function testGetPolicyDisallowImageDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob: www.nextcloud.com;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedImageDomain('www.nextcloud.com');
@@ -165,7 +165,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowImageDomainMultipleStakes() {
+ public function testGetPolicyDisallowImageDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedImageDomain('www.nextcloud.com');
@@ -173,14 +173,14 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyFontDomainValid() {
+ public function testGetPolicyFontDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data: www.nextcloud.com;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFontDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyFontDomainValidMultiple() {
+ public function testGetPolicyFontDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data: www.nextcloud.com www.nextcloud.org;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFontDomain('www.nextcloud.com');
@@ -188,7 +188,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFontDomain() {
+ public function testGetPolicyDisallowFontDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFontDomain('www.nextcloud.com');
@@ -196,7 +196,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFontDomainMultiple() {
+ public function testGetPolicyDisallowFontDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data: www.nextcloud.com;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFontDomain('www.nextcloud.com');
@@ -204,7 +204,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFontDomainMultipleStakes() {
+ public function testGetPolicyDisallowFontDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFontDomain('www.nextcloud.com');
@@ -212,14 +212,14 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyConnectDomainValid() {
+ public function testGetPolicyConnectDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self' www.nextcloud.com;media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedConnectDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyConnectDomainValidMultiple() {
+ public function testGetPolicyConnectDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self' www.nextcloud.com www.nextcloud.org;media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedConnectDomain('www.nextcloud.com');
@@ -227,7 +227,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowConnectDomain() {
+ public function testGetPolicyDisallowConnectDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedConnectDomain('www.nextcloud.com');
@@ -235,7 +235,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowConnectDomainMultiple() {
+ public function testGetPolicyDisallowConnectDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self' www.nextcloud.com;media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedConnectDomain('www.nextcloud.com');
@@ -243,7 +243,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowConnectDomainMultipleStakes() {
+ public function testGetPolicyDisallowConnectDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedConnectDomain('www.nextcloud.com');
@@ -251,14 +251,14 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyMediaDomainValid() {
+ public function testGetPolicyMediaDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self' www.nextcloud.com;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedMediaDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyMediaDomainValidMultiple() {
+ public function testGetPolicyMediaDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self' www.nextcloud.com www.nextcloud.org;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedMediaDomain('www.nextcloud.com');
@@ -266,7 +266,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowMediaDomain() {
+ public function testGetPolicyDisallowMediaDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedMediaDomain('www.nextcloud.com');
@@ -274,7 +274,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowMediaDomainMultiple() {
+ public function testGetPolicyDisallowMediaDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self' www.nextcloud.com;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedMediaDomain('www.nextcloud.com');
@@ -282,7 +282,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowMediaDomainMultipleStakes() {
+ public function testGetPolicyDisallowMediaDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedMediaDomain('www.nextcloud.com');
@@ -290,14 +290,14 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyObjectDomainValid() {
+ public function testGetPolicyObjectDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';object-src www.nextcloud.com;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedObjectDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyObjectDomainValidMultiple() {
+ public function testGetPolicyObjectDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';object-src www.nextcloud.com www.nextcloud.org;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedObjectDomain('www.nextcloud.com');
@@ -305,7 +305,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowObjectDomain() {
+ public function testGetPolicyDisallowObjectDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedObjectDomain('www.nextcloud.com');
@@ -313,7 +313,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowObjectDomainMultiple() {
+ public function testGetPolicyDisallowObjectDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';object-src www.nextcloud.com;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedObjectDomain('www.nextcloud.com');
@@ -321,7 +321,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowObjectDomainMultipleStakes() {
+ public function testGetPolicyDisallowObjectDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedObjectDomain('www.nextcloud.com');
@@ -329,14 +329,14 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetAllowedFrameDomain() {
+ public function testGetAllowedFrameDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-src www.nextcloud.com;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFrameDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyFrameDomainValidMultiple() {
+ public function testGetPolicyFrameDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-src www.nextcloud.com www.nextcloud.org;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFrameDomain('www.nextcloud.com');
@@ -344,7 +344,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFrameDomain() {
+ public function testGetPolicyDisallowFrameDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFrameDomain('www.nextcloud.com');
@@ -352,7 +352,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFrameDomainMultiple() {
+ public function testGetPolicyDisallowFrameDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-src www.nextcloud.com;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFrameDomain('www.nextcloud.com');
@@ -360,7 +360,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFrameDomainMultipleStakes() {
+ public function testGetPolicyDisallowFrameDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFrameDomain('www.nextcloud.com');
@@ -368,14 +368,14 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetAllowedChildSrcDomain() {
+ public function testGetAllowedChildSrcDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';child-src child.nextcloud.com;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('child.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyChildSrcValidMultiple() {
+ public function testGetPolicyChildSrcValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';child-src child.nextcloud.com child.nextcloud.org;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('child.nextcloud.com');
@@ -383,7 +383,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowChildSrcDomain() {
+ public function testGetPolicyDisallowChildSrcDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('www.nextcloud.com');
@@ -391,7 +391,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowChildSrcDomainMultiple() {
+ public function testGetPolicyDisallowChildSrcDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';child-src www.nextcloud.com;frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('www.nextcloud.com');
@@ -399,7 +399,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowChildSrcDomainMultipleStakes() {
+ public function testGetPolicyDisallowChildSrcDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('www.nextcloud.com');
@@ -409,14 +409,14 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
- public function testGetAllowedFrameAncestorDomain() {
+ public function testGetAllowedFrameAncestorDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self' sub.nextcloud.com;form-action 'self'";
$this->contentSecurityPolicy->addAllowedFrameAncestorDomain('sub.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyFrameAncestorValidMultiple() {
+ public function testGetPolicyFrameAncestorValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self' sub.nextcloud.com foo.nextcloud.com;form-action 'self'";
$this->contentSecurityPolicy->addAllowedFrameAncestorDomain('sub.nextcloud.com');
@@ -424,7 +424,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFrameAncestorDomain() {
+ public function testGetPolicyDisallowFrameAncestorDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedFrameAncestorDomain('www.nextcloud.com');
@@ -432,7 +432,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFrameAncestorDomainMultiple() {
+ public function testGetPolicyDisallowFrameAncestorDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self' www.nextcloud.com;form-action 'self'";
$this->contentSecurityPolicy->addAllowedFrameAncestorDomain('www.nextcloud.com');
@@ -440,7 +440,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFrameAncestorDomainMultipleStakes() {
+ public function testGetPolicyDisallowFrameAncestorDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('www.nextcloud.com');
@@ -448,21 +448,21 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyUnsafeEval() {
+ public function testGetPolicyUnsafeEval(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->allowEvalScript(true);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyUnsafeWasmEval() {
+ public function testGetPolicyUnsafeWasmEval(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self' 'wasm-unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->allowEvalWasm(true);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyNonce() {
+ public function testGetPolicyNonce(): void {
$nonce = base64_encode('my-nonce');
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-$nonce';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
@@ -471,7 +471,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyNonceDefault() {
+ public function testGetPolicyNonceDefault(): void {
$nonce = base64_encode('my-nonce');
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-$nonce';script-src-elem 'strict-dynamic' 'nonce-$nonce';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
@@ -479,7 +479,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyNonceStrictDynamic() {
+ public function testGetPolicyNonceStrictDynamic(): void {
$nonce = base64_encode('my-nonce');
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'strict-dynamic' 'nonce-$nonce';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
@@ -489,7 +489,7 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyNonceStrictDynamicDefault() {
+ public function testGetPolicyNonceStrictDynamicDefault(): void {
$nonce = base64_encode('my-nonce');
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'strict-dynamic' 'nonce-$nonce';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
@@ -498,14 +498,14 @@ class ContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStrictDynamicOnScriptsOff() {
+ public function testGetPolicyStrictDynamicOnScriptsOff(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->useStrictDynamicOnScripts(false);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStrictDynamicAndStrictDynamicOnScripts() {
+ public function testGetPolicyStrictDynamicAndStrictDynamicOnScripts(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self';media-src 'self';frame-ancestors 'self';form-action 'self'";
$this->contentSecurityPolicy->useStrictDynamic(true);
diff --git a/tests/lib/AppFramework/Http/DataResponseTest.php b/tests/lib/AppFramework/Http/DataResponseTest.php
index 39f7e76ea0c..7ae19e7d5d8 100644
--- a/tests/lib/AppFramework/Http/DataResponseTest.php
+++ b/tests/lib/AppFramework/Http/DataResponseTest.php
@@ -24,7 +24,7 @@ class DataResponseTest extends \Test\TestCase {
}
- public function testSetData() {
+ public function testSetData(): void {
$params = ['hi', 'yo'];
$this->response->setData($params);
@@ -32,7 +32,7 @@ class DataResponseTest extends \Test\TestCase {
}
- public function testConstructorAllowsToSetData() {
+ public function testConstructorAllowsToSetData(): void {
$data = ['hi'];
$code = 300;
$response = new DataResponse($data, $code);
@@ -42,7 +42,7 @@ class DataResponseTest extends \Test\TestCase {
}
- public function testConstructorAllowsToSetHeaders() {
+ public function testConstructorAllowsToSetHeaders(): void {
$data = ['hi'];
$code = 300;
$headers = ['test' => 'something'];
@@ -63,7 +63,7 @@ class DataResponseTest extends \Test\TestCase {
}
- public function testChainability() {
+ public function testChainability(): void {
$params = ['hi', 'yo'];
$this->response->setData($params)
->setStatus(Http::STATUS_NOT_FOUND);
diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php
index ef37a0b8942..94bcfcc4af2 100644
--- a/tests/lib/AppFramework/Http/DispatcherTest.php
+++ b/tests/lib/AppFramework/Http/DispatcherTest.php
@@ -230,7 +230,7 @@ class DispatcherTest extends \Test\TestCase {
}
- public function testDispatcherReturnsArrayWith2Entries() {
+ public function testDispatcherReturnsArrayWith2Entries(): void {
$this->setMiddlewareExpectations('');
$response = $this->dispatcher->dispatch($this->controller, $this->controllerMethod);
@@ -240,7 +240,7 @@ class DispatcherTest extends \Test\TestCase {
}
- public function testHeadersAndOutputAreReturned() {
+ public function testHeadersAndOutputAreReturned(): void {
$out = 'yo';
$httpHeaders = 'Http';
$responseHeaders = ['hell' => 'yeah'];
@@ -255,7 +255,7 @@ class DispatcherTest extends \Test\TestCase {
}
- public function testExceptionCallsAfterException() {
+ public function testExceptionCallsAfterException(): void {
$out = 'yo';
$httpHeaders = 'Http';
$responseHeaders = ['hell' => 'yeah'];
@@ -270,7 +270,7 @@ class DispatcherTest extends \Test\TestCase {
}
- public function testExceptionThrowsIfCanNotBeHandledByAfterException() {
+ public function testExceptionThrowsIfCanNotBeHandledByAfterException(): void {
$out = 'yo';
$httpHeaders = 'Http';
$responseHeaders = ['hell' => 'yeah'];
@@ -300,7 +300,7 @@ class DispatcherTest extends \Test\TestCase {
}
- public function testControllerParametersInjected() {
+ public function testControllerParametersInjected(): void {
$this->request = new Request(
[
'post' => [
@@ -332,7 +332,7 @@ class DispatcherTest extends \Test\TestCase {
}
- public function testControllerParametersInjectedDefaultOverwritten() {
+ public function testControllerParametersInjectedDefaultOverwritten(): void {
$this->request = new Request(
[
'post' => [
@@ -366,7 +366,7 @@ class DispatcherTest extends \Test\TestCase {
- public function testResponseTransformedByUrlFormat() {
+ public function testResponseTransformedByUrlFormat(): void {
$this->request = new Request(
[
'post' => [
@@ -401,7 +401,7 @@ class DispatcherTest extends \Test\TestCase {
}
- public function testResponseTransformsDataResponse() {
+ public function testResponseTransformsDataResponse(): void {
$this->request = new Request(
[
'post' => [
@@ -436,7 +436,7 @@ class DispatcherTest extends \Test\TestCase {
}
- public function testResponseTransformedByAcceptHeader() {
+ public function testResponseTransformedByAcceptHeader(): void {
$this->request = new Request(
[
'post' => [
@@ -472,7 +472,7 @@ class DispatcherTest extends \Test\TestCase {
}
- public function testResponsePrimarilyTransformedByParameterFormat() {
+ public function testResponsePrimarilyTransformedByParameterFormat(): void {
$this->request = new Request(
[
'post' => [
diff --git a/tests/lib/AppFramework/Http/DownloadResponseTest.php b/tests/lib/AppFramework/Http/DownloadResponseTest.php
index 425e5ecde1f..8ac5954e00d 100644
--- a/tests/lib/AppFramework/Http/DownloadResponseTest.php
+++ b/tests/lib/AppFramework/Http/DownloadResponseTest.php
@@ -19,7 +19,7 @@ class DownloadResponseTest extends \Test\TestCase {
parent::setUp();
}
- public function testHeaders() {
+ public function testHeaders(): void {
$response = new ChildDownloadResponse('file', 'content');
$headers = $response->getHeaders();
@@ -30,7 +30,7 @@ class DownloadResponseTest extends \Test\TestCase {
/**
* @dataProvider filenameEncodingProvider
*/
- public function testFilenameEncoding(string $input, string $expected) {
+ public function testFilenameEncoding(string $input, string $expected): void {
$response = new ChildDownloadResponse($input, 'content');
$headers = $response->getHeaders();
diff --git a/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php b/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php
index 28158414351..3110f632fa7 100644
--- a/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php
+++ b/tests/lib/AppFramework/Http/EmptyContentSecurityPolicyTest.php
@@ -23,19 +23,19 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->contentSecurityPolicy = new EmptyContentSecurityPolicy();
}
- public function testGetPolicyDefault() {
+ public function testGetPolicyDefault(): void {
$defaultPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->assertSame($defaultPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyScriptDomainValid() {
+ public function testGetPolicyScriptDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedScriptDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyScriptDomainValidMultiple() {
+ public function testGetPolicyScriptDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src www.nextcloud.com www.nextcloud.org;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedScriptDomain('www.nextcloud.com');
@@ -43,7 +43,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowScriptDomain() {
+ public function testGetPolicyDisallowScriptDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedScriptDomain('www.nextcloud.com');
@@ -51,7 +51,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowScriptDomainMultiple() {
+ public function testGetPolicyDisallowScriptDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedScriptDomain('www.nextcloud.com');
@@ -59,7 +59,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowScriptDomainMultipleStacked() {
+ public function testGetPolicyDisallowScriptDomainMultipleStacked(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedScriptDomain('www.nextcloud.com');
@@ -67,28 +67,28 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyScriptAllowEval() {
+ public function testGetPolicyScriptAllowEval(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'unsafe-eval';frame-ancestors 'none'";
$this->contentSecurityPolicy->allowEvalScript(true);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyScriptAllowWasmEval() {
+ public function testGetPolicyScriptAllowWasmEval(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'wasm-unsafe-eval';frame-ancestors 'none'";
$this->contentSecurityPolicy->allowEvalWasm(true);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStyleDomainValid() {
+ public function testGetPolicyStyleDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';style-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStyleDomainValidMultiple() {
+ public function testGetPolicyStyleDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';style-src www.nextcloud.com www.nextcloud.org;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
@@ -96,7 +96,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowStyleDomain() {
+ public function testGetPolicyDisallowStyleDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
@@ -104,7 +104,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowStyleDomainMultiple() {
+ public function testGetPolicyDisallowStyleDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';style-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
@@ -112,7 +112,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowStyleDomainMultipleStacked() {
+ public function testGetPolicyDisallowStyleDomainMultipleStacked(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
@@ -120,14 +120,14 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStyleAllowInline() {
+ public function testGetPolicyStyleAllowInline(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';style-src 'unsafe-inline';frame-ancestors 'none'";
$this->contentSecurityPolicy->allowInlineStyle(true);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStyleAllowInlineWithDomain() {
+ public function testGetPolicyStyleAllowInlineWithDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';style-src www.nextcloud.com 'unsafe-inline';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedStyleDomain('www.nextcloud.com');
@@ -135,21 +135,21 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyStyleDisallowInline() {
+ public function testGetPolicyStyleDisallowInline(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->allowInlineStyle(false);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyImageDomainValid() {
+ public function testGetPolicyImageDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';img-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedImageDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyImageDomainValidMultiple() {
+ public function testGetPolicyImageDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';img-src www.nextcloud.com www.nextcloud.org;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedImageDomain('www.nextcloud.com');
@@ -157,7 +157,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowImageDomain() {
+ public function testGetPolicyDisallowImageDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedImageDomain('www.nextcloud.com');
@@ -165,7 +165,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowImageDomainMultiple() {
+ public function testGetPolicyDisallowImageDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';img-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedImageDomain('www.nextcloud.com');
@@ -173,7 +173,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowImageDomainMultipleStakes() {
+ public function testGetPolicyDisallowImageDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedImageDomain('www.nextcloud.com');
@@ -181,14 +181,14 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyFontDomainValid() {
+ public function testGetPolicyFontDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';font-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedFontDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyFontDomainValidMultiple() {
+ public function testGetPolicyFontDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';font-src www.nextcloud.com www.nextcloud.org;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedFontDomain('www.nextcloud.com');
@@ -196,7 +196,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFontDomain() {
+ public function testGetPolicyDisallowFontDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedFontDomain('www.nextcloud.com');
@@ -204,7 +204,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFontDomainMultiple() {
+ public function testGetPolicyDisallowFontDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';font-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedFontDomain('www.nextcloud.com');
@@ -212,7 +212,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFontDomainMultipleStakes() {
+ public function testGetPolicyDisallowFontDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedFontDomain('www.nextcloud.com');
@@ -220,14 +220,14 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyConnectDomainValid() {
+ public function testGetPolicyConnectDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';connect-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedConnectDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyConnectDomainValidMultiple() {
+ public function testGetPolicyConnectDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';connect-src www.nextcloud.com www.nextcloud.org;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedConnectDomain('www.nextcloud.com');
@@ -235,7 +235,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowConnectDomain() {
+ public function testGetPolicyDisallowConnectDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedConnectDomain('www.nextcloud.com');
@@ -243,7 +243,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowConnectDomainMultiple() {
+ public function testGetPolicyDisallowConnectDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';connect-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedConnectDomain('www.nextcloud.com');
@@ -251,7 +251,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowConnectDomainMultipleStakes() {
+ public function testGetPolicyDisallowConnectDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedConnectDomain('www.nextcloud.com');
@@ -259,14 +259,14 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyMediaDomainValid() {
+ public function testGetPolicyMediaDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';media-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedMediaDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyMediaDomainValidMultiple() {
+ public function testGetPolicyMediaDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';media-src www.nextcloud.com www.nextcloud.org;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedMediaDomain('www.nextcloud.com');
@@ -274,7 +274,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowMediaDomain() {
+ public function testGetPolicyDisallowMediaDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedMediaDomain('www.nextcloud.com');
@@ -282,7 +282,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowMediaDomainMultiple() {
+ public function testGetPolicyDisallowMediaDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';media-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedMediaDomain('www.nextcloud.com');
@@ -290,7 +290,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowMediaDomainMultipleStakes() {
+ public function testGetPolicyDisallowMediaDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedMediaDomain('www.nextcloud.com');
@@ -298,14 +298,14 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyObjectDomainValid() {
+ public function testGetPolicyObjectDomainValid(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';object-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedObjectDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyObjectDomainValidMultiple() {
+ public function testGetPolicyObjectDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';object-src www.nextcloud.com www.nextcloud.org;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedObjectDomain('www.nextcloud.com');
@@ -313,7 +313,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowObjectDomain() {
+ public function testGetPolicyDisallowObjectDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedObjectDomain('www.nextcloud.com');
@@ -321,7 +321,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowObjectDomainMultiple() {
+ public function testGetPolicyDisallowObjectDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';object-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedObjectDomain('www.nextcloud.com');
@@ -329,7 +329,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowObjectDomainMultipleStakes() {
+ public function testGetPolicyDisallowObjectDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedObjectDomain('www.nextcloud.com');
@@ -337,14 +337,14 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetAllowedFrameDomain() {
+ public function testGetAllowedFrameDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedFrameDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyFrameDomainValidMultiple() {
+ public function testGetPolicyFrameDomainValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-src www.nextcloud.com www.nextcloud.org;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedFrameDomain('www.nextcloud.com');
@@ -352,7 +352,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFrameDomain() {
+ public function testGetPolicyDisallowFrameDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedFrameDomain('www.nextcloud.com');
@@ -360,7 +360,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFrameDomainMultiple() {
+ public function testGetPolicyDisallowFrameDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedFrameDomain('www.nextcloud.com');
@@ -368,7 +368,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowFrameDomainMultipleStakes() {
+ public function testGetPolicyDisallowFrameDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedFrameDomain('www.nextcloud.com');
@@ -376,14 +376,14 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetAllowedChildSrcDomain() {
+ public function testGetAllowedChildSrcDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';child-src child.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('child.nextcloud.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyChildSrcValidMultiple() {
+ public function testGetPolicyChildSrcValidMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';child-src child.nextcloud.com child.nextcloud.org;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('child.nextcloud.com');
@@ -391,7 +391,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowChildSrcDomain() {
+ public function testGetPolicyDisallowChildSrcDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('www.nextcloud.com');
@@ -399,7 +399,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowChildSrcDomainMultiple() {
+ public function testGetPolicyDisallowChildSrcDomainMultiple(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';child-src www.nextcloud.com;frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('www.nextcloud.com');
@@ -407,7 +407,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyDisallowChildSrcDomainMultipleStakes() {
+ public function testGetPolicyDisallowChildSrcDomainMultipleStakes(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedChildSrcDomain('www.nextcloud.com');
@@ -415,7 +415,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyWithJsNonceAndScriptDomains() {
+ public function testGetPolicyWithJsNonceAndScriptDomains(): void {
$nonce = base64_encode('MyJsNonce');
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-$nonce' www.nextcloud.com www.nextcloud.org;frame-ancestors 'none'";
@@ -425,7 +425,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyWithJsNonceAndStrictDynamic() {
+ public function testGetPolicyWithJsNonceAndStrictDynamic(): void {
$nonce = base64_encode('MyJsNonce');
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'strict-dynamic' 'nonce-$nonce' www.nextcloud.com;frame-ancestors 'none'";
@@ -435,7 +435,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyWithJsNonceAndStrictDynamicAndStrictDynamicOnScripts() {
+ public function testGetPolicyWithJsNonceAndStrictDynamicAndStrictDynamicOnScripts(): void {
$nonce = base64_encode('MyJsNonce');
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'strict-dynamic' 'nonce-$nonce' www.nextcloud.com;frame-ancestors 'none'";
@@ -447,7 +447,7 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyWithJsNonceAndStrictDynamicOnScripts() {
+ public function testGetPolicyWithJsNonceAndStrictDynamicOnScripts(): void {
$nonce = base64_encode('MyJsNonce');
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-$nonce' www.nextcloud.com;script-src-elem 'strict-dynamic' 'nonce-$nonce' www.nextcloud.com;frame-ancestors 'none'";
@@ -457,14 +457,14 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyWithStrictDynamicOnScripts() {
+ public function testGetPolicyWithStrictDynamicOnScripts(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->useStrictDynamicOnScripts(true);
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyWithJsNonceAndSelfScriptDomain() {
+ public function testGetPolicyWithJsNonceAndSelfScriptDomain(): void {
$nonce = base64_encode('MyJsNonce');
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-$nonce';frame-ancestors 'none'";
@@ -473,21 +473,21 @@ class EmptyContentSecurityPolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyWithoutJsNonceAndSelfScriptDomain() {
+ public function testGetPolicyWithoutJsNonceAndSelfScriptDomain(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self';frame-ancestors 'none'";
$this->contentSecurityPolicy->addAllowedScriptDomain("'self'");
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyWithReportUri() {
+ public function testGetPolicyWithReportUri(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none';report-uri https://my-report-uri.com";
$this->contentSecurityPolicy->addReportTo('https://my-report-uri.com');
$this->assertSame($expectedPolicy, $this->contentSecurityPolicy->buildPolicy());
}
- public function testGetPolicyWithMultipleReportUri() {
+ public function testGetPolicyWithMultipleReportUri(): void {
$expectedPolicy = "default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none';report-uri https://my-report-uri.com https://my-other-report-uri.com";
$this->contentSecurityPolicy->addReportTo('https://my-report-uri.com');
diff --git a/tests/lib/AppFramework/Http/EmptyFeaturePolicyTest.php b/tests/lib/AppFramework/Http/EmptyFeaturePolicyTest.php
index ca65fcd978c..71342485552 100644
--- a/tests/lib/AppFramework/Http/EmptyFeaturePolicyTest.php
+++ b/tests/lib/AppFramework/Http/EmptyFeaturePolicyTest.php
@@ -19,19 +19,19 @@ class EmptyFeaturePolicyTest extends \Test\TestCase {
$this->policy = new EmptyFeaturePolicy();
}
- public function testGetPolicyDefault() {
+ public function testGetPolicyDefault(): void {
$defaultPolicy = "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'";
$this->assertSame($defaultPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyAutoplayDomainValid() {
+ public function testGetPolicyAutoplayDomainValid(): void {
$expectedPolicy = "autoplay www.nextcloud.com;camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedAutoplayDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyAutoplayDomainValidMultiple() {
+ public function testGetPolicyAutoplayDomainValidMultiple(): void {
$expectedPolicy = "autoplay www.nextcloud.com www.nextcloud.org;camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedAutoplayDomain('www.nextcloud.com');
@@ -39,14 +39,14 @@ class EmptyFeaturePolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyCameraDomainValid() {
+ public function testGetPolicyCameraDomainValid(): void {
$expectedPolicy = "autoplay 'none';camera www.nextcloud.com;fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedCameraDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyCameraDomainValidMultiple() {
+ public function testGetPolicyCameraDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'none';camera www.nextcloud.com www.nextcloud.org;fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedCameraDomain('www.nextcloud.com');
@@ -54,14 +54,14 @@ class EmptyFeaturePolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyFullScreenDomainValid() {
+ public function testGetPolicyFullScreenDomainValid(): void {
$expectedPolicy = "autoplay 'none';camera 'none';fullscreen www.nextcloud.com;geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedFullScreenDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyFullScreenDomainValidMultiple() {
+ public function testGetPolicyFullScreenDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'none';camera 'none';fullscreen www.nextcloud.com www.nextcloud.org;geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedFullScreenDomain('www.nextcloud.com');
@@ -69,14 +69,14 @@ class EmptyFeaturePolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyGeoLocationDomainValid() {
+ public function testGetPolicyGeoLocationDomainValid(): void {
$expectedPolicy = "autoplay 'none';camera 'none';fullscreen 'none';geolocation www.nextcloud.com;microphone 'none';payment 'none'";
$this->policy->addAllowedGeoLocationDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyGeoLocationDomainValidMultiple() {
+ public function testGetPolicyGeoLocationDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'none';camera 'none';fullscreen 'none';geolocation www.nextcloud.com www.nextcloud.org;microphone 'none';payment 'none'";
$this->policy->addAllowedGeoLocationDomain('www.nextcloud.com');
@@ -84,14 +84,14 @@ class EmptyFeaturePolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyMicrophoneDomainValid() {
+ public function testGetPolicyMicrophoneDomainValid(): void {
$expectedPolicy = "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone www.nextcloud.com;payment 'none'";
$this->policy->addAllowedMicrophoneDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyMicrophoneDomainValidMultiple() {
+ public function testGetPolicyMicrophoneDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone www.nextcloud.com www.nextcloud.org;payment 'none'";
$this->policy->addAllowedMicrophoneDomain('www.nextcloud.com');
@@ -99,14 +99,14 @@ class EmptyFeaturePolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyPaymentDomainValid() {
+ public function testGetPolicyPaymentDomainValid(): void {
$expectedPolicy = "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment www.nextcloud.com";
$this->policy->addAllowedPaymentDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyPaymentDomainValidMultiple() {
+ public function testGetPolicyPaymentDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment www.nextcloud.com www.nextcloud.org";
$this->policy->addAllowedPaymentDomain('www.nextcloud.com');
diff --git a/tests/lib/AppFramework/Http/FeaturePolicyTest.php b/tests/lib/AppFramework/Http/FeaturePolicyTest.php
index ce6a87406e8..6ea990fb111 100644
--- a/tests/lib/AppFramework/Http/FeaturePolicyTest.php
+++ b/tests/lib/AppFramework/Http/FeaturePolicyTest.php
@@ -19,19 +19,19 @@ class FeaturePolicyTest extends \Test\TestCase {
$this->policy = new FeaturePolicy();
}
- public function testGetPolicyDefault() {
+ public function testGetPolicyDefault(): void {
$defaultPolicy = "autoplay 'self';camera 'none';fullscreen 'self';geolocation 'none';microphone 'none';payment 'none'";
$this->assertSame($defaultPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyAutoplayDomainValid() {
+ public function testGetPolicyAutoplayDomainValid(): void {
$expectedPolicy = "autoplay 'self' www.nextcloud.com;camera 'none';fullscreen 'self';geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedAutoplayDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyAutoplayDomainValidMultiple() {
+ public function testGetPolicyAutoplayDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'self' www.nextcloud.com www.nextcloud.org;camera 'none';fullscreen 'self';geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedAutoplayDomain('www.nextcloud.com');
@@ -39,14 +39,14 @@ class FeaturePolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyCameraDomainValid() {
+ public function testGetPolicyCameraDomainValid(): void {
$expectedPolicy = "autoplay 'self';camera www.nextcloud.com;fullscreen 'self';geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedCameraDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyCameraDomainValidMultiple() {
+ public function testGetPolicyCameraDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'self';camera www.nextcloud.com www.nextcloud.org;fullscreen 'self';geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedCameraDomain('www.nextcloud.com');
@@ -54,14 +54,14 @@ class FeaturePolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyFullScreenDomainValid() {
+ public function testGetPolicyFullScreenDomainValid(): void {
$expectedPolicy = "autoplay 'self';camera 'none';fullscreen 'self' www.nextcloud.com;geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedFullScreenDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyFullScreenDomainValidMultiple() {
+ public function testGetPolicyFullScreenDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'self';camera 'none';fullscreen 'self' www.nextcloud.com www.nextcloud.org;geolocation 'none';microphone 'none';payment 'none'";
$this->policy->addAllowedFullScreenDomain('www.nextcloud.com');
@@ -69,14 +69,14 @@ class FeaturePolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyGeoLocationDomainValid() {
+ public function testGetPolicyGeoLocationDomainValid(): void {
$expectedPolicy = "autoplay 'self';camera 'none';fullscreen 'self';geolocation www.nextcloud.com;microphone 'none';payment 'none'";
$this->policy->addAllowedGeoLocationDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyGeoLocationDomainValidMultiple() {
+ public function testGetPolicyGeoLocationDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'self';camera 'none';fullscreen 'self';geolocation www.nextcloud.com www.nextcloud.org;microphone 'none';payment 'none'";
$this->policy->addAllowedGeoLocationDomain('www.nextcloud.com');
@@ -84,14 +84,14 @@ class FeaturePolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyMicrophoneDomainValid() {
+ public function testGetPolicyMicrophoneDomainValid(): void {
$expectedPolicy = "autoplay 'self';camera 'none';fullscreen 'self';geolocation 'none';microphone www.nextcloud.com;payment 'none'";
$this->policy->addAllowedMicrophoneDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyMicrophoneDomainValidMultiple() {
+ public function testGetPolicyMicrophoneDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'self';camera 'none';fullscreen 'self';geolocation 'none';microphone www.nextcloud.com www.nextcloud.org;payment 'none'";
$this->policy->addAllowedMicrophoneDomain('www.nextcloud.com');
@@ -99,14 +99,14 @@ class FeaturePolicyTest extends \Test\TestCase {
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyPaymentDomainValid() {
+ public function testGetPolicyPaymentDomainValid(): void {
$expectedPolicy = "autoplay 'self';camera 'none';fullscreen 'self';geolocation 'none';microphone 'none';payment www.nextcloud.com";
$this->policy->addAllowedPaymentDomain('www.nextcloud.com');
$this->assertSame($expectedPolicy, $this->policy->buildPolicy());
}
- public function testGetPolicyPaymentDomainValidMultiple() {
+ public function testGetPolicyPaymentDomainValidMultiple(): void {
$expectedPolicy = "autoplay 'self';camera 'none';fullscreen 'self';geolocation 'none';microphone 'none';payment www.nextcloud.com www.nextcloud.org";
$this->policy->addAllowedPaymentDomain('www.nextcloud.com');
diff --git a/tests/lib/AppFramework/Http/FileDisplayResponseTest.php b/tests/lib/AppFramework/Http/FileDisplayResponseTest.php
index a75c6fdd591..5f602b2e1c6 100644
--- a/tests/lib/AppFramework/Http/FileDisplayResponseTest.php
+++ b/tests/lib/AppFramework/Http/FileDisplayResponseTest.php
@@ -34,23 +34,23 @@ class FileDisplayResponseTest extends \Test\TestCase {
$this->response = new FileDisplayResponse($this->file);
}
- public function testHeader() {
+ public function testHeader(): void {
$headers = $this->response->getHeaders();
$this->assertArrayHasKey('Content-Disposition', $headers);
$this->assertSame('inline; filename="myFileName"', $headers['Content-Disposition']);
}
- public function testETag() {
+ public function testETag(): void {
$this->assertSame('myETag', $this->response->getETag());
}
- public function testLastModified() {
+ public function testLastModified(): void {
$lastModified = $this->response->getLastModified();
$this->assertNotNull($lastModified);
$this->assertSame(1464825600, $lastModified->getTimestamp());
}
- public function test304() {
+ public function test304(): void {
$output = $this->getMockBuilder('OCP\AppFramework\Http\IOutput')
->disableOriginalConstructor()
->getMock();
@@ -67,7 +67,7 @@ class FileDisplayResponseTest extends \Test\TestCase {
}
- public function testNon304() {
+ public function testNon304(): void {
$output = $this->getMockBuilder('OCP\AppFramework\Http\IOutput')
->disableOriginalConstructor()
->getMock();
diff --git a/tests/lib/AppFramework/Http/HttpTest.php b/tests/lib/AppFramework/Http/HttpTest.php
index 46d2bb9d17a..d3ec8438554 100644
--- a/tests/lib/AppFramework/Http/HttpTest.php
+++ b/tests/lib/AppFramework/Http/HttpTest.php
@@ -26,19 +26,19 @@ class HttpTest extends \Test\TestCase {
}
- public function testProtocol() {
+ public function testProtocol(): void {
$header = $this->http->getStatusHeader(Http::STATUS_TEMPORARY_REDIRECT);
$this->assertEquals('HTTP/1.1 307 Temporary Redirect', $header);
}
- public function testProtocol10() {
+ public function testProtocol10(): void {
$this->http = new Http($this->server, 'HTTP/1.0');
$header = $this->http->getStatusHeader(Http::STATUS_OK);
$this->assertEquals('HTTP/1.0 200 OK', $header);
}
- public function testTempRedirectBecomesFoundInHttp10() {
+ public function testTempRedirectBecomesFoundInHttp10(): void {
$http = new Http([], 'HTTP/1.0');
$header = $http->getStatusHeader(Http::STATUS_TEMPORARY_REDIRECT);
diff --git a/tests/lib/AppFramework/Http/JSONResponseTest.php b/tests/lib/AppFramework/Http/JSONResponseTest.php
index bacc5999348..175ed852c7b 100644
--- a/tests/lib/AppFramework/Http/JSONResponseTest.php
+++ b/tests/lib/AppFramework/Http/JSONResponseTest.php
@@ -23,13 +23,13 @@ class JSONResponseTest extends \Test\TestCase {
}
- public function testHeader() {
+ public function testHeader(): void {
$headers = $this->json->getHeaders();
$this->assertEquals('application/json; charset=utf-8', $headers['Content-Type']);
}
- public function testSetData() {
+ public function testSetData(): void {
$params = ['hi', 'yo'];
$this->json->setData($params);
@@ -37,7 +37,7 @@ class JSONResponseTest extends \Test\TestCase {
}
- public function testSetRender() {
+ public function testSetRender(): void {
$params = ['test' => 'hi'];
$this->json->setData($params);
@@ -65,13 +65,13 @@ class JSONResponseTest extends \Test\TestCase {
* @param array $input
* @param string $expected
*/
- public function testRender(array $input, $expected) {
+ public function testRender(array $input, $expected): void {
$this->json->setData($input);
$this->assertEquals($expected, $this->json->render());
}
- public function testRenderWithNonUtf8Encoding() {
+ public function testRenderWithNonUtf8Encoding(): void {
$this->expectException(\JsonException::class);
$this->expectExceptionMessage('Malformed UTF-8 characters, possibly incorrectly encoded');
@@ -80,7 +80,7 @@ class JSONResponseTest extends \Test\TestCase {
$this->json->render();
}
- public function testConstructorAllowsToSetData() {
+ public function testConstructorAllowsToSetData(): void {
$data = ['hi'];
$code = 300;
$response = new JSONResponse($data, $code);
@@ -90,7 +90,7 @@ class JSONResponseTest extends \Test\TestCase {
$this->assertEquals($code, $response->getStatus());
}
- public function testChainability() {
+ public function testChainability(): void {
$params = ['hi', 'yo'];
$this->json->setData($params)
->setStatus(Http::STATUS_NOT_FOUND);
diff --git a/tests/lib/AppFramework/Http/OutputTest.php b/tests/lib/AppFramework/Http/OutputTest.php
index cad49ae77ba..58b17c08141 100644
--- a/tests/lib/AppFramework/Http/OutputTest.php
+++ b/tests/lib/AppFramework/Http/OutputTest.php
@@ -9,19 +9,19 @@ namespace Test\AppFramework\Http;
use OC\AppFramework\Http\Output;
class OutputTest extends \Test\TestCase {
- public function testSetOutput() {
+ public function testSetOutput(): void {
$this->expectOutputString('foo');
$output = new Output('');
$output->setOutput('foo');
}
- public function testSetReadfile() {
+ public function testSetReadfile(): void {
$this->expectOutputString(file_get_contents(__FILE__));
$output = new Output('');
$output->setReadfile(__FILE__);
}
- public function testSetReadfileStream() {
+ public function testSetReadfileStream(): void {
$this->expectOutputString(file_get_contents(__FILE__));
$output = new Output('');
$output->setReadfile(fopen(__FILE__, 'r'));
diff --git a/tests/lib/AppFramework/Http/PublicTemplateResponseTest.php b/tests/lib/AppFramework/Http/PublicTemplateResponseTest.php
index 6b6e6fd429c..d963705bc24 100644
--- a/tests/lib/AppFramework/Http/PublicTemplateResponseTest.php
+++ b/tests/lib/AppFramework/Http/PublicTemplateResponseTest.php
@@ -12,12 +12,12 @@ use OCP\AppFramework\Http\Template\PublicTemplateResponse;
use Test\TestCase;
class PublicTemplateResponseTest extends TestCase {
- public function testSetParamsConstructor() {
+ public function testSetParamsConstructor(): void {
$template = new PublicTemplateResponse('app', 'home', ['key' => 'value']);
$this->assertEquals(['key' => 'value'], $template->getParams());
}
- public function testAdditionalElements() {
+ public function testAdditionalElements(): void {
$template = new PublicTemplateResponse('app', 'home', ['key' => 'value']);
$template->setHeaderTitle('Header');
$template->setHeaderDetails('Details');
@@ -26,7 +26,7 @@ class PublicTemplateResponseTest extends TestCase {
$this->assertEquals('Details', $template->getHeaderDetails());
}
- public function testActionSingle() {
+ public function testActionSingle(): void {
$actions = [
new Http\Template\SimpleMenuAction('link', 'Download', 'download', 'downloadLink', 0)
];
@@ -39,7 +39,7 @@ class PublicTemplateResponseTest extends TestCase {
}
- public function testActionMultiple() {
+ public function testActionMultiple(): void {
$actions = [
new Http\Template\SimpleMenuAction('link1', 'Download1', 'download1', 'downloadLink1', 100),
new Http\Template\SimpleMenuAction('link2', 'Download2', 'download2', 'downloadLink2', 20),
@@ -54,7 +54,7 @@ class PublicTemplateResponseTest extends TestCase {
}
- public function testGetRenderAs() {
+ public function testGetRenderAs(): void {
$template = new PublicTemplateResponse('app', 'home', ['key' => 'value']);
$this->assertEquals(['key' => 'value'], $template->getParams());
$this->assertEquals('public', $template->getRenderAs());
diff --git a/tests/lib/AppFramework/Http/RedirectResponseTest.php b/tests/lib/AppFramework/Http/RedirectResponseTest.php
index dd0142b77a7..f6319782e79 100644
--- a/tests/lib/AppFramework/Http/RedirectResponseTest.php
+++ b/tests/lib/AppFramework/Http/RedirectResponseTest.php
@@ -23,7 +23,7 @@ class RedirectResponseTest extends \Test\TestCase {
}
- public function testHeaders() {
+ public function testHeaders(): void {
$headers = $this->response->getHeaders();
$this->assertEquals('/url', $headers['Location']);
$this->assertEquals(Http::STATUS_SEE_OTHER,
@@ -31,7 +31,7 @@ class RedirectResponseTest extends \Test\TestCase {
}
- public function testGetRedirectUrl() {
+ public function testGetRedirectUrl(): void {
$this->assertEquals('/url', $this->response->getRedirectUrl());
}
}
diff --git a/tests/lib/AppFramework/Http/RequestTest.php b/tests/lib/AppFramework/Http/RequestTest.php
index f97341cb265..1c7f07580cc 100644
--- a/tests/lib/AppFramework/Http/RequestTest.php
+++ b/tests/lib/AppFramework/Http/RequestTest.php
@@ -47,7 +47,7 @@ class RequestTest extends \Test\TestCase {
parent::tearDown();
}
- public function testRequestAccessors() {
+ public function testRequestAccessors(): void {
$vars = [
'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
'method' => 'GET',
@@ -77,7 +77,7 @@ class RequestTest extends \Test\TestCase {
}
// urlParams has precedence over POST which has precedence over GET
- public function testPrecedence() {
+ public function testPrecedence(): void {
$vars = [
'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
'post' => ['name' => 'Jane Doe', 'nickname' => 'Janey'],
@@ -100,7 +100,7 @@ class RequestTest extends \Test\TestCase {
- public function testImmutableArrayAccess() {
+ public function testImmutableArrayAccess(): void {
$this->expectException(\RuntimeException::class);
$vars = [
@@ -120,7 +120,7 @@ class RequestTest extends \Test\TestCase {
}
- public function testImmutableMagicAccess() {
+ public function testImmutableMagicAccess(): void {
$this->expectException(\RuntimeException::class);
$vars = [
@@ -140,7 +140,7 @@ class RequestTest extends \Test\TestCase {
}
- public function testGetTheMethodRight() {
+ public function testGetTheMethodRight(): void {
$this->expectException(\LogicException::class);
$vars = [
@@ -159,7 +159,7 @@ class RequestTest extends \Test\TestCase {
$request->post;
}
- public function testTheMethodIsRight() {
+ public function testTheMethodIsRight(): void {
$vars = [
'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
'method' => 'GET',
@@ -179,7 +179,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('Joey', $result['nickname']);
}
- public function testJsonPost() {
+ public function testJsonPost(): void {
global $data;
$data = '{"name": "John Q. Public", "nickname": "Joey"}';
$vars = [
@@ -203,7 +203,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('Joey', $request['nickname']);
}
- public function testScimJsonPost() {
+ public function testScimJsonPost(): void {
global $data;
$data = '{"userName":"testusername", "displayName":"Example User"}';
$vars = [
@@ -227,7 +227,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('Example User', $request['displayName']);
}
- public function testCustomJsonPost() {
+ public function testCustomJsonPost(): void {
global $data;
$data = '{"propertyA":"sometestvalue", "propertyB":"someothertestvalue"}';
@@ -262,7 +262,7 @@ class RequestTest extends \Test\TestCase {
/**
* @dataProvider notJsonDataProvider
*/
- public function testNotJsonPost($testData) {
+ public function testNotJsonPost($testData): void {
global $data;
$data = $testData;
$vars = [
@@ -283,7 +283,7 @@ class RequestTest extends \Test\TestCase {
// ensure there's no error attempting to decode the content
}
- public function testNotScimJsonPost() {
+ public function testNotScimJsonPost(): void {
global $data;
$data = 'this is not valid scim json';
$vars = [
@@ -304,7 +304,7 @@ class RequestTest extends \Test\TestCase {
// ensure there's no error attempting to decode the content
}
- public function testNotCustomJsonPost() {
+ public function testNotCustomJsonPost(): void {
global $data;
$data = 'this is not valid json';
$vars = [
@@ -325,7 +325,7 @@ class RequestTest extends \Test\TestCase {
// ensure there's no error attempting to decode the content
}
- public function testPatch() {
+ public function testPatch(): void {
global $data;
$data = http_build_query(['name' => 'John Q. Public', 'nickname' => 'Joey'], '', '&');
@@ -349,7 +349,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('Joey', $result['nickname']);
}
- public function testJsonPatchAndPut() {
+ public function testJsonPatchAndPut(): void {
global $data;
// PUT content
@@ -395,7 +395,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame(null, $result['nickname']);
}
- public function testScimJsonPatchAndPut() {
+ public function testScimJsonPatchAndPut(): void {
global $data;
// PUT content
@@ -441,7 +441,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame(null, $result['displayName']);
}
- public function testCustomJsonPatchAndPut() {
+ public function testCustomJsonPatchAndPut(): void {
global $data;
// PUT content
@@ -487,7 +487,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame(null, $result['propertyB']);
}
- public function testPutStream() {
+ public function testPutStream(): void {
global $data;
$data = file_get_contents(__DIR__ . '/../../../data/testimage.png');
@@ -522,7 +522,7 @@ class RequestTest extends \Test\TestCase {
}
- public function testSetUrlParameters() {
+ public function testSetUrlParameters(): void {
$vars = [
'post' => [],
'method' => 'POST',
@@ -771,7 +771,7 @@ class RequestTest extends \Test\TestCase {
* @param mixed $input
* @param string $expected
*/
- public function testGetHttpProtocol($input, $expected) {
+ public function testGetHttpProtocol($input, $expected): void {
$request = new Request(
[
'server' => [
@@ -787,7 +787,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame($expected, $request->getHttpProtocol());
}
- public function testGetServerProtocolWithOverride() {
+ public function testGetServerProtocolWithOverride(): void {
$this->config
->expects($this->exactly(3))
->method('getSystemValueString')
@@ -807,7 +807,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('customProtocol', $request->getServerProtocol());
}
- public function testGetServerProtocolWithProtoValid() {
+ public function testGetServerProtocolWithProtoValid(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -848,7 +848,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('http', $requestHttp->getServerProtocol());
}
- public function testGetServerProtocolWithHttpsServerValueOn() {
+ public function testGetServerProtocolWithHttpsServerValueOn(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -869,7 +869,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('https', $request->getServerProtocol());
}
- public function testGetServerProtocolWithHttpsServerValueOff() {
+ public function testGetServerProtocolWithHttpsServerValueOff(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -890,7 +890,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('http', $request->getServerProtocol());
}
- public function testGetServerProtocolWithHttpsServerValueEmpty() {
+ public function testGetServerProtocolWithHttpsServerValueEmpty(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -911,7 +911,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('http', $request->getServerProtocol());
}
- public function testGetServerProtocolDefault() {
+ public function testGetServerProtocolDefault(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -928,7 +928,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('http', $request->getServerProtocol());
}
- public function testGetServerProtocolBehindLoadBalancers() {
+ public function testGetServerProtocolBehindLoadBalancers(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -961,7 +961,7 @@ class RequestTest extends \Test\TestCase {
* @param array $userAgent
* @param bool $matches
*/
- public function testUserAgent($testAgent, $userAgent, $matches) {
+ public function testUserAgent($testAgent, $userAgent, $matches): void {
$request = new Request(
[
'server' => [
@@ -983,7 +983,7 @@ class RequestTest extends \Test\TestCase {
* @param array $userAgent
* @param bool $matches
*/
- public function testUndefinedUserAgent($testAgent, $userAgent, $matches) {
+ public function testUndefinedUserAgent($testAgent, $userAgent, $matches): void {
$request = new Request(
[],
$this->requestId,
@@ -1174,7 +1174,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame($version, $matches[1]);
}
- public function testInsecureServerHostServerNameHeader() {
+ public function testInsecureServerHostServerNameHeader(): void {
$request = new Request(
[
'server' => [
@@ -1190,7 +1190,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('from.server.name:8080', $request->getInsecureServerHost());
}
- public function testInsecureServerHostHttpHostHeader() {
+ public function testInsecureServerHostHttpHostHeader(): void {
$request = new Request(
[
'server' => [
@@ -1207,7 +1207,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('from.host.header:8080', $request->getInsecureServerHost());
}
- public function testInsecureServerHostHttpFromForwardedHeaderSingle() {
+ public function testInsecureServerHostHttpFromForwardedHeaderSingle(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -1236,7 +1236,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('from.forwarded.host:8080', $request->getInsecureServerHost());
}
- public function testInsecureServerHostHttpFromForwardedHeaderStacked() {
+ public function testInsecureServerHostHttpFromForwardedHeaderStacked(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -1265,7 +1265,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('from.forwarded.host2:8080', $request->getInsecureServerHost());
}
- public function testGetServerHostWithOverwriteHost() {
+ public function testGetServerHostWithOverwriteHost(): void {
$this->config
->method('getSystemValueString')
->willReturnCallback(function ($key, $default) {
@@ -1289,7 +1289,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('my.overwritten.host', $request->getServerHost());
}
- public function testGetServerHostWithTrustedDomain() {
+ public function testGetServerHostWithTrustedDomain(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -1318,7 +1318,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('my.trusted.host', $request->getServerHost());
}
- public function testGetServerHostWithUntrustedDomain() {
+ public function testGetServerHostWithUntrustedDomain(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -1347,7 +1347,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('my.trusted.host', $request->getServerHost());
}
- public function testGetServerHostWithNoTrustedDomain() {
+ public function testGetServerHostWithNoTrustedDomain(): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) {
@@ -1390,7 +1390,7 @@ class RequestTest extends \Test\TestCase {
* @param $expected
* @param $trustedDomain
*/
- public function testGetServerHostTrustedDomain($expected, $trustedDomain) {
+ public function testGetServerHostTrustedDomain($expected, $trustedDomain): void {
$this->config
->method('getSystemValue')
->willReturnCallback(function ($key, $default) use ($trustedDomain) {
@@ -1419,7 +1419,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame($expected, $request->getServerHost());
}
- public function testGetOverwriteHostDefaultNull() {
+ public function testGetOverwriteHostDefaultNull(): void {
$this->config
->expects($this->once())
->method('getSystemValueString')
@@ -1436,7 +1436,7 @@ class RequestTest extends \Test\TestCase {
$this->assertNull(self::invokePrivate($request, 'getOverwriteHost'));
}
- public function testGetOverwriteHostWithOverwrite() {
+ public function testGetOverwriteHostWithOverwrite(): void {
$this->config
->expects($this->exactly(3))
->method('getSystemValueString')
@@ -1457,7 +1457,7 @@ class RequestTest extends \Test\TestCase {
}
- public function testGetPathInfoNotProcessible() {
+ public function testGetPathInfoNotProcessible(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('The requested uri(/foo.php) cannot be processed by the script \'/var/www/index.php\')');
@@ -1478,7 +1478,7 @@ class RequestTest extends \Test\TestCase {
}
- public function testGetRawPathInfoNotProcessible() {
+ public function testGetRawPathInfoNotProcessible(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('The requested uri(/foo.php) cannot be processed by the script \'/var/www/index.php\')');
@@ -1504,7 +1504,7 @@ class RequestTest extends \Test\TestCase {
* @param string $scriptName
* @param string $expected
*/
- public function testGetPathInfoWithoutSetEnvGeneric($requestUri, $scriptName, $expected) {
+ public function testGetPathInfoWithoutSetEnvGeneric($requestUri, $scriptName, $expected): void {
$request = new Request(
[
'server' => [
@@ -1527,7 +1527,7 @@ class RequestTest extends \Test\TestCase {
* @param string $scriptName
* @param string $expected
*/
- public function testGetRawPathInfoWithoutSetEnvGeneric($requestUri, $scriptName, $expected) {
+ public function testGetRawPathInfoWithoutSetEnvGeneric($requestUri, $scriptName, $expected): void {
$request = new Request(
[
'server' => [
@@ -1550,7 +1550,7 @@ class RequestTest extends \Test\TestCase {
* @param string $scriptName
* @param string $expected
*/
- public function testGetRawPathInfoWithoutSetEnv($requestUri, $scriptName, $expected) {
+ public function testGetRawPathInfoWithoutSetEnv($requestUri, $scriptName, $expected): void {
$request = new Request(
[
'server' => [
@@ -1573,7 +1573,7 @@ class RequestTest extends \Test\TestCase {
* @param string $scriptName
* @param string $expected
*/
- public function testGetPathInfoWithoutSetEnv($requestUri, $scriptName, $expected) {
+ public function testGetPathInfoWithoutSetEnv($requestUri, $scriptName, $expected): void {
$request = new Request(
[
'server' => [
@@ -1623,7 +1623,7 @@ class RequestTest extends \Test\TestCase {
];
}
- public function testGetRequestUriWithoutOverwrite() {
+ public function testGetRequestUriWithoutOverwrite(): void {
$this->config
->expects($this->once())
->method('getSystemValueString')
@@ -1655,7 +1655,7 @@ class RequestTest extends \Test\TestCase {
/**
* @dataProvider providesGetRequestUriWithOverwriteData
*/
- public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot, $overwriteCondAddr, $remoteAddr = '') {
+ public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot, $overwriteCondAddr, $remoteAddr = ''): void {
$this->config
->expects($this->exactly(2))
->method('getSystemValueString')
@@ -1688,7 +1688,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame($expectedUri, $request->getRequestUri());
}
- public function testPassesCSRFCheckWithGet() {
+ public function testPassesCSRFCheckWithGet(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -1718,7 +1718,7 @@ class RequestTest extends \Test\TestCase {
$this->assertTrue($request->passesCSRFCheck());
}
- public function testPassesCSRFCheckWithPost() {
+ public function testPassesCSRFCheckWithPost(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -1748,7 +1748,7 @@ class RequestTest extends \Test\TestCase {
$this->assertTrue($request->passesCSRFCheck());
}
- public function testPassesCSRFCheckWithHeader() {
+ public function testPassesCSRFCheckWithHeader(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -1778,7 +1778,7 @@ class RequestTest extends \Test\TestCase {
$this->assertTrue($request->passesCSRFCheck());
}
- public function testPassesCSRFCheckWithGetAndWithoutCookies() {
+ public function testPassesCSRFCheckWithGetAndWithoutCookies(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -1802,7 +1802,7 @@ class RequestTest extends \Test\TestCase {
$this->assertTrue($request->passesCSRFCheck());
}
- public function testPassesCSRFCheckWithPostAndWithoutCookies() {
+ public function testPassesCSRFCheckWithPostAndWithoutCookies(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -1826,7 +1826,7 @@ class RequestTest extends \Test\TestCase {
$this->assertTrue($request->passesCSRFCheck());
}
- public function testPassesCSRFCheckWithHeaderAndWithoutCookies() {
+ public function testPassesCSRFCheckWithHeaderAndWithoutCookies(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -1850,7 +1850,7 @@ class RequestTest extends \Test\TestCase {
$this->assertTrue($request->passesCSRFCheck());
}
- public function testFailsCSRFCheckWithHeaderAndNotAllChecksPassing() {
+ public function testFailsCSRFCheckWithHeaderAndNotAllChecksPassing(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -1877,7 +1877,7 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesCSRFCheck());
}
- public function testPassesStrictCookieCheckWithAllCookiesAndStrict() {
+ public function testPassesStrictCookieCheckWithAllCookiesAndStrict(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName', 'getCookieParams'])
@@ -1909,7 +1909,7 @@ class RequestTest extends \Test\TestCase {
$this->assertTrue($request->passesStrictCookieCheck());
}
- public function testFailsStrictCookieCheckWithAllCookiesAndMissingStrict() {
+ public function testFailsStrictCookieCheckWithAllCookiesAndMissingStrict(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName', 'getCookieParams'])
@@ -1941,7 +1941,7 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesStrictCookieCheck());
}
- public function testGetCookieParams() {
+ public function testGetCookieParams(): void {
/** @var Request $request */
$request = $this->getMockBuilder(Request::class)
->setMethods(['getScriptName'])
@@ -1957,7 +1957,7 @@ class RequestTest extends \Test\TestCase {
$this->assertSame(session_get_cookie_params(), $actual);
}
- public function testPassesStrictCookieCheckWithAllCookies() {
+ public function testPassesStrictCookieCheckWithAllCookies(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -1982,7 +1982,7 @@ class RequestTest extends \Test\TestCase {
$this->assertTrue($request->passesStrictCookieCheck());
}
- public function testPassesStrictCookieCheckWithRandomCookies() {
+ public function testPassesStrictCookieCheckWithRandomCookies(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2005,7 +2005,7 @@ class RequestTest extends \Test\TestCase {
$this->assertTrue($request->passesStrictCookieCheck());
}
- public function testFailsStrictCookieCheckWithSessionCookie() {
+ public function testFailsStrictCookieCheckWithSessionCookie(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2028,7 +2028,7 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesStrictCookieCheck());
}
- public function testFailsStrictCookieCheckWithRememberMeCookie() {
+ public function testFailsStrictCookieCheckWithRememberMeCookie(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2051,7 +2051,7 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesStrictCookieCheck());
}
- public function testFailsCSRFCheckWithPostAndWithCookies() {
+ public function testFailsCSRFCheckWithPostAndWithCookies(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2078,7 +2078,7 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesCSRFCheck());
}
- public function testFailStrictCookieCheckWithOnlyLaxCookie() {
+ public function testFailStrictCookieCheckWithOnlyLaxCookie(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2102,7 +2102,7 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesStrictCookieCheck());
}
- public function testFailStrictCookieCheckWithOnlyStrictCookie() {
+ public function testFailStrictCookieCheckWithOnlyStrictCookie(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2126,7 +2126,7 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesStrictCookieCheck());
}
- public function testPassesLaxCookieCheck() {
+ public function testPassesLaxCookieCheck(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2150,7 +2150,7 @@ class RequestTest extends \Test\TestCase {
$this->assertTrue($request->passesLaxCookieCheck());
}
- public function testFailsLaxCookieCheckWithOnlyStrictCookie() {
+ public function testFailsLaxCookieCheckWithOnlyStrictCookie(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2174,7 +2174,7 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesLaxCookieCheck());
}
- public function testSkipCookieCheckForOCSRequests() {
+ public function testSkipCookieCheckForOCSRequests(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2214,7 +2214,7 @@ class RequestTest extends \Test\TestCase {
* @dataProvider invalidTokenDataProvider
* @param string $invalidToken
*/
- public function testPassesCSRFCheckWithInvalidToken($invalidToken) {
+ public function testPassesCSRFCheckWithInvalidToken($invalidToken): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2241,7 +2241,7 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesCSRFCheck());
}
- public function testPassesCSRFCheckWithoutTokenFail() {
+ public function testPassesCSRFCheckWithoutTokenFail(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
@@ -2257,7 +2257,7 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesCSRFCheck());
}
- public function testPassesCSRFCheckWithOCSAPIRequestHeader() {
+ public function testPassesCSRFCheckWithOCSAPIRequestHeader(): void {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
diff --git a/tests/lib/AppFramework/Http/ResponseTest.php b/tests/lib/AppFramework/Http/ResponseTest.php
index d01d29e7071..28614b14b40 100644
--- a/tests/lib/AppFramework/Http/ResponseTest.php
+++ b/tests/lib/AppFramework/Http/ResponseTest.php
@@ -24,14 +24,14 @@ class ResponseTest extends \Test\TestCase {
}
- public function testAddHeader() {
+ public function testAddHeader(): void {
$this->childResponse->addHeader(' hello ', 'world');
$headers = $this->childResponse->getHeaders();
$this->assertEquals('world', $headers['hello']);
}
- public function testSetHeaders() {
+ public function testSetHeaders(): void {
$expected = [
'Last-Modified' => 1,
'ETag' => 3,
@@ -50,7 +50,7 @@ class ResponseTest extends \Test\TestCase {
$this->assertEquals($expected, $headers);
}
- public function testOverwriteCsp() {
+ public function testOverwriteCsp(): void {
$expected = [
'Content-Security-Policy' => "default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self' 'unsafe-inline';style-src 'self' 'unsafe-inline';img-src 'self';font-src 'self' data:;connect-src 'self';media-src 'self'",
];
@@ -62,31 +62,31 @@ class ResponseTest extends \Test\TestCase {
$this->assertEquals(array_merge($expected, $headers), $headers);
}
- public function testGetCsp() {
+ public function testGetCsp(): void {
$policy = new Http\ContentSecurityPolicy();
$this->childResponse->setContentSecurityPolicy($policy);
$this->assertEquals($policy, $this->childResponse->getContentSecurityPolicy());
}
- public function testGetCspEmpty() {
+ public function testGetCspEmpty(): void {
$this->assertEquals(new Http\EmptyContentSecurityPolicy(), $this->childResponse->getContentSecurityPolicy());
}
- public function testAddHeaderValueNullDeletesIt() {
+ public function testAddHeaderValueNullDeletesIt(): void {
$this->childResponse->addHeader('hello', 'world');
$this->childResponse->addHeader('hello', null);
$this->assertEquals(5, count($this->childResponse->getHeaders()));
}
- public function testCacheHeadersAreDisabledByDefault() {
+ public function testCacheHeadersAreDisabledByDefault(): void {
$headers = $this->childResponse->getHeaders();
$this->assertEquals('no-cache, no-store, must-revalidate', $headers['Cache-Control']);
}
- public function testAddCookie() {
+ public function testAddCookie(): void {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->addCookie('bar', 'foo', new \DateTime('1970-01-01'));
@@ -106,7 +106,7 @@ class ResponseTest extends \Test\TestCase {
}
- public function testSetCookies() {
+ public function testSetCookies(): void {
$expected = [
'foo' => [
'value' => 'bar',
@@ -125,7 +125,7 @@ class ResponseTest extends \Test\TestCase {
}
- public function testInvalidateCookie() {
+ public function testInvalidateCookie(): void {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->invalidateCookie('foo');
$expected = [
@@ -142,7 +142,7 @@ class ResponseTest extends \Test\TestCase {
}
- public function testInvalidateCookies() {
+ public function testInvalidateCookies(): void {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->addCookie('bar', 'foo');
$expected = [
@@ -179,12 +179,12 @@ class ResponseTest extends \Test\TestCase {
}
- public function testRenderReturnNullByDefault() {
+ public function testRenderReturnNullByDefault(): void {
$this->assertEquals(null, $this->childResponse->render());
}
- public function testGetStatus() {
+ public function testGetStatus(): void {
$default = $this->childResponse->getStatus();
$this->childResponse->setStatus(Http::STATUS_NOT_FOUND);
@@ -194,13 +194,13 @@ class ResponseTest extends \Test\TestCase {
}
- public function testGetEtag() {
+ public function testGetEtag(): void {
$this->childResponse->setEtag('hi');
$this->assertSame('hi', $this->childResponse->getEtag());
}
- public function testGetLastModified() {
+ public function testGetLastModified(): void {
$lastModified = new \DateTime('now', new \DateTimeZone('GMT'));
$lastModified->setTimestamp(1);
$this->childResponse->setLastModified($lastModified);
@@ -209,7 +209,7 @@ class ResponseTest extends \Test\TestCase {
- public function testCacheSecondsZero() {
+ public function testCacheSecondsZero(): void {
$this->childResponse->cacheFor(0);
$headers = $this->childResponse->getHeaders();
@@ -218,7 +218,7 @@ class ResponseTest extends \Test\TestCase {
}
- public function testCacheSeconds() {
+ public function testCacheSeconds(): void {
$time = $this->createMock(ITimeFactory::class);
$time->method('getTime')
->willReturn(1234567);
@@ -234,7 +234,7 @@ class ResponseTest extends \Test\TestCase {
- public function testEtagLastModifiedHeaders() {
+ public function testEtagLastModifiedHeaders(): void {
$lastModified = new \DateTime('now', new \DateTimeZone('GMT'));
$lastModified->setTimestamp(1);
$this->childResponse->setLastModified($lastModified);
@@ -242,7 +242,7 @@ class ResponseTest extends \Test\TestCase {
$this->assertEquals('Thu, 01 Jan 1970 00:00:01 +0000', $headers['Last-Modified']);
}
- public function testChainability() {
+ public function testChainability(): void {
$lastModified = new \DateTime('now', new \DateTimeZone('GMT'));
$lastModified->setTimestamp(1);
@@ -262,13 +262,13 @@ class ResponseTest extends \Test\TestCase {
$headers['Cache-Control']);
}
- public function testThrottle() {
+ public function testThrottle(): void {
$this->assertFalse($this->childResponse->isThrottled());
$this->childResponse->throttle();
$this->assertTrue($this->childResponse->isThrottled());
}
- public function testGetThrottleMetadata() {
+ public function testGetThrottleMetadata(): void {
$this->childResponse->throttle(['foo' => 'bar']);
$this->assertSame(['foo' => 'bar'], $this->childResponse->getThrottleMetadata());
}
diff --git a/tests/lib/AppFramework/Http/StreamResponseTest.php b/tests/lib/AppFramework/Http/StreamResponseTest.php
index 637fb025142..87f6097a07a 100644
--- a/tests/lib/AppFramework/Http/StreamResponseTest.php
+++ b/tests/lib/AppFramework/Http/StreamResponseTest.php
@@ -23,7 +23,7 @@ class StreamResponseTest extends \Test\TestCase {
->getMock();
}
- public function testOutputNotModified() {
+ public function testOutputNotModified(): void {
$path = __FILE__;
$this->output->expects($this->once())
->method('getHttpResponseCode')
@@ -35,7 +35,7 @@ class StreamResponseTest extends \Test\TestCase {
$response->callback($this->output);
}
- public function testOutputOk() {
+ public function testOutputOk(): void {
$path = __FILE__;
$this->output->expects($this->once())
->method('getHttpResponseCode')
@@ -49,7 +49,7 @@ class StreamResponseTest extends \Test\TestCase {
$response->callback($this->output);
}
- public function testOutputNotFound() {
+ public function testOutputNotFound(): void {
$path = __FILE__ . 'test';
$this->output->expects($this->once())
->method('getHttpResponseCode')
@@ -64,7 +64,7 @@ class StreamResponseTest extends \Test\TestCase {
$response->callback($this->output);
}
- public function testOutputReadFileError() {
+ public function testOutputReadFileError(): void {
$path = __FILE__;
$this->output->expects($this->once())
->method('getHttpResponseCode')
diff --git a/tests/lib/AppFramework/Http/TemplateResponseTest.php b/tests/lib/AppFramework/Http/TemplateResponseTest.php
index df9824d3032..ad0fe808b76 100644
--- a/tests/lib/AppFramework/Http/TemplateResponseTest.php
+++ b/tests/lib/AppFramework/Http/TemplateResponseTest.php
@@ -24,7 +24,7 @@ class TemplateResponseTest extends \Test\TestCase {
}
- public function testSetParamsConstructor() {
+ public function testSetParamsConstructor(): void {
$params = ['hi' => 'yo'];
$this->tpl = new TemplateResponse('app', 'home', $params);
@@ -32,7 +32,7 @@ class TemplateResponseTest extends \Test\TestCase {
}
- public function testSetRenderAsConstructor() {
+ public function testSetRenderAsConstructor(): void {
$renderAs = 'myrender';
$this->tpl = new TemplateResponse('app', 'home', [], $renderAs);
@@ -40,7 +40,7 @@ class TemplateResponseTest extends \Test\TestCase {
}
- public function testSetParams() {
+ public function testSetParams(): void {
$params = ['hi' => 'yo'];
$this->tpl->setParams($params);
@@ -48,17 +48,17 @@ class TemplateResponseTest extends \Test\TestCase {
}
- public function testGetTemplateName() {
+ public function testGetTemplateName(): void {
$this->assertEquals('home', $this->tpl->getTemplateName());
}
- public function testGetRenderAs() {
+ public function testGetRenderAs(): void {
$render = 'myrender';
$this->tpl->renderAs($render);
$this->assertEquals($render, $this->tpl->getRenderAs());
}
- public function testChainability() {
+ public function testChainability(): void {
$params = ['hi' => 'yo'];
$this->tpl->setParams($params)
->setStatus(Http::STATUS_NOT_FOUND);
diff --git a/tests/lib/AppFramework/Middleware/AdditionalScriptsMiddlewareTest.php b/tests/lib/AppFramework/Middleware/AdditionalScriptsMiddlewareTest.php
index 890735008fc..22b1b13aaee 100644
--- a/tests/lib/AppFramework/Middleware/AdditionalScriptsMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/AdditionalScriptsMiddlewareTest.php
@@ -44,7 +44,7 @@ class AdditionalScriptsMiddlewareTest extends \Test\TestCase {
$this->controller = $this->createMock(Controller::class);
}
- public function testNoTemplateResponse() {
+ public function testNoTemplateResponse(): void {
$this->userSession->expects($this->never())
->method($this->anything());
$this->dispatcher->expects($this->never())
@@ -53,7 +53,7 @@ class AdditionalScriptsMiddlewareTest extends \Test\TestCase {
$this->middleWare->afterController($this->controller, 'myMethod', $this->createMock(Response::class));
}
- public function testPublicShareController() {
+ public function testPublicShareController(): void {
$this->userSession->expects($this->never())
->method($this->anything());
$this->dispatcher->expects($this->never())
@@ -62,7 +62,7 @@ class AdditionalScriptsMiddlewareTest extends \Test\TestCase {
$this->middleWare->afterController($this->createMock(PublicShareController::class), 'myMethod', $this->createMock(Response::class));
}
- public function testStandaloneTemplateResponse() {
+ public function testStandaloneTemplateResponse(): void {
$this->userSession->expects($this->never())
->method($this->anything());
$this->dispatcher->expects($this->once())
@@ -78,7 +78,7 @@ class AdditionalScriptsMiddlewareTest extends \Test\TestCase {
$this->middleWare->afterController($this->controller, 'myMethod', $this->createMock(StandaloneTemplateResponse::class));
}
- public function testTemplateResponseNotLoggedIn() {
+ public function testTemplateResponseNotLoggedIn(): void {
$this->userSession->method('isLoggedIn')
->willReturn(false);
$this->dispatcher->expects($this->once())
@@ -94,7 +94,7 @@ class AdditionalScriptsMiddlewareTest extends \Test\TestCase {
$this->middleWare->afterController($this->controller, 'myMethod', $this->createMock(TemplateResponse::class));
}
- public function testTemplateResponseLoggedIn() {
+ public function testTemplateResponseLoggedIn(): void {
$events = [];
$this->userSession->method('isLoggedIn')
diff --git a/tests/lib/AppFramework/Middleware/CompressionMiddlewareTest.php b/tests/lib/AppFramework/Middleware/CompressionMiddlewareTest.php
index a0848b70796..010ce3fff6d 100644
--- a/tests/lib/AppFramework/Middleware/CompressionMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/CompressionMiddlewareTest.php
@@ -36,7 +36,7 @@ class CompressionMiddlewareTest extends \Test\TestCase {
$this->controller = $this->createMock(Controller::class);
}
- public function testGzipOCSV1() {
+ public function testGzipOCSV1(): void {
$this->request->method('getHeader')
->with('Accept-Encoding')
->willReturn('gzip');
@@ -58,7 +58,7 @@ class CompressionMiddlewareTest extends \Test\TestCase {
$this->assertSame($output, gzdecode($result));
}
- public function testGzipOCSV2() {
+ public function testGzipOCSV2(): void {
$this->request->method('getHeader')
->with('Accept-Encoding')
->willReturn('gzip');
@@ -80,7 +80,7 @@ class CompressionMiddlewareTest extends \Test\TestCase {
$this->assertSame($output, gzdecode($result));
}
- public function testGzipJSONResponse() {
+ public function testGzipJSONResponse(): void {
$this->request->method('getHeader')
->with('Accept-Encoding')
->willReturn('gzip');
@@ -102,7 +102,7 @@ class CompressionMiddlewareTest extends \Test\TestCase {
$this->assertSame($output, gzdecode($result));
}
- public function testNoGzipDataResponse() {
+ public function testNoGzipDataResponse(): void {
$this->request->method('getHeader')
->with('Accept-Encoding')
->willReturn('gzip');
@@ -122,7 +122,7 @@ class CompressionMiddlewareTest extends \Test\TestCase {
$this->assertSame($output, $result);
}
- public function testNoGzipNo200() {
+ public function testNoGzipNo200(): void {
$this->request->method('getHeader')
->with('Accept-Encoding')
->willReturn('gzip');
diff --git a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php
index cddec9bf256..fae5f5d9f1c 100644
--- a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php
+++ b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php
@@ -129,7 +129,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testAfterExceptionShouldReturnResponseOfMiddleware() {
+ public function testAfterExceptionShouldReturnResponseOfMiddleware(): void {
$response = new Response();
$m1 = $this->getMockBuilder('\OCP\AppFramework\Middleware')
->setMethods(['afterException', 'beforeController'])
@@ -152,7 +152,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testAfterExceptionShouldThrowAgainWhenNotHandled() {
+ public function testAfterExceptionShouldThrowAgainWhenNotHandled(): void {
$m1 = new TestMiddleware(false);
$m2 = new TestMiddleware(true);
@@ -165,7 +165,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testBeforeControllerCorrectArguments() {
+ public function testBeforeControllerCorrectArguments(): void {
$m1 = $this->getMiddleware();
$this->dispatcher->beforeController($this->controller, $this->method);
@@ -174,7 +174,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testAfterControllerCorrectArguments() {
+ public function testAfterControllerCorrectArguments(): void {
$m1 = $this->getMiddleware();
$this->dispatcher->afterController($this->controller, $this->method, $this->response);
@@ -185,7 +185,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testAfterExceptionCorrectArguments() {
+ public function testAfterExceptionCorrectArguments(): void {
$m1 = $this->getMiddleware();
$this->expectException(\Exception::class);
@@ -199,7 +199,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testBeforeOutputCorrectArguments() {
+ public function testBeforeOutputCorrectArguments(): void {
$m1 = $this->getMiddleware();
$this->dispatcher->beforeOutput($this->controller, $this->method, $this->out);
@@ -210,7 +210,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testBeforeControllerOrder() {
+ public function testBeforeControllerOrder(): void {
$m1 = $this->getMiddleware();
$m2 = $this->getMiddleware();
@@ -220,7 +220,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
$this->assertEquals(2, $m2->beforeControllerOrder);
}
- public function testAfterControllerOrder() {
+ public function testAfterControllerOrder(): void {
$m1 = $this->getMiddleware();
$m2 = $this->getMiddleware();
@@ -231,7 +231,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testAfterExceptionOrder() {
+ public function testAfterExceptionOrder(): void {
$m1 = $this->getMiddleware();
$m2 = $this->getMiddleware();
@@ -244,7 +244,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testBeforeOutputOrder() {
+ public function testBeforeOutputOrder(): void {
$m1 = $this->getMiddleware();
$m2 = $this->getMiddleware();
@@ -255,7 +255,7 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
}
- public function testExceptionShouldRunAfterExceptionOfOnlyPreviouslyExecutedMiddlewares() {
+ public function testExceptionShouldRunAfterExceptionOfOnlyPreviouslyExecutedMiddlewares(): void {
$m1 = $this->getMiddleware();
$m2 = $this->getMiddleware(true);
$m3 = $this->createMock(Middleware::class);
diff --git a/tests/lib/AppFramework/Middleware/NotModifiedMiddlewareTest.php b/tests/lib/AppFramework/Middleware/NotModifiedMiddlewareTest.php
index e41bb45e069..58ae6b13aed 100644
--- a/tests/lib/AppFramework/Middleware/NotModifiedMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/NotModifiedMiddlewareTest.php
@@ -56,7 +56,7 @@ class NotModifiedMiddlewareTest extends \Test\TestCase {
/**
* @dataProvider dataModified
*/
- public function testMiddleware(?string $etag, string $etagHeader, ?\DateTime $lastModified, string $lastModifiedHeader, bool $notModifiedSet) {
+ public function testMiddleware(?string $etag, string $etagHeader, ?\DateTime $lastModified, string $lastModifiedHeader, bool $notModifiedSet): void {
$this->request->method('getHeader')
->willReturnCallback(function (string $name) use ($etagHeader, $lastModifiedHeader) {
if ($name === 'IF_NONE_MATCH') {
diff --git a/tests/lib/AppFramework/Middleware/OCSMiddlewareTest.php b/tests/lib/AppFramework/Middleware/OCSMiddlewareTest.php
index 28b2ba34fca..6724f841c5e 100644
--- a/tests/lib/AppFramework/Middleware/OCSMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/OCSMiddlewareTest.php
@@ -74,7 +74,7 @@ class OCSMiddlewareTest extends \Test\TestCase {
* @param string $message
* @param int $code
*/
- public function testAfterExceptionOCSv1($controller, $exception, $forward, $message = '', $code = 0) {
+ public function testAfterExceptionOCSv1($controller, $exception, $forward, $message = '', $code = 0): void {
$this->request
->method('getScriptName')
->willReturn('/ocs/v1.php');
@@ -110,7 +110,7 @@ class OCSMiddlewareTest extends \Test\TestCase {
* @param string $message
* @param int $code
*/
- public function testAfterExceptionOCSv2($controller, $exception, $forward, $message = '', $code = 0) {
+ public function testAfterExceptionOCSv2($controller, $exception, $forward, $message = '', $code = 0): void {
$this->request
->method('getScriptName')
->willReturn('/ocs/v2.php');
@@ -144,7 +144,7 @@ class OCSMiddlewareTest extends \Test\TestCase {
* @param string $message
* @param int $code
*/
- public function testAfterExceptionOCSv2SubFolder($controller, $exception, $forward, $message = '', $code = 0) {
+ public function testAfterExceptionOCSv2SubFolder($controller, $exception, $forward, $message = '', $code = 0): void {
$this->request
->method('getScriptName')
->willReturn('/mysubfolder/ocs/v2.php');
@@ -201,7 +201,7 @@ class OCSMiddlewareTest extends \Test\TestCase {
* @param bool $converted
* @param int $convertedOCSStatus
*/
- public function testAfterController($controller, $response, $converted, $convertedOCSStatus = 0) {
+ public function testAfterController($controller, $response, $converted, $convertedOCSStatus = 0): void {
$OCSMiddleware = new OCSMiddleware($this->request);
$newResponse = $OCSMiddleware->afterController($controller, 'foo', $response);
diff --git a/tests/lib/AppFramework/Middleware/PublicShare/PublicShareMiddlewareTest.php b/tests/lib/AppFramework/Middleware/PublicShare/PublicShareMiddlewareTest.php
index 64a9efbfe60..8433aa93f4a 100644
--- a/tests/lib/AppFramework/Middleware/PublicShare/PublicShareMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/PublicShare/PublicShareMiddlewareTest.php
@@ -51,7 +51,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
);
}
- public function testBeforeControllerNoPublicShareController() {
+ public function testBeforeControllerNoPublicShareController(): void {
$controller = $this->createMock(Controller::class);
$this->middleware->beforeController($controller, 'method');
@@ -69,7 +69,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
/**
* @dataProvider dataShareApi
*/
- public function testBeforeControllerShareApiDisabled(string $shareApi, string $shareLinks) {
+ public function testBeforeControllerShareApiDisabled(string $shareApi, string $shareLinks): void {
$controller = $this->createMock(PublicShareController::class);
$this->config->method('getAppValue')
@@ -82,7 +82,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
$this->middleware->beforeController($controller, 'mehod');
}
- public function testBeforeControllerNoTokenParam() {
+ public function testBeforeControllerNoTokenParam(): void {
$controller = $this->createMock(PublicShareController::class);
$this->config->method('getAppValue')
@@ -95,7 +95,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
$this->middleware->beforeController($controller, 'mehod');
}
- public function testBeforeControllerInvalidToken() {
+ public function testBeforeControllerInvalidToken(): void {
$controller = $this->createMock(PublicShareController::class);
$this->config->method('getAppValue')
@@ -117,7 +117,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
$this->middleware->beforeController($controller, 'mehod');
}
- public function testBeforeControllerValidTokenNotAuthenticated() {
+ public function testBeforeControllerValidTokenNotAuthenticated(): void {
$controller = $this->getMockBuilder(PublicShareController::class)
->setConstructorArgs(['app', $this->request, $this->session])
->getMock();
@@ -142,7 +142,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
$this->middleware->beforeController($controller, 'mehod');
}
- public function testBeforeControllerValidTokenAuthenticateMethod() {
+ public function testBeforeControllerValidTokenAuthenticateMethod(): void {
$controller = $this->getMockBuilder(PublicShareController::class)
->setConstructorArgs(['app', $this->request, $this->session])
->getMock();
@@ -167,7 +167,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
$this->assertTrue(true);
}
- public function testBeforeControllerValidTokenShowAuthenticateMethod() {
+ public function testBeforeControllerValidTokenShowAuthenticateMethod(): void {
$controller = $this->getMockBuilder(PublicShareController::class)
->setConstructorArgs(['app', $this->request, $this->session])
->getMock();
@@ -192,7 +192,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
$this->assertTrue(true);
}
- public function testBeforeControllerAuthPublicShareController() {
+ public function testBeforeControllerAuthPublicShareController(): void {
$controller = $this->getMockBuilder(AuthPublicShareController::class)
->setConstructorArgs(['app', $this->request, $this->session, $this->createMock(IURLGenerator::class)])
->getMock();
@@ -221,7 +221,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
$this->middleware->beforeController($controller, 'method');
}
- public function testAfterExceptionNoPublicShareController() {
+ public function testAfterExceptionNoPublicShareController(): void {
$controller = $this->createMock(Controller::class);
$exception = new \Exception();
@@ -232,7 +232,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
}
}
- public function testAfterExceptionPublicShareControllerNotFoundException() {
+ public function testAfterExceptionPublicShareControllerNotFoundException(): void {
$controller = $this->createMock(PublicShareController::class);
$exception = new NotFoundException();
@@ -241,7 +241,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
$this->assertEquals($result->getStatus(), Http::STATUS_NOT_FOUND);
}
- public function testAfterExceptionPublicShareController() {
+ public function testAfterExceptionPublicShareController(): void {
$controller = $this->createMock(PublicShareController::class);
$exception = new \Exception();
@@ -252,7 +252,7 @@ class PublicShareMiddlewareTest extends \Test\TestCase {
}
}
- public function testAfterExceptionAuthPublicShareController() {
+ public function testAfterExceptionAuthPublicShareController(): void {
$controller = $this->getMockBuilder(AuthPublicShareController::class)
->setConstructorArgs([
'app',
diff --git a/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php
index 00538dda4b0..b703b10c554 100644
--- a/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/Security/CORSMiddlewareTest.php
@@ -308,7 +308,7 @@ class CORSMiddlewareTest extends \Test\TestCase {
$middleware->beforeController($this->controller, $method);
}
- public function testAfterExceptionWithSecurityExceptionNoStatus() {
+ public function testAfterExceptionWithSecurityExceptionNoStatus(): void {
$request = new Request(
['server' => [
'PHP_AUTH_USER' => 'user',
@@ -324,7 +324,7 @@ class CORSMiddlewareTest extends \Test\TestCase {
$this->assertEquals($expected, $response);
}
- public function testAfterExceptionWithSecurityExceptionWithStatus() {
+ public function testAfterExceptionWithSecurityExceptionWithStatus(): void {
$request = new Request(
['server' => [
'PHP_AUTH_USER' => 'user',
@@ -340,7 +340,7 @@ class CORSMiddlewareTest extends \Test\TestCase {
$this->assertEquals($expected, $response);
}
- public function testAfterExceptionWithRegularException() {
+ public function testAfterExceptionWithRegularException(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('A regular exception');
diff --git a/tests/lib/AppFramework/Middleware/Security/CSPMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/CSPMiddlewareTest.php
index dd6ee9531b2..b0b41b27cb9 100644
--- a/tests/lib/AppFramework/Middleware/Security/CSPMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/Security/CSPMiddlewareTest.php
@@ -39,7 +39,7 @@ class CSPMiddlewareTest extends \Test\TestCase {
);
}
- public function testAfterController() {
+ public function testAfterController(): void {
$this->cspNonceManager
->expects($this->once())
->method('browserSupportsCspV3')
@@ -71,7 +71,7 @@ class CSPMiddlewareTest extends \Test\TestCase {
$this->middleware->afterController($this->controller, 'test', $response);
}
- public function testAfterControllerEmptyCSP() {
+ public function testAfterControllerEmptyCSP(): void {
$response = $this->createMock(Response::class);
$emptyPolicy = new EmptyContentSecurityPolicy();
$response->expects($this->any())
@@ -83,7 +83,7 @@ class CSPMiddlewareTest extends \Test\TestCase {
$this->middleware->afterController($this->controller, 'test', $response);
}
- public function testAfterControllerWithContentSecurityPolicy3Support() {
+ public function testAfterControllerWithContentSecurityPolicy3Support(): void {
$this->cspNonceManager
->expects($this->once())
->method('browserSupportsCspV3')
diff --git a/tests/lib/AppFramework/Middleware/Security/FeaturePolicyMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/FeaturePolicyMiddlewareTest.php
index 1cdd99b1aae..55a70d4c040 100644
--- a/tests/lib/AppFramework/Middleware/Security/FeaturePolicyMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/Security/FeaturePolicyMiddlewareTest.php
@@ -34,7 +34,7 @@ class FeaturePolicyMiddlewareTest extends \Test\TestCase {
);
}
- public function testAfterController() {
+ public function testAfterController(): void {
$response = $this->createMock(Response::class);
$defaultPolicy = new FeaturePolicy();
$defaultPolicy->addAllowedCameraDomain('defaultpolicy');
@@ -56,7 +56,7 @@ class FeaturePolicyMiddlewareTest extends \Test\TestCase {
$this->middleware->afterController($this->controller, 'test', $response);
}
- public function testAfterControllerEmptyCSP() {
+ public function testAfterControllerEmptyCSP(): void {
$response = $this->createMock(Response::class);
$emptyPolicy = new EmptyFeaturePolicy();
$response->method('getFeaturePolicy')
diff --git a/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php
index a9f3258e8d3..148335d270f 100644
--- a/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php
@@ -61,7 +61,7 @@ class PasswordConfirmationMiddlewareTest extends TestCase {
);
}
- public function testNoAnnotationNorAttribute() {
+ public function testNoAnnotationNorAttribute(): void {
$this->reflector->reflect($this->controller, __FUNCTION__);
$this->session->expects($this->never())
->method($this->anything());
@@ -71,7 +71,7 @@ class PasswordConfirmationMiddlewareTest extends TestCase {
$this->middleware->beforeController($this->controller, __FUNCTION__);
}
- public function testDifferentAnnotation() {
+ public function testDifferentAnnotation(): void {
$this->reflector->reflect($this->controller, __FUNCTION__);
$this->session->expects($this->never())
->method($this->anything());
@@ -84,7 +84,7 @@ class PasswordConfirmationMiddlewareTest extends TestCase {
/**
* @dataProvider dataProvider
*/
- public function testAnnotation($backend, $lastConfirm, $currentTime, $exception) {
+ public function testAnnotation($backend, $lastConfirm, $currentTime, $exception): void {
$this->reflector->reflect($this->controller, __FUNCTION__);
$this->user->method('getBackendClassName')
@@ -119,7 +119,7 @@ class PasswordConfirmationMiddlewareTest extends TestCase {
/**
* @dataProvider dataProvider
*/
- public function testAttribute($backend, $lastConfirm, $currentTime, $exception) {
+ public function testAttribute($backend, $lastConfirm, $currentTime, $exception): void {
$this->reflector->reflect($this->controller, __FUNCTION__);
$this->user->method('getBackendClassName')
@@ -164,7 +164,7 @@ class PasswordConfirmationMiddlewareTest extends TestCase {
];
}
- public function testSSO() {
+ public function testSSO(): void {
static $sessionId = 'mySession1d';
$this->reflector->reflect($this->controller, __FUNCTION__);
diff --git a/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php
index b4d7ee10f7c..0ca4a455cba 100644
--- a/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php
@@ -33,7 +33,7 @@ class SameSiteCookieMiddlewareTest extends TestCase {
$this->middleware = new SameSiteCookieMiddleware($this->request, $this->reflector);
}
- public function testBeforeControllerNoIndex() {
+ public function testBeforeControllerNoIndex(): void {
$this->request->method('getScriptName')
->willReturn('/ocs/v2.php');
@@ -41,7 +41,7 @@ class SameSiteCookieMiddlewareTest extends TestCase {
$this->addToAssertionCount(1);
}
- public function testBeforeControllerIndexHasAnnotation() {
+ public function testBeforeControllerIndexHasAnnotation(): void {
$this->request->method('getScriptName')
->willReturn('/index.php');
@@ -53,7 +53,7 @@ class SameSiteCookieMiddlewareTest extends TestCase {
$this->addToAssertionCount(1);
}
- public function testBeforeControllerIndexNoAnnotationPassingCheck() {
+ public function testBeforeControllerIndexNoAnnotationPassingCheck(): void {
$this->request->method('getScriptName')
->willReturn('/index.php');
@@ -68,7 +68,7 @@ class SameSiteCookieMiddlewareTest extends TestCase {
$this->addToAssertionCount(1);
}
- public function testBeforeControllerIndexNoAnnotationFailingCheck() {
+ public function testBeforeControllerIndexNoAnnotationFailingCheck(): void {
$this->expectException(LaxSameSiteCookieFailedException::class);
$this->request->method('getScriptName')
@@ -84,7 +84,7 @@ class SameSiteCookieMiddlewareTest extends TestCase {
$this->middleware->beforeController($this->createMock(Controller::class), 'foo');
}
- public function testAfterExceptionNoLaxCookie() {
+ public function testAfterExceptionNoLaxCookie(): void {
$ex = new SecurityException();
try {
@@ -95,7 +95,7 @@ class SameSiteCookieMiddlewareTest extends TestCase {
}
}
- public function testAfterExceptionLaxCookie() {
+ public function testAfterExceptionLaxCookie(): void {
$ex = new LaxSameSiteCookieFailedException();
$this->request->method('getRequestUri')
diff --git a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php
index b7af6984237..07e368fd1e6 100644
--- a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php
+++ b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php
@@ -347,7 +347,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
/**
* @dataProvider dataNoCSRFRequiredPublicPage
*/
- public function testNoCsrfCheck(string $method) {
+ public function testNoCsrfCheck(string $method): void {
$this->request->expects($this->never())
->method('passesCSRFCheck')
->willReturn(false);
@@ -591,13 +591,13 @@ class SecurityMiddlewareTest extends \Test\TestCase {
}
- public function testAfterExceptionNotCaughtThrowsItAgain() {
+ public function testAfterExceptionNotCaughtThrowsItAgain(): void {
$ex = new \Exception();
$this->expectException(\Exception::class);
$this->middleware->afterException($this->controller, 'test', $ex);
}
- public function testAfterExceptionReturnsRedirectForNotLoggedInUser() {
+ public function testAfterExceptionReturnsRedirectForNotLoggedInUser(): void {
$this->request = new Request(
[
'server' =>
@@ -632,7 +632,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
$this->assertEquals($expected, $response);
}
- public function testAfterExceptionRedirectsToWebRootAfterStrictCookieFail() {
+ public function testAfterExceptionRedirectsToWebRootAfterStrictCookieFail(): void {
$this->request = new Request(
[
'server' => [
@@ -677,7 +677,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
* @dataProvider exceptionProvider
* @param SecurityException $exception
*/
- public function testAfterExceptionReturnsTemplateResponse(SecurityException $exception) {
+ public function testAfterExceptionReturnsTemplateResponse(SecurityException $exception): void {
$this->request = new Request(
[
'server' =>
@@ -703,7 +703,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
$this->assertEquals($expected, $response);
}
- public function testAfterAjaxExceptionReturnsJSONError() {
+ public function testAfterAjaxExceptionReturnsJSONError(): void {
$response = $this->middleware->afterException($this->controller, 'test',
$this->secAjaxException);
diff --git a/tests/lib/AppFramework/Routing/RoutingTest.php b/tests/lib/AppFramework/Routing/RoutingTest.php
index 00b586e6cc4..32b57e7bf21 100644
--- a/tests/lib/AppFramework/Routing/RoutingTest.php
+++ b/tests/lib/AppFramework/Routing/RoutingTest.php
@@ -20,7 +20,7 @@ use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
class RoutingTest extends \Test\TestCase {
- public function testSimpleRoute() {
+ public function testSimpleRoute(): void {
$routes = ['routes' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'GET']
]];
@@ -28,7 +28,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleRoute($routes, 'folders.open', 'GET', '/apps/app1/folders/{folderId}/open', 'FoldersController', 'open');
}
- public function testSimpleRouteWithUnderScoreNames() {
+ public function testSimpleRouteWithUnderScoreNames(): void {
$routes = ['routes' => [
['name' => 'admin_folders#open_current', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'root' => '']
]];
@@ -36,7 +36,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleRoute($routes, 'admin_folders.open_current', 'DELETE', '/folders/{folderId}/open', 'AdminFoldersController', 'openCurrent', [], [], '', true);
}
- public function testSimpleOCSRoute() {
+ public function testSimpleOCSRoute(): void {
$routes = ['ocs' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'GET']
]
@@ -45,7 +45,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleOCSRoute($routes, 'folders.open', 'GET', '/apps/app1/folders/{folderId}/open', 'FoldersController', 'open');
}
- public function testSimpleRouteWithMissingVerb() {
+ public function testSimpleRouteWithMissingVerb(): void {
$routes = ['routes' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open']
]];
@@ -53,7 +53,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleRoute($routes, 'folders.open', 'GET', '/apps/app1/folders/{folderId}/open', 'FoldersController', 'open');
}
- public function testSimpleOCSRouteWithMissingVerb() {
+ public function testSimpleOCSRouteWithMissingVerb(): void {
$routes = ['ocs' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open']
]
@@ -62,7 +62,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleOCSRoute($routes, 'folders.open', 'GET', '/apps/app1/folders/{folderId}/open', 'FoldersController', 'open');
}
- public function testSimpleRouteWithLowercaseVerb() {
+ public function testSimpleRouteWithLowercaseVerb(): void {
$routes = ['routes' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete']
]];
@@ -70,7 +70,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/apps/app1/folders/{folderId}/open', 'FoldersController', 'open');
}
- public function testSimpleOCSRouteWithLowercaseVerb() {
+ public function testSimpleOCSRouteWithLowercaseVerb(): void {
$routes = ['ocs' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete']
]
@@ -79,7 +79,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleOCSRoute($routes, 'folders.open', 'DELETE', '/apps/app1/folders/{folderId}/open', 'FoldersController', 'open');
}
- public function testSimpleRouteWithRequirements() {
+ public function testSimpleRouteWithRequirements(): void {
$routes = ['routes' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'requirements' => ['something']]
]];
@@ -87,7 +87,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/apps/app1/folders/{folderId}/open', 'FoldersController', 'open', ['something']);
}
- public function testSimpleOCSRouteWithRequirements() {
+ public function testSimpleOCSRouteWithRequirements(): void {
$routes = ['ocs' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'requirements' => ['something']]
]
@@ -96,7 +96,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleOCSRoute($routes, 'folders.open', 'DELETE', '/apps/app1/folders/{folderId}/open', 'FoldersController', 'open', ['something']);
}
- public function testSimpleRouteWithDefaults() {
+ public function testSimpleRouteWithDefaults(): void {
$routes = ['routes' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', [], 'defaults' => ['param' => 'foobar']]
]];
@@ -105,7 +105,7 @@ class RoutingTest extends \Test\TestCase {
}
- public function testSimpleOCSRouteWithDefaults() {
+ public function testSimpleOCSRouteWithDefaults(): void {
$routes = ['ocs' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'defaults' => ['param' => 'foobar']]
]
@@ -114,7 +114,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleOCSRoute($routes, 'folders.open', 'DELETE', '/apps/app1/folders/{folderId}/open', 'FoldersController', 'open', [], ['param' => 'foobar']);
}
- public function testSimpleRouteWithPostfix() {
+ public function testSimpleRouteWithPostfix(): void {
$routes = ['routes' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'postfix' => '_something']
]];
@@ -122,7 +122,7 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/apps/app1/folders/{folderId}/open', 'FoldersController', 'open', [], [], '_something');
}
- public function testSimpleOCSRouteWithPostfix() {
+ public function testSimpleOCSRouteWithPostfix(): void {
$routes = ['ocs' => [
['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'postfix' => '_something']
]
@@ -132,7 +132,7 @@ class RoutingTest extends \Test\TestCase {
}
- public function testSimpleRouteWithBrokenName() {
+ public function testSimpleRouteWithBrokenName(): void {
$this->expectException(\UnexpectedValueException::class);
$routes = ['routes' => [
@@ -160,7 +160,7 @@ class RoutingTest extends \Test\TestCase {
}
- public function testSimpleOCSRouteWithBrokenName() {
+ public function testSimpleOCSRouteWithBrokenName(): void {
$this->expectException(\UnexpectedValueException::class);
$routes = ['ocs' => [
@@ -187,7 +187,7 @@ class RoutingTest extends \Test\TestCase {
$config->register();
}
- public function testSimpleOCSRouteWithUnderScoreNames() {
+ public function testSimpleOCSRouteWithUnderScoreNames(): void {
$routes = ['ocs' => [
['name' => 'admin_folders#open_current', 'url' => '/folders/{folderId}/open', 'verb' => 'delete']
]];
@@ -195,31 +195,31 @@ class RoutingTest extends \Test\TestCase {
$this->assertSimpleOCSRoute($routes, 'admin_folders.open_current', 'DELETE', '/apps/app1/folders/{folderId}/open', 'AdminFoldersController', 'openCurrent');
}
- public function testOCSResource() {
+ public function testOCSResource(): void {
$routes = ['ocs-resources' => ['account' => ['url' => '/accounts']]];
$this->assertOCSResource($routes, 'account', '/apps/app1/accounts', 'AccountController', 'id');
}
- public function testOCSResourceWithUnderScoreName() {
+ public function testOCSResourceWithUnderScoreName(): void {
$routes = ['ocs-resources' => ['admin_accounts' => ['url' => '/admin/accounts']]];
$this->assertOCSResource($routes, 'admin_accounts', '/apps/app1/admin/accounts', 'AdminAccountsController', 'id');
}
- public function testOCSResourceWithRoot() {
+ public function testOCSResourceWithRoot(): void {
$routes = ['ocs-resources' => ['admin_accounts' => ['url' => '/admin/accounts', 'root' => '/core/endpoint']]];
$this->assertOCSResource($routes, 'admin_accounts', '/core/endpoint/admin/accounts', 'AdminAccountsController', 'id');
}
- public function testResource() {
+ public function testResource(): void {
$routes = ['resources' => ['account' => ['url' => '/accounts']]];
$this->assertResource($routes, 'account', '/apps/app1/accounts', 'AccountController', 'id');
}
- public function testResourceWithUnderScoreName() {
+ public function testResourceWithUnderScoreName(): void {
$routes = ['resources' => ['admin_accounts' => ['url' => '/admin/accounts']]];
$this->assertResource($routes, 'admin_accounts', '/apps/app1/admin/accounts', 'AdminAccountsController', 'id');
diff --git a/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php b/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php
index b7d14cb6cba..e5c683d2486 100644
--- a/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php
+++ b/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php
@@ -56,7 +56,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
/**
* @Annotation
*/
- public function testReadAnnotation() {
+ public function testReadAnnotation(): void {
$reader = new ControllerMethodReflector();
$reader->reflect(
'\Test\AppFramework\Utility\ControllerMethodReflectorTest',
@@ -69,7 +69,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
/**
* @Annotation(parameter=value)
*/
- public function testGetAnnotationParameterSingle() {
+ public function testGetAnnotationParameterSingle(): void {
$reader = new ControllerMethodReflector();
$reader->reflect(
__CLASS__,
@@ -82,7 +82,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
/**
* @Annotation(parameter1=value1, parameter2=value2,parameter3=value3)
*/
- public function testGetAnnotationParameterMultiple() {
+ public function testGetAnnotationParameterMultiple(): void {
$reader = new ControllerMethodReflector();
$reader->reflect(
__CLASS__,
@@ -98,7 +98,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
* @Annotation
* @param test
*/
- public function testReadAnnotationNoLowercase() {
+ public function testReadAnnotationNoLowercase(): void {
$reader = new ControllerMethodReflector();
$reader->reflect(
'\Test\AppFramework\Utility\ControllerMethodReflectorTest',
@@ -114,7 +114,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
* @Annotation
* @param int $test
*/
- public function testReadTypeIntAnnotations() {
+ public function testReadTypeIntAnnotations(): void {
$reader = new ControllerMethodReflector();
$reader->reflect(
'\Test\AppFramework\Utility\ControllerMethodReflectorTest',
@@ -135,7 +135,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
/**
* @requires PHP 7
*/
- public function testReadTypeIntAnnotationsScalarTypes() {
+ public function testReadTypeIntAnnotationsScalarTypes(): void {
$reader = new ControllerMethodReflector();
$reader->reflect(
'\Test\AppFramework\Utility\ControllerMethodReflectorTest',
@@ -153,7 +153,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
* @Annotation
* @param double $test something special
*/
- public function testReadTypeDoubleAnnotations() {
+ public function testReadTypeDoubleAnnotations(): void {
$reader = new ControllerMethodReflector();
$reader->reflect(
'\Test\AppFramework\Utility\ControllerMethodReflectorTest',
@@ -167,7 +167,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
* @Annotation
* @param string $foo
*/
- public function testReadTypeWhitespaceAnnotations() {
+ public function testReadTypeWhitespaceAnnotations(): void {
$reader = new ControllerMethodReflector();
$reader->reflect(
'\Test\AppFramework\Utility\ControllerMethodReflectorTest',
@@ -180,7 +180,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
public function arguments($arg, $arg2 = 'hi') {
}
- public function testReflectParameters() {
+ public function testReflectParameters(): void {
$reader = new ControllerMethodReflector();
$reader->reflect(
'\Test\AppFramework\Utility\ControllerMethodReflectorTest',
@@ -193,7 +193,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
public function arguments2($arg) {
}
- public function testReflectParameters2() {
+ public function testReflectParameters2(): void {
$reader = new ControllerMethodReflector();
$reader->reflect(
'\Test\AppFramework\Utility\ControllerMethodReflectorTest',
@@ -204,7 +204,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
}
- public function testInheritance() {
+ public function testInheritance(): void {
$reader = new ControllerMethodReflector();
$reader->reflect('Test\AppFramework\Utility\EndController', 'test');
@@ -212,7 +212,7 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
}
- public function testInheritanceOverride() {
+ public function testInheritanceOverride(): void {
$reader = new ControllerMethodReflector();
$reader->reflect('Test\AppFramework\Utility\EndController', 'test2');
@@ -221,14 +221,14 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
}
- public function testInheritanceOverrideNoDocblock() {
+ public function testInheritanceOverrideNoDocblock(): void {
$reader = new ControllerMethodReflector();
$reader->reflect('Test\AppFramework\Utility\EndController', 'test3');
$this->assertFalse($reader->hasAnnotation('Annotation'));
}
- public function testRangeDetection() {
+ public function testRangeDetection(): void {
$reader = new ControllerMethodReflector();
$reader->reflect('Test\AppFramework\Utility\EndController', 'test4');
diff --git a/tests/lib/AppFramework/Utility/SimpleContainerTest.php b/tests/lib/AppFramework/Utility/SimpleContainerTest.php
index d27d29db951..d3e9dec18e0 100644
--- a/tests/lib/AppFramework/Utility/SimpleContainerTest.php
+++ b/tests/lib/AppFramework/Utility/SimpleContainerTest.php
@@ -67,7 +67,7 @@ class SimpleContainerTest extends \Test\TestCase {
- public function testRegister() {
+ public function testRegister(): void {
$this->container->registerParameter('test', 'abc');
$this->assertEquals('abc', $this->container->query('test'));
}
@@ -76,7 +76,7 @@ class SimpleContainerTest extends \Test\TestCase {
/**
* Test querying a class that is not registered without autoload enabled
*/
- public function testNothingRegistered() {
+ public function testNothingRegistered(): void {
try {
$this->container->query('something really hard', false);
$this->fail('Expected `QueryException` exception was not thrown');
@@ -90,7 +90,7 @@ class SimpleContainerTest extends \Test\TestCase {
/**
* Test querying a class that is not registered with autoload enabled
*/
- public function testNothingRegistered_autoload() {
+ public function testNothingRegistered_autoload(): void {
try {
$this->container->query('something really hard');
$this->fail('Expected `QueryException` exception was not thrown');
@@ -102,26 +102,26 @@ class SimpleContainerTest extends \Test\TestCase {
- public function testNotAClass() {
+ public function testNotAClass(): void {
$this->expectException(\OCP\AppFramework\QueryException::class);
$this->container->query('Test\AppFramework\Utility\TestInterface');
}
- public function testNoConstructorClass() {
+ public function testNoConstructorClass(): void {
$object = $this->container->query('Test\AppFramework\Utility\ClassEmptyConstructor');
$this->assertTrue($object instanceof ClassEmptyConstructor);
}
- public function testInstancesOnlyOnce() {
+ public function testInstancesOnlyOnce(): void {
$object = $this->container->query('Test\AppFramework\Utility\ClassEmptyConstructor');
$object2 = $this->container->query('Test\AppFramework\Utility\ClassEmptyConstructor');
$this->assertSame($object, $object2);
}
- public function testConstructorSimple() {
+ public function testConstructorSimple(): void {
$this->container->registerParameter('test', 'abc');
$object = $this->container->query(
'Test\AppFramework\Utility\ClassSimpleConstructor'
@@ -131,7 +131,7 @@ class SimpleContainerTest extends \Test\TestCase {
}
- public function testConstructorComplex() {
+ public function testConstructorComplex(): void {
$this->container->registerParameter('test', 'abc');
$object = $this->container->query(
'Test\AppFramework\Utility\ClassComplexConstructor'
@@ -142,7 +142,7 @@ class SimpleContainerTest extends \Test\TestCase {
}
- public function testConstructorComplexInterface() {
+ public function testConstructorComplexInterface(): void {
$this->container->registerParameter('test', 'abc');
$this->container->registerService(
'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) {
@@ -157,7 +157,7 @@ class SimpleContainerTest extends \Test\TestCase {
}
- public function testOverrideService() {
+ public function testOverrideService(): void {
$this->container->registerService(
'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) {
return $c->query('Test\AppFramework\Utility\ClassSimpleConstructor');
@@ -172,13 +172,13 @@ class SimpleContainerTest extends \Test\TestCase {
$this->assertTrue($object instanceof ClassEmptyConstructor);
}
- public function testRegisterAliasParamter() {
+ public function testRegisterAliasParamter(): void {
$this->container->registerParameter('test', 'abc');
$this->container->registerAlias('test1', 'test');
$this->assertEquals('abc', $this->container->query('test1'));
}
- public function testRegisterAliasService() {
+ public function testRegisterAliasService(): void {
$this->container->registerService('test', function () {
return new \StdClass;
}, true);
@@ -203,7 +203,7 @@ class SimpleContainerTest extends \Test\TestCase {
/**
* @dataProvider sanitizeNameProvider
*/
- public function testSanitizeName($register, $query) {
+ public function testSanitizeName($register, $query): void {
$this->container->registerService($register, function () {
return 'abc';
});
@@ -211,7 +211,7 @@ class SimpleContainerTest extends \Test\TestCase {
}
- public function testConstructorComplexNoTestParameterFound() {
+ public function testConstructorComplexNoTestParameterFound(): void {
$this->expectException(\OCP\AppFramework\QueryException::class);
$object = $this->container->query(
@@ -219,7 +219,7 @@ class SimpleContainerTest extends \Test\TestCase {
);
}
- public function testRegisterFactory() {
+ public function testRegisterFactory(): void {
$this->container->registerService('test', function () {
return new \StdClass();
}, false);
@@ -227,7 +227,7 @@ class SimpleContainerTest extends \Test\TestCase {
$this->container->query('test'), $this->container->query('test'));
}
- public function testRegisterAliasFactory() {
+ public function testRegisterAliasFactory(): void {
$this->container->registerService('test', function () {
return new \StdClass();
}, false);
diff --git a/tests/lib/AppTest.php b/tests/lib/AppTest.php
index 4364b7bbc2f..e6759170fb1 100644
--- a/tests/lib/AppTest.php
+++ b/tests/lib/AppTest.php
@@ -308,14 +308,14 @@ class AppTest extends \Test\TestCase {
/**
* @dataProvider appVersionsProvider
*/
- public function testIsAppCompatible($ocVersion, $appInfo, $expectedResult) {
+ public function testIsAppCompatible($ocVersion, $appInfo, $expectedResult): void {
$this->assertEquals($expectedResult, \OC_App::isAppCompatible($ocVersion, $appInfo));
}
/**
* Tests that the app order is correct
*/
- public function testGetEnabledAppsIsSorted() {
+ public function testGetEnabledAppsIsSorted(): void {
$apps = \OC_App::getEnabledApps();
// copy array
$sortedApps = $apps;
@@ -457,7 +457,7 @@ class AppTest extends \Test\TestCase {
*
* @dataProvider appConfigValuesProvider
*/
- public function testEnabledApps($user, $expectedApps, $forceAll) {
+ public function testEnabledApps($user, $expectedApps, $forceAll): void {
$userManager = \OC::$server->getUserManager();
$groupManager = \OC::$server->getGroupManager();
$user1 = $userManager->createUser(self::TEST_USER1, 'NotAnEasyPassword123456+');
@@ -506,7 +506,7 @@ class AppTest extends \Test\TestCase {
* Test isEnabledApps() with cache, not re-reading the list of
* enabled apps more than once when a user is set.
*/
- public function testEnabledAppsCache() {
+ public function testEnabledAppsCache(): void {
$userManager = \OC::$server->getUserManager();
$user1 = $userManager->createUser(self::TEST_USER1, 'NotAnEasyPassword123456+');
@@ -615,18 +615,18 @@ class AppTest extends \Test\TestCase {
* @param array $data
* @param array $expected
*/
- public function testParseAppInfo(array $data, array $expected) {
+ public function testParseAppInfo(array $data, array $expected): void {
$this->assertSame($expected, \OC_App::parseAppInfo($data));
}
- public function testParseAppInfoL10N() {
+ public function testParseAppInfoL10N(): void {
$parser = new InfoParser();
$data = $parser->parse(\OC::$SERVERROOT. '/tests/data/app/description-multi-lang.xml');
$this->assertEquals('English', \OC_App::parseAppInfo($data, 'en')['description']);
$this->assertEquals('German', \OC_App::parseAppInfo($data, 'de')['description']);
}
- public function testParseAppInfoL10NSingleLanguage() {
+ public function testParseAppInfoL10NSingleLanguage(): void {
$parser = new InfoParser();
$data = $parser->parse(\OC::$SERVERROOT. '/tests/data/app/description-single-lang.xml');
$this->assertEquals('English', \OC_App::parseAppInfo($data, 'en')['description']);
diff --git a/tests/lib/Archive/TestBase.php b/tests/lib/Archive/TestBase.php
index 6475b49e549..3f2d8c9561e 100644
--- a/tests/lib/Archive/TestBase.php
+++ b/tests/lib/Archive/TestBase.php
@@ -24,7 +24,7 @@ abstract class TestBase extends \Test\TestCase {
*/
abstract protected function getNew();
- public function testGetFiles() {
+ public function testGetFiles(): void {
$this->instance = $this->getExisting();
$allFiles = $this->instance->getFiles();
$expected = ['lorem.txt','logo-wide.png','dir/', 'dir/lorem.txt'];
@@ -50,7 +50,7 @@ abstract class TestBase extends \Test\TestCase {
}
}
- public function testContent() {
+ public function testContent(): void {
$this->instance = $this->getExisting();
$dir = \OC::$SERVERROOT.'/tests/data';
$textFile = $dir.'/lorem.txt';
@@ -61,7 +61,7 @@ abstract class TestBase extends \Test\TestCase {
$this->assertEquals(file_get_contents($textFile), file_get_contents($tmpFile));
}
- public function testWrite() {
+ public function testWrite(): void {
$dir = \OC::$SERVERROOT.'/tests/data';
$textFile = $dir.'/lorem.txt';
$this->instance = $this->getNew();
@@ -76,7 +76,7 @@ abstract class TestBase extends \Test\TestCase {
$this->assertEquals('foobar', $this->instance->getFile('lorem.txt'));
}
- public function testReadStream() {
+ public function testReadStream(): void {
$dir = \OC::$SERVERROOT.'/tests/data';
$this->instance = $this->getExisting();
$fh = $this->instance->getStream('lorem.txt', 'r');
@@ -85,7 +85,7 @@ abstract class TestBase extends \Test\TestCase {
fclose($fh);
$this->assertEquals(file_get_contents($dir.'/lorem.txt'), $content);
}
- public function testWriteStream() {
+ public function testWriteStream(): void {
$dir = \OC::$SERVERROOT.'/tests/data';
$this->instance = $this->getNew();
$fh = $this->instance->getStream('lorem.txt', 'w');
@@ -96,7 +96,7 @@ abstract class TestBase extends \Test\TestCase {
$this->assertTrue($this->instance->fileExists('lorem.txt'));
$this->assertEquals(file_get_contents($dir.'/lorem.txt'), $this->instance->getFile('lorem.txt'));
}
- public function testFolder() {
+ public function testFolder(): void {
$this->instance = $this->getNew();
$this->assertFalse($this->instance->fileExists('/test'));
$this->assertFalse($this->instance->fileExists('/test/'));
@@ -107,7 +107,7 @@ abstract class TestBase extends \Test\TestCase {
$this->assertFalse($this->instance->fileExists('/test'));
$this->assertFalse($this->instance->fileExists('/test/'));
}
- public function testExtract() {
+ public function testExtract(): void {
$dir = \OC::$SERVERROOT.'/tests/data';
$this->instance = $this->getExisting();
$tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
@@ -118,7 +118,7 @@ abstract class TestBase extends \Test\TestCase {
$this->assertEquals(file_get_contents($dir.'/lorem.txt'), file_get_contents($tmpDir.'lorem.txt'));
\OCP\Files::rmdirr($tmpDir);
}
- public function testMoveRemove() {
+ public function testMoveRemove(): void {
$dir = \OC::$SERVERROOT.'/tests/data';
$textFile = $dir.'/lorem.txt';
$this->instance = $this->getNew();
@@ -131,7 +131,7 @@ abstract class TestBase extends \Test\TestCase {
$this->instance->remove('target.txt');
$this->assertFalse($this->instance->fileExists('target.txt'));
}
- public function testRecursive() {
+ public function testRecursive(): void {
$dir = \OC::$SERVERROOT.'/tests/data';
$this->instance = $this->getNew();
$this->instance->addRecursive('/dir', $dir);
diff --git a/tests/lib/Authentication/Events/RemoteWipeFinishedTest.php b/tests/lib/Authentication/Events/RemoteWipeFinishedTest.php
index c8fd688d154..c89b1e4108f 100644
--- a/tests/lib/Authentication/Events/RemoteWipeFinishedTest.php
+++ b/tests/lib/Authentication/Events/RemoteWipeFinishedTest.php
@@ -14,7 +14,7 @@ use OC\Authentication\Token\IToken;
use Test\TestCase;
class RemoteWipeFinishedTest extends TestCase {
- public function testGetToken() {
+ public function testGetToken(): void {
$token = $this->createMock(IToken::class);
$event = new RemoteWipeFinished($token);
diff --git a/tests/lib/Authentication/Events/RemoteWipeStartedTest.php b/tests/lib/Authentication/Events/RemoteWipeStartedTest.php
index 27bd10dea05..fc297f7c087 100644
--- a/tests/lib/Authentication/Events/RemoteWipeStartedTest.php
+++ b/tests/lib/Authentication/Events/RemoteWipeStartedTest.php
@@ -14,7 +14,7 @@ use OC\Authentication\Token\IToken;
use Test\TestCase;
class RemoteWipeStartedTest extends TestCase {
- public function testGetToken() {
+ public function testGetToken(): void {
$token = $this->createMock(IToken::class);
$event = new RemoteWipeStarted($token);
diff --git a/tests/lib/Authentication/Listeners/RemoteWipeActivityListenerTest.php b/tests/lib/Authentication/Listeners/RemoteWipeActivityListenerTest.php
index d1cbaae22fb..e2f957ab69a 100644
--- a/tests/lib/Authentication/Listeners/RemoteWipeActivityListenerTest.php
+++ b/tests/lib/Authentication/Listeners/RemoteWipeActivityListenerTest.php
@@ -43,7 +43,7 @@ class RemoteWipeActivityListenerTest extends TestCase {
);
}
- public function testHandleUnrelated() {
+ public function testHandleUnrelated(): void {
$event = new Event();
$this->listener->handle($event);
@@ -51,7 +51,7 @@ class RemoteWipeActivityListenerTest extends TestCase {
$this->addToAssertionCount(1);
}
- public function testHandleRemoteWipeStarted() {
+ public function testHandleRemoteWipeStarted(): void {
/** @var IToken|MockObject $token */
$token = $this->createMock(IToken::class);
$event = new RemoteWipeStarted($token);
@@ -87,7 +87,7 @@ class RemoteWipeActivityListenerTest extends TestCase {
$this->listener->handle($event);
}
- public function testHandleRemoteWipeStartedCanNotPublish() {
+ public function testHandleRemoteWipeStartedCanNotPublish(): void {
$token = $this->createMock(IToken::class);
$event = new RemoteWipeStarted($token);
$this->activityManager->expects($this->once())
@@ -99,7 +99,7 @@ class RemoteWipeActivityListenerTest extends TestCase {
$this->listener->handle($event);
}
- public function testHandleRemoteWipeFinished() {
+ public function testHandleRemoteWipeFinished(): void {
/** @var IToken|MockObject $token */
$token = $this->createMock(IToken::class);
$event = new RemoteWipeFinished($token);
diff --git a/tests/lib/Authentication/Listeners/RemoteWipeEmailListenerTest.php b/tests/lib/Authentication/Listeners/RemoteWipeEmailListenerTest.php
index 27dd85d9961..1c45add4e31 100644
--- a/tests/lib/Authentication/Listeners/RemoteWipeEmailListenerTest.php
+++ b/tests/lib/Authentication/Listeners/RemoteWipeEmailListenerTest.php
@@ -66,14 +66,14 @@ class RemoteWipeEmailListenerTest extends TestCase {
}
- public function testHandleUnrelated() {
+ public function testHandleUnrelated(): void {
$event = new Event();
$this->mailer->expects($this->never())->method('send');
$this->listener->handle($event);
}
- public function testHandleRemoteWipeStartedInvalidUser() {
+ public function testHandleRemoteWipeStartedInvalidUser(): void {
/** @var IToken|MockObject $token */
$token = $this->createMock(IToken::class);
$event = new RemoteWipeStarted($token);
@@ -87,7 +87,7 @@ class RemoteWipeEmailListenerTest extends TestCase {
$this->listener->handle($event);
}
- public function testHandleRemoteWipeStartedNoEmailSet() {
+ public function testHandleRemoteWipeStartedNoEmailSet(): void {
/** @var IToken|MockObject $token */
$token = $this->createMock(IToken::class);
$event = new RemoteWipeStarted($token);
@@ -103,7 +103,7 @@ class RemoteWipeEmailListenerTest extends TestCase {
$this->listener->handle($event);
}
- public function testHandleRemoteWipeStartedTransmissionError() {
+ public function testHandleRemoteWipeStartedTransmissionError(): void {
/** @var IToken|MockObject $token */
$token = $this->createMock(IToken::class);
$event = new RemoteWipeStarted($token);
@@ -123,7 +123,7 @@ class RemoteWipeEmailListenerTest extends TestCase {
$this->listener->handle($event);
}
- public function testHandleRemoteWipeStarted() {
+ public function testHandleRemoteWipeStarted(): void {
/** @var IToken|MockObject $token */
$token = $this->createMock(IToken::class);
$event = new RemoteWipeStarted($token);
@@ -148,7 +148,7 @@ class RemoteWipeEmailListenerTest extends TestCase {
$this->listener->handle($event);
}
- public function testHandleRemoteWipeFinishedInvalidUser() {
+ public function testHandleRemoteWipeFinishedInvalidUser(): void {
/** @var IToken|MockObject $token */
$token = $this->createMock(IToken::class);
$event = new RemoteWipeFinished($token);
@@ -162,7 +162,7 @@ class RemoteWipeEmailListenerTest extends TestCase {
$this->listener->handle($event);
}
- public function testHandleRemoteWipeFinishedNoEmailSet() {
+ public function testHandleRemoteWipeFinishedNoEmailSet(): void {
/** @var IToken|MockObject $token */
$token = $this->createMock(IToken::class);
$event = new RemoteWipeFinished($token);
@@ -178,7 +178,7 @@ class RemoteWipeEmailListenerTest extends TestCase {
$this->listener->handle($event);
}
- public function testHandleRemoteWipeFinishedTransmissionError() {
+ public function testHandleRemoteWipeFinishedTransmissionError(): void {
/** @var IToken|MockObject $token */
$token = $this->createMock(IToken::class);
$event = new RemoteWipeFinished($token);
@@ -198,7 +198,7 @@ class RemoteWipeEmailListenerTest extends TestCase {
$this->listener->handle($event);
}
- public function testHandleRemoteWipeFinished() {
+ public function testHandleRemoteWipeFinished(): void {
/** @var IToken|MockObject $token */
$token = $this->createMock(IToken::class);
$event = new RemoteWipeFinished($token);
diff --git a/tests/lib/Authentication/Listeners/RemoteWipeNotificationsListenerTest.php b/tests/lib/Authentication/Listeners/RemoteWipeNotificationsListenerTest.php
index d223f0d05a1..53fa502b199 100644
--- a/tests/lib/Authentication/Listeners/RemoteWipeNotificationsListenerTest.php
+++ b/tests/lib/Authentication/Listeners/RemoteWipeNotificationsListenerTest.php
@@ -44,7 +44,7 @@ class RemoteWipeNotificationsListenerTest extends TestCase {
);
}
- public function testHandleUnrelated() {
+ public function testHandleUnrelated(): void {
$event = new Event();
$this->listener->handle($event);
@@ -52,7 +52,7 @@ class RemoteWipeNotificationsListenerTest extends TestCase {
$this->addToAssertionCount(1);
}
- public function testHandleRemoteWipeStarted() {
+ public function testHandleRemoteWipeStarted(): void {
$token = $this->createMock(IToken::class);
$event = new RemoteWipeStarted($token);
$notification = $this->createMock(INotification::class);
@@ -92,7 +92,7 @@ class RemoteWipeNotificationsListenerTest extends TestCase {
$this->listener->handle($event);
}
- public function testHandleRemoteWipeFinished() {
+ public function testHandleRemoteWipeFinished(): void {
$token = $this->createMock(IToken::class);
$event = new RemoteWipeFinished($token);
$notification = $this->createMock(INotification::class);
diff --git a/tests/lib/Authentication/Login/ClearLostPasswordTokensCommandTest.php b/tests/lib/Authentication/Login/ClearLostPasswordTokensCommandTest.php
index 1a97f0e345b..025612e963e 100644
--- a/tests/lib/Authentication/Login/ClearLostPasswordTokensCommandTest.php
+++ b/tests/lib/Authentication/Login/ClearLostPasswordTokensCommandTest.php
@@ -27,7 +27,7 @@ class ClearLostPasswordTokensCommandTest extends ALoginCommandTest {
);
}
- public function testProcess() {
+ public function testProcess(): void {
$data = $this->getLoggedInLoginData();
$this->user->expects($this->once())
->method('getUID')
diff --git a/tests/lib/Authentication/Login/CompleteLoginCommandTest.php b/tests/lib/Authentication/Login/CompleteLoginCommandTest.php
index eeb39d5173d..4ddb26e7648 100644
--- a/tests/lib/Authentication/Login/CompleteLoginCommandTest.php
+++ b/tests/lib/Authentication/Login/CompleteLoginCommandTest.php
@@ -27,7 +27,7 @@ class CompleteLoginCommandTest extends ALoginCommandTest {
);
}
- public function testProcess() {
+ public function testProcess(): void {
$data = $this->getLoggedInLoginData();
$this->session->expects($this->once())
->method('completeLogin')
diff --git a/tests/lib/Authentication/Login/CreateSessionTokenCommandTest.php b/tests/lib/Authentication/Login/CreateSessionTokenCommandTest.php
index 049b6b1c94b..fd6a154ef5d 100644
--- a/tests/lib/Authentication/Login/CreateSessionTokenCommandTest.php
+++ b/tests/lib/Authentication/Login/CreateSessionTokenCommandTest.php
@@ -34,7 +34,7 @@ class CreateSessionTokenCommandTest extends ALoginCommandTest {
);
}
- public function testProcess() {
+ public function testProcess(): void {
$data = $this->getLoggedInLoginData();
$this->config->expects($this->once())
->method('getSystemValueInt')
@@ -67,7 +67,7 @@ class CreateSessionTokenCommandTest extends ALoginCommandTest {
$this->assertTrue($result->isSuccess());
}
- public function testProcessDoNotRemember() {
+ public function testProcessDoNotRemember(): void {
$data = $this->getLoggedInLoginData();
$this->config->expects($this->once())
->method('getSystemValueInt')
diff --git a/tests/lib/Authentication/Login/EmailLoginCommandTest.php b/tests/lib/Authentication/Login/EmailLoginCommandTest.php
index 236825e77bb..b34d0d95f4f 100644
--- a/tests/lib/Authentication/Login/EmailLoginCommandTest.php
+++ b/tests/lib/Authentication/Login/EmailLoginCommandTest.php
@@ -28,7 +28,7 @@ class EmailLoginCommandTest extends ALoginCommandTest {
);
}
- public function testProcessAlreadyLoggedIn() {
+ public function testProcessAlreadyLoggedIn(): void {
$data = $this->getLoggedInLoginData();
$result = $this->cmd->process($data);
@@ -36,7 +36,7 @@ class EmailLoginCommandTest extends ALoginCommandTest {
$this->assertTrue($result->isSuccess());
}
- public function testProcessNotAnEmailLogin() {
+ public function testProcessNotAnEmailLogin(): void {
$data = $this->getFailedLoginData();
$this->userManager->expects($this->never())
->method('getByEmail')
@@ -48,7 +48,7 @@ class EmailLoginCommandTest extends ALoginCommandTest {
$this->assertTrue($result->isSuccess());
}
- public function testProcessDuplicateEmailLogin() {
+ public function testProcessDuplicateEmailLogin(): void {
$data = $this->getFailedLoginData();
$data->setUsername('user@example.com');
$this->userManager->expects($this->once())
@@ -64,7 +64,7 @@ class EmailLoginCommandTest extends ALoginCommandTest {
$this->assertTrue($result->isSuccess());
}
- public function testProcessUidIsEmail() {
+ public function testProcessUidIsEmail(): void {
$email = 'user@domain.com';
$data = $this->getFailedLoginData();
$data->setUsername($email);
@@ -88,7 +88,7 @@ class EmailLoginCommandTest extends ALoginCommandTest {
$this->assertEquals($email, $data->getUsername());
}
- public function testProcessWrongPassword() {
+ public function testProcessWrongPassword(): void {
$email = 'user@domain.com';
$data = $this->getFailedLoginData();
$data->setUsername($email);
@@ -117,7 +117,7 @@ class EmailLoginCommandTest extends ALoginCommandTest {
$this->assertEquals($email, $data->getUsername());
}
- public function testProcess() {
+ public function testProcess(): void {
$email = 'user@domain.com';
$data = $this->getFailedLoginData();
$data->setUsername($email);
diff --git a/tests/lib/Authentication/Login/FinishRememberedLoginCommandTest.php b/tests/lib/Authentication/Login/FinishRememberedLoginCommandTest.php
index 9f9a36faf9f..4eb4f94055f 100644
--- a/tests/lib/Authentication/Login/FinishRememberedLoginCommandTest.php
+++ b/tests/lib/Authentication/Login/FinishRememberedLoginCommandTest.php
@@ -32,7 +32,7 @@ class FinishRememberedLoginCommandTest extends ALoginCommandTest {
);
}
- public function testProcessNotRememberedLogin() {
+ public function testProcessNotRememberedLogin(): void {
$data = $this->getLoggedInLoginData();
$data->setRememberLogin(false);
$this->userSession->expects($this->never())
@@ -43,7 +43,7 @@ class FinishRememberedLoginCommandTest extends ALoginCommandTest {
$this->assertTrue($result->isSuccess());
}
- public function testProcess() {
+ public function testProcess(): void {
$data = $this->getLoggedInLoginData();
$this->config->expects($this->once())
->method('getSystemValueBool')
@@ -58,7 +58,7 @@ class FinishRememberedLoginCommandTest extends ALoginCommandTest {
$this->assertTrue($result->isSuccess());
}
- public function testProcessNotRemeberedLoginWithAutologout() {
+ public function testProcessNotRemeberedLoginWithAutologout(): void {
$data = $this->getLoggedInLoginData();
$this->config->expects($this->once())
->method('getSystemValueBool')
diff --git a/tests/lib/Authentication/Login/LoggedInCheckCommandTest.php b/tests/lib/Authentication/Login/LoggedInCheckCommandTest.php
index bb5d6235f86..ce783050921 100644
--- a/tests/lib/Authentication/Login/LoggedInCheckCommandTest.php
+++ b/tests/lib/Authentication/Login/LoggedInCheckCommandTest.php
@@ -34,7 +34,7 @@ class LoggedInCheckCommandTest extends ALoginCommandTest {
);
}
- public function testProcessSuccessfulLogin() {
+ public function testProcessSuccessfulLogin(): void {
$data = $this->getLoggedInLoginData();
$result = $this->cmd->process($data);
@@ -42,7 +42,7 @@ class LoggedInCheckCommandTest extends ALoginCommandTest {
$this->assertTrue($result->isSuccess());
}
- public function testProcessFailedLogin() {
+ public function testProcessFailedLogin(): void {
$data = $this->getFailedLoginData();
$this->logger->expects($this->once())
->method('warning');
diff --git a/tests/lib/Authentication/Login/PreLoginHookCommandTest.php b/tests/lib/Authentication/Login/PreLoginHookCommandTest.php
index 824042e1dee..b6d826f1c21 100644
--- a/tests/lib/Authentication/Login/PreLoginHookCommandTest.php
+++ b/tests/lib/Authentication/Login/PreLoginHookCommandTest.php
@@ -28,7 +28,7 @@ class PreLoginHookCommandTest extends ALoginCommandTest {
);
}
- public function testProcess() {
+ public function testProcess(): void {
$data = $this->getBasicLoginData();
$this->userManager->expects($this->once())
->method('emit')
diff --git a/tests/lib/Authentication/Login/SetUserTimezoneCommandTest.php b/tests/lib/Authentication/Login/SetUserTimezoneCommandTest.php
index 068516b933b..d4e15f68257 100644
--- a/tests/lib/Authentication/Login/SetUserTimezoneCommandTest.php
+++ b/tests/lib/Authentication/Login/SetUserTimezoneCommandTest.php
@@ -33,7 +33,7 @@ class SetUserTimezoneCommandTest extends ALoginCommandTest {
);
}
- public function testProcessNoTimezoneSet() {
+ public function testProcessNoTimezoneSet(): void {
$data = $this->getLoggedInLoginData();
$this->config->expects($this->never())
->method('setUserValue');
@@ -45,7 +45,7 @@ class SetUserTimezoneCommandTest extends ALoginCommandTest {
$this->assertTrue($result->isSuccess());
}
- public function testProcess() {
+ public function testProcess(): void {
$data = $this->getLoggedInLoginDataWithTimezone();
$this->user->expects($this->once())
->method('getUID')
diff --git a/tests/lib/Authentication/Login/TwoFactorCommandTest.php b/tests/lib/Authentication/Login/TwoFactorCommandTest.php
index 54f634618fd..af7d7446bfb 100644
--- a/tests/lib/Authentication/Login/TwoFactorCommandTest.php
+++ b/tests/lib/Authentication/Login/TwoFactorCommandTest.php
@@ -42,7 +42,7 @@ class TwoFactorCommandTest extends ALoginCommandTest {
);
}
- public function testNotTwoFactorAuthenticated() {
+ public function testNotTwoFactorAuthenticated(): void {
$data = $this->getLoggedInLoginData();
$this->twoFactorManager->expects($this->once())
->method('isTwoFactorAuthenticated')
@@ -55,7 +55,7 @@ class TwoFactorCommandTest extends ALoginCommandTest {
$this->assertTrue($result->isSuccess());
}
- public function testProcessOneActiveProvider() {
+ public function testProcessOneActiveProvider(): void {
$data = $this->getLoggedInLoginData();
$this->twoFactorManager->expects($this->once())
->method('isTwoFactorAuthenticated')
@@ -99,7 +99,7 @@ class TwoFactorCommandTest extends ALoginCommandTest {
$this->assertEquals('two/factor/url', $result->getRedirectUrl());
}
- public function testProcessMissingProviders() {
+ public function testProcessMissingProviders(): void {
$data = $this->getLoggedInLoginData();
$this->twoFactorManager->expects($this->once())
->method('isTwoFactorAuthenticated')
@@ -140,7 +140,7 @@ class TwoFactorCommandTest extends ALoginCommandTest {
$this->assertEquals('two/factor/url', $result->getRedirectUrl());
}
- public function testProcessTwoActiveProviders() {
+ public function testProcessTwoActiveProviders(): void {
$data = $this->getLoggedInLoginData();
$this->twoFactorManager->expects($this->once())
->method('isTwoFactorAuthenticated')
@@ -186,7 +186,7 @@ class TwoFactorCommandTest extends ALoginCommandTest {
$this->assertEquals('two/factor/url', $result->getRedirectUrl());
}
- public function testProcessFailingProviderAndEnforcedButNoSetupProviders() {
+ public function testProcessFailingProviderAndEnforcedButNoSetupProviders(): void {
$data = $this->getLoggedInLoginData();
$this->twoFactorManager->expects($this->once())
->method('isTwoFactorAuthenticated')
@@ -221,7 +221,7 @@ class TwoFactorCommandTest extends ALoginCommandTest {
$this->assertEquals('two/factor/url', $result->getRedirectUrl());
}
- public function testProcessFailingProviderAndEnforced() {
+ public function testProcessFailingProviderAndEnforced(): void {
$data = $this->getLoggedInLoginData();
$this->twoFactorManager->expects($this->once())
->method('isTwoFactorAuthenticated')
@@ -259,7 +259,7 @@ class TwoFactorCommandTest extends ALoginCommandTest {
$this->assertEquals('two/factor/url', $result->getRedirectUrl());
}
- public function testProcessNoProvidersButEnforced() {
+ public function testProcessNoProvidersButEnforced(): void {
$data = $this->getLoggedInLoginData();
$this->twoFactorManager->expects($this->once())
->method('isTwoFactorAuthenticated')
@@ -294,7 +294,7 @@ class TwoFactorCommandTest extends ALoginCommandTest {
$this->assertEquals('two/factor/url', $result->getRedirectUrl());
}
- public function testProcessWithRedirectUrl() {
+ public function testProcessWithRedirectUrl(): void {
$data = $this->getLoggedInLoginDataWithRedirectUrl();
$this->twoFactorManager->expects($this->once())
->method('isTwoFactorAuthenticated')
diff --git a/tests/lib/Authentication/Login/UidLoginCommandTest.php b/tests/lib/Authentication/Login/UidLoginCommandTest.php
index e56c4323fd4..3073aac1859 100644
--- a/tests/lib/Authentication/Login/UidLoginCommandTest.php
+++ b/tests/lib/Authentication/Login/UidLoginCommandTest.php
@@ -27,7 +27,7 @@ class UidLoginCommandTest extends ALoginCommandTest {
);
}
- public function testProcessFailingLogin() {
+ public function testProcessFailingLogin(): void {
$data = $this->getBasicLoginData();
$this->userManager->expects($this->once())
->method('checkPasswordNoLogging')
@@ -43,7 +43,7 @@ class UidLoginCommandTest extends ALoginCommandTest {
$this->assertFalse($data->getUser());
}
- public function testProcess() {
+ public function testProcess(): void {
$data = $this->getBasicLoginData();
$this->userManager->expects($this->once())
->method('checkPasswordNoLogging')
diff --git a/tests/lib/Authentication/Login/UpdateLastPasswordConfirmCommandTest.php b/tests/lib/Authentication/Login/UpdateLastPasswordConfirmCommandTest.php
index d471b73659f..f5760f3f232 100644
--- a/tests/lib/Authentication/Login/UpdateLastPasswordConfirmCommandTest.php
+++ b/tests/lib/Authentication/Login/UpdateLastPasswordConfirmCommandTest.php
@@ -27,7 +27,7 @@ class UpdateLastPasswordConfirmCommandTest extends ALoginCommandTest {
);
}
- public function testProcess() {
+ public function testProcess(): void {
$data = $this->getLoggedInLoginData();
$this->user->expects($this->once())
->method('getLastLogin')
diff --git a/tests/lib/Authentication/Login/UserDisabledCheckCommandTest.php b/tests/lib/Authentication/Login/UserDisabledCheckCommandTest.php
index a36fb5c70bd..84b1018e5fa 100644
--- a/tests/lib/Authentication/Login/UserDisabledCheckCommandTest.php
+++ b/tests/lib/Authentication/Login/UserDisabledCheckCommandTest.php
@@ -34,7 +34,7 @@ class UserDisabledCheckCommandTest extends ALoginCommandTest {
);
}
- public function testProcessNonExistingUser() {
+ public function testProcessNonExistingUser(): void {
$data = $this->getBasicLoginData();
$this->userManager->expects($this->once())
->method('get')
@@ -46,7 +46,7 @@ class UserDisabledCheckCommandTest extends ALoginCommandTest {
$this->assertTrue($result->isSuccess());
}
- public function testProcessDisabledUser() {
+ public function testProcessDisabledUser(): void {
$data = $this->getBasicLoginData();
$this->userManager->expects($this->once())
->method('get')
@@ -62,7 +62,7 @@ class UserDisabledCheckCommandTest extends ALoginCommandTest {
$this->assertSame(LoginController::LOGIN_MSG_USERDISABLED, $result->getErrorMessage());
}
- public function testProcess() {
+ public function testProcess(): void {
$data = $this->getBasicLoginData();
$this->userManager->expects($this->once())
->method('get')
diff --git a/tests/lib/Authentication/LoginCredentials/CredentialsTest.php b/tests/lib/Authentication/LoginCredentials/CredentialsTest.php
index ed3ea469653..a64ad6c9b76 100644
--- a/tests/lib/Authentication/LoginCredentials/CredentialsTest.php
+++ b/tests/lib/Authentication/LoginCredentials/CredentialsTest.php
@@ -33,15 +33,15 @@ class CredentialsTest extends TestCase {
$this->credentials = new Credentials($this->uid, $this->user, $this->password);
}
- public function testGetUID() {
+ public function testGetUID(): void {
$this->assertEquals($this->uid, $this->credentials->getUID());
}
- public function testGetUserName() {
+ public function testGetUserName(): void {
$this->assertEquals($this->user, $this->credentials->getLoginName());
}
- public function testGetPassword() {
+ public function testGetPassword(): void {
$this->assertEquals($this->password, $this->credentials->getPassword());
}
}
diff --git a/tests/lib/Authentication/LoginCredentials/StoreTest.php b/tests/lib/Authentication/LoginCredentials/StoreTest.php
index 06dd2527930..6f1e3a6d750 100644
--- a/tests/lib/Authentication/LoginCredentials/StoreTest.php
+++ b/tests/lib/Authentication/LoginCredentials/StoreTest.php
@@ -43,7 +43,7 @@ class StoreTest extends TestCase {
$this->store = new Store($this->session, $this->logger, $this->tokenProvider);
}
- public function testAuthenticate() {
+ public function testAuthenticate(): void {
$params = [
'run' => true,
'uid' => 'user123',
@@ -57,14 +57,14 @@ class StoreTest extends TestCase {
$this->store->authenticate($params);
}
- public function testSetSession() {
+ public function testSetSession(): void {
$session = $this->createMock(ISession::class);
$this->store->setSession($session);
$this->addToAssertionCount(1);
}
- public function testGetLoginCredentialsNoTokenProvider() {
+ public function testGetLoginCredentialsNoTokenProvider(): void {
$this->store = new Store($this->session, $this->logger, null);
$this->expectException(CredentialsUnavailableException::class);
@@ -72,7 +72,7 @@ class StoreTest extends TestCase {
$this->store->getLoginCredentials();
}
- public function testGetLoginCredentials() {
+ public function testGetLoginCredentials(): void {
$uid = 'uid';
$user = 'user123';
$password = 'passme';
@@ -101,7 +101,7 @@ class StoreTest extends TestCase {
$this->assertEquals($expected, $creds);
}
- public function testGetLoginCredentialsSessionNotAvailable() {
+ public function testGetLoginCredentialsSessionNotAvailable(): void {
$this->session->expects($this->once())
->method('getId')
->will($this->throwException(new SessionNotAvailableException()));
@@ -110,7 +110,7 @@ class StoreTest extends TestCase {
$this->store->getLoginCredentials();
}
- public function testGetLoginCredentialsInvalidToken() {
+ public function testGetLoginCredentialsInvalidToken(): void {
$this->session->expects($this->once())
->method('getId')
->willReturn('sess2233');
@@ -123,7 +123,7 @@ class StoreTest extends TestCase {
$this->store->getLoginCredentials();
}
- public function testGetLoginCredentialsPartialCredentialsAndSessionName() {
+ public function testGetLoginCredentialsPartialCredentialsAndSessionName(): void {
$uid = 'id987';
$user = 'user987';
$password = '7389374';
@@ -161,7 +161,7 @@ class StoreTest extends TestCase {
$this->assertEquals($expected, $actual);
}
- public function testGetLoginCredentialsPartialCredentials() {
+ public function testGetLoginCredentialsPartialCredentials(): void {
$uid = 'id987';
$password = '7389374';
@@ -198,7 +198,7 @@ class StoreTest extends TestCase {
$this->assertEquals($expected, $actual);
}
- public function testGetLoginCredentialsInvalidTokenLoginCredentials() {
+ public function testGetLoginCredentialsInvalidTokenLoginCredentials(): void {
$uid = 'id987';
$user = 'user987';
$password = '7389374';
@@ -225,7 +225,7 @@ class StoreTest extends TestCase {
$this->assertEquals($expected, $actual);
}
- public function testGetLoginCredentialsPasswordlessToken() {
+ public function testGetLoginCredentialsPasswordlessToken(): void {
$this->session->expects($this->once())
->method('getId')
->willReturn('sess2233');
diff --git a/tests/lib/Authentication/Token/ManagerTest.php b/tests/lib/Authentication/Token/ManagerTest.php
index 98baffed14b..4fde9817d09 100644
--- a/tests/lib/Authentication/Token/ManagerTest.php
+++ b/tests/lib/Authentication/Token/ManagerTest.php
@@ -33,7 +33,7 @@ class ManagerTest extends TestCase {
);
}
- public function testGenerateToken() {
+ public function testGenerateToken(): void {
$token = new PublicKeyToken();
$this->publicKeyTokenProvider->expects($this->once())
@@ -61,7 +61,7 @@ class ManagerTest extends TestCase {
$this->assertSame($token, $actual);
}
- public function testGenerateConflictingToken() {
+ public function testGenerateConflictingToken(): void {
/** @var MockObject|UniqueConstraintViolationException $exception */
$exception = $this->createMock(UniqueConstraintViolationException::class);
@@ -97,7 +97,7 @@ class ManagerTest extends TestCase {
$this->assertSame($token, $actual);
}
- public function testGenerateTokenTooLongName() {
+ public function testGenerateTokenTooLongName(): void {
$token = $this->createMock(IToken::class);
$token->method('getName')
->willReturn(str_repeat('a', 120) . '…');
@@ -160,7 +160,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider tokenData
*/
- public function testUpdateToken(IToken $token) {
+ public function testUpdateToken(IToken $token): void {
$this->setNoCall($token);
$this->setCall($token, 'updateToken');
$this->setException($token);
@@ -171,7 +171,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider tokenData
*/
- public function testUpdateTokenActivity(IToken $token) {
+ public function testUpdateTokenActivity(IToken $token): void {
$this->setNoCall($token);
$this->setCall($token, 'updateTokenActivity');
$this->setException($token);
@@ -182,7 +182,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider tokenData
*/
- public function testGetPassword(IToken $token) {
+ public function testGetPassword(IToken $token): void {
$this->setNoCall($token);
$this->setCall($token, 'getPassword', 'password');
$this->setException($token);
@@ -195,7 +195,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider tokenData
*/
- public function testSetPassword(IToken $token) {
+ public function testSetPassword(IToken $token): void {
$this->setNoCall($token);
$this->setCall($token, 'setPassword');
$this->setException($token);
@@ -203,7 +203,7 @@ class ManagerTest extends TestCase {
$this->manager->setPassword($token, 'tokenId', 'password');
}
- public function testInvalidateTokens() {
+ public function testInvalidateTokens(): void {
$this->publicKeyTokenProvider->expects($this->once())
->method('invalidateToken')
->with('token');
@@ -211,7 +211,7 @@ class ManagerTest extends TestCase {
$this->manager->invalidateToken('token');
}
- public function testInvalidateTokenById() {
+ public function testInvalidateTokenById(): void {
$this->publicKeyTokenProvider->expects($this->once())
->method('invalidateTokenById')
->with('uid', 42);
@@ -219,14 +219,14 @@ class ManagerTest extends TestCase {
$this->manager->invalidateTokenById('uid', 42);
}
- public function testInvalidateOldTokens() {
+ public function testInvalidateOldTokens(): void {
$this->publicKeyTokenProvider->expects($this->once())
->method('invalidateOldTokens');
$this->manager->invalidateOldTokens();
}
- public function testInvalidateLastUsedBefore() {
+ public function testInvalidateLastUsedBefore(): void {
$this->publicKeyTokenProvider->expects($this->once())
->method('invalidateLastUsedBefore')
->with('user', 946684800);
@@ -234,7 +234,7 @@ class ManagerTest extends TestCase {
$this->manager->invalidateLastUsedBefore('user', 946684800);
}
- public function testGetTokenByUser() {
+ public function testGetTokenByUser(): void {
$t1 = new PublicKeyToken();
$t2 = new PublicKeyToken();
@@ -247,7 +247,7 @@ class ManagerTest extends TestCase {
$this->assertEquals([$t1, $t2], $result);
}
- public function testRenewSessionTokenPublicKey() {
+ public function testRenewSessionTokenPublicKey(): void {
$this->publicKeyTokenProvider->expects($this->once())
->method('renewSessionToken')
->with('oldId', 'newId');
@@ -255,7 +255,7 @@ class ManagerTest extends TestCase {
$this->manager->renewSessionToken('oldId', 'newId');
}
- public function testRenewSessionInvalid() {
+ public function testRenewSessionInvalid(): void {
$this->publicKeyTokenProvider->expects($this->once())
->method('renewSessionToken')
->with('oldId', 'newId')
@@ -265,7 +265,7 @@ class ManagerTest extends TestCase {
$this->manager->renewSessionToken('oldId', 'newId');
}
- public function testGetTokenByIdPublicKey() {
+ public function testGetTokenByIdPublicKey(): void {
$token = $this->createMock(IToken::class);
$this->publicKeyTokenProvider->expects($this->once())
@@ -276,7 +276,7 @@ class ManagerTest extends TestCase {
$this->assertSame($token, $this->manager->getTokenById(42));
}
- public function testGetTokenByIdInvalid() {
+ public function testGetTokenByIdInvalid(): void {
$this->publicKeyTokenProvider->expects($this->once())
->method('getTokenById')
->with(42)
@@ -286,7 +286,7 @@ class ManagerTest extends TestCase {
$this->manager->getTokenById(42);
}
- public function testGetTokenPublicKey() {
+ public function testGetTokenPublicKey(): void {
$token = new PublicKeyToken();
$this->publicKeyTokenProvider
@@ -297,7 +297,7 @@ class ManagerTest extends TestCase {
$this->assertSame($token, $this->manager->getToken('tokenId'));
}
- public function testGetTokenInvalid() {
+ public function testGetTokenInvalid(): void {
$this->publicKeyTokenProvider
->method('getToken')
->with('tokenId')
@@ -307,12 +307,12 @@ class ManagerTest extends TestCase {
$this->manager->getToken('tokenId');
}
- public function testRotateInvalid() {
+ public function testRotateInvalid(): void {
$this->expectException(InvalidTokenException::class);
$this->manager->rotate($this->createMock(IToken::class), 'oldId', 'newId');
}
- public function testRotatePublicKey() {
+ public function testRotatePublicKey(): void {
$token = new PublicKeyToken();
$this->publicKeyTokenProvider
@@ -323,7 +323,7 @@ class ManagerTest extends TestCase {
$this->assertSame($token, $this->manager->rotate($token, 'oldId', 'newId'));
}
- public function testMarkPasswordInvalidPublicKey() {
+ public function testMarkPasswordInvalidPublicKey(): void {
$token = $this->createMock(PublicKeyToken::class);
$this->publicKeyTokenProvider->expects($this->once())
@@ -333,13 +333,13 @@ class ManagerTest extends TestCase {
$this->manager->markPasswordInvalid($token, 'tokenId');
}
- public function testMarkPasswordInvalidInvalidToken() {
+ public function testMarkPasswordInvalidInvalidToken(): void {
$this->expectException(InvalidTokenException::class);
$this->manager->markPasswordInvalid($this->createMock(IToken::class), 'tokenId');
}
- public function testUpdatePasswords() {
+ public function testUpdatePasswords(): void {
$this->publicKeyTokenProvider->expects($this->once())
->method('updatePasswords')
->with('uid', 'pass');
@@ -347,7 +347,7 @@ class ManagerTest extends TestCase {
$this->manager->updatePasswords('uid', 'pass');
}
- public function testInvalidateTokensOfUserNoClientName() {
+ public function testInvalidateTokensOfUserNoClientName(): void {
$t1 = new PublicKeyToken();
$t2 = new PublicKeyToken();
$t1->setId(123);
@@ -368,7 +368,7 @@ class ManagerTest extends TestCase {
$this->manager->invalidateTokensOfUser('theUser', null);
}
- public function testInvalidateTokensOfUserClientNameGiven() {
+ public function testInvalidateTokensOfUserClientNameGiven(): void {
$t1 = new PublicKeyToken();
$t2 = new PublicKeyToken();
$t3 = new PublicKeyToken();
diff --git a/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php b/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php
index 137618a965a..7cc4e77ecb2 100644
--- a/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php
+++ b/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php
@@ -121,7 +121,7 @@ class PublicKeyTokenMapperTest extends TestCase {
return (int)$result['count'];
}
- public function testInvalidate() {
+ public function testInvalidate(): void {
$token = '9c5a2e661482b65597408a6bb6c4a3d1af36337381872ac56e445a06cdb7fea2b1039db707545c11027a4966919918b19d875a8b774840b18c6cbb7ae56fe206';
$this->mapper->invalidate($token);
@@ -129,7 +129,7 @@ class PublicKeyTokenMapperTest extends TestCase {
$this->assertSame(4, $this->getNumberOfTokens());
}
- public function testInvalidateInvalid() {
+ public function testInvalidateInvalid(): void {
$token = 'youwontfindthisoneinthedatabase';
$this->mapper->invalidate($token);
@@ -137,7 +137,7 @@ class PublicKeyTokenMapperTest extends TestCase {
$this->assertSame(5, $this->getNumberOfTokens());
}
- public function testInvalidateOld() {
+ public function testInvalidateOld(): void {
$olderThan = $this->time - 60 * 60; // One hour
$this->mapper->invalidateOld($olderThan);
@@ -145,7 +145,7 @@ class PublicKeyTokenMapperTest extends TestCase {
$this->assertSame(4, $this->getNumberOfTokens());
}
- public function testInvalidateLastUsedBefore() {
+ public function testInvalidateLastUsedBefore(): void {
$before = $this->time - 60 * 2; // Two minutes
$this->mapper->invalidateLastUsedBefore('user3', $before);
@@ -153,7 +153,7 @@ class PublicKeyTokenMapperTest extends TestCase {
$this->assertSame(4, $this->getNumberOfTokens());
}
- public function testGetToken() {
+ public function testGetToken(): void {
$token = new PublicKeyToken();
$token->setUid('user2');
$token->setLoginName('User2');
@@ -177,7 +177,7 @@ class PublicKeyTokenMapperTest extends TestCase {
}
- public function testGetInvalidToken() {
+ public function testGetInvalidToken(): void {
$this->expectException(\OCP\AppFramework\Db\DoesNotExistException::class);
$token = 'thisisaninvalidtokenthatisnotinthedatabase';
@@ -185,7 +185,7 @@ class PublicKeyTokenMapperTest extends TestCase {
$this->mapper->getToken($token);
}
- public function testGetTokenById() {
+ public function testGetTokenById(): void {
$token = new PublicKeyToken();
$token->setUid('user2');
$token->setLoginName('User2');
@@ -209,14 +209,14 @@ class PublicKeyTokenMapperTest extends TestCase {
}
- public function testGetTokenByIdNotFound() {
+ public function testGetTokenByIdNotFound(): void {
$this->expectException(\OCP\AppFramework\Db\DoesNotExistException::class);
$this->mapper->getTokenById(-1);
}
- public function testGetInvalidTokenById() {
+ public function testGetInvalidTokenById(): void {
$this->expectException(\OCP\AppFramework\Db\DoesNotExistException::class);
$id = '42';
@@ -224,15 +224,15 @@ class PublicKeyTokenMapperTest extends TestCase {
$this->mapper->getToken($id);
}
- public function testGetTokenByUser() {
+ public function testGetTokenByUser(): void {
$this->assertCount(2, $this->mapper->getTokenByUser('user1'));
}
- public function testGetTokenByUserNotFound() {
+ public function testGetTokenByUserNotFound(): void {
$this->assertCount(0, $this->mapper->getTokenByUser('user1000'));
}
- public function testGetById() {
+ public function testGetById(): void {
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
$user = $this->createMock(IUser::class);
$qb = $this->dbConnection->getQueryBuilder();
@@ -246,7 +246,7 @@ class PublicKeyTokenMapperTest extends TestCase {
$this->assertEquals('user1', $token->getUID());
}
- public function testDeleteByName() {
+ public function testDeleteByName(): void {
$qb = $this->dbConnection->getQueryBuilder();
$qb->select('name')
->from('authtoken')
@@ -257,7 +257,7 @@ class PublicKeyTokenMapperTest extends TestCase {
$this->assertEquals(4, $this->getNumberOfTokens());
}
- public function testHasExpiredTokens() {
+ public function testHasExpiredTokens(): void {
$this->assertFalse($this->mapper->hasExpiredTokens('user1'));
$this->assertTrue($this->mapper->hasExpiredTokens('user3'));
}
diff --git a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
index e2ca4350f29..be90d60c64f 100644
--- a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
+++ b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
@@ -84,7 +84,7 @@ class PublicKeyTokenProviderTest extends TestCase {
);
}
- public function testGenerateToken() {
+ public function testGenerateToken(): void {
$token = 'tokentokentokentokentoken';
$uid = 'user';
$user = 'User';
@@ -129,7 +129,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->getPassword($actual, $token);
}
- public function testGenerateTokenLongPassword() {
+ public function testGenerateTokenLongPassword(): void {
$token = 'tokentokentokentokentoken';
$uid = 'user';
$user = 'User';
@@ -148,7 +148,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$actual = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
}
- public function testGenerateTokenInvalidName() {
+ public function testGenerateTokenInvalidName(): void {
$token = 'tokentokentokentokentoken';
$uid = 'user';
$user = 'User';
@@ -173,7 +173,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->assertSame($password, $this->tokenProvider->getPassword($actual, $token));
}
- public function testUpdateToken() {
+ public function testUpdateToken(): void {
$tk = new PublicKeyToken();
$this->mapper->expects($this->once())
->method('updateActivity')
@@ -189,7 +189,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->assertEquals($this->time, $tk->getLastActivity());
}
- public function testUpdateTokenDebounce() {
+ public function testUpdateTokenDebounce(): void {
$tk = new PublicKeyToken();
$this->config->method('getSystemValueInt')
->willReturnCallback(function ($value, $default) {
@@ -204,7 +204,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->updateTokenActivity($tk);
}
- public function testGetTokenByUser() {
+ public function testGetTokenByUser(): void {
$this->mapper->expects($this->once())
->method('getTokenByUser')
->with('uid')
@@ -213,7 +213,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->assertEquals(['token'], $this->tokenProvider->getTokenByUser('uid'));
}
- public function testGetPassword() {
+ public function testGetPassword(): void {
$token = 'tokentokentokentokentoken';
$uid = 'user';
$user = 'User';
@@ -231,7 +231,7 @@ class PublicKeyTokenProviderTest extends TestCase {
}
- public function testGetPasswordPasswordLessToken() {
+ public function testGetPasswordPasswordLessToken(): void {
$this->expectException(\OC\Authentication\Exceptions\PasswordlessTokenException::class);
$token = 'token1234';
@@ -242,7 +242,7 @@ class PublicKeyTokenProviderTest extends TestCase {
}
- public function testGetPasswordInvalidToken() {
+ public function testGetPasswordInvalidToken(): void {
$this->expectException(\OC\Authentication\Exceptions\InvalidTokenException::class);
$token = 'tokentokentokentokentoken';
@@ -261,7 +261,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->getPassword($actual, 'wrongtoken');
}
- public function testSetPassword() {
+ public function testSetPassword(): void {
$token = 'tokentokentokentokentoken';
$uid = 'user';
$user = 'User';
@@ -293,7 +293,7 @@ class PublicKeyTokenProviderTest extends TestCase {
}
- public function testSetPasswordInvalidToken() {
+ public function testSetPasswordInvalidToken(): void {
$this->expectException(\OC\Authentication\Exceptions\InvalidTokenException::class);
$token = $this->createMock(IToken::class);
@@ -303,7 +303,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->setPassword($token, $tokenId, $password);
}
- public function testInvalidateToken() {
+ public function testInvalidateToken(): void {
$this->mapper->expects($this->exactly(2))
->method('invalidate')
->withConsecutive(
@@ -314,7 +314,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->invalidateToken('token7');
}
- public function testInvalidateTokenById() {
+ public function testInvalidateTokenById(): void {
$id = 123;
$this->mapper->expects($this->once())
@@ -348,7 +348,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->invalidateOldTokens();
}
- public function testInvalidateLastUsedBefore() {
+ public function testInvalidateLastUsedBefore(): void {
$this->mapper->expects($this->once())
->method('invalidateLastUsedBefore')
->with('user', 946684800);
@@ -356,7 +356,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->invalidateLastUsedBefore('user', 946684800);
}
- public function testRenewSessionTokenWithoutPassword() {
+ public function testRenewSessionTokenWithoutPassword(): void {
$token = 'oldIdtokentokentokentoken';
$uid = 'user';
$user = 'User';
@@ -450,7 +450,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->assertSame($token, $this->tokenProvider->getToken('unhashedTokentokentokentokentoken'));
}
- public function testGetInvalidToken() {
+ public function testGetInvalidToken(): void {
$this->expectException(InvalidTokenException::class);
$this->mapper->expects($this->exactly(2))
@@ -467,7 +467,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->getToken('unhashedTokentokentokentokentoken');
}
- public function testGetExpiredToken() {
+ public function testGetExpiredToken(): void {
$token = 'tokentokentokentokentoken';
$uid = 'user';
$user = 'User';
@@ -493,7 +493,7 @@ class PublicKeyTokenProviderTest extends TestCase {
}
}
- public function testGetTokenById() {
+ public function testGetTokenById(): void {
$token = $this->createMock(PublicKeyToken::class);
$this->mapper->expects($this->once())
@@ -504,7 +504,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->assertSame($token, $this->tokenProvider->getTokenById(42));
}
- public function testGetInvalidTokenById() {
+ public function testGetInvalidTokenById(): void {
$this->expectException(InvalidTokenException::class);
$this->mapper->expects($this->once())
@@ -515,7 +515,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->getTokenById(42);
}
- public function testGetExpiredTokenById() {
+ public function testGetExpiredTokenById(): void {
$token = new PublicKeyToken();
$token->setExpires(42);
@@ -532,7 +532,7 @@ class PublicKeyTokenProviderTest extends TestCase {
}
}
- public function testRotate() {
+ public function testRotate(): void {
$token = 'oldtokentokentokentokentoken';
$uid = 'user';
$user = 'User';
@@ -551,7 +551,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->assertSame('password', $this->tokenProvider->getPassword($new, 'newtokentokentokentokentoken'));
}
- public function testRotateNoPassword() {
+ public function testRotateNoPassword(): void {
$token = 'oldtokentokentokentokentoken';
$uid = 'user';
$user = 'User';
@@ -571,7 +571,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->assertNull($new->getPassword());
}
- public function testMarkPasswordInvalidInvalidToken() {
+ public function testMarkPasswordInvalidInvalidToken(): void {
$token = $this->createMock(IToken::class);
$this->expectException(InvalidTokenException::class);
@@ -579,7 +579,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->markPasswordInvalid($token, 'tokenId');
}
- public function testMarkPasswordInvalid() {
+ public function testMarkPasswordInvalid(): void {
$token = $this->createMock(PublicKeyToken::class);
$token->expects($this->once())
@@ -592,7 +592,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->markPasswordInvalid($token, 'tokenId');
}
- public function testUpdatePasswords() {
+ public function testUpdatePasswords(): void {
$uid = 'myUID';
$token1 = $this->tokenProvider->generateToken(
'foobetokentokentokentoken',
diff --git a/tests/lib/Authentication/Token/PublicKeyTokenTest.php b/tests/lib/Authentication/Token/PublicKeyTokenTest.php
index cc8890002e9..5f5f29c865f 100644
--- a/tests/lib/Authentication/Token/PublicKeyTokenTest.php
+++ b/tests/lib/Authentication/Token/PublicKeyTokenTest.php
@@ -13,7 +13,7 @@ use OCP\Authentication\Token\IToken;
use Test\TestCase;
class PublicKeyTokenTest extends TestCase {
- public function testSetScopeAsArray() {
+ public function testSetScopeAsArray(): void {
$scope = [IToken::SCOPE_FILESYSTEM => false];
$token = new PublicKeyToken();
$token->setScope($scope);
@@ -21,7 +21,7 @@ class PublicKeyTokenTest extends TestCase {
$this->assertEquals($scope, $token->getScopeAsArray());
}
- public function testDefaultScope() {
+ public function testDefaultScope(): void {
$scope = [IToken::SCOPE_FILESYSTEM => true];
$token = new PublicKeyToken();
$this->assertEquals($scope, $token->getScopeAsArray());
diff --git a/tests/lib/Authentication/Token/RemoteWipeTest.php b/tests/lib/Authentication/Token/RemoteWipeTest.php
index 1c4a0f73d84..ca09767c759 100644
--- a/tests/lib/Authentication/Token/RemoteWipeTest.php
+++ b/tests/lib/Authentication/Token/RemoteWipeTest.php
@@ -106,7 +106,7 @@ class RemoteWipeTest extends TestCase {
$this->assertTrue($result);
}
- public function testStartWipingNotAWipeToken() {
+ public function testStartWipingNotAWipeToken(): void {
$token = $this->createMock(IToken::class);
$this->tokenProvider->expects($this->once())
->method('getToken')
@@ -120,7 +120,7 @@ class RemoteWipeTest extends TestCase {
$this->assertFalse($result);
}
- public function testStartWiping() {
+ public function testStartWiping(): void {
$token = $this->createMock(IToken::class);
$this->tokenProvider->expects($this->once())
->method('getToken')
@@ -137,7 +137,7 @@ class RemoteWipeTest extends TestCase {
$this->assertTrue($result);
}
- public function testFinishWipingNotAWipeToken() {
+ public function testFinishWipingNotAWipeToken(): void {
$token = $this->createMock(IToken::class);
$this->tokenProvider->expects($this->once())
->method('getToken')
diff --git a/tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php b/tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php
index 56acba46ef0..7a1ea64ca9a 100644
--- a/tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php
@@ -35,7 +35,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->dao = new ProviderUserAssignmentDao($this->dbConn);
}
- public function testGetState() {
+ public function testGetState(): void {
$qb = $this->dbConn->getQueryBuilder();
$q1 = $qb->insert(ProviderUserAssignmentDao::TABLE_NAME)->values([
'provider_id' => $qb->createNamedParameter('twofactor_u2f'),
@@ -59,7 +59,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->assertEquals($expected, $state);
}
- public function testPersist() {
+ public function testPersist(): void {
$qb = $this->dbConn->getQueryBuilder();
$this->dao->persist('twofactor_totp', 'user123', 0);
@@ -76,7 +76,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->assertCount(1, $data);
}
- public function testPersistTwice() {
+ public function testPersistTwice(): void {
$qb = $this->dbConn->getQueryBuilder();
$this->dao->persist('twofactor_totp', 'user123', 0);
@@ -95,7 +95,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->assertCount(1, $data);
}
- public function testPersistSameStateTwice() {
+ public function testPersistSameStateTwice(): void {
$qb = $this->dbConn->getQueryBuilder();
$this->dao->persist('twofactor_totp', 'user123', 1);
@@ -114,7 +114,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->assertCount(1, $data);
}
- public function testDeleteByUser() {
+ public function testDeleteByUser(): void {
$this->dao->persist('twofactor_fail', 'user1', 1);
$this->dao->persist('twofactor_u2f', 'user1', 1);
$this->dao->persist('twofactor_fail', 'user2', 0);
@@ -143,7 +143,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->assertCount(2, $statesUser2);
}
- public function testDeleteAll() {
+ public function testDeleteAll(): void {
$this->dao->persist('twofactor_fail', 'user1', 1);
$this->dao->persist('twofactor_u2f', 'user1', 1);
$this->dao->persist('twofactor_fail', 'user2', 0);
diff --git a/tests/lib/Authentication/TwoFactorAuth/EnforcementStateTest.php b/tests/lib/Authentication/TwoFactorAuth/EnforcementStateTest.php
index bf09b3d8ca3..5323a36867a 100644
--- a/tests/lib/Authentication/TwoFactorAuth/EnforcementStateTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/EnforcementStateTest.php
@@ -17,25 +17,25 @@ use OC\Authentication\TwoFactorAuth\EnforcementState;
use Test\TestCase;
class EnforcementStateTest extends TestCase {
- public function testIsEnforced() {
+ public function testIsEnforced(): void {
$state = new EnforcementState(true);
$this->assertTrue($state->isEnforced());
}
- public function testGetEnforcedGroups() {
+ public function testGetEnforcedGroups(): void {
$state = new EnforcementState(true, ['twofactorers']);
$this->assertEquals(['twofactorers'], $state->getEnforcedGroups());
}
- public function testGetExcludedGroups() {
+ public function testGetExcludedGroups(): void {
$state = new EnforcementState(true, [], ['yoloers']);
$this->assertEquals(['yoloers'], $state->getExcludedGroups());
}
- public function testJsonSerialize() {
+ public function testJsonSerialize(): void {
$state = new EnforcementState(true, ['twofactorers'], ['yoloers']);
$expected = [
'enforced' => true,
diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
index a89b07f7716..7701cb68302 100644
--- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
@@ -135,7 +135,7 @@ class ManagerTest extends TestCase {
]);
}
- public function testIsTwoFactorAuthenticatedEnforced() {
+ public function testIsTwoFactorAuthenticatedEnforced(): void {
$this->mandatoryTwoFactor->expects($this->once())
->method('isEnforcedFor')
->with($this->user)
@@ -146,7 +146,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($enabled);
}
- public function testIsTwoFactorAuthenticatedNoProviders() {
+ public function testIsTwoFactorAuthenticatedNoProviders(): void {
$this->mandatoryTwoFactor->expects($this->once())
->method('isEnforcedFor')
->with($this->user)
@@ -161,7 +161,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->isTwoFactorAuthenticated($this->user));
}
- public function testIsTwoFactorAuthenticatedOnlyBackupCodes() {
+ public function testIsTwoFactorAuthenticatedOnlyBackupCodes(): void {
$this->mandatoryTwoFactor->expects($this->once())
->method('isEnforcedFor')
->with($this->user)
@@ -184,7 +184,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->isTwoFactorAuthenticated($this->user));
}
- public function testIsTwoFactorAuthenticatedFailingProviders() {
+ public function testIsTwoFactorAuthenticatedFailingProviders(): void {
$this->mandatoryTwoFactor->expects($this->once())
->method('isEnforcedFor')
->with($this->user)
@@ -219,7 +219,7 @@ class ManagerTest extends TestCase {
*
* @dataProvider providerStatesFixData
*/
- public function testIsTwoFactorAuthenticatedFixesProviderStates(bool $providerEnabled, bool $expected) {
+ public function testIsTwoFactorAuthenticatedFixesProviderStates(bool $providerEnabled, bool $expected): void {
$this->providerRegistry->expects($this->once())
->method('getProviderStates')
->willReturn([]); // Nothing registered yet
@@ -251,7 +251,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($expected, $this->manager->isTwoFactorAuthenticated($this->user));
}
- public function testGetProvider() {
+ public function testGetProvider(): void {
$this->providerRegistry->expects($this->once())
->method('getProviderStates')
->with($this->user)
@@ -268,7 +268,7 @@ class ManagerTest extends TestCase {
$this->assertSame($this->fakeProvider, $provider);
}
- public function testGetInvalidProvider() {
+ public function testGetInvalidProvider(): void {
$this->providerRegistry->expects($this->once())
->method('getProviderStates')
->with($this->user)
@@ -283,7 +283,7 @@ class ManagerTest extends TestCase {
$this->assertNull($provider);
}
- public function testGetLoginSetupProviders() {
+ public function testGetLoginSetupProviders(): void {
$provider1 = $this->createMock(IProvider::class);
$provider2 = $this->createMock(IActivatableAtLogin::class);
$this->providerLoader->expects($this->once())
@@ -300,7 +300,7 @@ class ManagerTest extends TestCase {
$this->assertSame($provider2, reset($providers));
}
- public function testGetProviders() {
+ public function testGetProviders(): void {
$this->providerRegistry->expects($this->once())
->method('getProviderStates')
->with($this->user)
@@ -322,7 +322,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($providerSet->isProviderMissing());
}
- public function testGetProvidersOneMissing() {
+ public function testGetProvidersOneMissing(): void {
$this->providerRegistry->expects($this->once())
->method('getProviderStates')
->with($this->user)
@@ -342,7 +342,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($providerSet->isProviderMissing());
}
- public function testVerifyChallenge() {
+ public function testVerifyChallenge(): void {
$this->prepareProviders();
$challenge = 'passme';
@@ -412,7 +412,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($result);
}
- public function testVerifyChallengeInvalidProviderId() {
+ public function testVerifyChallengeInvalidProviderId(): void {
$this->prepareProviders();
$challenge = 'passme';
@@ -425,7 +425,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->verifyChallenge('dontexist', $this->user, $challenge));
}
- public function testVerifyInvalidChallenge() {
+ public function testVerifyInvalidChallenge(): void {
$this->prepareProviders();
$challenge = 'dontpassme';
@@ -471,7 +471,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->verifyChallenge('email', $this->user, $challenge));
}
- public function testNeedsSecondFactor() {
+ public function testNeedsSecondFactor(): void {
$user = $this->createMock(IUser::class);
$this->session->expects($this->exactly(3))
->method('exists')
@@ -522,7 +522,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($manager->needsSecondFactor($user));
}
- public function testNeedsSecondFactorUserIsNull() {
+ public function testNeedsSecondFactorUserIsNull(): void {
$user = null;
$this->session->expects($this->never())
->method('exists');
@@ -530,7 +530,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->needsSecondFactor($user));
}
- public function testNeedsSecondFactorWithNoProviderAvailableAnymore() {
+ public function testNeedsSecondFactorWithNoProviderAvailableAnymore(): void {
$this->prepareNoProviders();
$user = null;
@@ -545,7 +545,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->needsSecondFactor($user));
}
- public function testPrepareTwoFactorLogin() {
+ public function testPrepareTwoFactorLogin(): void {
$this->user->method('getUID')
->willReturn('ferdinand');
@@ -575,7 +575,7 @@ class ManagerTest extends TestCase {
$this->manager->prepareTwoFactorLogin($this->user, true);
}
- public function testPrepareTwoFactorLoginDontRemember() {
+ public function testPrepareTwoFactorLoginDontRemember(): void {
$this->user->method('getUID')
->willReturn('ferdinand');
@@ -604,7 +604,7 @@ class ManagerTest extends TestCase {
$this->manager->prepareTwoFactorLogin($this->user, false);
}
- public function testNeedsSecondFactorSessionAuth() {
+ public function testNeedsSecondFactorSessionAuth(): void {
$user = $this->createMock(IUser::class);
$user->method('getUID')
->willReturn('user');
@@ -639,7 +639,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->needsSecondFactor($user));
}
- public function testNeedsSecondFactorSessionAuthFailDBPass() {
+ public function testNeedsSecondFactorSessionAuthFailDBPass(): void {
$user = $this->createMock(IUser::class);
$user->method('getUID')
->willReturn('user');
@@ -670,7 +670,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->needsSecondFactor($user));
}
- public function testNeedsSecondFactorInvalidToken() {
+ public function testNeedsSecondFactorInvalidToken(): void {
$this->prepareNoProviders();
$user = $this->createMock(IUser::class);
@@ -691,7 +691,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->needsSecondFactor($user));
}
- public function testNeedsSecondFactorAppPassword() {
+ public function testNeedsSecondFactorAppPassword(): void {
$user = $this->createMock(IUser::class);
$this->session->method('exists')
->willReturnMap([
diff --git a/tests/lib/Authentication/TwoFactorAuth/MandatoryTwoFactorTest.php b/tests/lib/Authentication/TwoFactorAuth/MandatoryTwoFactorTest.php
index 1d6127fa928..d2ecd3c509c 100644
--- a/tests/lib/Authentication/TwoFactorAuth/MandatoryTwoFactorTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/MandatoryTwoFactorTest.php
@@ -36,7 +36,7 @@ class MandatoryTwoFactorTest extends TestCase {
$this->mandatoryTwoFactor = new MandatoryTwoFactor($this->config, $this->groupManager);
}
- public function testIsNotEnforced() {
+ public function testIsNotEnforced(): void {
$this->config
->method('getSystemValue')
->willReturnMap([
@@ -50,7 +50,7 @@ class MandatoryTwoFactorTest extends TestCase {
$this->assertFalse($state->isEnforced());
}
- public function testIsEnforced() {
+ public function testIsEnforced(): void {
$this->config
->method('getSystemValue')
->willReturnMap([
@@ -64,7 +64,7 @@ class MandatoryTwoFactorTest extends TestCase {
$this->assertTrue($state->isEnforced());
}
- public function testIsNotEnforcedForAnybody() {
+ public function testIsNotEnforcedForAnybody(): void {
$user = $this->createMock(IUser::class);
$user->method('getUID')->willReturn('user123');
$this->config
@@ -80,7 +80,7 @@ class MandatoryTwoFactorTest extends TestCase {
$this->assertFalse($isEnforced);
}
- public function testIsEnforcedForAGroupMember() {
+ public function testIsEnforcedForAGroupMember(): void {
$user = $this->createMock(IUser::class);
$user->method('getUID')->willReturn('user123');
$this->config
@@ -100,7 +100,7 @@ class MandatoryTwoFactorTest extends TestCase {
$this->assertTrue($isEnforced);
}
- public function testIsEnforcedForOtherGroups() {
+ public function testIsEnforcedForOtherGroups(): void {
$user = $this->createMock(IUser::class);
$user->method('getUID')->willReturn('user123');
$this->config
@@ -118,7 +118,7 @@ class MandatoryTwoFactorTest extends TestCase {
$this->assertFalse($isEnforced);
}
- public function testIsEnforcedButMemberOfExcludedGroup() {
+ public function testIsEnforcedButMemberOfExcludedGroup(): void {
$user = $this->createMock(IUser::class);
$user->method('getUID')->willReturn('user123');
$this->config
@@ -138,7 +138,7 @@ class MandatoryTwoFactorTest extends TestCase {
$this->assertFalse($isEnforced);
}
- public function testSetEnforced() {
+ public function testSetEnforced(): void {
$this->config
->expects($this->exactly(3))
->method('setSystemValue')
@@ -151,7 +151,7 @@ class MandatoryTwoFactorTest extends TestCase {
$this->mandatoryTwoFactor->setState(new EnforcementState(true));
}
- public function testSetEnforcedForGroups() {
+ public function testSetEnforcedForGroups(): void {
$this->config
->expects($this->exactly(3))
->method('setSystemValue')
@@ -164,7 +164,7 @@ class MandatoryTwoFactorTest extends TestCase {
$this->mandatoryTwoFactor->setState(new EnforcementState(true, ['twofactorers'], ['yoloers']));
}
- public function testSetNotEnforced() {
+ public function testSetNotEnforced(): void {
$this->config
->expects($this->exactly(3))
->method('setSystemValue')
diff --git a/tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php b/tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php
index bbbb8e8e55a..6eb3b7dfb26 100644
--- a/tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/ProviderLoaderTest.php
@@ -47,7 +47,7 @@ class ProviderLoaderTest extends TestCase {
}
- public function testFailHardIfProviderCanNotBeLoaded() {
+ public function testFailHardIfProviderCanNotBeLoaded(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Could not load two-factor auth provider \\OCA\\MyFaulty2faApp\\DoesNotExist');
@@ -69,7 +69,7 @@ class ProviderLoaderTest extends TestCase {
$this->loader->getProviders($this->user);
}
- public function testGetProviders() {
+ public function testGetProviders(): void {
$provider = $this->createMock(IProvider::class);
$provider->method('getId')->willReturn('test');
\OC::$server->registerService('\\OCA\\TwoFactorTest\\Provider', function () use ($provider) {
@@ -93,7 +93,7 @@ class ProviderLoaderTest extends TestCase {
$this->assertSame($provider, $providers['test']);
}
- public function testGetProvidersBootstrap() {
+ public function testGetProvidersBootstrap(): void {
$provider = $this->createMock(IProvider::class);
$provider->method('getId')->willReturn('test');
diff --git a/tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php
index 0e8cf122080..34248f11f21 100644
--- a/tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/ProviderManagerTest.php
@@ -42,14 +42,14 @@ class ProviderManagerTest extends TestCase {
}
- public function testTryEnableInvalidProvider() {
+ public function testTryEnableInvalidProvider(): void {
$this->expectException(\OC\Authentication\Exceptions\InvalidProviderException::class);
$user = $this->createMock(IUser::class);
$this->providerManager->tryEnableProviderFor('none', $user);
}
- public function testTryEnableUnsupportedProvider() {
+ public function testTryEnableUnsupportedProvider(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
$this->providerLoader->expects($this->once())
@@ -66,7 +66,7 @@ class ProviderManagerTest extends TestCase {
$this->assertFalse($res);
}
- public function testTryEnableProvider() {
+ public function testTryEnableProvider(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IActivatableByAdmin::class);
$this->providerLoader->expects($this->once())
@@ -88,14 +88,14 @@ class ProviderManagerTest extends TestCase {
}
- public function testTryDisableInvalidProvider() {
+ public function testTryDisableInvalidProvider(): void {
$this->expectException(\OC\Authentication\Exceptions\InvalidProviderException::class);
$user = $this->createMock(IUser::class);
$this->providerManager->tryDisableProviderFor('none', $user);
}
- public function testTryDisableUnsupportedProvider() {
+ public function testTryDisableUnsupportedProvider(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
$this->providerLoader->expects($this->once())
@@ -112,7 +112,7 @@ class ProviderManagerTest extends TestCase {
$this->assertFalse($res);
}
- public function testTryDisableProvider() {
+ public function testTryDisableProvider(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IDeactivatableByAdmin::class);
$this->providerLoader->expects($this->once())
diff --git a/tests/lib/Authentication/TwoFactorAuth/ProviderSetTest.php b/tests/lib/Authentication/TwoFactorAuth/ProviderSetTest.php
index b6b9640cd9b..568b83567f8 100644
--- a/tests/lib/Authentication/TwoFactorAuth/ProviderSetTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/ProviderSetTest.php
@@ -18,7 +18,7 @@ class ProviderSetTest extends TestCase {
/** @var ProviderSet */
private $providerSet;
- public function testIndexesProviders() {
+ public function testIndexesProviders(): void {
$p1 = $this->createMock(IProvider::class);
$p1->method('getId')->willReturn('p1');
$p2 = $this->createMock(IProvider::class);
@@ -33,7 +33,7 @@ class ProviderSetTest extends TestCase {
$this->assertEquals($expected, $set->getProviders());
}
- public function testGet3rdPartyProviders() {
+ public function testGet3rdPartyProviders(): void {
$p1 = $this->createMock(IProvider::class);
$p1->method('getId')->willReturn('p1');
$p2 = $this->createMock(IProvider::class);
@@ -50,7 +50,7 @@ class ProviderSetTest extends TestCase {
$this->assertEquals($expected, $set->getPrimaryProviders());
}
- public function testGetProvider() {
+ public function testGetProvider(): void {
$p1 = $this->createMock(IProvider::class);
$p1->method('getId')->willReturn('p1');
@@ -60,14 +60,14 @@ class ProviderSetTest extends TestCase {
$this->assertEquals($p1, $provider);
}
- public function testGetProviderNotFound() {
+ public function testGetProviderNotFound(): void {
$set = new ProviderSet([], false);
$provider = $set->getProvider('p1');
$this->assertNull($provider);
}
- public function testIsProviderMissing() {
+ public function testIsProviderMissing(): void {
$set = new ProviderSet([], true);
$this->assertTrue($set->isProviderMissing());
diff --git a/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php b/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php
index 7485fe377ee..77e619d03a2 100644
--- a/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php
@@ -42,7 +42,7 @@ class RegistryTest extends TestCase {
$this->registry = new Registry($this->dao, $this->dispatcher);
}
- public function testGetProviderStates() {
+ public function testGetProviderStates(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->once())->method('getUID')->willReturn('user123');
$state = [
@@ -55,7 +55,7 @@ class RegistryTest extends TestCase {
$this->assertEquals($state, $actual);
}
- public function testEnableProvider() {
+ public function testEnableProvider(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
$user->expects($this->once())->method('getUID')->willReturn('user123');
@@ -81,7 +81,7 @@ class RegistryTest extends TestCase {
$this->registry->enableProviderFor($provider, $user);
}
- public function testDisableProvider() {
+ public function testDisableProvider(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
$user->expects($this->once())->method('getUID')->willReturn('user123');
@@ -108,7 +108,7 @@ class RegistryTest extends TestCase {
$this->registry->disableProviderFor($provider, $user);
}
- public function testDeleteUserData() {
+ public function testDeleteUserData(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->once())->method('getUID')->willReturn('user123');
$this->dao->expects($this->once())
@@ -129,7 +129,7 @@ class RegistryTest extends TestCase {
$this->registry->deleteUserData($user);
}
- public function testCleanUp() {
+ public function testCleanUp(): void {
$this->dao->expects($this->once())
->method('deleteAll')
->with('twofactor_u2f');
diff --git a/tests/lib/AutoLoaderTest.php b/tests/lib/AutoLoaderTest.php
index 22d66c6c4aa..2aa8bc2a26a 100644
--- a/tests/lib/AutoLoaderTest.php
+++ b/tests/lib/AutoLoaderTest.php
@@ -18,40 +18,40 @@ class AutoLoaderTest extends TestCase {
$this->loader = new \OC\AutoLoader([]);
}
- public function testLegacyPath() {
+ public function testLegacyPath(): void {
$this->assertEquals([
\OC::$SERVERROOT . '/lib/private/legacy/files.php',
], $this->loader->findClass('OC_Files'));
}
- public function testLoadTestTestCase() {
+ public function testLoadTestTestCase(): void {
$this->assertEquals([
\OC::$SERVERROOT . '/tests/lib/TestCase.php'
], $this->loader->findClass('Test\TestCase'));
}
- public function testLoadCore() {
+ public function testLoadCore(): void {
$this->assertEquals([
\OC::$SERVERROOT . '/lib/private/legacy/foo/bar.php',
], $this->loader->findClass('OC_Foo_Bar'));
}
- public function testLoadPublicNamespace() {
+ public function testLoadPublicNamespace(): void {
$this->assertEquals([], $this->loader->findClass('OCP\Foo\Bar'));
}
- public function testLoadAppNamespace() {
+ public function testLoadAppNamespace(): void {
$result = $this->loader->findClass('OCA\Files\Foobar');
$this->assertEquals(2, count($result));
$this->assertStringEndsWith('apps/files/foobar.php', $result[0]);
$this->assertStringEndsWith('apps/files/lib/foobar.php', $result[1]);
}
- public function testLoadCoreNamespaceCore() {
+ public function testLoadCoreNamespaceCore(): void {
$this->assertEquals([], $this->loader->findClass('OC\Core\Foo\Bar'));
}
- public function testLoadCoreNamespaceSettings() {
+ public function testLoadCoreNamespaceSettings(): void {
$this->assertEquals([], $this->loader->findClass('OC\Settings\Foo\Bar'));
}
}
diff --git a/tests/lib/Avatar/AvatarManagerTest.php b/tests/lib/Avatar/AvatarManagerTest.php
index 6995edb8004..25e8e1563f5 100644
--- a/tests/lib/Avatar/AvatarManagerTest.php
+++ b/tests/lib/Avatar/AvatarManagerTest.php
@@ -71,7 +71,7 @@ class AvatarManagerTest extends \Test\TestCase {
);
}
- public function testGetAvatarInvalidUser() {
+ public function testGetAvatarInvalidUser(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('user does not exist');
@@ -84,7 +84,7 @@ class AvatarManagerTest extends \Test\TestCase {
$this->avatarManager->getAvatar('invalidUser');
}
- public function testGetAvatarForSelf() {
+ public function testGetAvatarForSelf(): void {
$user = $this->createMock(User::class);
$user
->expects($this->any())
@@ -139,7 +139,7 @@ class AvatarManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $this->avatarManager->getAvatar('valid-user'));
}
- public function testGetAvatarValidUserDifferentCasing() {
+ public function testGetAvatarValidUserDifferentCasing(): void {
$user = $this->createMock(User::class);
$this->userManager->expects($this->once())
->method('get')
@@ -206,7 +206,7 @@ class AvatarManagerTest extends \Test\TestCase {
/**
* @dataProvider dataGetAvatarScopes
*/
- public function testGetAvatarScopes($avatarScope, $isPublicCall, $isKnownUser, $expectedPlaceholder) {
+ public function testGetAvatarScopes($avatarScope, $isPublicCall, $isKnownUser, $expectedPlaceholder): void {
if ($isPublicCall) {
$requestingUser = null;
} else {
diff --git a/tests/lib/Avatar/GuestAvatarTest.php b/tests/lib/Avatar/GuestAvatarTest.php
index e71cabaa624..8188684b51f 100644
--- a/tests/lib/Avatar/GuestAvatarTest.php
+++ b/tests/lib/Avatar/GuestAvatarTest.php
@@ -44,7 +44,7 @@ class GuestAvatarTest extends TestCase {
* For the test a static name "einstein" is used and
* the generated image is compared with an expected one.
*/
- public function testGet() {
+ public function testGet(): void {
$this->markTestSkipped('TODO: Disable because fails on drone');
$avatar = $this->guestAvatar->getFile(32);
self::assertInstanceOf(InMemoryFile::class, $avatar);
@@ -59,7 +59,7 @@ class GuestAvatarTest extends TestCase {
*
* @return void
*/
- public function testIsCustomAvatar() {
+ public function testIsCustomAvatar(): void {
self::assertFalse($this->guestAvatar->isCustomAvatar());
}
}
diff --git a/tests/lib/Avatar/UserAvatarTest.php b/tests/lib/Avatar/UserAvatarTest.php
index fde2ccef5c3..0e2bfe6872f 100644
--- a/tests/lib/Avatar/UserAvatarTest.php
+++ b/tests/lib/Avatar/UserAvatarTest.php
@@ -50,7 +50,7 @@ class UserAvatarTest extends \Test\TestCase {
];
}
- public function testGetNoAvatar() {
+ public function testGetNoAvatar(): void {
$file = $this->createMock(ISimpleFile::class);
$this->folder->method('newFile')
->willReturn($file);
@@ -85,7 +85,7 @@ class UserAvatarTest extends \Test\TestCase {
$this->assertTrue($result->valid());
}
- public function testGetAvatarSizeMatch() {
+ public function testGetAvatarSizeMatch(): void {
$this->folder->method('fileExists')
->willReturnMap([
['avatar.jpg', true],
@@ -103,7 +103,7 @@ class UserAvatarTest extends \Test\TestCase {
$this->assertEquals($expected->data(), $this->avatar->get(128)->data());
}
- public function testGetAvatarSizeMinusOne() {
+ public function testGetAvatarSizeMinusOne(): void {
$this->folder->method('fileExists')
->willReturnMap([
['avatar.jpg', true],
@@ -120,7 +120,7 @@ class UserAvatarTest extends \Test\TestCase {
$this->assertEquals($expected->data(), $this->avatar->get(-1)->data());
}
- public function testGetAvatarNoSizeMatch() {
+ public function testGetAvatarNoSizeMatch(): void {
$this->folder->method('fileExists')
->willReturnMap([
['avatar.jpg', false],
@@ -164,11 +164,11 @@ class UserAvatarTest extends \Test\TestCase {
$this->assertEquals($expected2->data(), $this->avatar->get(32)->data());
}
- public function testExistsNo() {
+ public function testExistsNo(): void {
$this->assertFalse($this->avatar->exists());
}
- public function testExiststJPG() {
+ public function testExiststJPG(): void {
$this->folder->method('fileExists')
->willReturnMap([
['avatar.jpg', true],
@@ -177,7 +177,7 @@ class UserAvatarTest extends \Test\TestCase {
$this->assertTrue($this->avatar->exists());
}
- public function testExistsPNG() {
+ public function testExistsPNG(): void {
$this->folder->method('fileExists')
->willReturnMap([
['avatar.jpg', false],
@@ -186,7 +186,7 @@ class UserAvatarTest extends \Test\TestCase {
$this->assertTrue($this->avatar->exists());
}
- public function testSetAvatar() {
+ public function testSetAvatar(): void {
$avatarFileJPG = $this->createMock(File::class);
$avatarFileJPG->method('getName')
->willReturn('avatar.jpg');
@@ -232,7 +232,7 @@ class UserAvatarTest extends \Test\TestCase {
$this->avatar->set($image->data());
}
- public function testGenerateSvgAvatar() {
+ public function testGenerateSvgAvatar(): void {
$avatar = $this->invokePrivate($this->avatar, 'getAvatarVector', [64, false]);
$svg = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
@@ -247,7 +247,7 @@ class UserAvatarTest extends \Test\TestCase {
/**
* @dataProvider avatarTextData
*/
- public function testGetAvatarText($displayName, $expectedAvatarText) {
+ public function testGetAvatarText($displayName, $expectedAvatarText): void {
$user = $this->getUserWithDisplayName($displayName);
$avatar = $this->getUserAvatar($user);
@@ -255,12 +255,12 @@ class UserAvatarTest extends \Test\TestCase {
$this->assertEquals($expectedAvatarText, $avatarText);
}
- public function testHashToInt() {
+ public function testHashToInt(): void {
$hashToInt = $this->invokePrivate($this->avatar, 'hashToInt', ['abcdef', 18]);
$this->assertTrue(gettype($hashToInt) === 'integer');
}
- public function testMixPalette() {
+ public function testMixPalette(): void {
$colorFrom = new \OCP\Color(0, 0, 0);
$colorTo = new \OCP\Color(6, 12, 18);
$steps = 6;
diff --git a/tests/lib/BackgroundJob/JobListTest.php b/tests/lib/BackgroundJob/JobListTest.php
index 510d307eda8..a9d7df0e6f4 100644
--- a/tests/lib/BackgroundJob/JobListTest.php
+++ b/tests/lib/BackgroundJob/JobListTest.php
@@ -87,7 +87,7 @@ class JobListTest extends TestCase {
* @dataProvider argumentProvider
* @param $argument
*/
- public function testAddRemove($argument) {
+ public function testAddRemove($argument): void {
$existingJobs = $this->getAllSorted();
$job = new TestJob();
$this->instance->add($job, $argument);
@@ -109,7 +109,7 @@ class JobListTest extends TestCase {
* @dataProvider argumentProvider
* @param $argument
*/
- public function testRemoveDifferentArgument($argument) {
+ public function testRemoveDifferentArgument($argument): void {
$existingJobs = $this->getAllSorted();
$job = new TestJob();
$this->instance->add($job, $argument);
@@ -130,7 +130,7 @@ class JobListTest extends TestCase {
* @dataProvider argumentProvider
* @param $argument
*/
- public function testHas($argument) {
+ public function testHas($argument): void {
$job = new TestJob();
$this->assertFalse($this->instance->has($job, $argument));
$this->instance->add($job, $argument);
@@ -146,7 +146,7 @@ class JobListTest extends TestCase {
* @dataProvider argumentProvider
* @param $argument
*/
- public function testHasDifferentArgument($argument) {
+ public function testHasDifferentArgument($argument): void {
$job = new TestJob();
$this->instance->add($job, $argument);
@@ -170,7 +170,7 @@ class JobListTest extends TestCase {
$query->execute();
}
- public function testGetNext() {
+ public function testGetNext(): void {
$job = new TestJob();
$this->createTempJob(get_class($job), 1, 0, 12345);
$this->createTempJob(get_class($job), 2, 0, 12346);
@@ -186,7 +186,7 @@ class JobListTest extends TestCase {
$this->assertEquals($savedJob1, $nextJob);
}
- public function testGetNextSkipReserved() {
+ public function testGetNextSkipReserved(): void {
$job = new TestJob();
$this->createTempJob(get_class($job), 1, 123456789, 12345);
$this->createTempJob(get_class($job), 2, 0, 12346);
@@ -200,7 +200,7 @@ class JobListTest extends TestCase {
$this->assertEquals(2, $nextJob->getArgument());
}
- public function testGetNextSkipNonExisting() {
+ public function testGetNextSkipNonExisting(): void {
$job = new TestJob();
$this->createTempJob('\OC\Non\Existing\Class', 1, 0, 12345);
$this->createTempJob(get_class($job), 2, 0, 12346);
@@ -218,7 +218,7 @@ class JobListTest extends TestCase {
* @dataProvider argumentProvider
* @param $argument
*/
- public function testGetById($argument) {
+ public function testGetById($argument): void {
$job = new TestJob();
$this->instance->add($job, $argument);
@@ -229,7 +229,7 @@ class JobListTest extends TestCase {
$this->assertEquals($addedJob, $this->instance->getById($addedJob->getId()));
}
- public function testSetLastRun() {
+ public function testSetLastRun(): void {
$job = new TestJob();
$this->instance->add($job);
@@ -247,7 +247,7 @@ class JobListTest extends TestCase {
$this->assertLessThanOrEqual($timeEnd, $addedJob->getLastRun());
}
- public function testHasReservedJobs() {
+ public function testHasReservedJobs(): void {
$this->clearJobsList();
$this->timeFactory->expects($this->atLeastOnce())
@@ -278,7 +278,7 @@ class JobListTest extends TestCase {
$this->assertTrue($this->instance->hasReservedJob(TestJob::class));
}
- public function testHasReservedJobsAndParallelAwareJob() {
+ public function testHasReservedJobsAndParallelAwareJob(): void {
$this->clearJobsList();
$this->timeFactory->expects($this->atLeastOnce())
diff --git a/tests/lib/BackgroundJob/JobTest.php b/tests/lib/BackgroundJob/JobTest.php
index fa89a06c8f5..9024742f432 100644
--- a/tests/lib/BackgroundJob/JobTest.php
+++ b/tests/lib/BackgroundJob/JobTest.php
@@ -24,7 +24,7 @@ class JobTest extends \Test\TestCase {
\OC::$server->registerService(LoggerInterface::class, fn ($c) => $this->logger);
}
- public function testRemoveAfterException() {
+ public function testRemoveAfterException(): void {
$jobList = new DummyJobList();
$e = new \Exception();
$job = new TestJob($this->timeFactory, $this, function () use ($e) {
@@ -41,7 +41,7 @@ class JobTest extends \Test\TestCase {
$this->assertCount(1, $jobList->getAll());
}
- public function testRemoveAfterError() {
+ public function testRemoveAfterError(): void {
$jobList = new DummyJobList();
$job = new TestJob($this->timeFactory, $this, function () {
$test = null;
diff --git a/tests/lib/BackgroundJob/QueuedJobTest.php b/tests/lib/BackgroundJob/QueuedJobTest.php
index ab4bacb201e..893f476bb5f 100644
--- a/tests/lib/BackgroundJob/QueuedJobTest.php
+++ b/tests/lib/BackgroundJob/QueuedJobTest.php
@@ -27,7 +27,7 @@ class QueuedJobTest extends \Test\TestCase {
$this->jobList = new DummyJobList();
}
- public function testJobShouldBeRemovedNew() {
+ public function testJobShouldBeRemovedNew(): void {
$job = new TestQueuedJobNew(\OCP\Server::get(ITimeFactory::class));
$job->setId(42);
$this->jobList->add($job);
diff --git a/tests/lib/BackgroundJob/TimedJobTest.php b/tests/lib/BackgroundJob/TimedJobTest.php
index 0ae245d1ff8..ad0f54ebe4a 100644
--- a/tests/lib/BackgroundJob/TimedJobTest.php
+++ b/tests/lib/BackgroundJob/TimedJobTest.php
@@ -34,7 +34,7 @@ class TimedJobTest extends \Test\TestCase {
$this->time = \OCP\Server::get(ITimeFactory::class);
}
- public function testShouldRunAfterIntervalNew() {
+ public function testShouldRunAfterIntervalNew(): void {
$job = new TestTimedJobNew($this->time);
$job->setId(42);
$this->jobList->add($job);
@@ -44,7 +44,7 @@ class TimedJobTest extends \Test\TestCase {
$this->assertTrue($job->ran);
}
- public function testShouldNotRunWithinIntervalNew() {
+ public function testShouldNotRunWithinIntervalNew(): void {
$job = new TestTimedJobNew($this->time);
$job->setId(42);
$this->jobList->add($job);
@@ -54,7 +54,7 @@ class TimedJobTest extends \Test\TestCase {
$this->assertFalse($job->ran);
}
- public function testShouldNotTwiceNew() {
+ public function testShouldNotTwiceNew(): void {
$job = new TestTimedJobNew($this->time);
$job->setId(42);
$this->jobList->add($job);
diff --git a/tests/lib/Cache/CappedMemoryCacheTest.php b/tests/lib/Cache/CappedMemoryCacheTest.php
index 6d1c7e6e372..f2ed1a5ee0d 100644
--- a/tests/lib/Cache/CappedMemoryCacheTest.php
+++ b/tests/lib/Cache/CappedMemoryCacheTest.php
@@ -18,7 +18,7 @@ class CappedMemoryCacheTest extends TestCache {
$this->instance = new \OCP\Cache\CappedMemoryCache();
}
- public function testSetOverCap() {
+ public function testSetOverCap(): void {
$instance = new \OCP\Cache\CappedMemoryCache(3);
$instance->set('1', 'a');
@@ -34,7 +34,7 @@ class CappedMemoryCacheTest extends TestCache {
$this->assertTrue($instance->hasKey('5'));
}
- public function testClear() {
+ public function testClear(): void {
$value = 'ipsum lorum';
$this->instance->set('1_value1', $value);
$this->instance->set('1_value2', $value);
@@ -48,7 +48,7 @@ class CappedMemoryCacheTest extends TestCache {
$this->assertFalse($this->instance->hasKey('3_value1'));
}
- public function testIndirectSet() {
+ public function testIndirectSet(): void {
$this->instance->set('array', []);
$this->instance['array'][] = 'foo';
diff --git a/tests/lib/Cache/FileCacheTest.php b/tests/lib/Cache/FileCacheTest.php
index ef738eaaacf..1d12147af0d 100644
--- a/tests/lib/Cache/FileCacheTest.php
+++ b/tests/lib/Cache/FileCacheTest.php
@@ -97,7 +97,7 @@ class FileCacheTest extends TestCache {
return $mockStorage;
}
- public function testGarbageCollectOldKeys() {
+ public function testGarbageCollectOldKeys(): void {
$mockStorage = $this->setupMockStorage();
$mockStorage->expects($this->atLeastOnce())
@@ -112,7 +112,7 @@ class FileCacheTest extends TestCache {
$this->instance->gc();
}
- public function testGarbageCollectLeaveRecentKeys() {
+ public function testGarbageCollectLeaveRecentKeys(): void {
$mockStorage = $this->setupMockStorage();
$mockStorage->expects($this->atLeastOnce())
@@ -135,7 +135,7 @@ class FileCacheTest extends TestCache {
/**
* @dataProvider lockExceptionProvider
*/
- public function testGarbageCollectIgnoreLockedKeys($testException) {
+ public function testGarbageCollectIgnoreLockedKeys($testException): void {
$mockStorage = $this->setupMockStorage();
$mockStorage->expects($this->atLeastOnce())
diff --git a/tests/lib/Cache/TestCache.php b/tests/lib/Cache/TestCache.php
index 1ed52ad5170..3245cd90a38 100644
--- a/tests/lib/Cache/TestCache.php
+++ b/tests/lib/Cache/TestCache.php
@@ -21,7 +21,7 @@ abstract class TestCache extends \Test\TestCase {
parent::tearDown();
}
- public function testSimple() {
+ public function testSimple(): void {
$this->assertNull($this->instance->get('value1'));
$this->assertFalse($this->instance->hasKey('value1'));
@@ -50,7 +50,7 @@ abstract class TestCache extends \Test\TestCase {
$this->assertFalse($this->instance->hasKey('value1'));
}
- public function testClear() {
+ public function testClear(): void {
$value = 'ipsum lorum';
$this->instance->set('1_value1', $value . '1');
$this->instance->set('1_value2', $value . '2');
diff --git a/tests/lib/Calendar/ManagerTest.php b/tests/lib/Calendar/ManagerTest.php
index 93fa21cf174..3d1a46d3f2a 100644
--- a/tests/lib/Calendar/ManagerTest.php
+++ b/tests/lib/Calendar/ManagerTest.php
@@ -60,7 +60,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider searchProvider
*/
- public function testSearch($search1, $search2, $expected) {
+ public function testSearch($search1, $search2, $expected): void {
/** @var ICalendar | MockObject $calendar1 */
$calendar1 = $this->createMock(ICalendar::class);
$calendar1->method('getKey')->willReturn('simple:1');
@@ -87,7 +87,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider searchProvider
*/
- public function testSearchOptions($search1, $search2, $expected) {
+ public function testSearchOptions($search1, $search2, $expected): void {
/** @var ICalendar | MockObject $calendar1 */
$calendar1 = $this->createMock(ICalendar::class);
$calendar1->method('getKey')->willReturn('simple:1');
@@ -168,7 +168,7 @@ class ManagerTest extends TestCase {
];
}
- public function testRegisterUnregister() {
+ public function testRegisterUnregister(): void {
/** @var ICalendar | MockObject $calendar1 */
$calendar1 = $this->createMock(ICalendar::class);
$calendar1->method('getKey')->willReturn('key1');
@@ -192,7 +192,7 @@ class ManagerTest extends TestCase {
$this->assertContains($calendar2, $result);
}
- public function testGetCalendars() {
+ public function testGetCalendars(): void {
/** @var ICalendar | MockObject $calendar1 */
$calendar1 = $this->createMock(ICalendar::class);
$calendar1->method('getKey')->willReturn('key1');
@@ -216,12 +216,12 @@ class ManagerTest extends TestCase {
$this->assertCount(0, $result);
}
- public function testEnabledIfNot() {
+ public function testEnabledIfNot(): void {
$isEnabled = $this->manager->isEnabled();
$this->assertFalse($isEnabled);
}
- public function testIfEnabledIfSo() {
+ public function testIfEnabledIfSo(): void {
/** @var ICalendar | MockObject $calendar */
$calendar = $this->createMock(ICalendar::class);
$this->manager->registerCalendar($calendar);
diff --git a/tests/lib/CapabilitiesManagerTest.php b/tests/lib/CapabilitiesManagerTest.php
index 14b83e3dda3..23909a91c5a 100644
--- a/tests/lib/CapabilitiesManagerTest.php
+++ b/tests/lib/CapabilitiesManagerTest.php
@@ -29,7 +29,7 @@ class CapabilitiesManagerTest extends TestCase {
/**
* Test no capabilities
*/
- public function testNoCapabilities() {
+ public function testNoCapabilities(): void {
$res = $this->manager->getCapabilities();
$this->assertEmpty($res);
}
@@ -37,7 +37,7 @@ class CapabilitiesManagerTest extends TestCase {
/**
* Test a valid capabilitie
*/
- public function testValidCapability() {
+ public function testValidCapability(): void {
$this->manager->registerCapability(function () {
return new SimpleCapability();
});
@@ -49,7 +49,7 @@ class CapabilitiesManagerTest extends TestCase {
/**
* Test a public capabilitie
*/
- public function testPublicCapability() {
+ public function testPublicCapability(): void {
$this->manager->registerCapability(function () {
return new PublicSimpleCapability1();
});
@@ -67,7 +67,7 @@ class CapabilitiesManagerTest extends TestCase {
/**
* Test that we need something that implents ICapability
*/
- public function testNoICapability() {
+ public function testNoICapability(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The given Capability (Test\\NoCapability) does not implement the ICapability interface');
@@ -82,7 +82,7 @@ class CapabilitiesManagerTest extends TestCase {
/**
* Test a bunch of merged Capabilities
*/
- public function testMergedCapabilities() {
+ public function testMergedCapabilities(): void {
$this->manager->registerCapability(function () {
return new SimpleCapability();
});
@@ -108,7 +108,7 @@ class CapabilitiesManagerTest extends TestCase {
/**
* Test deep identical capabilities
*/
- public function testDeepIdenticalCapabilities() {
+ public function testDeepIdenticalCapabilities(): void {
$this->manager->registerCapability(function () {
return new DeepCapability();
});
@@ -128,7 +128,7 @@ class CapabilitiesManagerTest extends TestCase {
$this->assertEquals($expected, $res);
}
- public function testInvalidCapability() {
+ public function testInvalidCapability(): void {
$this->manager->registerCapability(function () {
throw new QueryException();
});
diff --git a/tests/lib/Collaboration/Collaborators/GroupPluginTest.php b/tests/lib/Collaboration/Collaborators/GroupPluginTest.php
index f9ac2c408db..e52ae95bf34 100644
--- a/tests/lib/Collaboration/Collaborators/GroupPluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/GroupPluginTest.php
@@ -441,7 +441,7 @@ class GroupPluginTest extends TestCase {
array $expected,
bool $reachedEnd,
$singleGroup
- ) {
+ ): void {
$this->config->expects($this->any())
->method('getAppValue')
->willReturnCallback(
diff --git a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php
index 631d6ce0296..b54ca3ee4c3 100644
--- a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php
@@ -69,7 +69,7 @@ class LookupPluginTest extends TestCase {
);
}
- public function testSearchNoLookupServerURI() {
+ public function testSearchNoLookupServerURI(): void {
$this->config->expects($this->once())
->method('getAppValue')
->with('files_sharing', 'lookupServerEnabled', 'yes')
@@ -98,7 +98,7 @@ class LookupPluginTest extends TestCase {
$this->plugin->search('foobar', 10, 0, $searchResult);
}
- public function testSearchNoInternet() {
+ public function testSearchNoInternet(): void {
$this->config->expects($this->once())
->method('getAppValue')
->with('files_sharing', 'lookupServerEnabled', 'yes')
@@ -126,7 +126,7 @@ class LookupPluginTest extends TestCase {
* @dataProvider searchDataProvider
* @param array $searchParams
*/
- public function testSearch(array $searchParams) {
+ public function testSearch(array $searchParams): void {
$type = new SearchResultType('lookup');
/** @var ISearchResult|MockObject $searchResult */
@@ -189,7 +189,7 @@ class LookupPluginTest extends TestCase {
* @param bool $GSEnabled
* @param bool $LookupEnabled
*/
- public function testSearchEnableDisableLookupServer(array $searchParams, $GSEnabled, $LookupEnabled) {
+ public function testSearchEnableDisableLookupServer(array $searchParams, $GSEnabled, $LookupEnabled): void {
$type = new SearchResultType('lookup');
/** @var ISearchResult|MockObject $searchResult */
@@ -258,7 +258,7 @@ class LookupPluginTest extends TestCase {
}
- public function testSearchLookupServerDisabled() {
+ public function testSearchLookupServerDisabled(): void {
$this->config->expects($this->once())
->method('getAppValue')
->with('files_sharing', 'lookupServerEnabled', 'yes')
diff --git a/tests/lib/Collaboration/Collaborators/MailPluginTest.php b/tests/lib/Collaboration/Collaborators/MailPluginTest.php
index b21e6f1ba4d..568325fd30c 100644
--- a/tests/lib/Collaboration/Collaborators/MailPluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/MailPluginTest.php
@@ -94,7 +94,7 @@ class MailPluginTest extends TestCase {
* @param array $expected
* @param bool $reachedEnd
*/
- public function testSearch($searchTerm, $contacts, $shareeEnumeration, $expected, $exactIdMatch, $reachedEnd, $validEmail) {
+ public function testSearch($searchTerm, $contacts, $shareeEnumeration, $expected, $exactIdMatch, $reachedEnd, $validEmail): void {
$this->config->expects($this->any())
->method('getAppValue')
->willReturnCallback(
@@ -577,7 +577,7 @@ class MailPluginTest extends TestCase {
* @param bool $reachedEnd
* @param array groups
*/
- public function testSearchGroupsOnly($searchTerm, $contacts, $expected, $exactIdMatch, $reachedEnd, $userToGroupMapping, $validEmail) {
+ public function testSearchGroupsOnly($searchTerm, $contacts, $expected, $exactIdMatch, $reachedEnd, $userToGroupMapping, $validEmail): void {
$this->config->expects($this->any())
->method('getAppValue')
->willReturnCallback(
diff --git a/tests/lib/Collaboration/Collaborators/RemotePluginTest.php b/tests/lib/Collaboration/Collaborators/RemotePluginTest.php
index f1668dbcec2..14894aa2df6 100644
--- a/tests/lib/Collaboration/Collaborators/RemotePluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/RemotePluginTest.php
@@ -79,7 +79,7 @@ class RemotePluginTest extends TestCase {
* @param bool $exactIdMatch
* @param bool $reachedEnd
*/
- public function testSearch($searchTerm, array $contacts, $shareeEnumeration, array $expected, $exactIdMatch, $reachedEnd) {
+ public function testSearch($searchTerm, array $contacts, $shareeEnumeration, array $expected, $exactIdMatch, $reachedEnd): void {
$this->config->expects($this->any())
->method('getAppValue')
->willReturnCallback(
@@ -117,7 +117,7 @@ class RemotePluginTest extends TestCase {
* @param string $expectedUser
* @param string $expectedUrl
*/
- public function testSplitUserRemote($remote, $expectedUser, $expectedUrl) {
+ public function testSplitUserRemote($remote, $expectedUser, $expectedUrl): void {
$this->instantiatePlugin();
$this->contactsManager->expects($this->any())
@@ -134,7 +134,7 @@ class RemotePluginTest extends TestCase {
*
* @param string $id
*/
- public function testSplitUserRemoteError($id) {
+ public function testSplitUserRemoteError($id): void {
$this->expectException(\Exception::class);
$this->instantiatePlugin();
diff --git a/tests/lib/Collaboration/Collaborators/SearchResultTest.php b/tests/lib/Collaboration/Collaborators/SearchResultTest.php
index b91e7f5a12d..6641a2caed1 100644
--- a/tests/lib/Collaboration/Collaborators/SearchResultTest.php
+++ b/tests/lib/Collaboration/Collaborators/SearchResultTest.php
@@ -41,7 +41,7 @@ class SearchResultTest extends TestCase {
* @param array $toAdd
* @param array $expected
*/
- public function testAddResultSet(array $toAdd, array $expected) {
+ public function testAddResultSet(array $toAdd, array $expected): void {
$result = new SearchResult();
foreach ($toAdd as $type => $results) {
@@ -72,7 +72,7 @@ class SearchResultTest extends TestCase {
* @param string $id
* @param bool $expected
*/
- public function testHasResult(array $toAdd, $type, $id, $expected) {
+ public function testHasResult(array $toAdd, $type, $id, $expected): void {
$result = new SearchResult();
foreach ($toAdd as $addType => $results) {
diff --git a/tests/lib/Collaboration/Collaborators/SearchTest.php b/tests/lib/Collaboration/Collaborators/SearchTest.php
index d23f584cb8a..88bdfa6047e 100644
--- a/tests/lib/Collaboration/Collaborators/SearchTest.php
+++ b/tests/lib/Collaboration/Collaborators/SearchTest.php
@@ -43,7 +43,7 @@ class SearchTest extends TestCase {
array $mockedMailResult,
array $expected,
bool $expectedMoreResults
- ) {
+ ): void {
$searchResult = new SearchResult();
$userPlugin = $this->createMock(ISearchPlugin::class);
diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php
index 4ba03224533..c6a266b55d6 100644
--- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php
@@ -442,7 +442,7 @@ class UserPluginTest extends TestCase {
$singleUser,
array $users = [],
$shareeEnumerationPhone = false
- ) {
+ ): void {
$this->mockConfig(['core' => [
'shareapi_only_share_with_group_members' => $shareWithGroupOnly ? 'yes' : 'no',
'shareapi_allow_share_dialog_user_enumeration' => $shareeEnumeration? 'yes' : 'no',
@@ -539,7 +539,7 @@ class UserPluginTest extends TestCase {
* @param array $expectedUIDs
* @param $currentUserId
*/
- public function testTakeOutCurrentUser(array $users, array $expectedUIDs, $currentUserId) {
+ public function testTakeOutCurrentUser(array $users, array $expectedUIDs, $currentUserId): void {
$this->instantiatePlugin();
$this->session->expects($this->once())
@@ -719,7 +719,7 @@ class UserPluginTest extends TestCase {
/**
* @dataProvider dataSearchEnumeration
*/
- public function testSearchEnumerationLimit($search, $userGroups, $matchingUsers, $result, $mockedSettings) {
+ public function testSearchEnumerationLimit($search, $userGroups, $matchingUsers, $result, $mockedSettings): void {
$this->mockConfig($mockedSettings);
$userResults = [];
diff --git a/tests/lib/Command/AsyncBusTest.php b/tests/lib/Command/AsyncBusTest.php
index 7492a4912d7..e8d7a857129 100644
--- a/tests/lib/Command/AsyncBusTest.php
+++ b/tests/lib/Command/AsyncBusTest.php
@@ -92,40 +92,40 @@ abstract class AsyncBusTest extends TestCase {
self::$lastCommand = '';
}
- public function testSimpleCommand() {
+ public function testSimpleCommand(): void {
$command = new SimpleCommand();
$this->getBus()->push($command);
$this->runJobs();
$this->assertEquals('SimpleCommand', self::$lastCommand);
}
- public function testStateFullCommand() {
+ public function testStateFullCommand(): void {
$command = new StateFullCommand('foo');
$this->getBus()->push($command);
$this->runJobs();
$this->assertEquals('foo', self::$lastCommand);
}
- public function testStaticCallable() {
+ public function testStaticCallable(): void {
$this->getBus()->push(['\Test\Command\AsyncBusTest', 'DummyCommand']);
$this->runJobs();
$this->assertEquals('static', self::$lastCommand);
}
- public function testMemberCallable() {
+ public function testMemberCallable(): void {
$command = new StateFullCommand('bar');
$this->getBus()->push([$command, 'handle']);
$this->runJobs();
$this->assertEquals('bar', self::$lastCommand);
}
- public function testFunctionCallable() {
+ public function testFunctionCallable(): void {
$this->getBus()->push('\Test\Command\BasicFunction');
$this->runJobs();
$this->assertEquals('function', self::$lastCommand);
}
- public function testClosure() {
+ public function testClosure(): void {
$this->getBus()->push(function () {
AsyncBusTest::$lastCommand = 'closure';
});
@@ -133,7 +133,7 @@ abstract class AsyncBusTest extends TestCase {
$this->assertEquals('closure', self::$lastCommand);
}
- public function testClosureSelf() {
+ public function testClosureSelf(): void {
$this->getBus()->push(function () {
AsyncBusTest::$lastCommand = 'closure-self';
});
@@ -142,7 +142,7 @@ abstract class AsyncBusTest extends TestCase {
}
- public function testClosureThis() {
+ public function testClosureThis(): void {
// clean class to prevent phpunit putting closure in $this
$test = new ThisClosureTest();
$test->test($this->getBus());
@@ -150,7 +150,7 @@ abstract class AsyncBusTest extends TestCase {
$this->assertEquals('closure-this', self::$lastCommand);
}
- public function testClosureBind() {
+ public function testClosureBind(): void {
$state = 'bar';
$this->getBus()->push(function () use ($state) {
AsyncBusTest::$lastCommand = 'closure-' . $state;
@@ -159,14 +159,14 @@ abstract class AsyncBusTest extends TestCase {
$this->assertEquals('closure-bar', self::$lastCommand);
}
- public function testFileFileAccessCommand() {
+ public function testFileFileAccessCommand(): void {
$this->getBus()->push(new FilesystemCommand());
$this->assertEquals('', self::$lastCommand);
$this->runJobs();
$this->assertEquals('FileAccess', self::$lastCommand);
}
- public function testFileFileAccessCommandSync() {
+ public function testFileFileAccessCommandSync(): void {
$this->getBus()->requireSync('\OC\Command\FileAccess');
$this->getBus()->push(new FilesystemCommand());
$this->assertEquals('FileAccess', self::$lastCommand);
diff --git a/tests/lib/Command/Integrity/SignAppTest.php b/tests/lib/Command/Integrity/SignAppTest.php
index 41333863ad4..d4921c79431 100644
--- a/tests/lib/Command/Integrity/SignAppTest.php
+++ b/tests/lib/Command/Integrity/SignAppTest.php
@@ -37,7 +37,7 @@ class SignAppTest extends TestCase {
);
}
- public function testExecuteWithMissingPath() {
+ public function testExecuteWithMissingPath(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -64,7 +64,7 @@ class SignAppTest extends TestCase {
$this->assertSame(1, self::invokePrivate($this->signApp, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecuteWithMissingPrivateKey() {
+ public function testExecuteWithMissingPrivateKey(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -91,7 +91,7 @@ class SignAppTest extends TestCase {
$this->assertSame(1, self::invokePrivate($this->signApp, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecuteWithMissingCertificate() {
+ public function testExecuteWithMissingCertificate(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -118,7 +118,7 @@ class SignAppTest extends TestCase {
$this->assertSame(1, self::invokePrivate($this->signApp, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecuteWithNotExistingPrivateKey() {
+ public function testExecuteWithNotExistingPrivateKey(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -152,7 +152,7 @@ class SignAppTest extends TestCase {
$this->assertSame(1, self::invokePrivate($this->signApp, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecuteWithNotExistingCertificate() {
+ public function testExecuteWithNotExistingCertificate(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -191,7 +191,7 @@ class SignAppTest extends TestCase {
$this->assertSame(1, self::invokePrivate($this->signApp, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecuteWithException() {
+ public function testExecuteWithException(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -235,7 +235,7 @@ class SignAppTest extends TestCase {
$this->assertSame(1, self::invokePrivate($this->signApp, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecute() {
+ public function testExecute(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
diff --git a/tests/lib/Command/Integrity/SignCoreTest.php b/tests/lib/Command/Integrity/SignCoreTest.php
index 51bec55b774..bbb68e00a84 100644
--- a/tests/lib/Command/Integrity/SignCoreTest.php
+++ b/tests/lib/Command/Integrity/SignCoreTest.php
@@ -32,7 +32,7 @@ class SignCoreTest extends TestCase {
);
}
- public function testExecuteWithMissingPrivateKey() {
+ public function testExecuteWithMissingPrivateKey(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -59,7 +59,7 @@ class SignCoreTest extends TestCase {
$this->assertSame(1, self::invokePrivate($this->signCore, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecuteWithMissingCertificate() {
+ public function testExecuteWithMissingCertificate(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -86,7 +86,7 @@ class SignCoreTest extends TestCase {
$this->assertSame(1, self::invokePrivate($this->signCore, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecuteWithNotExistingPrivateKey() {
+ public function testExecuteWithNotExistingPrivateKey(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -123,7 +123,7 @@ class SignCoreTest extends TestCase {
$this->assertSame(1, self::invokePrivate($this->signCore, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecuteWithNotExistingCertificate() {
+ public function testExecuteWithNotExistingCertificate(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -162,7 +162,7 @@ class SignCoreTest extends TestCase {
$this->assertSame(1, self::invokePrivate($this->signCore, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecuteWithException() {
+ public function testExecuteWithException(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
@@ -206,7 +206,7 @@ class SignCoreTest extends TestCase {
$this->assertEquals(1, self::invokePrivate($this->signCore, 'execute', [$inputInterface, $outputInterface]));
}
- public function testExecute() {
+ public function testExecute(): void {
$inputInterface = $this->createMock(InputInterface::class);
$outputInterface = $this->createMock(OutputInterface::class);
diff --git a/tests/lib/Comments/CommentTest.php b/tests/lib/Comments/CommentTest.php
index feaa268a09e..742ce33071f 100644
--- a/tests/lib/Comments/CommentTest.php
+++ b/tests/lib/Comments/CommentTest.php
@@ -14,7 +14,7 @@ class CommentTest extends TestCase {
/**
* @throws \OCP\Comments\IllegalIDChangeException
*/
- public function testSettersValidInput() {
+ public function testSettersValidInput(): void {
$comment = new Comment();
$id = 'comment23';
@@ -61,7 +61,7 @@ class CommentTest extends TestCase {
}
- public function testSetIdIllegalInput() {
+ public function testSetIdIllegalInput(): void {
$this->expectException(\OCP\Comments\IllegalIDChangeException::class);
$comment = new Comment();
@@ -73,7 +73,7 @@ class CommentTest extends TestCase {
/**
* @throws \OCP\Comments\IllegalIDChangeException
*/
- public function testResetId() {
+ public function testResetId(): void {
$comment = new Comment();
$comment->setId('c23');
$comment->setId('');
@@ -96,7 +96,7 @@ class CommentTest extends TestCase {
/**
* @dataProvider simpleSetterProvider
*/
- public function testSimpleSetterInvalidInput($field, $input) {
+ public function testSimpleSetterInvalidInput($field, $input): void {
$this->expectException(\InvalidArgumentException::class);
$comment = new Comment();
@@ -121,7 +121,7 @@ class CommentTest extends TestCase {
/**
* @dataProvider roleSetterProvider
*/
- public function testSetRoleInvalidInput($role, $type, $id) {
+ public function testSetRoleInvalidInput($role, $type, $id): void {
$this->expectException(\InvalidArgumentException::class);
$comment = new Comment();
@@ -130,7 +130,7 @@ class CommentTest extends TestCase {
}
- public function testSetUberlongMessage() {
+ public function testSetUberlongMessage(): void {
$this->expectException(\OCP\Comments\MessageTooLongException::class);
$comment = new Comment();
diff --git a/tests/lib/Comments/ManagerTest.php b/tests/lib/Comments/ManagerTest.php
index fda007c76a1..9a36182d393 100644
--- a/tests/lib/Comments/ManagerTest.php
+++ b/tests/lib/Comments/ManagerTest.php
@@ -97,7 +97,7 @@ class ManagerTest extends TestCase {
}
- public function testGetCommentNotFound() {
+ public function testGetCommentNotFound(): void {
$this->expectException(\OCP\Comments\NotFoundException::class);
$manager = $this->getManager();
@@ -105,14 +105,14 @@ class ManagerTest extends TestCase {
}
- public function testGetCommentNotFoundInvalidInput() {
+ public function testGetCommentNotFoundInvalidInput(): void {
$this->expectException(\InvalidArgumentException::class);
$manager = $this->getManager();
$manager->get('unexisting22');
}
- public function testGetComment() {
+ public function testGetComment(): void {
$manager = $this->getManager();
$creationDT = new \DateTime();
@@ -159,7 +159,7 @@ class ManagerTest extends TestCase {
}
- public function testGetTreeNotFound() {
+ public function testGetTreeNotFound(): void {
$this->expectException(\OCP\Comments\NotFoundException::class);
$manager = $this->getManager();
@@ -167,14 +167,14 @@ class ManagerTest extends TestCase {
}
- public function testGetTreeNotFoundInvalidIpnut() {
+ public function testGetTreeNotFoundInvalidIpnut(): void {
$this->expectException(\InvalidArgumentException::class);
$manager = $this->getManager();
$manager->getTree('unexisting22');
}
- public function testGetTree() {
+ public function testGetTree(): void {
$headId = $this->addDatabaseEntry(0, 0);
$this->addDatabaseEntry($headId, $headId, new \DateTime('-3 hours'));
@@ -200,7 +200,7 @@ class ManagerTest extends TestCase {
}
}
- public function testGetTreeNoReplies() {
+ public function testGetTreeNoReplies(): void {
$id = $this->addDatabaseEntry(0, 0);
$manager = $this->getManager();
@@ -219,7 +219,7 @@ class ManagerTest extends TestCase {
}
}
- public function testGetTreeWithLimitAndOffset() {
+ public function testGetTreeWithLimitAndOffset(): void {
$headId = $this->addDatabaseEntry(0, 0);
$this->addDatabaseEntry($headId, $headId, new \DateTime('-3 hours'));
@@ -249,7 +249,7 @@ class ManagerTest extends TestCase {
}
}
- public function testGetForObject() {
+ public function testGetForObject(): void {
$this->addDatabaseEntry(0, 0);
$manager = $this->getManager();
@@ -261,7 +261,7 @@ class ManagerTest extends TestCase {
$this->assertSame($comments[0]->getMessage(), 'nice one');
}
- public function testGetForObjectWithLimitAndOffset() {
+ public function testGetForObjectWithLimitAndOffset(): void {
$this->addDatabaseEntry(0, 0, new \DateTime('-6 hours'));
$this->addDatabaseEntry(0, 0, new \DateTime('-5 hours'));
$this->addDatabaseEntry(1, 1, new \DateTime('-4 hours'));
@@ -286,7 +286,7 @@ class ManagerTest extends TestCase {
} while (count($comments) > 0);
}
- public function testGetForObjectWithDateTimeConstraint() {
+ public function testGetForObjectWithDateTimeConstraint(): void {
$this->addDatabaseEntry(0, 0, new \DateTime('-6 hours'));
$this->addDatabaseEntry(0, 0, new \DateTime('-5 hours'));
$id1 = $this->addDatabaseEntry(0, 0, new \DateTime('-3 hours'));
@@ -300,7 +300,7 @@ class ManagerTest extends TestCase {
$this->assertSame($comments[1]->getId(), strval($id1));
}
- public function testGetForObjectWithLimitAndOffsetAndDateTimeConstraint() {
+ public function testGetForObjectWithLimitAndOffsetAndDateTimeConstraint(): void {
$this->addDatabaseEntry(0, 0, new \DateTime('-7 hours'));
$this->addDatabaseEntry(0, 0, new \DateTime('-6 hours'));
$this->addDatabaseEntry(1, 1, new \DateTime('-5 hours'));
@@ -326,7 +326,7 @@ class ManagerTest extends TestCase {
} while (count($comments) > 0);
}
- public function testGetNumberOfCommentsForObject() {
+ public function testGetNumberOfCommentsForObject(): void {
for ($i = 1; $i < 5; $i++) {
$this->addDatabaseEntry(0, 0);
}
@@ -340,7 +340,7 @@ class ManagerTest extends TestCase {
$this->assertSame($amount, 4);
}
- public function testGetNumberOfUnreadCommentsForFolder() {
+ public function testGetNumberOfUnreadCommentsForFolder(): void {
$folder = $this->createMock(Folder::class);
$fileIds = range(1111, 1114);
$children = array_map(function (int $id) {
@@ -391,7 +391,7 @@ class ManagerTest extends TestCase {
* @param $resultFrom
* @param $resultTo
*/
- public function testGetForObjectSince($lastKnown, $order, $limit, $resultFrom, $resultTo) {
+ public function testGetForObjectSince($lastKnown, $order, $limit, $resultFrom, $resultTo): void {
$ids = [];
$ids[] = $this->addDatabaseEntry(0, 0);
$ids[] = $this->addDatabaseEntry(0, 0);
@@ -445,14 +445,14 @@ class ManagerTest extends TestCase {
* @param string $oType
* @param string $oId
*/
- public function testCreateCommentInvalidArguments($aType, $aId, $oType, $oId) {
+ public function testCreateCommentInvalidArguments($aType, $aId, $oType, $oId): void {
$this->expectException(\InvalidArgumentException::class);
$manager = $this->getManager();
$manager->create($aType, $aId, $oType, $oId);
}
- public function testCreateComment() {
+ public function testCreateComment(): void {
$actorType = 'bot';
$actorId = 'bob';
$objectType = 'weather';
@@ -467,7 +467,7 @@ class ManagerTest extends TestCase {
}
- public function testDelete() {
+ public function testDelete(): void {
$this->expectException(\OCP\Comments\NotFoundException::class);
$manager = $this->getManager();
@@ -523,7 +523,7 @@ class ManagerTest extends TestCase {
];
}
- public function testSaveUpdate() {
+ public function testSaveUpdate(): void {
$manager = $this->getManager();
$comment = new Comment();
$comment
@@ -568,7 +568,7 @@ class ManagerTest extends TestCase {
}
- public function testSaveUpdateException() {
+ public function testSaveUpdateException(): void {
$this->expectException(\OCP\Comments\NotFoundException::class);
$manager = $this->getManager();
@@ -587,7 +587,7 @@ class ManagerTest extends TestCase {
}
- public function testSaveIncomplete() {
+ public function testSaveIncomplete(): void {
$this->expectException(\UnexpectedValueException::class);
$manager = $this->getManager();
@@ -596,7 +596,7 @@ class ManagerTest extends TestCase {
$manager->save($comment);
}
- public function testSaveAsChild() {
+ public function testSaveAsChild(): void {
$id = $this->addDatabaseEntry(0, 0);
$manager = $this->getManager();
@@ -635,14 +635,14 @@ class ManagerTest extends TestCase {
* @param string $type
* @param string $id
*/
- public function testDeleteReferencesOfActorInvalidInput($type, $id) {
+ public function testDeleteReferencesOfActorInvalidInput($type, $id): void {
$this->expectException(\InvalidArgumentException::class);
$manager = $this->getManager();
$manager->deleteReferencesOfActor($type, $id);
}
- public function testDeleteReferencesOfActor() {
+ public function testDeleteReferencesOfActor(): void {
$ids = [];
$ids[] = $this->addDatabaseEntry(0, 0);
$ids[] = $this->addDatabaseEntry(0, 0);
@@ -670,7 +670,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($wasSuccessful);
}
- public function testDeleteReferencesOfActorWithUserManagement() {
+ public function testDeleteReferencesOfActorWithUserManagement(): void {
$user = \OC::$server->getUserManager()->createUser('xenia', 'NotAnEasyPassword123456+');
$this->assertTrue($user instanceof IUser);
@@ -704,14 +704,14 @@ class ManagerTest extends TestCase {
* @param string $type
* @param string $id
*/
- public function testDeleteCommentsAtObjectInvalidInput($type, $id) {
+ public function testDeleteCommentsAtObjectInvalidInput($type, $id): void {
$this->expectException(\InvalidArgumentException::class);
$manager = $this->getManager();
$manager->deleteCommentsAtObject($type, $id);
}
- public function testDeleteCommentsAtObject() {
+ public function testDeleteCommentsAtObject(): void {
$ids = [];
$ids[] = $this->addDatabaseEntry(0, 0);
$ids[] = $this->addDatabaseEntry(0, 0);
@@ -832,7 +832,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($deleted);
}
- public function testSetMarkRead() {
+ public function testSetMarkRead(): void {
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
$user = $this->createMock(IUser::class);
$user->expects($this->any())
@@ -849,7 +849,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($dateTimeGet->getTimestamp(), $dateTimeSet->getTimestamp());
}
- public function testSetMarkReadUpdate() {
+ public function testSetMarkReadUpdate(): void {
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
$user = $this->createMock(IUser::class);
$user->expects($this->any())
@@ -869,7 +869,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($dateTimeGet, $dateTimeSet);
}
- public function testReadMarkDeleteUser() {
+ public function testReadMarkDeleteUser(): void {
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
$user = $this->createMock(IUser::class);
$user->expects($this->any())
@@ -887,7 +887,7 @@ class ManagerTest extends TestCase {
$this->assertNull($dateTimeGet);
}
- public function testReadMarkDeleteObject() {
+ public function testReadMarkDeleteObject(): void {
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
$user = $this->createMock(IUser::class);
$user->expects($this->any())
@@ -905,7 +905,7 @@ class ManagerTest extends TestCase {
$this->assertNull($dateTimeGet);
}
- public function testSendEvent() {
+ public function testSendEvent(): void {
$handler1 = $this->getMockBuilder(ICommentsEventHandler::class)->getMock();
$handler1->expects($this->exactly(4))
->method('handle');
@@ -940,7 +940,7 @@ class ManagerTest extends TestCase {
$manager->delete($comment->getId());
}
- public function testResolveDisplayName() {
+ public function testResolveDisplayName(): void {
$manager = $this->getManager();
$planetClosure = function ($name) {
@@ -959,7 +959,7 @@ class ManagerTest extends TestCase {
}
- public function testRegisterResolverDuplicate() {
+ public function testRegisterResolverDuplicate(): void {
$this->expectException(\OutOfBoundsException::class);
$manager = $this->getManager();
@@ -972,7 +972,7 @@ class ManagerTest extends TestCase {
}
- public function testRegisterResolverInvalidType() {
+ public function testRegisterResolverInvalidType(): void {
$this->expectException(\InvalidArgumentException::class);
$manager = $this->getManager();
@@ -984,7 +984,7 @@ class ManagerTest extends TestCase {
}
- public function testResolveDisplayNameUnregisteredType() {
+ public function testResolveDisplayNameUnregisteredType(): void {
$this->expectException(\OutOfBoundsException::class);
$manager = $this->getManager();
@@ -997,7 +997,7 @@ class ManagerTest extends TestCase {
$manager->resolveDisplayName('galaxy', 'sombrero');
}
- public function testResolveDisplayNameDirtyResolver() {
+ public function testResolveDisplayNameDirtyResolver(): void {
$manager = $this->getManager();
$planetClosure = function () {
@@ -1021,7 +1021,7 @@ class ManagerTest extends TestCase {
* @param array $reactionsExpected
* @return void
*/
- public function testReactionAddAndDelete(array $comments, array $reactionsExpected) {
+ public function testReactionAddAndDelete(array $comments, array $reactionsExpected): void {
$this->skipIfNotSupport4ByteUTF();
$manager = $this->getManager();
@@ -1080,7 +1080,7 @@ class ManagerTest extends TestCase {
];
}
- public function testResolveDisplayNameInvalidType() {
+ public function testResolveDisplayNameInvalidType(): void {
$this->expectException(\InvalidArgumentException::class);
$manager = $this->getManager();
@@ -1119,7 +1119,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider providerTestRetrieveAllReactions
*/
- public function testRetrieveAllReactions(array $comments, array $expected) {
+ public function testRetrieveAllReactions(array $comments, array $expected): void {
$this->skipIfNotSupport4ByteUTF();
$manager = $this->getManager();
@@ -2379,7 +2379,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider providerTestRetrieveAllReactionsWithSpecificReaction
*/
- public function testRetrieveAllReactionsWithSpecificReaction(array $comments, string $reaction, array $expected) {
+ public function testRetrieveAllReactionsWithSpecificReaction(array $comments, string $reaction, array $expected): void {
$this->skipIfNotSupport4ByteUTF();
$manager = $this->getManager();
@@ -2434,7 +2434,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider providerTestGetReactionComment
*/
- public function testGetReactionComment(array $comments, array $expected, bool $notFound) {
+ public function testGetReactionComment(array $comments, array $expected, bool $notFound): void {
$this->skipIfNotSupport4ByteUTF();
$manager = $this->getManager();
@@ -2503,7 +2503,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider providerTestReactionMessageSize
*/
- public function testReactionMessageSize($reactionString, $valid) {
+ public function testReactionMessageSize($reactionString, $valid): void {
$this->skipIfNotSupport4ByteUTF();
if (!$valid) {
$this->expectException(\UnexpectedValueException::class);
@@ -2534,7 +2534,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider providerTestReactionsSummarizeOrdered
*/
- public function testReactionsSummarizeOrdered(array $comments, array $expected, bool $isFullMatch) {
+ public function testReactionsSummarizeOrdered(array $comments, array $expected, bool $isFullMatch): void {
$this->skipIfNotSupport4ByteUTF();
$manager = $this->getManager();
diff --git a/tests/lib/ConfigTest.php b/tests/lib/ConfigTest.php
index e65cf7633e1..60006aa43de 100644
--- a/tests/lib/ConfigTest.php
+++ b/tests/lib/ConfigTest.php
@@ -36,12 +36,12 @@ class ConfigTest extends TestCase {
return new \OC\Config($this->randomTmpDir, 'testconfig.php');
}
- public function testGetKeys() {
+ public function testGetKeys(): void {
$expectedConfig = ['foo', 'beers', 'alcohol_free'];
$this->assertSame($expectedConfig, $this->getConfig()->getKeys());
}
- public function testGetValue() {
+ public function testGetValue(): void {
$config = $this->getConfig();
$this->assertSame('bar', $config->getValue('foo'));
$this->assertSame(null, $config->getValue('bar'));
@@ -51,7 +51,7 @@ class ConfigTest extends TestCase {
$this->assertSame(['Appenzeller', 'Guinness', 'Kölsch'], $config->getValue('beers'));
}
- public function testGetValueReturnsEnvironmentValueIfSet() {
+ public function testGetValueReturnsEnvironmentValueIfSet(): void {
$config = $this->getConfig();
$this->assertEquals('bar', $config->getValue('foo'));
@@ -61,7 +61,7 @@ class ConfigTest extends TestCase {
putenv('NC_foo'); // unset the env variable
}
- public function testGetValueReturnsEnvironmentValueIfSetToZero() {
+ public function testGetValueReturnsEnvironmentValueIfSetToZero(): void {
$config = $this->getConfig();
$this->assertEquals('bar', $config->getValue('foo'));
@@ -71,7 +71,7 @@ class ConfigTest extends TestCase {
putenv('NC_foo'); // unset the env variable
}
- public function testGetValueReturnsEnvironmentValueIfSetToFalse() {
+ public function testGetValueReturnsEnvironmentValueIfSetToFalse(): void {
$config = $this->getConfig();
$this->assertEquals('bar', $config->getValue('foo'));
@@ -81,7 +81,7 @@ class ConfigTest extends TestCase {
putenv('NC_foo'); // unset the env variable
}
- public function testSetValue() {
+ public function testSetValue(): void {
$config = $this->getConfig();
$config->setValue('foo', 'moo');
$this->assertSame('moo', $config->getValue('foo'));
@@ -104,7 +104,7 @@ class ConfigTest extends TestCase {
$this->assertEquals($expected, $content);
}
- public function testSetValues() {
+ public function testSetValues(): void {
$config = $this->getConfig();
$content = file_get_contents($this->configFile);
$this->assertEquals(self::TESTCONTENT, $content);
@@ -134,7 +134,7 @@ class ConfigTest extends TestCase {
$this->assertEquals($expected, $content);
}
- public function testDeleteKey() {
+ public function testDeleteKey(): void {
$config = $this->getConfig();
$config->deleteKey('foo');
$this->assertSame('this_was_clearly_not_set_before', $config->getValue('foo', 'this_was_clearly_not_set_before'));
@@ -145,7 +145,7 @@ class ConfigTest extends TestCase {
$this->assertEquals($expected, $content);
}
- public function testConfigMerge() {
+ public function testConfigMerge(): void {
// Create additional config
$additionalConfig = '<?php $CONFIG=array("php53"=>"totallyOutdated");';
$additionalConfigPath = $this->randomTmpDir.'additionalConfig.testconfig.php';
diff --git a/tests/lib/Contacts/ContactsMenu/ActionFactoryTest.php b/tests/lib/Contacts/ContactsMenu/ActionFactoryTest.php
index 55129f7753f..09e0e11bd5e 100644
--- a/tests/lib/Contacts/ContactsMenu/ActionFactoryTest.php
+++ b/tests/lib/Contacts/ContactsMenu/ActionFactoryTest.php
@@ -20,7 +20,7 @@ class ActionFactoryTest extends TestCase {
$this->actionFactory = new ActionFactory();
}
- public function testNewLinkAction() {
+ public function testNewLinkAction(): void {
$icon = 'icon-test';
$name = 'Test';
$href = 'some/url';
@@ -32,7 +32,7 @@ class ActionFactoryTest extends TestCase {
$this->assertEquals(10, $action->getPriority());
}
- public function testNewEMailAction() {
+ public function testNewEMailAction(): void {
$icon = 'icon-test';
$name = 'Test';
$href = 'user@example.com';
diff --git a/tests/lib/Contacts/ContactsMenu/ActionProviderStoreTest.php b/tests/lib/Contacts/ContactsMenu/ActionProviderStoreTest.php
index e9dcb2fba81..84de6ec88e2 100644
--- a/tests/lib/Contacts/ContactsMenu/ActionProviderStoreTest.php
+++ b/tests/lib/Contacts/ContactsMenu/ActionProviderStoreTest.php
@@ -40,7 +40,7 @@ class ActionProviderStoreTest extends TestCase {
$this->actionProviderStore = new ActionProviderStore($this->serverContainer, $this->appManager, $logger);
}
- public function testGetProviders() {
+ public function testGetProviders(): void {
$user = $this->createMock(IUser::class);
$provider1 = $this->createMock(ProfileProvider::class);
$provider2 = $this->createMock(LocalTimeProvider::class);
@@ -76,7 +76,7 @@ class ActionProviderStoreTest extends TestCase {
$this->assertInstanceOf(EMailProvider::class, $providers[2]);
}
- public function testGetProvidersOfAppWithIncompleInfo() {
+ public function testGetProvidersOfAppWithIncompleInfo(): void {
$user = $this->createMock(IUser::class);
$provider1 = $this->createMock(ProfileProvider::class);
$provider2 = $this->createMock(LocalTimeProvider::class);
@@ -107,7 +107,7 @@ class ActionProviderStoreTest extends TestCase {
}
- public function testGetProvidersWithQueryException() {
+ public function testGetProvidersWithQueryException(): void {
$this->expectException(\Exception::class);
$user = $this->createMock(IUser::class);
diff --git a/tests/lib/Contacts/ContactsMenu/Actions/LinkActionTest.php b/tests/lib/Contacts/ContactsMenu/Actions/LinkActionTest.php
index a5ac4543463..5e2b416a66b 100644
--- a/tests/lib/Contacts/ContactsMenu/Actions/LinkActionTest.php
+++ b/tests/lib/Contacts/ContactsMenu/Actions/LinkActionTest.php
@@ -19,7 +19,7 @@ class LinkActionTest extends TestCase {
$this->action = new LinkAction();
}
- public function testSetIcon() {
+ public function testSetIcon(): void {
$icon = 'icon-test';
$this->action->setIcon($icon);
@@ -29,7 +29,7 @@ class LinkActionTest extends TestCase {
$this->assertEquals($json['icon'], $icon);
}
- public function testGetSetName() {
+ public function testGetSetName(): void {
$name = 'Jane Doe';
$this->assertEmpty($this->action->getName());
@@ -37,7 +37,7 @@ class LinkActionTest extends TestCase {
$this->assertEquals($name, $this->action->getName());
}
- public function testGetSetPriority() {
+ public function testGetSetPriority(): void {
$prio = 50;
$this->assertEquals(10, $this->action->getPriority());
@@ -45,7 +45,7 @@ class LinkActionTest extends TestCase {
$this->assertEquals($prio, $this->action->getPriority());
}
- public function testSetHref() {
+ public function testSetHref(): void {
$this->action->setHref('/some/url');
$json = $this->action->jsonSerialize();
@@ -53,7 +53,7 @@ class LinkActionTest extends TestCase {
$this->assertEquals('/some/url', $json['hyperlink']);
}
- public function testJsonSerialize() {
+ public function testJsonSerialize(): void {
$this->action->setIcon('icon-contacts');
$this->action->setName('Nickie Works');
$this->action->setPriority(33);
@@ -71,7 +71,7 @@ class LinkActionTest extends TestCase {
$this->assertEquals($expected, $json);
}
- public function testJsonSerializeNoAppName() {
+ public function testJsonSerializeNoAppName(): void {
$this->action->setIcon('icon-contacts');
$this->action->setName('Nickie Works');
$this->action->setPriority(33);
diff --git a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php
index d66af2925f4..a3151d0b040 100644
--- a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php
+++ b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php
@@ -69,7 +69,7 @@ class ContactsStoreTest extends TestCase {
);
}
- public function testGetContactsWithoutFilter() {
+ public function testGetContactsWithoutFilter(): void {
/** @var IUser|MockObject $user */
$user = $this->createMock(IUser::class);
$this->contactsManager->expects($this->once())
@@ -99,7 +99,7 @@ class ContactsStoreTest extends TestCase {
], $entries[1]->getEMailAddresses());
}
- public function testGetContactsHidesOwnEntry() {
+ public function testGetContactsHidesOwnEntry(): void {
/** @var IUser|MockObject $user */
$user = $this->createMock(IUser::class);
$this->contactsManager->expects($this->once())
@@ -126,7 +126,7 @@ class ContactsStoreTest extends TestCase {
$this->assertCount(1, $entries);
}
- public function testGetContactsWithoutBinaryImage() {
+ public function testGetContactsWithoutBinaryImage(): void {
/** @var IUser|MockObject $user */
$user = $this->createMock(IUser::class);
$this->urlGenerator->expects($this->any())
@@ -159,7 +159,7 @@ class ContactsStoreTest extends TestCase {
$this->assertSame('https://urlToNcAvatar.test', $entries[1]->getAvatar());
}
- public function testGetContactsWithoutAvatarURI() {
+ public function testGetContactsWithoutAvatarURI(): void {
/** @var IUser|MockObject $user */
$user = $this->createMock(IUser::class);
$this->contactsManager->expects($this->once())
@@ -188,7 +188,7 @@ class ContactsStoreTest extends TestCase {
$this->assertEquals('https://photo', $entries[1]->getAvatar());
}
- public function testGetContactsWhenUserIsInExcludeGroups() {
+ public function testGetContactsWhenUserIsInExcludeGroups(): void {
$this->config
->method('getAppValue')
->willReturnMap([
@@ -233,7 +233,7 @@ class ContactsStoreTest extends TestCase {
$this->assertCount(0, $entries);
}
- public function testGetContactsOnlyShareIfInTheSameGroup() {
+ public function testGetContactsOnlyShareIfInTheSameGroup(): void {
$this->config
->method('getAppValue')
->willReturnMap([
@@ -308,7 +308,7 @@ class ContactsStoreTest extends TestCase {
$this->assertEquals('contact', $entries[2]->getProperty('UID'));
}
- public function testGetContactsOnlyEnumerateIfInTheSameGroup() {
+ public function testGetContactsOnlyEnumerateIfInTheSameGroup(): void {
$this->config
->method('getAppValue')
->willReturnMap([
@@ -383,7 +383,7 @@ class ContactsStoreTest extends TestCase {
$this->assertEquals('contact', $entries[2]->getProperty('UID'));
}
- public function testGetContactsOnlyEnumerateIfPhoneBookMatch() {
+ public function testGetContactsOnlyEnumerateIfPhoneBookMatch(): void {
$this->config
->method('getAppValue')
->willReturnMap([
@@ -441,7 +441,7 @@ class ContactsStoreTest extends TestCase {
$this->assertEquals('contact', $entries[2]->getProperty('UID'));
}
- public function testGetContactsOnlyEnumerateIfPhoneBookMatchWithOwnGroupsOnly() {
+ public function testGetContactsOnlyEnumerateIfPhoneBookMatchWithOwnGroupsOnly(): void {
$this->config
->method('getAppValue')
->willReturnMap([
@@ -523,7 +523,7 @@ class ContactsStoreTest extends TestCase {
$this->assertEquals('contact', $entries[2]->getProperty('UID'));
}
- public function testGetContactsOnlyEnumerateIfPhoneBookOrSameGroup() {
+ public function testGetContactsOnlyEnumerateIfPhoneBookOrSameGroup(): void {
$this->config
->method('getAppValue')
->willReturnMap([
@@ -595,7 +595,7 @@ class ContactsStoreTest extends TestCase {
$this->assertEquals('contact', $entries[3]->getProperty('UID'));
}
- public function testGetContactsOnlyEnumerateIfPhoneBookOrSameGroupInOwnGroupsOnly() {
+ public function testGetContactsOnlyEnumerateIfPhoneBookOrSameGroupInOwnGroupsOnly(): void {
$this->config
->method('getAppValue')
->willReturnMap([
@@ -677,7 +677,7 @@ class ContactsStoreTest extends TestCase {
$this->assertEquals('contact', $entries[2]->getProperty('UID'));
}
- public function testGetContactsWithFilter() {
+ public function testGetContactsWithFilter(): void {
$this->config
->method('getAppValue')
->willReturnMap([
@@ -764,7 +764,7 @@ class ContactsStoreTest extends TestCase {
], $entry[0]->getEMailAddresses());
}
- public function testGetContactsWithFilterWithoutFullMatch() {
+ public function testGetContactsWithFilterWithoutFullMatch(): void {
$this->config
->method('getAppValue')
->willReturnMap([
@@ -848,7 +848,7 @@ class ContactsStoreTest extends TestCase {
], $entry[0]->getEMailAddresses());
}
- public function testFindOneUser() {
+ public function testFindOneUser(): void {
$this->config
->method('getAppValue')
->willReturnMap([
@@ -891,7 +891,7 @@ class ContactsStoreTest extends TestCase {
], $entry->getEMailAddresses());
}
- public function testFindOneEMail() {
+ public function testFindOneEMail(): void {
/** @var IUser|MockObject $user */
$user = $this->createMock(IUser::class);
$this->contactsManager->expects($this->once())
@@ -922,7 +922,7 @@ class ContactsStoreTest extends TestCase {
], $entry->getEMailAddresses());
}
- public function testFindOneNotSupportedType() {
+ public function testFindOneNotSupportedType(): void {
/** @var IUser|MockObject $user */
$user = $this->createMock(IUser::class);
@@ -931,7 +931,7 @@ class ContactsStoreTest extends TestCase {
$this->assertEquals(null, $entry);
}
- public function testFindOneNoMatches() {
+ public function testFindOneNoMatches(): void {
/** @var IUser|MockObject $user */
$user = $this->createMock(IUser::class);
$this->contactsManager->expects($this->once())
diff --git a/tests/lib/Contacts/ContactsMenu/EntryTest.php b/tests/lib/Contacts/ContactsMenu/EntryTest.php
index b06054ee77b..15f5b60b948 100644
--- a/tests/lib/Contacts/ContactsMenu/EntryTest.php
+++ b/tests/lib/Contacts/ContactsMenu/EntryTest.php
@@ -20,25 +20,25 @@ class EntryTest extends TestCase {
$this->entry = new Entry();
}
- public function testSetId() {
+ public function testSetId(): void {
$this->entry->setId(123);
$this->addToAssertionCount(1);
}
- public function testSetGetFullName() {
+ public function testSetGetFullName(): void {
$fn = 'Danette Chaille';
$this->assertEquals('', $this->entry->getFullName());
$this->entry->setFullName($fn);
$this->assertEquals($fn, $this->entry->getFullName());
}
- public function testAddGetEMailAddresses() {
+ public function testAddGetEMailAddresses(): void {
$this->assertEmpty($this->entry->getEMailAddresses());
$this->entry->addEMailAddress('user@example.com');
$this->assertEquals(['user@example.com'], $this->entry->getEMailAddresses());
}
- public function testAddAndSortAction() {
+ public function testAddAndSortAction(): void {
// Three actions, two with equal priority
$action1 = new LinkAction();
$action2 = new LinkAction();
@@ -62,7 +62,7 @@ class EntryTest extends TestCase {
$this->assertSame($action2, $sorted[2]);
}
- public function testSetGetProperties() {
+ public function testSetGetProperties(): void {
$props = [
'prop1' => 123,
'prop2' => 'string',
@@ -75,7 +75,7 @@ class EntryTest extends TestCase {
$this->assertEquals('string', $this->entry->getProperty('prop2'));
}
- public function testJsonSerialize() {
+ public function testJsonSerialize(): void {
$expectedJson = [
'id' => '123',
'fullName' => 'Guadalupe Frisbey',
diff --git a/tests/lib/Contacts/ContactsMenu/ManagerTest.php b/tests/lib/Contacts/ContactsMenu/ManagerTest.php
index 27ae9f5415c..c87bb3d5147 100644
--- a/tests/lib/Contacts/ContactsMenu/ManagerTest.php
+++ b/tests/lib/Contacts/ContactsMenu/ManagerTest.php
@@ -57,7 +57,7 @@ class ManagerTest extends TestCase {
return $entries;
}
- public function testGetFilteredEntries() {
+ public function testGetFilteredEntries(): void {
$filter = 'con';
$user = $this->createMock(IUser::class);
$entries = $this->generateTestEntries();
@@ -94,7 +94,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($expected, $data);
}
- public function testGetFilteredEntriesLimit() {
+ public function testGetFilteredEntriesLimit(): void {
$filter = 'con';
$user = $this->createMock(IUser::class);
$entries = $this->generateTestEntries();
@@ -131,7 +131,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($expected, $data);
}
- public function testGetFilteredEntriesMinSearchStringLength() {
+ public function testGetFilteredEntriesMinSearchStringLength(): void {
$filter = 'con';
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
@@ -157,7 +157,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($expected, $data);
}
- public function testFindOne() {
+ public function testFindOne(): void {
$shareTypeFilter = 42;
$shareWithFilter = 'foobar';
@@ -180,7 +180,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($entry, $data);
}
- public function testFindOne404() {
+ public function testFindOne404(): void {
$shareTypeFilter = 42;
$shareWithFilter = 'foobar';
diff --git a/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php b/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php
index 0c7c4922939..648351c2ca9 100644
--- a/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php
+++ b/tests/lib/Contacts/ContactsMenu/Providers/EMailproviderTest.php
@@ -33,7 +33,7 @@ class EMailproviderTest extends TestCase {
$this->provider = new EMailProvider($this->actionFactory, $this->urlGenerator);
}
- public function testProcess() {
+ public function testProcess(): void {
$entry = $this->createMock(IEntry::class);
$action = $this->createMock(ILinkAction::class);
$iconUrl = 'https://example.com/img/actions/icon.svg';
@@ -60,7 +60,7 @@ class EMailproviderTest extends TestCase {
$this->provider->process($entry);
}
- public function testProcessEmptyAddress() {
+ public function testProcessEmptyAddress(): void {
$entry = $this->createMock(IEntry::class);
$iconUrl = 'https://example.com/img/actions/icon.svg';
$this->urlGenerator->expects($this->once())
diff --git a/tests/lib/ContactsManagerTest.php b/tests/lib/ContactsManagerTest.php
index 91053cd0b52..6a6cd5f421a 100644
--- a/tests/lib/ContactsManagerTest.php
+++ b/tests/lib/ContactsManagerTest.php
@@ -65,7 +65,7 @@ class ContactsManagerTest extends \Test\TestCase {
/**
* @dataProvider searchProvider
*/
- public function testSearch($search1, $search2, $expectedResult) {
+ public function testSearch($search1, $search2, $expectedResult): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBook $addressbook */
$addressbook1 = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor()
@@ -99,7 +99,7 @@ class ContactsManagerTest extends \Test\TestCase {
}
- public function testDeleteHavePermission() {
+ public function testDeleteHavePermission(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBook $addressbook */
$addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor()
@@ -122,7 +122,7 @@ class ContactsManagerTest extends \Test\TestCase {
$this->assertEquals($result, 'returnMe');
}
- public function testDeleteNoPermission() {
+ public function testDeleteNoPermission(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBook $addressbook */
$addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor()
@@ -144,7 +144,7 @@ class ContactsManagerTest extends \Test\TestCase {
$this->assertEquals($result, null);
}
- public function testDeleteNoAddressbook() {
+ public function testDeleteNoAddressbook(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBook $addressbook */
$addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor()
@@ -162,7 +162,7 @@ class ContactsManagerTest extends \Test\TestCase {
$this->assertEquals($result, null);
}
- public function testCreateOrUpdateHavePermission() {
+ public function testCreateOrUpdateHavePermission(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBook $addressbook */
$addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor()
@@ -185,7 +185,7 @@ class ContactsManagerTest extends \Test\TestCase {
$this->assertEquals($result, 'returnMe');
}
- public function testCreateOrUpdateNoPermission() {
+ public function testCreateOrUpdateNoPermission(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBook $addressbook */
$addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor()
@@ -207,7 +207,7 @@ class ContactsManagerTest extends \Test\TestCase {
$this->assertEquals($result, null);
}
- public function testCreateOrUpdateNOAdressbook() {
+ public function testCreateOrUpdateNOAdressbook(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBook $addressbook */
$addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor()
@@ -225,12 +225,12 @@ class ContactsManagerTest extends \Test\TestCase {
$this->assertEquals($result, null);
}
- public function testIsEnabledIfNot() {
+ public function testIsEnabledIfNot(): void {
$result = $this->cm->isEnabled();
$this->assertFalse($result);
}
- public function testIsEnabledIfSo() {
+ public function testIsEnabledIfSo(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBook $addressbook */
$addressbook = $this->getMockBuilder('\OCP\IAddressBook')
->disableOriginalConstructor()
@@ -245,7 +245,7 @@ class ContactsManagerTest extends \Test\TestCase {
$this->assertTrue($result);
}
- public function testAddressBookEnumeration() {
+ public function testAddressBookEnumeration(): void {
// create mock for the addressbook
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBook $addressbook */
$addressbook = $this->getMockBuilder('\OCP\IAddressBook')
diff --git a/tests/lib/DB/ConnectionFactoryTest.php b/tests/lib/DB/ConnectionFactoryTest.php
index d889021f2b4..23bde34a8fb 100644
--- a/tests/lib/DB/ConnectionFactoryTest.php
+++ b/tests/lib/DB/ConnectionFactoryTest.php
@@ -31,7 +31,7 @@ class ConnectionFactoryTest extends TestCase {
* @param string $host
* @param array $expected
*/
- public function testSplitHostFromPortAndSocket($host, array $expected) {
+ public function testSplitHostFromPortAndSocket($host, array $expected): void {
/** @var SystemConfig $config */
$config = $this->createMock(SystemConfig::class);
$cacheFactory = $this->createMock(ICacheFactory::class);
diff --git a/tests/lib/DB/MigrationsTest.php b/tests/lib/DB/MigrationsTest.php
index a088ca1baf0..531e0a3805a 100644
--- a/tests/lib/DB/MigrationsTest.php
+++ b/tests/lib/DB/MigrationsTest.php
@@ -55,14 +55,14 @@ class MigrationsTest extends \Test\TestCase {
$this->appManager = Server::get(IAppManager::class);
}
- public function testGetters() {
+ public function testGetters(): void {
$this->assertEquals('testing', $this->migrationService->getApp());
$this->assertEquals(\OC::$SERVERROOT . '/apps/testing/lib/Migration', $this->migrationService->getMigrationsDirectory());
$this->assertEquals('OCA\Testing\Migration', $this->migrationService->getMigrationsNamespace());
$this->assertEquals('test_oc_migrations', $this->migrationService->getMigrationsTableName());
}
- public function testCore() {
+ public function testCore(): void {
$this->migrationService = new MigrationService('core', $this->db);
$this->assertEquals('core', $this->migrationService->getApp());
@@ -72,7 +72,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testExecuteUnknownStep() {
+ public function testExecuteUnknownStep(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Version 20170130180000 is unknown.');
@@ -80,7 +80,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testUnknownApp() {
+ public function testUnknownApp(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('App not found');
@@ -88,7 +88,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testExecuteStepWithUnknownClass() {
+ public function testExecuteStepWithUnknownClass(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Migration step \'X\' is unknown');
@@ -102,7 +102,7 @@ class MigrationsTest extends \Test\TestCase {
$this->migrationService->executeStep('20170130180000');
}
- public function testExecuteStepWithSchemaChange() {
+ public function testExecuteStepWithSchemaChange(): void {
$schema = $this->createMock(Schema::class);
$this->db->expects($this->any())
->method('createSchema')
@@ -145,7 +145,7 @@ class MigrationsTest extends \Test\TestCase {
$this->migrationService->executeStep('20170130180000');
}
- public function testExecuteStepWithoutSchemaChange() {
+ public function testExecuteStepWithoutSchemaChange(): void {
$schema = $this->createMock(Schema::class);
$this->db->expects($this->any())
->method('createSchema')
@@ -189,7 +189,7 @@ class MigrationsTest extends \Test\TestCase {
* @param string $alias
* @param string $expected
*/
- public function testGetMigration($alias, $expected) {
+ public function testGetMigration($alias, $expected): void {
$this->migrationService = $this->getMockBuilder(MigrationService::class)
->setMethods(['getMigratedVersions', 'findMigrations'])
->setConstructorArgs(['testing', $this->db])
@@ -209,7 +209,7 @@ class MigrationsTest extends \Test\TestCase {
$this->assertEquals($expected, $migration);
}
- public function testMigrate() {
+ public function testMigrate(): void {
$this->migrationService = $this->getMockBuilder(MigrationService::class)
->setMethods(['getMigratedVersions', 'findMigrations', 'executeStep'])
->setConstructorArgs(['testing', $this->db])
@@ -230,7 +230,7 @@ class MigrationsTest extends \Test\TestCase {
$this->migrationService->migrate();
}
- public function testEnsureOracleConstraintsValid() {
+ public function testEnsureOracleConstraintsValid(): void {
$column = $this->createMock(Column::class);
$column->expects($this->once())
->method('getName')
@@ -293,7 +293,7 @@ class MigrationsTest extends \Test\TestCase {
self::invokePrivate($this->migrationService, 'ensureOracleConstraints', [$sourceSchema, $schema, 3]);
}
- public function testEnsureOracleConstraintsValidWithPrimaryKey() {
+ public function testEnsureOracleConstraintsValidWithPrimaryKey(): void {
$index = $this->createMock(Index::class);
$index->expects($this->any())
->method('getName')
@@ -336,7 +336,7 @@ class MigrationsTest extends \Test\TestCase {
self::invokePrivate($this->migrationService, 'ensureOracleConstraints', [$sourceSchema, $schema, 3]);
}
- public function testEnsureOracleConstraintsValidWithPrimaryKeyDefault() {
+ public function testEnsureOracleConstraintsValidWithPrimaryKeyDefault(): void {
$defaultName = 'PRIMARY';
if ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_POSTGRES) {
$defaultName = \str_repeat('a', 26) . '_' . \str_repeat('b', 30) . '_seq';
@@ -390,7 +390,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongTableName() {
+ public function testEnsureOracleConstraintsTooLongTableName(): void {
$this->expectException(\InvalidArgumentException::class);
$table = $this->createMock(Table::class);
@@ -415,7 +415,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongPrimaryWithDefault() {
+ public function testEnsureOracleConstraintsTooLongPrimaryWithDefault(): void {
$this->expectException(\InvalidArgumentException::class);
$defaultName = 'PRIMARY';
@@ -468,7 +468,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongPrimaryWithName() {
+ public function testEnsureOracleConstraintsTooLongPrimaryWithName(): void {
$this->expectException(\InvalidArgumentException::class);
$index = $this->createMock(Index::class);
@@ -511,7 +511,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongColumnName() {
+ public function testEnsureOracleConstraintsTooLongColumnName(): void {
$this->expectException(\InvalidArgumentException::class);
$column = $this->createMock(Column::class);
@@ -545,7 +545,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongIndexName() {
+ public function testEnsureOracleConstraintsTooLongIndexName(): void {
$this->expectException(\InvalidArgumentException::class);
$index = $this->createMock(Index::class);
@@ -582,7 +582,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongForeignKeyName() {
+ public function testEnsureOracleConstraintsTooLongForeignKeyName(): void {
$this->expectException(\InvalidArgumentException::class);
$foreignKey = $this->createMock(ForeignKeyConstraint::class);
@@ -622,7 +622,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsNoPrimaryKey() {
+ public function testEnsureOracleConstraintsNoPrimaryKey(): void {
$this->markTestSkipped('Test disabled for now due to multiple reasons, see https://github.com/nextcloud/server/pull/31580#issuecomment-1069182234 for details.');
$this->expectException(\InvalidArgumentException::class);
@@ -663,7 +663,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsTooLongSequenceName() {
+ public function testEnsureOracleConstraintsTooLongSequenceName(): void {
$this->expectException(\InvalidArgumentException::class);
$sequence = $this->createMock(Sequence::class);
@@ -691,7 +691,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsBooleanNotNull() {
+ public function testEnsureOracleConstraintsBooleanNotNull(): void {
$this->expectException(\InvalidArgumentException::class);
$column = $this->createMock(Column::class);
@@ -731,7 +731,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testEnsureOracleConstraintsStringLength4000() {
+ public function testEnsureOracleConstraintsStringLength4000(): void {
$this->expectException(\InvalidArgumentException::class);
$column = $this->createMock(Column::class);
@@ -771,7 +771,7 @@ class MigrationsTest extends \Test\TestCase {
}
- public function testExtractMigrationAttributes() {
+ public function testExtractMigrationAttributes(): void {
$metadataManager = Server::get(MetadataManager::class);
$this->appManager->loadApp('testing');
@@ -780,7 +780,7 @@ class MigrationsTest extends \Test\TestCase {
$this->appManager->disableApp('testing');
}
- public function testDeserializeMigrationMetadata() {
+ public function testDeserializeMigrationMetadata(): void {
$metadataManager = Server::get(MetadataManager::class);
$this->assertEquals(
[
diff --git a/tests/lib/DB/MigratorTest.php b/tests/lib/DB/MigratorTest.php
index 929dc9aaf1b..c6afe5a053a 100644
--- a/tests/lib/DB/MigratorTest.php
+++ b/tests/lib/DB/MigratorTest.php
@@ -126,7 +126,7 @@ class MigratorTest extends \Test\TestCase {
return $config;
}
- public function testUpgrade() {
+ public function testUpgrade(): void {
[$startSchema, $endSchema] = $this->getDuplicateKeySchemas();
$migrator = $this->getMigrator();
$migrator->migrate($startSchema);
@@ -139,7 +139,7 @@ class MigratorTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testUpgradeDifferentPrefix() {
+ public function testUpgradeDifferentPrefix(): void {
$oldTablePrefix = $this->config->getSystemValueString('dbtableprefix', 'oc_');
$this->config->setSystemValue('dbtableprefix', 'ownc_');
@@ -159,7 +159,7 @@ class MigratorTest extends \Test\TestCase {
$this->config->setSystemValue('dbtableprefix', $oldTablePrefix);
}
- public function testInsertAfterUpgrade() {
+ public function testInsertAfterUpgrade(): void {
[$startSchema, $endSchema] = $this->getDuplicateKeySchemas();
$migrator = $this->getMigrator();
$migrator->migrate($startSchema);
@@ -176,7 +176,7 @@ class MigratorTest extends \Test\TestCase {
}
}
- public function testAddingPrimaryKeyWithAutoIncrement() {
+ public function testAddingPrimaryKeyWithAutoIncrement(): void {
$startSchema = new Schema([], [], $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);
$table->addColumn('id', 'integer');
@@ -196,7 +196,7 @@ class MigratorTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testReservedKeywords() {
+ public function testReservedKeywords(): void {
$startSchema = new Schema([], [], $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);
$table->addColumn('id', 'integer', ['autoincrement' => true]);
@@ -220,7 +220,7 @@ class MigratorTest extends \Test\TestCase {
/**
* Test for nextcloud/server#36803
*/
- public function testColumnCommentsInUpdate() {
+ public function testColumnCommentsInUpdate(): void {
$startSchema = new Schema([], [], $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);
$table->addColumn('id', 'integer', ['autoincrement' => true, 'comment' => 'foo']);
@@ -241,7 +241,7 @@ class MigratorTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testAddingForeignKey() {
+ public function testAddingForeignKey(): void {
$startSchema = new Schema([], [], $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);
$table->addColumn('id', 'integer', ['autoincrement' => true]);
diff --git a/tests/lib/DB/OCPostgreSqlPlatformTest.php b/tests/lib/DB/OCPostgreSqlPlatformTest.php
index 200fcbf36b3..bea3adf29a4 100644
--- a/tests/lib/DB/OCPostgreSqlPlatformTest.php
+++ b/tests/lib/DB/OCPostgreSqlPlatformTest.php
@@ -23,7 +23,7 @@ use Doctrine\DBAL\Types\Types;
* @package Test\DB
*/
class OCPostgreSqlPlatformTest extends \Test\TestCase {
- public function testAlterBigint() {
+ public function testAlterBigint(): void {
$platform = new PostgreSQLPlatform();
$sourceSchema = new Schema();
$targetSchema = new Schema();
diff --git a/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php b/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php
index 68dc4c1b712..ed6e328881b 100644
--- a/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php
+++ b/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php
@@ -52,7 +52,7 @@ class ExpressionBuilderDBTest extends TestCase {
* @param string $param2
* @param boolean $match
*/
- public function testLike($param1, $param2, $match) {
+ public function testLike($param1, $param2, $match): void {
$query = $this->connection->getQueryBuilder();
$query->select(new Literal('1'))
@@ -89,7 +89,7 @@ class ExpressionBuilderDBTest extends TestCase {
* @param string $param2
* @param boolean $match
*/
- public function testILike($param1, $param2, $match) {
+ public function testILike($param1, $param2, $match): void {
$query = $this->connection->getQueryBuilder();
$query->select(new Literal('1'))
@@ -141,7 +141,7 @@ class ExpressionBuilderDBTest extends TestCase {
self::assertEquals('myvalue', $entries[0]['configvalue']);
}
- public function testDateTimeEquals() {
+ public function testDateTimeEquals(): void {
$dateTime = new \DateTime('2023-01-01');
$insert = $this->connection->getQueryBuilder();
$insert->insert('testing')
@@ -158,7 +158,7 @@ class ExpressionBuilderDBTest extends TestCase {
self::assertCount(1, $entries);
}
- public function testDateTimeLess() {
+ public function testDateTimeLess(): void {
$dateTime = new \DateTime('2022-01-01');
$dateTimeCompare = new \DateTime('2022-01-02');
$insert = $this->connection->getQueryBuilder();
@@ -176,7 +176,7 @@ class ExpressionBuilderDBTest extends TestCase {
self::assertCount(1, $entries);
}
- public function testDateTimeGreater() {
+ public function testDateTimeGreater(): void {
$dateTime = new \DateTime('2023-01-02');
$dateTimeCompare = new \DateTime('2023-01-01');
$insert = $this->connection->getQueryBuilder();
diff --git a/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php b/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php
index 4ac5cbc8292..c14c55e6d02 100644
--- a/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php
+++ b/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php
@@ -72,7 +72,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input2
* @param bool $isInput2Literal
*/
- public function testComparison($comparison, $input1, $isInput1Literal, $input2, $isInput2Literal) {
+ public function testComparison($comparison, $input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -99,7 +99,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input2
* @param bool $isInput2Literal
*/
- public function testEquals($input1, $isInput1Literal, $input2, $isInput2Literal) {
+ public function testEquals($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -117,7 +117,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input2
* @param bool $isInput2Literal
*/
- public function testNotEquals($input1, $isInput1Literal, $input2, $isInput2Literal) {
+ public function testNotEquals($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -135,7 +135,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input2
* @param bool $isInput2Literal
*/
- public function testLowerThan($input1, $isInput1Literal, $input2, $isInput2Literal) {
+ public function testLowerThan($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -153,7 +153,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input2
* @param bool $isInput2Literal
*/
- public function testLowerThanEquals($input1, $isInput1Literal, $input2, $isInput2Literal) {
+ public function testLowerThanEquals($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -171,7 +171,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input2
* @param bool $isInput2Literal
*/
- public function testGreaterThan($input1, $isInput1Literal, $input2, $isInput2Literal) {
+ public function testGreaterThan($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -189,7 +189,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input2
* @param bool $isInput2Literal
*/
- public function testGreaterThanEquals($input1, $isInput1Literal, $input2, $isInput2Literal) {
+ public function testGreaterThanEquals($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -199,14 +199,14 @@ class ExpressionBuilderTest extends TestCase {
);
}
- public function testIsNull() {
+ public function testIsNull(): void {
$this->assertEquals(
$this->doctrineExpressionBuilder->isNull('`test`'),
$this->expressionBuilder->isNull('test')
);
}
- public function testIsNotNull() {
+ public function testIsNotNull(): void {
$this->assertEquals(
$this->doctrineExpressionBuilder->isNotNull('`test`'),
$this->expressionBuilder->isNotNull('test')
@@ -226,7 +226,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input
* @param bool $isLiteral
*/
- public function testLike($input, $isLiteral) {
+ public function testLike($input, $isLiteral): void {
[$doctrineInput, $ocInput] = $this->helpWithLiteral($input, $isLiteral);
$this->assertEquals(
@@ -241,7 +241,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input
* @param bool $isLiteral
*/
- public function testNotLike($input, $isLiteral) {
+ public function testNotLike($input, $isLiteral): void {
[$doctrineInput, $ocInput] = $this->helpWithLiteral($input, $isLiteral);
$this->assertEquals(
@@ -265,7 +265,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input
* @param bool $isLiteral
*/
- public function testIn($input, $isLiteral) {
+ public function testIn($input, $isLiteral): void {
[$doctrineInput, $ocInput] = $this->helpWithLiteral($input, $isLiteral);
$this->assertEquals(
@@ -280,7 +280,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input
* @param bool $isLiteral
*/
- public function testNotIn($input, $isLiteral) {
+ public function testNotIn($input, $isLiteral): void {
[$doctrineInput, $ocInput] = $this->helpWithLiteral($input, $isLiteral);
$this->assertEquals(
@@ -334,7 +334,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input
* @param string|null $type
*/
- public function testLiteral($input, $type) {
+ public function testLiteral($input, $type): void {
/** @var \OC\DB\QueryBuilder\Literal $actual */
$actual = $this->expressionBuilder->literal($input, $type);
@@ -380,7 +380,7 @@ class ExpressionBuilderTest extends TestCase {
* @param bool $compareKeyToValue
* @param int $expected
*/
- public function testClobComparisons($function, $value, $type, $compareKeyToValue, $expected) {
+ public function testClobComparisons($function, $value, $type, $compareKeyToValue, $expected): void {
$appId = $this->getUniqueID('testing');
$this->createConfig($appId, 1, 4);
$this->createConfig($appId, 2, 5);
diff --git a/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php b/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
index 4f7cc4dd39f..f3007ace85c 100644
--- a/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
+++ b/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
@@ -30,7 +30,7 @@ class FunctionBuilderTest extends TestCase {
/**
* @dataProvider providerTestConcatString
*/
- public function testConcatString($closure) {
+ public function testConcatString($closure): void {
$query = $this->connection->getQueryBuilder();
[$real, $arguments, $return] = $closure($query);
if ($real) {
@@ -232,7 +232,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEqualsCanonicalizing([1,2,3], $actual);
}
- public function testMd5() {
+ public function testMd5(): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->md5($query->createNamedParameter('foobar')));
@@ -245,7 +245,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals(md5('foobar'), $column);
}
- public function testSubstring() {
+ public function testSubstring(): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->substring($query->createNamedParameter('foobar'), new Literal(2), $query->createNamedParameter(2)));
@@ -258,7 +258,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals('oo', $column);
}
- public function testSubstringNoLength() {
+ public function testSubstringNoLength(): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->substring($query->createNamedParameter('foobar'), new Literal(2)));
@@ -271,7 +271,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals('oobar', $column);
}
- public function testLower() {
+ public function testLower(): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->lower($query->createNamedParameter('FooBar')));
@@ -284,7 +284,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals('foobar', $column);
}
- public function testAdd() {
+ public function testAdd(): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->add($query->createNamedParameter(2, IQueryBuilder::PARAM_INT), new Literal(1)));
@@ -297,7 +297,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals(3, $column);
}
- public function testSubtract() {
+ public function testSubtract(): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->subtract($query->createNamedParameter(2, IQueryBuilder::PARAM_INT), new Literal(1)));
@@ -310,7 +310,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals(1, $column);
}
- public function testCount() {
+ public function testCount(): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->count('appid'));
@@ -335,7 +335,7 @@ class FunctionBuilderTest extends TestCase {
/**
* @dataProvider octetLengthProvider
*/
- public function testOctetLength(string $str, int $bytes) {
+ public function testOctetLength(string $str, int $bytes): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->octetLength($query->createNamedParameter($str, IQueryBuilder::PARAM_STR)));
@@ -360,7 +360,7 @@ class FunctionBuilderTest extends TestCase {
/**
* @dataProvider charLengthProvider
*/
- public function testCharLength(string $str, int $bytes) {
+ public function testCharLength(string $str, int $bytes): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->charLength($query->createNamedParameter($str, IQueryBuilder::PARAM_STR)));
@@ -393,7 +393,7 @@ class FunctionBuilderTest extends TestCase {
$query->execute();
}
- public function testMaxEmpty() {
+ public function testMaxEmpty(): void {
$this->clearMinMax();
$query = $this->connection->getQueryBuilder();
@@ -409,7 +409,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals(null, $row);
}
- public function testMinEmpty() {
+ public function testMinEmpty(): void {
$this->clearMinMax();
$query = $this->connection->getQueryBuilder();
@@ -425,7 +425,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals(null, $row);
}
- public function testMax() {
+ public function testMax(): void {
$this->clearMinMax();
$this->setUpMinMax(10);
$this->setUpMinMax(11);
@@ -444,7 +444,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals(20, $row);
}
- public function testMin() {
+ public function testMin(): void {
$this->clearMinMax();
$this->setUpMinMax(10);
$this->setUpMinMax(11);
@@ -463,7 +463,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals(10, $row);
}
- public function testGreatest() {
+ public function testGreatest(): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->greatest($query->createNamedParameter(2, IQueryBuilder::PARAM_INT), new Literal(1)));
@@ -476,7 +476,7 @@ class FunctionBuilderTest extends TestCase {
$this->assertEquals(2, $row);
}
- public function testLeast() {
+ public function testLeast(): void {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->least($query->createNamedParameter(2, IQueryBuilder::PARAM_INT), new Literal(1)));
diff --git a/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php b/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php
index 12ba74fe89f..88a3c125044 100644
--- a/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php
+++ b/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php
@@ -115,7 +115,7 @@ class PartitionedQueryBuilderTest extends TestCase {
$query->executeStatement();
}
- public function testSimpleOnlyPartitionQuery() {
+ public function testSimpleOnlyPartitionQuery(): void {
$builder = $this->getQueryBuilder();
$builder->addPartition(new PartitionSplit('filecache', ['filecache']));
@@ -129,7 +129,7 @@ class PartitionedQueryBuilderTest extends TestCase {
$this->assertEquals($results[0]['path'], 'file1');
}
- public function testSimplePartitionedQuery() {
+ public function testSimplePartitionedQuery(): void {
$builder = $this->getQueryBuilder();
$builder->addPartition(new PartitionSplit('filecache', ['filecache']));
@@ -151,7 +151,7 @@ class PartitionedQueryBuilderTest extends TestCase {
$this->assertEquals($results[0]['path'], 'file1');
}
- public function testMultiTablePartitionedQuery() {
+ public function testMultiTablePartitionedQuery(): void {
$builder = $this->getQueryBuilder();
$builder->addPartition(new PartitionSplit('filecache', ['filecache', 'filecache_extended']));
@@ -174,7 +174,7 @@ class PartitionedQueryBuilderTest extends TestCase {
$this->assertEquals($results[0]['upload_time'], 1234);
}
- public function testPartitionedQueryFromSplit() {
+ public function testPartitionedQueryFromSplit(): void {
$builder = $this->getQueryBuilder();
$builder->addPartition(new PartitionSplit('filecache', ['filecache']));
@@ -195,7 +195,7 @@ class PartitionedQueryBuilderTest extends TestCase {
$this->assertEquals($results[0]['path'], 'file1');
}
- public function testMultiJoinPartitionedQuery() {
+ public function testMultiJoinPartitionedQuery(): void {
$builder = $this->getQueryBuilder();
$builder->addPartition(new PartitionSplit('filecache', ['filecache']));
diff --git a/tests/lib/DB/QueryBuilder/QueryBuilderTest.php b/tests/lib/DB/QueryBuilder/QueryBuilderTest.php
index 335666b54fd..508748f13b2 100644
--- a/tests/lib/DB/QueryBuilder/QueryBuilderTest.php
+++ b/tests/lib/DB/QueryBuilder/QueryBuilderTest.php
@@ -103,7 +103,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param int|null $firstResult
* @param array $expectedSet
*/
- public function testFirstResult($firstResult, $expectedSet) {
+ public function testFirstResult($firstResult, $expectedSet): void {
$this->deleteTestingRows();
$this->createTestingRows();
@@ -140,7 +140,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param int $maxResult
* @param array $expectedSet
*/
- public function testMaxResults($maxResult, $expectedSet) {
+ public function testMaxResults($maxResult, $expectedSet): void {
$this->deleteTestingRows();
$this->createTestingRows();
@@ -193,7 +193,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expected
* @param string $expectedLiteral
*/
- public function testSelect($selectArguments, $expected, $expectedLiteral = '') {
+ public function testSelect($selectArguments, $expected, $expectedLiteral = ''): void {
$this->deleteTestingRows();
$this->createTestingRows();
@@ -246,7 +246,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $alias
* @param array $expected
*/
- public function testSelectAlias($select, $alias, $expected) {
+ public function testSelectAlias($select, $alias, $expected): void {
$this->deleteTestingRows();
$this->createTestingRows();
@@ -272,7 +272,7 @@ class QueryBuilderTest extends \Test\TestCase {
$this->deleteTestingRows();
}
- public function testSelectDistinct() {
+ public function testSelectDistinct(): void {
$this->deleteTestingRows('testFirstResult1');
$this->deleteTestingRows('testFirstResult2');
$this->createTestingRows('testFirstResult1');
@@ -300,7 +300,7 @@ class QueryBuilderTest extends \Test\TestCase {
$this->deleteTestingRows('testFirstResult2');
}
- public function testSelectDistinctMultiple() {
+ public function testSelectDistinctMultiple(): void {
$this->deleteTestingRows('testFirstResult1');
$this->deleteTestingRows('testFirstResult2');
$this->createTestingRows('testFirstResult1');
@@ -370,7 +370,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expected
* @param string $expectedLiteral
*/
- public function testAddSelect($selectArguments, $expected, $expectedLiteral = '') {
+ public function testAddSelect($selectArguments, $expected, $expectedLiteral = ''): void {
$this->deleteTestingRows();
$this->createTestingRows();
@@ -423,7 +423,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testDelete($tableName, $tableAlias, $expectedQueryPart, $expectedQuery) {
+ public function testDelete($tableName, $tableAlias, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->delete($tableName, $tableAlias);
$this->assertSame(
@@ -452,7 +452,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testUpdate($tableName, $tableAlias, $expectedQueryPart, $expectedQuery) {
+ public function testUpdate($tableName, $tableAlias, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->update($tableName, $tableAlias);
$this->assertSame(
@@ -479,7 +479,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testInsert($tableName, $expectedQueryPart, $expectedQuery) {
+ public function testInsert($tableName, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->insert($tableName);
$this->assertSame(
@@ -524,7 +524,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testFrom($table1Name, $table1Alias, $table2Name, $table2Alias, $expectedQueryPart, $expectedQuery) {
+ public function testFrom($table1Name, $table1Alias, $table2Name, $table2Alias, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->from($table1Name, $table1Alias);
if ($table2Name !== null) {
$this->queryBuilder->from($table2Name, $table2Alias);
@@ -572,7 +572,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery) {
+ public function testJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->from('data1', 'd1');
$this->queryBuilder->join(
$fromAlias,
@@ -602,7 +602,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testInnerJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery) {
+ public function testInnerJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->from('data1', 'd1');
$this->queryBuilder->innerJoin(
$fromAlias,
@@ -652,7 +652,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testLeftJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery) {
+ public function testLeftJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->from('data1', 'd1');
$this->queryBuilder->leftJoin(
$fromAlias,
@@ -702,7 +702,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testRightJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery) {
+ public function testRightJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->from('data1', 'd1');
$this->queryBuilder->rightJoin(
$fromAlias,
@@ -741,7 +741,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testSet($partOne1, $partOne2, $partTwo1, $partTwo2, $expectedQueryPart, $expectedQuery) {
+ public function testSet($partOne1, $partOne2, $partTwo1, $partTwo2, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->update('data');
$this->queryBuilder->set($partOne1, $partOne2);
if ($partTwo1 !== null) {
@@ -773,7 +773,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testWhere($whereArguments, $expectedQueryPart, $expectedQuery) {
+ public function testWhere($whereArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->select('column');
call_user_func_array(
[$this->queryBuilder, 'where'],
@@ -798,7 +798,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testAndWhere($whereArguments, $expectedQueryPart, $expectedQuery) {
+ public function testAndWhere($whereArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->select('column');
call_user_func_array(
[$this->queryBuilder, 'andWhere'],
@@ -830,7 +830,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testOrWhere($whereArguments, $expectedQueryPart, $expectedQuery) {
+ public function testOrWhere($whereArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->select('column');
call_user_func_array(
[$this->queryBuilder, 'orWhere'],
@@ -862,7 +862,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testGroupBy($groupByArguments, $expectedQueryPart, $expectedQuery) {
+ public function testGroupBy($groupByArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->select('column');
call_user_func_array(
[$this->queryBuilder, 'groupBy'],
@@ -894,7 +894,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testAddGroupBy($groupByArguments, $expectedQueryPart, $expectedQuery) {
+ public function testAddGroupBy($groupByArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->select('column');
$this->queryBuilder->groupBy('column1');
call_user_func_array(
@@ -927,7 +927,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testSetValue($column, $value, $expectedQueryPart, $expectedQuery) {
+ public function testSetValue($column, $value, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->insert('data');
$this->queryBuilder->setValue($column, $value);
@@ -950,7 +950,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testValues($column, $value, $expectedQueryPart, $expectedQuery) {
+ public function testValues($column, $value, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->insert('data');
$this->queryBuilder->values([
$column => $value,
@@ -991,7 +991,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testHaving($havingArguments, $expectedQueryPart, $expectedQuery) {
+ public function testHaving($havingArguments, $expectedQueryPart, $expectedQuery): void {
call_user_func_array(
[$this->queryBuilder, 'having'],
$havingArguments
@@ -1032,7 +1032,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testAndHaving($havingArguments, $expectedQueryPart, $expectedQuery) {
+ public function testAndHaving($havingArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->having('condition1');
call_user_func_array(
[$this->queryBuilder, 'andHaving'],
@@ -1074,7 +1074,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testOrHaving($havingArguments, $expectedQueryPart, $expectedQuery) {
+ public function testOrHaving($havingArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->having('condition1');
call_user_func_array(
[$this->queryBuilder, 'orHaving'],
@@ -1108,7 +1108,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testOrderBy($sort, $order, $expectedQueryPart, $expectedQuery) {
+ public function testOrderBy($sort, $order, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->orderBy($sort, $order);
$this->assertEquals(
@@ -1145,7 +1145,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
- public function testAddOrderBy($sort2, $order2, $order1, $expectedQueryPart, $expectedQuery) {
+ public function testAddOrderBy($sort2, $order2, $order1, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->orderBy('column1', $order1);
$this->queryBuilder->addOrderBy($sort2, $order2);
@@ -1160,7 +1160,7 @@ class QueryBuilderTest extends \Test\TestCase {
);
}
- public function testGetLastInsertId() {
+ public function testGetLastInsertId(): void {
$qB = $this->connection->getQueryBuilder();
try {
@@ -1223,7 +1223,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param bool $automatic
* @param string $expected
*/
- public function testGetTableName($tableName, $automatic, $expected) {
+ public function testGetTableName($tableName, $automatic, $expected): void {
if ($automatic !== null) {
$this->queryBuilder->automaticTablePrefix($automatic);
}
@@ -1247,7 +1247,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param string $prefix
* @param string $expected
*/
- public function testGetColumnName($column, $prefix, $expected) {
+ public function testGetColumnName($column, $prefix, $expected): void {
$this->assertSame(
$expected,
$this->queryBuilder->getColumnName($column, $prefix)
@@ -1263,7 +1263,7 @@ class QueryBuilderTest extends \Test\TestCase {
return $connection;
}
- public function testExecuteWithoutLogger() {
+ public function testExecuteWithoutLogger(): void {
$queryBuilder = $this->createMock(\Doctrine\DBAL\Query\QueryBuilder::class);
$queryBuilder
->method('getSQL')
@@ -1291,7 +1291,7 @@ class QueryBuilderTest extends \Test\TestCase {
$this->assertEquals(3, $this->queryBuilder->execute());
}
- public function testExecuteWithLoggerAndNamedArray() {
+ public function testExecuteWithLoggerAndNamedArray(): void {
$queryBuilder = $this->createMock(\Doctrine\DBAL\Query\QueryBuilder::class);
$queryBuilder
->expects($this->any())
@@ -1335,7 +1335,7 @@ class QueryBuilderTest extends \Test\TestCase {
$this->assertEquals(3, $this->queryBuilder->execute());
}
- public function testExecuteWithLoggerAndUnnamedArray() {
+ public function testExecuteWithLoggerAndUnnamedArray(): void {
$queryBuilder = $this->createMock(\Doctrine\DBAL\Query\QueryBuilder::class);
$queryBuilder
->expects($this->any())
@@ -1373,7 +1373,7 @@ class QueryBuilderTest extends \Test\TestCase {
$this->assertEquals(3, $this->queryBuilder->execute());
}
- public function testExecuteWithLoggerAndNoParams() {
+ public function testExecuteWithLoggerAndNoParams(): void {
$queryBuilder = $this->createMock(\Doctrine\DBAL\Query\QueryBuilder::class);
$queryBuilder
->expects($this->any())
@@ -1410,7 +1410,7 @@ class QueryBuilderTest extends \Test\TestCase {
$this->assertEquals(3, $this->queryBuilder->execute());
}
- public function testExecuteWithParameterTooLarge() {
+ public function testExecuteWithParameterTooLarge(): void {
$queryBuilder = $this->createMock(\Doctrine\DBAL\Query\QueryBuilder::class);
$p = array_fill(0, 1001, 'foo');
$queryBuilder
@@ -1445,7 +1445,7 @@ class QueryBuilderTest extends \Test\TestCase {
$this->queryBuilder->execute();
}
- public function testExecuteWithParametersTooMany() {
+ public function testExecuteWithParametersTooMany(): void {
$queryBuilder = $this->createMock(\Doctrine\DBAL\Query\QueryBuilder::class);
$p = array_fill(0, 999, 'foo');
$queryBuilder
diff --git a/tests/lib/DB/QueryBuilder/QuoteHelperTest.php b/tests/lib/DB/QueryBuilder/QuoteHelperTest.php
index 12984bac3e0..3c2e33c28ea 100644
--- a/tests/lib/DB/QueryBuilder/QuoteHelperTest.php
+++ b/tests/lib/DB/QueryBuilder/QuoteHelperTest.php
@@ -41,7 +41,7 @@ class QuoteHelperTest extends \Test\TestCase {
* @param mixed $input
* @param string $expected
*/
- public function testQuoteColumnName($input, $expected) {
+ public function testQuoteColumnName($input, $expected): void {
$this->assertSame(
$expected,
$this->helper->quoteColumnName($input)
@@ -76,7 +76,7 @@ class QuoteHelperTest extends \Test\TestCase {
* @param mixed $input
* @param string $expected
*/
- public function testQuoteColumnNames($input, $expected) {
+ public function testQuoteColumnNames($input, $expected): void {
$this->assertSame(
$expected,
$this->helper->quoteColumnNames($input)
diff --git a/tests/lib/DB/QueryBuilder/Sharded/SharedQueryBuilderTest.php b/tests/lib/DB/QueryBuilder/Sharded/SharedQueryBuilderTest.php
index 8f95c1b6263..a135b9159dd 100644
--- a/tests/lib/DB/QueryBuilder/Sharded/SharedQueryBuilderTest.php
+++ b/tests/lib/DB/QueryBuilder/Sharded/SharedQueryBuilderTest.php
@@ -46,7 +46,7 @@ class SharedQueryBuilderTest extends TestCase {
);
}
- public function testGetShardKeySingleParam() {
+ public function testGetShardKeySingleParam(): void {
$query = $this->getQueryBuilder('filecache', 'storage', 'fileid');
$query->select('fileid', 'path')
->from('filecache')
@@ -56,7 +56,7 @@ class SharedQueryBuilderTest extends TestCase {
$this->assertEquals([10], $query->getShardKeys());
}
- public function testGetPrimaryKeyParam() {
+ public function testGetPrimaryKeyParam(): void {
$query = $this->getQueryBuilder('filecache', 'storage', 'fileid');
$query->select('fileid', 'path')
->from('filecache')
@@ -66,7 +66,7 @@ class SharedQueryBuilderTest extends TestCase {
$this->assertEquals([], $query->getShardKeys());
}
- public function testValidateWithShardKey() {
+ public function testValidateWithShardKey(): void {
$query = $this->getQueryBuilder('filecache', 'storage', 'fileid');
$query->select('fileid', 'path')
->from('filecache')
@@ -76,7 +76,7 @@ class SharedQueryBuilderTest extends TestCase {
$this->assertTrue(true);
}
- public function testValidateWithPrimaryKey() {
+ public function testValidateWithPrimaryKey(): void {
$query = $this->getQueryBuilder('filecache', 'storage', 'fileid');
$query->select('fileid', 'path')
->from('filecache')
@@ -86,7 +86,7 @@ class SharedQueryBuilderTest extends TestCase {
$this->assertTrue(true);
}
- public function testValidateWithNoKey() {
+ public function testValidateWithNoKey(): void {
$query = $this->getQueryBuilder('filecache', 'storage', 'fileid');
$query->select('fileid', 'path')
->from('filecache')
@@ -97,7 +97,7 @@ class SharedQueryBuilderTest extends TestCase {
$this->fail('exception expected');
}
- public function testValidateNonSharedTable() {
+ public function testValidateNonSharedTable(): void {
$query = $this->getQueryBuilder('filecache', 'storage', 'fileid');
$query->select('configvalue')
->from('appconfig')
@@ -107,7 +107,7 @@ class SharedQueryBuilderTest extends TestCase {
$this->assertTrue(true);
}
- public function testGetShardKeyMultipleSingleParam() {
+ public function testGetShardKeyMultipleSingleParam(): void {
$query = $this->getQueryBuilder('filecache', 'storage', 'fileid');
$query->select('fileid', 'path')
->from('filecache')
diff --git a/tests/lib/DateTimeFormatterTest.php b/tests/lib/DateTimeFormatterTest.php
index 8f6dacd4678..924cac9d399 100644
--- a/tests/lib/DateTimeFormatterTest.php
+++ b/tests/lib/DateTimeFormatterTest.php
@@ -77,7 +77,7 @@ class DateTimeFormatterTest extends TestCase {
/**
* @dataProvider formatTimeSpanData
*/
- public function testFormatTimeSpan($expected, $timestamp, $compare, $locale = null) {
+ public function testFormatTimeSpan($expected, $timestamp, $compare, $locale = null): void {
$this->assertEquals((string)$expected, (string)$this->formatter->formatTimeSpan($timestamp, $compare, $locale));
}
@@ -143,7 +143,7 @@ class DateTimeFormatterTest extends TestCase {
/**
* @dataProvider formatDateSpanData
*/
- public function testFormatDateSpan($expected, $timestamp, $compare = null, $locale = null) {
+ public function testFormatDateSpan($expected, $timestamp, $compare = null, $locale = null): void {
$this->assertEquals((string)$expected, (string)$this->formatter->formatDateSpan($timestamp, $compare, $locale));
}
@@ -156,7 +156,7 @@ class DateTimeFormatterTest extends TestCase {
/**
* @dataProvider formatDateData
*/
- public function testFormatDate($timestamp, $expected) {
+ public function testFormatDate($timestamp, $expected): void {
$this->assertEquals($expected, (string)$this->formatter->formatDate($timestamp));
}
@@ -170,12 +170,12 @@ class DateTimeFormatterTest extends TestCase {
/**
* @dataProvider formatDateTimeData
*/
- public function testFormatDateTime($timestamp, $timeZone, $expected) {
+ public function testFormatDateTime($timestamp, $timeZone, $expected): void {
$this->assertEquals($expected, (string)$this->formatter->formatDateTime($timestamp, 'long', 'long', $timeZone));
}
- public function testFormatDateWithInvalidTZ() {
+ public function testFormatDateWithInvalidTZ(): void {
$this->expectException(\Exception::class);
$this->formatter->formatDate(1350129205, 'long', new \DateTimeZone('Mordor/Barad-dûr'));
diff --git a/tests/lib/Diagnostics/EventLoggerTest.php b/tests/lib/Diagnostics/EventLoggerTest.php
index 46a58e4275d..3ad13702679 100644
--- a/tests/lib/Diagnostics/EventLoggerTest.php
+++ b/tests/lib/Diagnostics/EventLoggerTest.php
@@ -27,7 +27,7 @@ class EventLoggerTest extends TestCase {
);
}
- public function testQueryLogger() {
+ public function testQueryLogger(): void {
// Module is not activated and this should not be logged
$this->logger->start('test1', 'testevent1');
$this->logger->end('test1');
diff --git a/tests/lib/Diagnostics/QueryLoggerTest.php b/tests/lib/Diagnostics/QueryLoggerTest.php
index 04b8d8570e7..6450c153b39 100644
--- a/tests/lib/Diagnostics/QueryLoggerTest.php
+++ b/tests/lib/Diagnostics/QueryLoggerTest.php
@@ -20,7 +20,7 @@ class QueryLoggerTest extends TestCase {
$this->logger = new QueryLogger();
}
- public function testQueryLogger() {
+ public function testQueryLogger(): void {
// Module is not activated and this should not be logged
$this->logger->startQuery('SELECT', ['testuser', 'count'], ['string', 'int']);
$this->logger->stopQuery();
diff --git a/tests/lib/DirectEditing/ManagerTest.php b/tests/lib/DirectEditing/ManagerTest.php
index 3dc2e464c37..d26817438cf 100644
--- a/tests/lib/DirectEditing/ManagerTest.php
+++ b/tests/lib/DirectEditing/ManagerTest.php
@@ -156,12 +156,12 @@ class ManagerTest extends TestCase {
$this->manager->registerDirectEditor($this->editor);
}
- public function testEditorRegistration() {
+ public function testEditorRegistration(): void {
$this->assertEquals($this->manager->getEditors(), ['testeditor' => $this->editor]);
}
- public function testCreateToken() {
+ public function testCreateToken(): void {
$expectedToken = 'TOKEN' . time();
$file = $this->createMock(File::class);
$file->expects($this->any())
@@ -186,7 +186,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($token, $expectedToken);
}
- public function testCreateTokenAccess() {
+ public function testCreateTokenAccess(): void {
$expectedToken = 'TOKEN' . time();
$file = $this->createMock(File::class);
$file->expects($this->any())
@@ -214,7 +214,7 @@ class ManagerTest extends TestCase {
$this->assertInstanceOf(NotFoundResponse::class, $secondResult);
}
- public function testOpenByPath() {
+ public function testOpenByPath(): void {
$expectedToken = 'TOKEN' . time();
$file = $this->createMock(File::class);
$file->expects($this->any())
@@ -245,7 +245,7 @@ class ManagerTest extends TestCase {
$this->assertInstanceOf(NotFoundResponse::class, $secondResult);
}
- public function testOpenById() {
+ public function testOpenById(): void {
$expectedToken = 'TOKEN' . time();
$fileRead = $this->createMock(File::class);
$fileRead->method('getPermissions')
@@ -294,7 +294,7 @@ class ManagerTest extends TestCase {
$this->assertInstanceOf(NotFoundResponse::class, $secondResult);
}
- public function testCreateFileAlreadyExists() {
+ public function testCreateFileAlreadyExists(): void {
$this->expectException(\RuntimeException::class);
$this->userFolder
->method('nodeExists')
diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php
index a74c0308986..d073efc8235 100644
--- a/tests/lib/Encryption/DecryptAllTest.php
+++ b/tests/lib/Encryption/DecryptAllTest.php
@@ -98,7 +98,7 @@ class DecryptAllTest extends TestCase {
* @param string $user
* @param bool $userExistsChecked
*/
- public function testDecryptAll($prepareResult, $user, $userExistsChecked) {
+ public function testDecryptAll($prepareResult, $user, $userExistsChecked): void {
if ($userExistsChecked) {
$this->userManager->expects($this->once())->method('userExists')->willReturn(true);
} else {
@@ -135,7 +135,7 @@ class DecryptAllTest extends TestCase {
/**
* test decrypt all call with a user who doesn't exists
*/
- public function testDecryptAllWrongUser() {
+ public function testDecryptAllWrongUser(): void {
$this->userManager->expects($this->once())->method('userExists')->willReturn(false);
$this->outputInterface->expects($this->once())->method('writeln')
->with('User "user1" does not exist. Please check the username and try again');
@@ -156,7 +156,7 @@ class DecryptAllTest extends TestCase {
* @dataProvider dataTrueFalse
* @param bool $success
*/
- public function testPrepareEncryptionModules($success) {
+ public function testPrepareEncryptionModules($success): void {
$user = 'user1';
$dummyEncryptionModule = $this->getMockBuilder('OCP\Encryption\IEncryptionModule')
@@ -188,7 +188,7 @@ class DecryptAllTest extends TestCase {
/**
* @dataProvider dataTestDecryptAllUsersFiles
*/
- public function testDecryptAllUsersFiles($user) {
+ public function testDecryptAllUsersFiles($user): void {
/** @var DecryptAll | \PHPUnit\Framework\MockObject\MockObject | $instance */
$instance = $this->getMockBuilder('OC\Encryption\DecryptAll')
->setConstructorArgs(
@@ -233,7 +233,7 @@ class DecryptAllTest extends TestCase {
];
}
- public function testDecryptUsersFiles() {
+ public function testDecryptUsersFiles(): void {
/** @var DecryptAll | \PHPUnit\Framework\MockObject\MockObject $instance */
$instance = $this->getMockBuilder('OC\Encryption\DecryptAll')
->setConstructorArgs(
@@ -308,7 +308,7 @@ class DecryptAllTest extends TestCase {
/**
* @dataProvider dataTrueFalse
*/
- public function testDecryptFile($isEncrypted) {
+ public function testDecryptFile($isEncrypted): void {
$path = 'test.txt';
/** @var DecryptAll | \PHPUnit\Framework\MockObject\MockObject $instance */
@@ -348,7 +348,7 @@ class DecryptAllTest extends TestCase {
);
}
- public function testDecryptFileFailure() {
+ public function testDecryptFileFailure(): void {
$path = 'test.txt';
/** @var DecryptAll | \PHPUnit\Framework\MockObject\MockObject $instance */
diff --git a/tests/lib/Encryption/EncryptionWrapperTest.php b/tests/lib/Encryption/EncryptionWrapperTest.php
index a5985c6c30d..1ecb9dc89c7 100644
--- a/tests/lib/Encryption/EncryptionWrapperTest.php
+++ b/tests/lib/Encryption/EncryptionWrapperTest.php
@@ -41,7 +41,7 @@ class EncryptionWrapperTest extends TestCase {
/**
* @dataProvider provideWrapStorage
*/
- public function testWrapStorage($expectedWrapped, $wrappedStorages) {
+ public function testWrapStorage($expectedWrapped, $wrappedStorages): void {
$storage = $this->getMockBuilder(Storage::class)
->disableOriginalConstructor()
->getMock();
diff --git a/tests/lib/Encryption/Keys/StorageTest.php b/tests/lib/Encryption/Keys/StorageTest.php
index 1f6773b1663..2ce30105293 100644
--- a/tests/lib/Encryption/Keys/StorageTest.php
+++ b/tests/lib/Encryption/Keys/StorageTest.php
@@ -62,7 +62,7 @@ class StorageTest extends TestCase {
$this->storage = new Storage($this->view, $this->util, $this->crypto, $this->config);
}
- public function testSetFileKey() {
+ public function testSetFileKey(): void {
$this->config->method('getSystemValueString')
->with('version')
->willReturn('20.0.0.2');
@@ -88,7 +88,7 @@ class StorageTest extends TestCase {
);
}
- public function testSetFileOld() {
+ public function testSetFileOld(): void {
$this->config->method('getSystemValueString')
->with('version')
->willReturn('20.0.0.0');
@@ -130,7 +130,7 @@ class StorageTest extends TestCase {
* @param bool $originalKeyExists
* @param string $expectedKeyContent
*/
- public function testGetFileKey($path, $strippedPartialName, $originalKeyExists, $expectedKeyContent) {
+ public function testGetFileKey($path, $strippedPartialName, $originalKeyExists, $expectedKeyContent): void {
$this->config->method('getSystemValueString')
->with('version')
->willReturn('20.0.0.2');
@@ -186,7 +186,7 @@ class StorageTest extends TestCase {
);
}
- public function testSetFileKeySystemWide() {
+ public function testSetFileKeySystemWide(): void {
$this->config->method('getSystemValueString')
->with('version')
->willReturn('20.0.0.2');
@@ -218,7 +218,7 @@ class StorageTest extends TestCase {
);
}
- public function testGetFileKeySystemWide() {
+ public function testGetFileKeySystemWide(): void {
$this->config->method('getSystemValueString')
->with('version')
->willReturn('20.0.0.2');
@@ -246,7 +246,7 @@ class StorageTest extends TestCase {
);
}
- public function testSetSystemUserKey() {
+ public function testSetSystemUserKey(): void {
$this->config->method('getSystemValueString')
->with('version')
->willReturn('20.0.0.2');
@@ -266,7 +266,7 @@ class StorageTest extends TestCase {
);
}
- public function testSetUserKey() {
+ public function testSetUserKey(): void {
$this->config->method('getSystemValueString')
->with('version')
->willReturn('20.0.0.2');
@@ -286,7 +286,7 @@ class StorageTest extends TestCase {
);
}
- public function testGetSystemUserKey() {
+ public function testGetSystemUserKey(): void {
$this->config->method('getSystemValueString')
->with('version')
->willReturn('20.0.0.2');
@@ -309,7 +309,7 @@ class StorageTest extends TestCase {
);
}
- public function testGetUserKey() {
+ public function testGetUserKey(): void {
$this->config->method('getSystemValueString')
->with('version')
->willReturn('20.0.0.2');
@@ -332,7 +332,7 @@ class StorageTest extends TestCase {
);
}
- public function testDeleteUserKey() {
+ public function testDeleteUserKey(): void {
$this->view->expects($this->once())
->method('file_exists')
->with($this->equalTo('/user1/files_encryption/encModule/user1.publicKey'))
@@ -347,7 +347,7 @@ class StorageTest extends TestCase {
);
}
- public function testDeleteSystemUserKey() {
+ public function testDeleteSystemUserKey(): void {
$this->view->expects($this->once())
->method('file_exists')
->with($this->equalTo('/files_encryption/encModule/shareKey_56884'))
@@ -362,7 +362,7 @@ class StorageTest extends TestCase {
);
}
- public function testDeleteFileKeySystemWide() {
+ public function testDeleteFileKeySystemWide(): void {
$this->util->expects($this->any())
->method('getUidAndFilename')
->willReturn(['user1', '/files/foo.txt']);
@@ -386,7 +386,7 @@ class StorageTest extends TestCase {
);
}
- public function testDeleteFileKey() {
+ public function testDeleteFileKey(): void {
$this->util->expects($this->any())
->method('getUidAndFilename')
->willReturn(['user1', '/files/foo.txt']);
@@ -413,7 +413,7 @@ class StorageTest extends TestCase {
/**
* @dataProvider dataProviderCopyRename
*/
- public function testRenameKeys($source, $target, $systemWideMountSource, $systemWideMountTarget, $expectedSource, $expectedTarget) {
+ public function testRenameKeys($source, $target, $systemWideMountSource, $systemWideMountTarget, $expectedSource, $expectedTarget): void {
$this->view->expects($this->any())
->method('file_exists')
->willReturn(true);
@@ -444,7 +444,7 @@ class StorageTest extends TestCase {
/**
* @dataProvider dataProviderCopyRename
*/
- public function testCopyKeys($source, $target, $systemWideMountSource, $systemWideMountTarget, $expectedSource, $expectedTarget) {
+ public function testCopyKeys($source, $target, $systemWideMountSource, $systemWideMountTarget, $expectedSource, $expectedTarget): void {
$this->view->expects($this->any())
->method('file_exists')
->willReturn(true);
@@ -519,7 +519,7 @@ class StorageTest extends TestCase {
* @param string $storageRoot
* @param string $expected
*/
- public function testGetPathToKeys($path, $systemWideMountPoint, $storageRoot, $expected) {
+ public function testGetPathToKeys($path, $systemWideMountPoint, $storageRoot, $expected): void {
$this->invokePrivate($this->storage, 'root_dir', [$storageRoot]);
$this->util->expects($this->any())
@@ -543,7 +543,7 @@ class StorageTest extends TestCase {
];
}
- public function testKeySetPreparation() {
+ public function testKeySetPreparation(): void {
$this->view->expects($this->any())
->method('file_exists')
->willReturn(false);
@@ -574,7 +574,7 @@ class StorageTest extends TestCase {
* @dataProvider dataTestBackupUserKeys
* @param bool $createBackupDir
*/
- public function testBackupUserKeys($createBackupDir) {
+ public function testBackupUserKeys($createBackupDir): void {
$storage = $this->getMockBuilder('OC\Encryption\Keys\Storage')
->setConstructorArgs([$this->view, $this->util, $this->crypto, $this->config])
->setMethods(['getTimestamp'])
diff --git a/tests/lib/Encryption/ManagerTest.php b/tests/lib/Encryption/ManagerTest.php
index d092068f6c6..8dd602349b6 100644
--- a/tests/lib/Encryption/ManagerTest.php
+++ b/tests/lib/Encryption/ManagerTest.php
@@ -49,16 +49,16 @@ class ManagerTest extends TestCase {
$this->manager = new Manager($this->config, $this->logger, $this->l10n, $this->view, $this->util, $this->arrayCache);
}
- public function testManagerIsDisabled() {
+ public function testManagerIsDisabled(): void {
$this->assertFalse($this->manager->isEnabled());
}
- public function testManagerIsDisabledIfEnabledButNoModules() {
+ public function testManagerIsDisabledIfEnabledButNoModules(): void {
$this->config->expects($this->any())->method('getAppValue')->willReturn(true);
$this->assertFalse($this->manager->isEnabled());
}
- public function testManagerIsDisabledIfDisabledButModules() {
+ public function testManagerIsDisabledIfDisabledButModules(): void {
$this->config->expects($this->any())->method('getAppValue')->willReturn(false);
$em = $this->createMock(IEncryptionModule::class);
$em->expects($this->any())->method('getId')->willReturn('id');
@@ -69,7 +69,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($this->manager->isEnabled());
}
- public function testManagerIsEnabled() {
+ public function testManagerIsEnabled(): void {
$this->config->expects($this->any())->method('getSystemValueBool')->willReturn(true);
$this->config->expects($this->any())->method('getAppValue')->willReturn('yes');
$this->assertTrue($this->manager->isEnabled());
@@ -87,14 +87,14 @@ class ManagerTest extends TestCase {
/**
* @depends testModuleRegistration
*/
- public function testModuleReRegistration($manager) {
+ public function testModuleReRegistration($manager): void {
$this->expectException(\OC\Encryption\Exceptions\ModuleAlreadyExistsException::class);
$this->expectExceptionMessage('Id "ID0" already used by encryption module "TestDummyModule0"');
$this->addNewEncryptionModule($manager, 0);
}
- public function testModuleUnRegistration() {
+ public function testModuleUnRegistration(): void {
$this->config->expects($this->any())->method('getAppValue')->willReturn(true);
$this->addNewEncryptionModule($this->manager, 0);
$this->assertCount(1, $this->manager->getEncryptionModules());
@@ -104,7 +104,7 @@ class ManagerTest extends TestCase {
}
- public function testGetEncryptionModuleUnknown() {
+ public function testGetEncryptionModuleUnknown(): void {
$this->expectException(\OC\Encryption\Exceptions\ModuleDoesNotExistsException::class);
$this->expectExceptionMessage('Module with ID: unknown does not exist.');
@@ -114,7 +114,7 @@ class ManagerTest extends TestCase {
$this->manager->getEncryptionModule('unknown');
}
- public function testGetEncryptionModuleEmpty() {
+ public function testGetEncryptionModuleEmpty(): void {
global $defaultId;
$defaultId = null;
@@ -138,7 +138,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('ID1', $this->manager->getEncryptionModule()->getId());
}
- public function testGetEncryptionModule() {
+ public function testGetEncryptionModule(): void {
global $defaultId;
$defaultId = null;
@@ -163,7 +163,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('ID0', $this->manager->getDefaultEncryptionModuleId());
}
- public function testSetDefaultEncryptionModule() {
+ public function testSetDefaultEncryptionModule(): void {
global $defaultId;
$defaultId = null;
diff --git a/tests/lib/Encryption/UpdateTest.php b/tests/lib/Encryption/UpdateTest.php
index a87a39fdf86..2627e18601d 100644
--- a/tests/lib/Encryption/UpdateTest.php
+++ b/tests/lib/Encryption/UpdateTest.php
@@ -75,7 +75,7 @@ class UpdateTest extends TestCase {
* @param array $allFiles
* @param integer $numberOfFiles
*/
- public function testUpdate($path, $isDir, $allFiles, $numberOfFiles) {
+ public function testUpdate($path, $isDir, $allFiles, $numberOfFiles): void {
$this->encryptionManager->expects($this->once())
->method('getEncryptionModule')
->willReturn($this->encryptionModule);
@@ -120,7 +120,7 @@ class UpdateTest extends TestCase {
* @param string $target
* @param boolean $encryptionEnabled
*/
- public function testPostRename($source, $target, $encryptionEnabled) {
+ public function testPostRename($source, $target, $encryptionEnabled): void {
$updateMock = $this->getUpdateMock(['update', 'getOwnerPath']);
$this->encryptionManager->expects($this->once())
@@ -168,7 +168,7 @@ class UpdateTest extends TestCase {
*
* @param boolean $encryptionEnabled
*/
- public function testPostRestore($encryptionEnabled) {
+ public function testPostRestore($encryptionEnabled): void {
$updateMock = $this->getUpdateMock(['update']);
$this->encryptionManager->expects($this->once())
diff --git a/tests/lib/Encryption/UtilTest.php b/tests/lib/Encryption/UtilTest.php
index 813a288a470..62ef809a867 100644
--- a/tests/lib/Encryption/UtilTest.php
+++ b/tests/lib/Encryption/UtilTest.php
@@ -56,7 +56,7 @@ class UtilTest extends TestCase {
/**
* @dataProvider providesHeadersForEncryptionModule
*/
- public function testGetEncryptionModuleId($expected, $header) {
+ public function testGetEncryptionModuleId($expected, $header): void {
$id = $this->util->getEncryptionModuleId($header);
$this->assertEquals($expected, $id);
}
@@ -72,7 +72,7 @@ class UtilTest extends TestCase {
/**
* @dataProvider providesHeaders
*/
- public function testCreateHeader($expected, $header, $moduleId) {
+ public function testCreateHeader($expected, $header, $moduleId): void {
$em = $this->createMock(IEncryptionModule::class);
$em->expects($this->any())->method('getId')->willReturn($moduleId);
@@ -90,7 +90,7 @@ class UtilTest extends TestCase {
}
- public function testCreateHeaderFailed() {
+ public function testCreateHeaderFailed(): void {
$this->expectException(\OC\Encryption\Exceptions\EncryptionHeaderKeyExistsException::class);
@@ -105,7 +105,7 @@ class UtilTest extends TestCase {
/**
* @dataProvider providePathsForTestIsExcluded
*/
- public function testIsExcluded($path, $keyStorageRoot, $expected) {
+ public function testIsExcluded($path, $keyStorageRoot, $expected): void {
$this->config->expects($this->once())
->method('getAppValue')
->with('core', 'encryption_key_storage_root', '')
@@ -146,7 +146,7 @@ class UtilTest extends TestCase {
/**
* @dataProvider dataTestIsFile
*/
- public function testIsFile($path, $expected) {
+ public function testIsFile($path, $expected): void {
$this->assertSame($expected,
$this->util->isFile($path)
);
@@ -170,7 +170,7 @@ class UtilTest extends TestCase {
* @param string $path
* @param string $expected
*/
- public function testStripPartialFileExtension($path, $expected) {
+ public function testStripPartialFileExtension($path, $expected): void {
$this->assertSame($expected,
$this->util->stripPartialFileExtension($path));
}
@@ -187,7 +187,7 @@ class UtilTest extends TestCase {
/**
* @dataProvider dataTestParseRawHeader
*/
- public function testParseRawHeader($rawHeader, $expected) {
+ public function testParseRawHeader($rawHeader, $expected): void {
$result = $this->util->parseRawHeader($rawHeader);
$this->assertSameSize($expected, $result);
foreach ($result as $key => $value) {
@@ -218,7 +218,7 @@ class UtilTest extends TestCase {
* @param string $storageRoot
* @param string $expected
*/
- public function testGetFileKeyDir($isSystemWideMountPoint, $storageRoot, $expected) {
+ public function testGetFileKeyDir($isSystemWideMountPoint, $storageRoot, $expected): void {
$path = '/user1/files/foo/bar.txt';
$owner = 'user1';
$relativePath = '/foo/bar.txt';
diff --git a/tests/lib/ErrorHandlerTest.php b/tests/lib/ErrorHandlerTest.php
index 72974a14550..0846d09fd47 100644
--- a/tests/lib/ErrorHandlerTest.php
+++ b/tests/lib/ErrorHandlerTest.php
@@ -53,7 +53,7 @@ class ErrorHandlerTest extends TestCase {
* @param string $username
* @param string $password
*/
- public function testRemovePasswordFromError($username, $password) {
+ public function testRemovePasswordFromError($username, $password): void {
$url = 'http://'.$username.':'.$password.'@owncloud.org';
$expectedResult = 'http://xxx:xxx@owncloud.org';
$this->logger->expects(self::once())
diff --git a/tests/lib/Federation/CloudIdTest.php b/tests/lib/Federation/CloudIdTest.php
index 4ac9bd92d64..4087f45622d 100644
--- a/tests/lib/Federation/CloudIdTest.php
+++ b/tests/lib/Federation/CloudIdTest.php
@@ -24,7 +24,7 @@ class CloudIdTest extends TestCase {
* @param string $id
* @param string $display
*/
- public function testGetDisplayCloudId($id, $display) {
+ public function testGetDisplayCloudId($id, $display): void {
$cloudId = new CloudId($id, '', '');
$this->assertEquals($display, $cloudId->getDisplayId());
}
diff --git a/tests/lib/Files/AppData/AppDataTest.php b/tests/lib/Files/AppData/AppDataTest.php
index 241e49a026f..494096d1ac3 100644
--- a/tests/lib/Files/AppData/AppDataTest.php
+++ b/tests/lib/Files/AppData/AppDataTest.php
@@ -49,7 +49,7 @@ class AppDataTest extends \Test\TestCase {
return $appFolder;
}
- public function testGetFolder() {
+ public function testGetFolder(): void {
$folder = $this->createMock(Folder::class);
$this->rootFolder->expects($this->once())
@@ -61,7 +61,7 @@ class AppDataTest extends \Test\TestCase {
$this->assertInstanceOf(ISimpleFolder::class, $result);
}
- public function testNewFolder() {
+ public function testNewFolder(): void {
$appFolder = $this->setupAppFolder();
$folder = $this->createMock(Folder::class);
@@ -75,7 +75,7 @@ class AppDataTest extends \Test\TestCase {
$this->assertInstanceOf(ISimpleFolder::class, $result);
}
- public function testGetDirectoryListing() {
+ public function testGetDirectoryListing(): void {
$appFolder = $this->setupAppFolder();
$file = $this->createMock(File::class);
diff --git a/tests/lib/Files/AppData/FactoryTest.php b/tests/lib/Files/AppData/FactoryTest.php
index 1aad461e633..dff999d8b48 100644
--- a/tests/lib/Files/AppData/FactoryTest.php
+++ b/tests/lib/Files/AppData/FactoryTest.php
@@ -28,7 +28,7 @@ class FactoryTest extends \Test\TestCase {
$this->factory = new Factory($this->rootFolder, $this->systemConfig);
}
- public function testGet() {
+ public function testGet(): void {
$this->rootFolder->expects($this->never())
->method($this->anything());
$this->systemConfig->expects($this->never())
diff --git a/tests/lib/Files/Cache/CacheTest.php b/tests/lib/Files/Cache/CacheTest.php
index b90b67a6589..9e3460ab6f2 100644
--- a/tests/lib/Files/Cache/CacheTest.php
+++ b/tests/lib/Files/Cache/CacheTest.php
@@ -47,11 +47,11 @@ class CacheTest extends \Test\TestCase {
*/
protected $cache2;
- public function testGetNumericId() {
+ public function testGetNumericId(): void {
$this->assertNotNull($this->cache->getNumericStorageId());
}
- public function testSimple() {
+ public function testSimple(): void {
$file1 = 'foo';
$file2 = 'foo/bar';
$data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
@@ -97,7 +97,7 @@ class CacheTest extends \Test\TestCase {
$this->assertEquals($cacheData1, $this->cache->get($id1));
}
- public function testCacheEntryGetters() {
+ public function testCacheEntryGetters(): void {
$file1 = 'foo';
$data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/file'];
@@ -122,7 +122,7 @@ class CacheTest extends \Test\TestCase {
$this->assertEquals($entry->getUnencryptedSize(), 100);
}
- public function testPartial() {
+ public function testPartial(): void {
$file1 = 'foo';
$this->cache->put($file1, ['size' => 10]);
@@ -138,7 +138,7 @@ class CacheTest extends \Test\TestCase {
/**
* @dataProvider folderDataProvider
*/
- public function testFolder($folder) {
+ public function testFolder($folder): void {
if (strpos($folder, 'F09F9890')) {
// 4 byte UTF doesn't work on mysql
$params = \OC::$server->get(\OC\DB\Connection::class)->getParams();
@@ -187,7 +187,7 @@ class CacheTest extends \Test\TestCase {
$this->assertFalse($this->cache->inCache($folder . '/bar'));
}
- public function testRemoveRecursive() {
+ public function testRemoveRecursive(): void {
$folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$fileData = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'text/plain'];
$folders = ['folder', 'folder/subfolder', 'folder/sub2', 'folder/sub2/sub3'];
@@ -220,7 +220,7 @@ class CacheTest extends \Test\TestCase {
];
}
- public function testEncryptedFolder() {
+ public function testEncryptedFolder(): void {
$file1 = 'folder';
$file2 = 'folder/bar';
$file3 = 'folder/foo';
@@ -263,7 +263,7 @@ class CacheTest extends \Test\TestCase {
$this->assertFalse($this->cache->inCache('folder/bar'));
}
- public function testRootFolderSizeForNonHomeStorage() {
+ public function testRootFolderSizeForNonHomeStorage(): void {
$dir1 = 'knownsize';
$dir2 = 'unknownsize';
$fileData = [];
@@ -290,7 +290,7 @@ class CacheTest extends \Test\TestCase {
$this->assertFalse($this->cache->inCache($dir2));
}
- public function testStatus() {
+ public function testStatus(): void {
$this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->getStatus('foo'));
$this->cache->put('foo', ['size' => -1]);
$this->assertEquals(\OC\Files\Cache\Cache::PARTIAL, $this->cache->getStatus('foo'));
@@ -312,7 +312,7 @@ class CacheTest extends \Test\TestCase {
* @dataProvider putWithAllKindOfQuotesData
* @param $fileName
*/
- public function testPutWithAllKindOfQuotes($fileName) {
+ public function testPutWithAllKindOfQuotes($fileName): void {
$this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->get($fileName));
$this->cache->put($fileName, ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file', 'etag' => $fileName]);
@@ -321,7 +321,7 @@ class CacheTest extends \Test\TestCase {
$this->assertEquals($fileName, $cacheEntry['path']);
}
- public function testSearch() {
+ public function testSearch(): void {
$file1 = 'folder';
$file2 = 'folder/foobar';
$file3 = 'folder/foo';
@@ -350,7 +350,7 @@ class CacheTest extends \Test\TestCase {
$this->assertEquals(2, count($this->cache->searchByMime('foo/file')));
}
- public function testSearchQueryByTag() {
+ public function testSearchQueryByTag(): void {
$userId = static::getUniqueID('user');
\OC::$server->getUserManager()->createUser($userId, $userId);
static::loginAsUser($userId);
@@ -408,7 +408,7 @@ class CacheTest extends \Test\TestCase {
}
}
- public function testSearchByQuery() {
+ public function testSearchByQuery(): void {
$file1 = 'folder';
$file2 = 'folder/foobar';
$file3 = 'folder/foo';
@@ -448,7 +448,7 @@ class CacheTest extends \Test\TestCase {
/**
* @dataProvider movePathProvider
*/
- public function testMove($sourceFolder, $targetFolder, $children) {
+ public function testMove($sourceFolder, $targetFolder, $children): void {
$data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/bar'];
$folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
@@ -483,7 +483,7 @@ class CacheTest extends \Test\TestCase {
}
}
- public function testMoveFromCache() {
+ public function testMoveFromCache(): void {
$data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/bar'];
$folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
@@ -500,7 +500,7 @@ class CacheTest extends \Test\TestCase {
$this->assertTrue($this->cache->inCache('targetfolder/sub'));
}
- public function testGetIncomplete() {
+ public function testGetIncomplete(): void {
$file1 = 'folder1';
$file2 = 'folder2';
$file3 = 'folder3';
@@ -517,13 +517,13 @@ class CacheTest extends \Test\TestCase {
$this->assertEquals($file3, $this->cache->getIncomplete());
}
- public function testNonExisting() {
+ public function testNonExisting(): void {
$this->assertFalse($this->cache->get('foo.txt'));
$this->assertFalse($this->cache->get(-1));
$this->assertEquals([], $this->cache->getFolderContents('foo'));
}
- public function testGetById() {
+ public function testGetById(): void {
$storageId = $this->storage->getId();
$data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
$id = $this->cache->put('foo', $data);
@@ -534,7 +534,7 @@ class CacheTest extends \Test\TestCase {
$this->assertEquals([$storageId, 'foo'], \OC\Files\Cache\Cache::getById($id));
}
- public function testStorageMTime() {
+ public function testStorageMTime(): void {
$data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
$this->cache->put('foo', $data);
$cachedData = $this->cache->get('foo');
@@ -551,7 +551,7 @@ class CacheTest extends \Test\TestCase {
$this->assertEquals(25, $cachedData['mtime']);
}
- public function testLongId() {
+ public function testLongId(): void {
$storage = new LongId([]);
$cache = $storage->getCache();
$storageId = $storage->getId();
@@ -563,7 +563,7 @@ class CacheTest extends \Test\TestCase {
/**
* this test show the bug resulting if we have no normalizer installed
*/
- public function testWithoutNormalizer() {
+ public function testWithoutNormalizer(): void {
// folder name "Schön" with U+00F6 (normalized)
$folderWith00F6 = "\x53\x63\x68\xc3\xb6\x6e";
@@ -609,7 +609,7 @@ class CacheTest extends \Test\TestCase {
/**
* this test shows that there is no bug if we use the normalizer
*/
- public function testWithNormalizer() {
+ public function testWithNormalizer(): void {
if (!class_exists('Patchwork\PHP\Shim\Normalizer')) {
$this->markTestSkipped('The 3rdparty Normalizer extension is not available.');
return;
@@ -659,7 +659,7 @@ class CacheTest extends \Test\TestCase {
*
* @dataProvider bogusPathNamesProvider
*/
- public function testBogusPaths($bogusPath, $fixedBogusPath) {
+ public function testBogusPaths($bogusPath, $fixedBogusPath): void {
$data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
// put root folder
@@ -681,7 +681,7 @@ class CacheTest extends \Test\TestCase {
$this->assertEquals($newData, $newDataFromBogus);
}
- public function testNoReuseOfFileId() {
+ public function testNoReuseOfFileId(): void {
$data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'];
$this->cache->put('somefile.txt', $data1);
$info = $this->cache->get('somefile.txt');
@@ -706,7 +706,7 @@ class CacheTest extends \Test\TestCase {
* @param string $name
* @dataProvider escapingProvider
*/
- public function testEscaping($name) {
+ public function testEscaping($name): void {
$data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'];
$this->cache->put($name, $data);
$this->assertTrue($this->cache->inCache($name));
@@ -742,7 +742,7 @@ class CacheTest extends \Test\TestCase {
}
}
- public function testExtended() {
+ public function testExtended(): void {
$folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$this->cache->put('', $folderData);
diff --git a/tests/lib/Files/Cache/HomeCacheTest.php b/tests/lib/Files/Cache/HomeCacheTest.php
index 986d6df4c17..ad069de1fef 100644
--- a/tests/lib/Files/Cache/HomeCacheTest.php
+++ b/tests/lib/Files/Cache/HomeCacheTest.php
@@ -78,7 +78,7 @@ class HomeCacheTest extends \Test\TestCase {
* that have an unknown size. This makes sure that quota calculation still
* works as it's based on the "files" folder size.
*/
- public function testRootFolderSizeIgnoresUnknownUpdate() {
+ public function testRootFolderSizeIgnoresUnknownUpdate(): void {
$dir1 = 'files/knownsize';
$dir2 = 'files/unknownsize';
$fileData = [];
@@ -110,7 +110,7 @@ class HomeCacheTest extends \Test\TestCase {
$this->assertFalse($this->cache->inCache($dir2));
}
- public function testRootFolderSizeIsFilesSize() {
+ public function testRootFolderSizeIsFilesSize(): void {
$dir1 = 'files';
$afile = 'test.txt';
$fileData = [];
diff --git a/tests/lib/Files/Cache/LocalRootScannerTest.php b/tests/lib/Files/Cache/LocalRootScannerTest.php
index 204621bbd03..e683283b7e1 100644
--- a/tests/lib/Files/Cache/LocalRootScannerTest.php
+++ b/tests/lib/Files/Cache/LocalRootScannerTest.php
@@ -25,7 +25,7 @@ class LocalRootScannerTest extends TestCase {
$this->storage = new LocalRootStorage(['datadir' => $folder]);
}
- public function testDontScanUsers() {
+ public function testDontScanUsers(): void {
$this->storage->mkdir('foo');
$this->storage->mkdir('foo/bar');
@@ -33,7 +33,7 @@ class LocalRootScannerTest extends TestCase {
$this->assertFalse($this->storage->getCache()->inCache('foo'));
}
- public function testDoScanAppData() {
+ public function testDoScanAppData(): void {
$this->storage->mkdir('appdata_foo');
$this->storage->mkdir('appdata_foo/bar');
diff --git a/tests/lib/Files/Cache/PropagatorTest.php b/tests/lib/Files/Cache/PropagatorTest.php
index dba1ae9c14e..e88816dfccc 100644
--- a/tests/lib/Files/Cache/PropagatorTest.php
+++ b/tests/lib/Files/Cache/PropagatorTest.php
@@ -38,7 +38,7 @@ class PropagatorTest extends TestCase {
return array_combine($paths, $values);
}
- public function testEtagPropagation() {
+ public function testEtagPropagation(): void {
$paths = ['', 'foo', 'foo/bar'];
$oldInfos = $this->getFileInfos($paths);
$this->storage->getPropagator()->propagateChange('foo/bar/file.txt', time());
@@ -49,7 +49,7 @@ class PropagatorTest extends TestCase {
}
}
- public function testTimePropagation() {
+ public function testTimePropagation(): void {
$paths = ['', 'foo', 'foo/bar'];
$oldTime = time() - 200;
$targetTime = time() - 100;
@@ -69,7 +69,7 @@ class PropagatorTest extends TestCase {
$this->assertEquals($now, $newInfos['']->getMTime());
}
- public function testSizePropagation() {
+ public function testSizePropagation(): void {
$paths = ['', 'foo', 'foo/bar'];
$oldInfos = $this->getFileInfos($paths);
$this->storage->getPropagator()->propagateChange('foo/bar/file.txt', time(), 10);
@@ -80,7 +80,7 @@ class PropagatorTest extends TestCase {
}
}
- public function testSizePropagationNoNegative() {
+ public function testSizePropagationNoNegative(): void {
$paths = ['', 'foo', 'foo/bar'];
$oldInfos = $this->getFileInfos($paths);
$this->storage->getPropagator()->propagateChange('foo/bar/file.txt', time(), -100);
@@ -91,7 +91,7 @@ class PropagatorTest extends TestCase {
}
}
- public function testBatchedPropagation() {
+ public function testBatchedPropagation(): void {
$this->storage->mkdir('foo/baz');
$this->storage->mkdir('asd');
$this->storage->file_put_contents('asd/file.txt', 'bar');
diff --git a/tests/lib/Files/Cache/ScannerTest.php b/tests/lib/Files/Cache/ScannerTest.php
index bc911baba0c..d78b7100d43 100644
--- a/tests/lib/Files/Cache/ScannerTest.php
+++ b/tests/lib/Files/Cache/ScannerTest.php
@@ -42,7 +42,7 @@ class ScannerTest extends TestCase {
parent::tearDown();
}
- public function testFile() {
+ public function testFile(): void {
$data = "dummy file data\n";
$this->storage->file_put_contents('foo.txt', $data);
$this->scanner->scanFile('foo.txt');
@@ -63,7 +63,7 @@ class ScannerTest extends TestCase {
$this->assertEquals($cachedData['mimetype'], 'image/png');
}
- public function testFile4Byte() {
+ public function testFile4Byte(): void {
$data = "dummy file data\n";
$this->storage->file_put_contents('foo🙈.txt', $data);
@@ -81,7 +81,7 @@ class ScannerTest extends TestCase {
}
}
- public function testFileInvalidChars() {
+ public function testFileInvalidChars(): void {
$data = "dummy file data\n";
$this->storage->file_put_contents("foo\nbar.txt", $data);
@@ -98,7 +98,7 @@ class ScannerTest extends TestCase {
$this->storage->file_put_contents('folder/bar.txt', $textData);
}
- public function testFolder() {
+ public function testFolder(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -120,7 +120,7 @@ class ScannerTest extends TestCase {
$this->assertEquals($cachedDataFolder2['size'], $cachedDataText2['size']);
}
- public function testShallow() {
+ public function testShallow(): void {
$this->fillTestFolders();
$this->scanner->scan('', IScanner::SCAN_SHALLOW);
@@ -148,7 +148,7 @@ class ScannerTest extends TestCase {
$this->assertNotEquals($cachedDataFolder['size'], -1);
}
- public function testBackgroundScan() {
+ public function testBackgroundScan(): void {
$this->fillTestFolders();
$this->storage->mkdir('folder2');
$this->storage->file_put_contents('folder2/bar.txt', 'foobar');
@@ -170,7 +170,7 @@ class ScannerTest extends TestCase {
$this->assertFalse($this->cache->getIncomplete());
}
- public function testBackgroundScanOnlyRecurseIncomplete() {
+ public function testBackgroundScanOnlyRecurseIncomplete(): void {
$this->fillTestFolders();
$this->storage->mkdir('folder2');
$this->storage->file_put_contents('folder2/bar.txt', 'foobar');
@@ -196,7 +196,7 @@ class ScannerTest extends TestCase {
$this->assertFalse($this->cache->getIncomplete());
}
- public function testBackgroundScanNestedIncompleteFolders() {
+ public function testBackgroundScanNestedIncompleteFolders(): void {
$this->storage->mkdir('folder');
$this->scanner->backgroundScan();
@@ -234,7 +234,7 @@ class ScannerTest extends TestCase {
$this->assertEquals(6, $this->cache->get('folder/subfolder2')['size']);
}
- public function testReuseExisting() {
+ public function testReuseExisting(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -273,7 +273,7 @@ class ScannerTest extends TestCase {
$this->assertEquals($oldData['size'], $newData['size']);
}
- public function testRemovedFile() {
+ public function testRemovedFile(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -283,7 +283,7 @@ class ScannerTest extends TestCase {
$this->assertFalse($this->cache->inCache('foo.txt'));
}
- public function testRemovedFolder() {
+ public function testRemovedFolder(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -294,7 +294,7 @@ class ScannerTest extends TestCase {
$this->assertFalse($this->cache->inCache('folder/bar.txt'));
}
- public function testScanRemovedFile() {
+ public function testScanRemovedFile(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -304,7 +304,7 @@ class ScannerTest extends TestCase {
$this->assertFalse($this->cache->inCache('folder/bar.txt'));
}
- public function testETagRecreation() {
+ public function testETagRecreation(): void {
$this->fillTestFolders();
$this->scanner->scan('folder/bar.txt');
@@ -330,7 +330,7 @@ class ScannerTest extends TestCase {
$this->assertNotEmpty($newData0['etag']);
}
- public function testRepairParent() {
+ public function testRepairParent(): void {
$this->fillTestFolders();
$this->scanner->scan('');
$this->assertTrue($this->cache->inCache('folder/bar.txt'));
@@ -356,7 +356,7 @@ class ScannerTest extends TestCase {
$this->assertEquals($newFolderId, $cachedData['parent']);
}
- public function testRepairParentShallow() {
+ public function testRepairParentShallow(): void {
$this->fillTestFolders();
$this->scanner->scan('');
$this->assertTrue($this->cache->inCache('folder/bar.txt'));
@@ -388,7 +388,7 @@ class ScannerTest extends TestCase {
* @param string $path
* @param bool $expected
*/
- public function testIsPartialFile($path, $expected) {
+ public function testIsPartialFile($path, $expected): void {
$this->assertSame($expected,
$this->scanner->isPartialFile($path)
);
@@ -404,7 +404,7 @@ class ScannerTest extends TestCase {
];
}
- public function testNoETagUnscannedFolder() {
+ public function testNoETagUnscannedFolder(): void {
$this->fillTestFolders();
$this->scanner->scan('');
@@ -423,7 +423,7 @@ class ScannerTest extends TestCase {
$this->assertNotEquals($newFolderEntry->getEtag(), $oldFolderEntry->getEtag());
}
- public function testNoETagUnscannedSubFolder() {
+ public function testNoETagUnscannedSubFolder(): void {
$this->fillTestFolders();
$this->storage->mkdir('folder/sub');
diff --git a/tests/lib/Files/Cache/SearchBuilderTest.php b/tests/lib/Files/Cache/SearchBuilderTest.php
index 57d890fcbcd..acb2e109144 100644
--- a/tests/lib/Files/Cache/SearchBuilderTest.php
+++ b/tests/lib/Files/Cache/SearchBuilderTest.php
@@ -175,7 +175,7 @@ class SearchBuilderTest extends TestCase {
* @param ISearchOperator $operator
* @param array $fileIds
*/
- public function testComparison(ISearchOperator $operator, array $fileIds) {
+ public function testComparison(ISearchOperator $operator, array $fileIds): void {
$fileId = [];
$fileId[] = $this->addCacheEntry([
'path' => 'foobar',
diff --git a/tests/lib/Files/Cache/UpdaterLegacyTest.php b/tests/lib/Files/Cache/UpdaterLegacyTest.php
index d95607eaeff..0f7e9d78d77 100644
--- a/tests/lib/Files/Cache/UpdaterLegacyTest.php
+++ b/tests/lib/Files/Cache/UpdaterLegacyTest.php
@@ -86,7 +86,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
parent::tearDown();
}
- public function testWrite() {
+ public function testWrite(): void {
$textSize = strlen("dummy file data\n");
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$this->cache->put('foo.txt', ['mtime' => 100, 'storage_mtime' => 150]);
@@ -121,7 +121,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
$this->assertGreaterThanOrEqual($rootCachedData['mtime'], $mtime);
}
- public function testWriteWithMountPoints() {
+ public function testWriteWithMountPoints(): void {
$storage2 = new \OC\Files\Storage\Temporary([]);
$storage2->getScanner()->scan(''); //initialize etags
$cache2 = $storage2->getCache();
@@ -147,7 +147,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
$this->assertNotSame($oldEtag, $cachedData['etag']);
}
- public function testDelete() {
+ public function testDelete(): void {
$textSize = strlen("dummy file data\n");
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$rootCachedData = $this->cache->get('');
@@ -182,7 +182,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
$this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']);
}
- public function testDeleteWithMountPoints() {
+ public function testDeleteWithMountPoints(): void {
$storage2 = new \OC\Files\Storage\Temporary([]);
$cache2 = $storage2->getCache();
Filesystem::mount($storage2, [], '/' . self::$user . '/files/folder/substorage');
@@ -208,7 +208,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
$this->assertGreaterThanOrEqual($folderCachedData['mtime'], $cachedData['mtime']);
}
- public function testRename() {
+ public function testRename(): void {
$textSize = strlen("dummy file data\n");
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$rootCachedData = $this->cache->get('');
@@ -230,7 +230,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
$this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
}
- public function testRenameExtension() {
+ public function testRenameExtension(): void {
$fooCachedData = $this->cache->get('foo.txt');
$this->assertEquals('text/plain', $fooCachedData['mimetype']);
Filesystem::rename('foo.txt', 'foo.abcd');
@@ -238,7 +238,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
$this->assertEquals('application/octet-stream', $fooCachedData['mimetype']);
}
- public function testRenameWithMountPoints() {
+ public function testRenameWithMountPoints(): void {
$storage2 = new \OC\Files\Storage\Temporary([]);
$cache2 = $storage2->getCache();
Filesystem::mount($storage2, [], '/' . self::$user . '/files/folder/substorage');
@@ -271,7 +271,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
// $this->assertEquals($mtime, $cachedData['mtime']);
}
- public function testTouch() {
+ public function testTouch(): void {
$rootCachedData = $this->cache->get('');
$fooCachedData = $this->cache->get('foo.txt');
Filesystem::touch('foo.txt');
diff --git a/tests/lib/Files/Cache/UpdaterTest.php b/tests/lib/Files/Cache/UpdaterTest.php
index bfc17e64467..8b8697fc139 100644
--- a/tests/lib/Files/Cache/UpdaterTest.php
+++ b/tests/lib/Files/Cache/UpdaterTest.php
@@ -53,7 +53,7 @@ class UpdaterTest extends \Test\TestCase {
parent::tearDown();
}
- public function testNewFile() {
+ public function testNewFile(): void {
$this->storage->file_put_contents('foo.txt', 'bar');
$this->assertFalse($this->cache->inCache('foo.txt'));
@@ -65,7 +65,7 @@ class UpdaterTest extends \Test\TestCase {
$this->assertEquals('text/plain', $cached['mimetype']);
}
- public function testUpdatedFile() {
+ public function testUpdatedFile(): void {
$this->storage->file_put_contents('foo.txt', 'bar');
$this->updater->update('foo.txt');
@@ -84,7 +84,7 @@ class UpdaterTest extends \Test\TestCase {
$this->assertEquals(6, $cached['size']);
}
- public function testParentSize() {
+ public function testParentSize(): void {
$this->storage->getScanner()->scan('');
$parentCached = $this->cache->get('');
@@ -121,7 +121,7 @@ class UpdaterTest extends \Test\TestCase {
$this->assertEquals(0, $parentCached['size']);
}
- public function testMove() {
+ public function testMove(): void {
$this->storage->file_put_contents('foo.txt', 'qwerty');
$this->updater->update('foo.txt');
@@ -146,7 +146,7 @@ class UpdaterTest extends \Test\TestCase {
$this->assertEquals($cached['fileid'], $cachedTarget['fileid']);
}
- public function testMoveNonExistingOverwrite() {
+ public function testMoveNonExistingOverwrite(): void {
$this->storage->file_put_contents('bar.txt', 'qwerty');
$this->updater->update('bar.txt');
@@ -164,7 +164,7 @@ class UpdaterTest extends \Test\TestCase {
$this->assertEquals($cached['fileid'], $cachedTarget['fileid']);
}
- public function testUpdateStorageMTime() {
+ public function testUpdateStorageMTime(): void {
$this->storage->mkdir('sub');
$this->storage->mkdir('sub2');
$this->storage->file_put_contents('sub/foo.txt', 'qwerty');
@@ -205,7 +205,7 @@ class UpdaterTest extends \Test\TestCase {
$this->assertNotEquals($testmtime, $cachedTargetParent['mtime'], 'target folder mtime changed, not from storage');
}
- public function testNewFileDisabled() {
+ public function testNewFileDisabled(): void {
$this->storage->file_put_contents('foo.txt', 'bar');
$this->assertFalse($this->cache->inCache('foo.txt'));
@@ -215,7 +215,7 @@ class UpdaterTest extends \Test\TestCase {
$this->assertFalse($this->cache->inCache('foo.txt'));
}
- public function testMoveCrossStorage() {
+ public function testMoveCrossStorage(): void {
$storage2 = new Temporary([]);
$cache2 = $storage2->getCache();
Filesystem::mount($storage2, [], '/bar');
@@ -246,7 +246,7 @@ class UpdaterTest extends \Test\TestCase {
$this->assertEquals($cached['fileid'], $cachedTarget['fileid']);
}
- public function testMoveFolderCrossStorage() {
+ public function testMoveFolderCrossStorage(): void {
$storage2 = new Temporary([]);
$cache2 = $storage2->getCache();
Filesystem::mount($storage2, [], '/bar');
diff --git a/tests/lib/Files/Cache/WatcherTest.php b/tests/lib/Files/Cache/WatcherTest.php
index d4a44ca6aa0..7319aa9b68d 100644
--- a/tests/lib/Files/Cache/WatcherTest.php
+++ b/tests/lib/Files/Cache/WatcherTest.php
@@ -40,7 +40,7 @@ class WatcherTest extends \Test\TestCase {
/**
* @medium
*/
- public function testWatcher() {
+ public function testWatcher(): void {
$storage = $this->getTestStorage();
$cache = $storage->getCache();
$updater = $storage->getWatcher();
@@ -81,7 +81,7 @@ class WatcherTest extends \Test\TestCase {
/**
* @medium
*/
- public function testFileToFolder() {
+ public function testFileToFolder(): void {
$storage = $this->getTestStorage();
$cache = $storage->getCache();
$updater = $storage->getWatcher();
@@ -116,7 +116,7 @@ class WatcherTest extends \Test\TestCase {
$this->assertTrue($cache->inCache('foo.txt/bar.txt'));
}
- public function testPolicyNever() {
+ public function testPolicyNever(): void {
$storage = $this->getTestStorage();
$cache = $storage->getCache();
$updater = $storage->getWatcher();
@@ -134,7 +134,7 @@ class WatcherTest extends \Test\TestCase {
$this->assertFalse($updater->checkUpdate('foo.txt'));
}
- public function testPolicyOnce() {
+ public function testPolicyOnce(): void {
$storage = $this->getTestStorage();
$cache = $storage->getCache();
$updater = $storage->getWatcher();
@@ -152,7 +152,7 @@ class WatcherTest extends \Test\TestCase {
$this->assertFalse($updater->checkUpdate('foo.txt'));
}
- public function testPolicyAlways() {
+ public function testPolicyAlways(): void {
$storage = $this->getTestStorage();
$cache = $storage->getCache();
$updater = $storage->getWatcher();
diff --git a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
index d0a6f99cb19..697a506971b 100644
--- a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
+++ b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
@@ -36,7 +36,7 @@ class CacheJailTest extends CacheTest {
$this->cache = new \OC\Files\Cache\Wrapper\CacheJail($this->sourceCache, 'foo');
}
- public function testSearchOutsideJail() {
+ public function testSearchOutsideJail(): void {
$this->storage->getScanner()->scan('');
$file1 = 'foo/foobar';
$file2 = 'folder/foobar';
@@ -60,7 +60,7 @@ class CacheJailTest extends CacheTest {
$this->assertEquals('foobar', $result[1]['path']);
}
- public function testSearchMimeOutsideJail() {
+ public function testSearchMimeOutsideJail(): void {
$this->storage->getScanner()->scan('');
$file1 = 'foo/foobar';
$file2 = 'folder/foobar';
@@ -76,7 +76,7 @@ class CacheJailTest extends CacheTest {
$this->assertEquals('foobar', $result[0]['path']);
}
- public function testSearchQueryOutsideJail() {
+ public function testSearchQueryOutsideJail(): void {
$this->storage->getScanner()->scan('');
$file1 = 'foo/foobar';
$file2 = 'folder/foobar';
@@ -98,7 +98,7 @@ class CacheJailTest extends CacheTest {
$this->assertEquals('', $result[0]['path']);
}
- public function testClearKeepEntriesOutsideJail() {
+ public function testClearKeepEntriesOutsideJail(): void {
$file1 = 'foo/foobar';
$file2 = 'foo/foobar/asd';
$file3 = 'folder/foobar';
@@ -115,7 +115,7 @@ class CacheJailTest extends CacheTest {
$this->assertTrue($this->sourceCache->inCache('folder/foobar'));
}
- public function testGetById() {
+ public function testGetById(): void {
$data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$id = $this->sourceCache->put('foo/bar', $data1);
@@ -129,12 +129,12 @@ class CacheJailTest extends CacheTest {
$this->assertEquals('foo/bar', $path);
}
- public function testGetIncomplete() {
+ public function testGetIncomplete(): void {
//not supported
$this->addToAssertionCount(1);
}
- public function testMoveFromJail() {
+ public function testMoveFromJail(): void {
$folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$this->sourceCache->put('source', $folderData);
@@ -150,7 +150,7 @@ class CacheJailTest extends CacheTest {
$this->assertTrue($this->sourceCache->inCache('target/foo/bar'));
}
- public function testMoveToJail() {
+ public function testMoveToJail(): void {
$folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$this->sourceCache->put('source', $folderData);
@@ -166,7 +166,7 @@ class CacheJailTest extends CacheTest {
$this->assertTrue($this->sourceCache->inCache('target/foo/bar'));
}
- public function testMoveBetweenJail() {
+ public function testMoveBetweenJail(): void {
$folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$this->sourceCache->put('source', $folderData);
@@ -183,7 +183,7 @@ class CacheJailTest extends CacheTest {
$this->assertTrue($this->sourceCache->inCache('target/foo/bar'));
}
- public function testSearchNested() {
+ public function testSearchNested(): void {
$this->storage->getScanner()->scan('');
$file1 = 'foo';
$file2 = 'foo/bar';
@@ -201,7 +201,7 @@ class CacheJailTest extends CacheTest {
$this->assertEquals('asd', $result[0]['path']);
}
- public function testRootJail() {
+ public function testRootJail(): void {
$this->storage->getScanner()->scan('');
$file1 = 'foo';
$file2 = 'foo/bar';
@@ -219,7 +219,7 @@ class CacheJailTest extends CacheTest {
$this->assertEquals('foo/bar/asd', $result[0]['path']);
}
- public function testWatcher() {
+ public function testWatcher(): void {
$storage = new Jail([
'storage' => $this->storage,
'root' => 'foo'
@@ -232,7 +232,7 @@ class CacheJailTest extends CacheTest {
$this->assertTrue($this->cache->inCache('bar'));
}
- public function testWatcherAfterInnerWatcher() {
+ public function testWatcherAfterInnerWatcher(): void {
$storage = new Jail([
'storage' => $this->storage,
'root' => 'foo'
diff --git a/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php b/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php
index d3eb8be7af9..afb5c6a5d4d 100644
--- a/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php
+++ b/tests/lib/Files/Cache/Wrapper/CachePermissionsMaskTest.php
@@ -47,7 +47,7 @@ class CachePermissionsMaskTest extends CacheTest {
* @dataProvider maskProvider
* @param int $mask
*/
- public function testGetMasked($mask) {
+ public function testGetMasked($mask): void {
$cache = $this->getMaskedCached($mask);
$data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain', 'permissions' => Constants::PERMISSION_ALL];
$this->sourceCache->put('foo', $data);
@@ -64,7 +64,7 @@ class CachePermissionsMaskTest extends CacheTest {
* @dataProvider maskProvider
* @param int $mask
*/
- public function testGetFolderContentMasked($mask) {
+ public function testGetFolderContentMasked($mask): void {
$this->storage->mkdir('foo');
$this->storage->file_put_contents('foo/bar', 'asd');
$this->storage->file_put_contents('foo/asd', 'bar');
@@ -83,7 +83,7 @@ class CachePermissionsMaskTest extends CacheTest {
* @dataProvider maskProvider
* @param int $mask
*/
- public function testSearchMasked($mask) {
+ public function testSearchMasked($mask): void {
$this->storage->mkdir('foo');
$this->storage->file_put_contents('foo/bar', 'asd');
$this->storage->file_put_contents('foo/foobar', 'bar');
diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php
index d84f4469e8b..a6f25026193 100644
--- a/tests/lib/Files/Config/UserMountCacheTest.php
+++ b/tests/lib/Files/Config/UserMountCacheTest.php
@@ -123,7 +123,7 @@ class UserMountCacheTest extends TestCase {
return $mount->getStorageRootId().'::'.$mount->getMountPoint();
}
- public function testNewMounts() {
+ public function testNewMounts(): void {
$user = $this->userManager->get('u1');
[$storage] = $this->getStorage(10);
@@ -143,7 +143,7 @@ class UserMountCacheTest extends TestCase {
$this->assertEquals($storage->getStorageCache()->getNumericId(), $cachedMount->getStorageId());
}
- public function testSameMounts() {
+ public function testSameMounts(): void {
$user = $this->userManager->get('u1');
[$storage] = $this->getStorage(10);
@@ -167,7 +167,7 @@ class UserMountCacheTest extends TestCase {
$this->assertEquals($storage->getStorageCache()->getNumericId(), $cachedMount->getStorageId());
}
- public function testRemoveMounts() {
+ public function testRemoveMounts(): void {
$user = $this->userManager->get('u1');
[$storage] = $this->getStorage(10);
@@ -186,7 +186,7 @@ class UserMountCacheTest extends TestCase {
$this->assertCount(0, $cachedMounts);
}
- public function testChangeMounts() {
+ public function testChangeMounts(): void {
$user = $this->userManager->get('u1');
[$storage] = $this->getStorage(10);
@@ -209,7 +209,7 @@ class UserMountCacheTest extends TestCase {
$this->assertEquals('/foo/', $cachedMount->getMountPoint());
}
- public function testChangeMountId() {
+ public function testChangeMountId(): void {
$user = $this->userManager->get('u1');
[$storage] = $this->getStorage(10);
@@ -232,7 +232,7 @@ class UserMountCacheTest extends TestCase {
$this->assertEquals(1, $cachedMount->getMountId());
}
- public function testGetMountsForUser() {
+ public function testGetMountsForUser(): void {
$user1 = $this->userManager->get('u1');
$user2 = $this->userManager->get('u2');
$user3 = $this->userManager->get('u3');
@@ -269,7 +269,7 @@ class UserMountCacheTest extends TestCase {
$this->assertEmpty($cachedMounts);
}
- public function testGetMountsByStorageId() {
+ public function testGetMountsByStorageId(): void {
$user1 = $this->userManager->get('u1');
$user2 = $this->userManager->get('u2');
@@ -299,7 +299,7 @@ class UserMountCacheTest extends TestCase {
$this->assertEquals(2, $cachedMounts[1]->getStorageId());
}
- public function testGetMountsByRootId() {
+ public function testGetMountsByRootId(): void {
$user1 = $this->userManager->get('u1');
$user2 = $this->userManager->get('u2');
@@ -373,7 +373,7 @@ class UserMountCacheTest extends TestCase {
return $id;
}
- public function testGetMountsForFileIdRootId() {
+ public function testGetMountsForFileIdRootId(): void {
$user1 = $this->userManager->get('u1');
[$storage1, $rootId] = $this->getStorage(2);
@@ -393,7 +393,7 @@ class UserMountCacheTest extends TestCase {
$this->assertEquals(2, $cachedMounts[0]->getStorageId());
}
- public function testGetMountsForFileIdSubFolder() {
+ public function testGetMountsForFileIdSubFolder(): void {
$user1 = $this->userManager->get('u1');
$fileId = $this->createCacheEntry('/foo/bar', 2);
@@ -417,7 +417,7 @@ class UserMountCacheTest extends TestCase {
$this->assertEquals('/foo/foo/bar', $cachedMounts[0]->getPath());
}
- public function testGetMountsForFileIdSubFolderMount() {
+ public function testGetMountsForFileIdSubFolderMount(): void {
$user1 = $this->userManager->get('u1');
[$storage1, $rootId] = $this->getStorage(2);
@@ -451,7 +451,7 @@ class UserMountCacheTest extends TestCase {
$this->assertEquals('/bar', $cachedMounts[0]->getPath());
}
- public function testGetMountsForFileIdSubFolderMountOutside() {
+ public function testGetMountsForFileIdSubFolderMountOutside(): void {
$user1 = $this->userManager->get('u1');
[$storage1, $rootId] = $this->getStorage(2);
@@ -479,7 +479,7 @@ class UserMountCacheTest extends TestCase {
}
- public function testGetMountsForFileIdDeletedUser() {
+ public function testGetMountsForFileIdDeletedUser(): void {
$user1 = $this->userManager->get('u1');
[$storage1, $rootId] = $this->getStorage(2);
@@ -494,7 +494,7 @@ class UserMountCacheTest extends TestCase {
$this->assertEmpty($cachedMounts);
}
- public function testGetUsedSpaceForUsers() {
+ public function testGetUsedSpaceForUsers(): void {
$user1 = $this->userManager->get('u1');
$user2 = $this->userManager->get('u2');
@@ -525,7 +525,7 @@ class UserMountCacheTest extends TestCase {
}
- public function testMigrateMountProvider() {
+ public function testMigrateMountProvider(): void {
$user1 = $this->userManager->get('u1');
[$storage1, $rootId] = $this->getStorage(2);
diff --git a/tests/lib/Files/EtagTest.php b/tests/lib/Files/EtagTest.php
index a109a17d250..dbf65eac439 100644
--- a/tests/lib/Files/EtagTest.php
+++ b/tests/lib/Files/EtagTest.php
@@ -55,7 +55,7 @@ class EtagTest extends \Test\TestCase {
parent::tearDown();
}
- public function testNewUser() {
+ public function testNewUser(): void {
$user1 = $this->getUniqueID('user_');
$this->userBackend->createUser($user1, '');
diff --git a/tests/lib/Files/FileInfoTest.php b/tests/lib/Files/FileInfoTest.php
index bc4a25ef622..2979252f78a 100644
--- a/tests/lib/Files/FileInfoTest.php
+++ b/tests/lib/Files/FileInfoTest.php
@@ -27,7 +27,7 @@ class FileInfoTest extends TestCase {
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
}
- public function testIsMountedHomeStorage() {
+ public function testIsMountedHomeStorage(): void {
$user = $this->createMock(IUser::class);
$user->method('getUID')
->willReturn('foo');
@@ -45,7 +45,7 @@ class FileInfoTest extends TestCase {
$this->assertFalse($fileInfo->isMounted());
}
- public function testIsMountedNonHomeStorage() {
+ public function testIsMountedNonHomeStorage(): void {
$storage = new Temporary();
$fileInfo = new FileInfo(
'',
diff --git a/tests/lib/Files/FilesystemTest.php b/tests/lib/Files/FilesystemTest.php
index f7964feeae8..91f0bb9b01d 100644
--- a/tests/lib/Files/FilesystemTest.php
+++ b/tests/lib/Files/FilesystemTest.php
@@ -80,7 +80,7 @@ class FilesystemTest extends \Test\TestCase {
parent::tearDown();
}
- public function testMount() {
+ public function testMount(): void {
\OC\Files\Filesystem::mount('\OC\Files\Storage\Local', self::getStorageData(), '/');
$this->assertEquals('/', \OC\Files\Filesystem::getMountPoint('/'));
$this->assertEquals('/', \OC\Files\Filesystem::getMountPoint('/some/folder'));
@@ -195,7 +195,7 @@ class FilesystemTest extends \Test\TestCase {
/**
* @dataProvider normalizePathData
*/
- public function testNormalizePath($expected, $path, $stripTrailingSlash = true) {
+ public function testNormalizePath($expected, $path, $stripTrailingSlash = true): void {
$this->assertEquals($expected, \OC\Files\Filesystem::normalizePath($path, $stripTrailingSlash));
}
@@ -213,11 +213,11 @@ class FilesystemTest extends \Test\TestCase {
/**
* @dataProvider normalizePathKeepUnicodeData
*/
- public function testNormalizePathKeepUnicode($expected, $path, $keepUnicode = false) {
+ public function testNormalizePathKeepUnicode($expected, $path, $keepUnicode = false): void {
$this->assertEquals($expected, \OC\Files\Filesystem::normalizePath($path, true, false, $keepUnicode));
}
- public function testNormalizePathKeepUnicodeCache() {
+ public function testNormalizePathKeepUnicodeCache(): void {
$nfdName = 'ümlaut';
$nfcName = 'ümlaut';
// call in succession due to cache
@@ -254,7 +254,7 @@ class FilesystemTest extends \Test\TestCase {
/**
* @dataProvider isValidPathData
*/
- public function testIsValidPath($path, $expected) {
+ public function testIsValidPath($path, $expected): void {
$this->assertSame($expected, \OC\Files\Filesystem::isValidPath($path));
}
@@ -276,11 +276,11 @@ class FilesystemTest extends \Test\TestCase {
/**
* @dataProvider isFileBlacklistedData
*/
- public function testIsFileBlacklisted($path, $expected) {
+ public function testIsFileBlacklisted($path, $expected): void {
$this->assertSame($expected, \OC\Files\Filesystem::isFileBlacklisted($path));
}
- public function testNormalizePathUTF8() {
+ public function testNormalizePathUTF8(): void {
if (!class_exists('Patchwork\PHP\Shim\Normalizer')) {
$this->markTestSkipped('UTF8 normalizer Patchwork was not found');
}
@@ -289,7 +289,7 @@ class FilesystemTest extends \Test\TestCase {
$this->assertEquals("/foo/bar\xC3\xBC", \OC\Files\Filesystem::normalizePath("\\foo\\baru\xCC\x88"));
}
- public function testHooks() {
+ public function testHooks(): void {
if (\OC\Files\Filesystem::getView()) {
$user = \OC_User::getUser();
} else {
@@ -324,7 +324,7 @@ class FilesystemTest extends \Test\TestCase {
* Tests that an exception is thrown when passed user does not exist.
*
*/
- public function testLocalMountWhenUserDoesNotExist() {
+ public function testLocalMountWhenUserDoesNotExist(): void {
$this->expectException(\OC\User\NoUserException::class);
$userId = $this->getUniqueID('user_');
@@ -333,13 +333,13 @@ class FilesystemTest extends \Test\TestCase {
}
- public function testNullUserThrows() {
+ public function testNullUserThrows(): void {
$this->expectException(\OC\User\NoUserException::class);
\OC\Files\Filesystem::initMountPoints(null);
}
- public function testNullUserThrowsTwice() {
+ public function testNullUserThrowsTwice(): void {
$thrown = 0;
try {
\OC\Files\Filesystem::initMountPoints(null);
@@ -357,7 +357,7 @@ class FilesystemTest extends \Test\TestCase {
/**
* Tests that an exception is thrown when passed user does not exist.
*/
- public function testLocalMountWhenUserDoesNotExistTwice() {
+ public function testLocalMountWhenUserDoesNotExistTwice(): void {
$thrown = 0;
$userId = $this->getUniqueID('user_');
@@ -379,7 +379,7 @@ class FilesystemTest extends \Test\TestCase {
/**
* Tests that the home storage is used for the user's mount point
*/
- public function testHomeMount() {
+ public function testHomeMount(): void {
$userId = $this->getUniqueID('user_');
\OC::$server->getUserManager()->createUser($userId, $userId);
@@ -409,7 +409,7 @@ class FilesystemTest extends \Test\TestCase {
/**
* Test that the default cache dir is part of the user's home
*/
- public function testMountDefaultCacheDir() {
+ public function testMountDefaultCacheDir(): void {
$userId = $this->getUniqueID('user_');
$config = \OC::$server->getConfig();
$oldCachePath = $config->getSystemValueString('cache_path', '');
@@ -438,7 +438,7 @@ class FilesystemTest extends \Test\TestCase {
* Test that an external cache is mounted into
* the user's home
*/
- public function testMountExternalCacheDir() {
+ public function testMountExternalCacheDir(): void {
$userId = $this->getUniqueID('user_');
$config = \OC::$server->getConfig();
@@ -465,7 +465,7 @@ class FilesystemTest extends \Test\TestCase {
$config->setSystemValue('cache_path', $oldCachePath);
}
- public function testRegisterMountProviderAfterSetup() {
+ public function testRegisterMountProviderAfterSetup(): void {
\OC\Files\Filesystem::initMountPoints(self::TEST_FILESYSTEM_USER2);
$this->assertEquals('/', \OC\Files\Filesystem::getMountPoint('/foo/bar'));
$mount = new MountPoint(new Temporary([]), '/foo/bar');
diff --git a/tests/lib/Files/Mount/ManagerTest.php b/tests/lib/Files/Mount/ManagerTest.php
index f8adb2bf1cf..fe166988687 100644
--- a/tests/lib/Files/Mount/ManagerTest.php
+++ b/tests/lib/Files/Mount/ManagerTest.php
@@ -27,7 +27,7 @@ class ManagerTest extends \Test\TestCase {
$this->manager = new \OC\Files\Mount\Manager($this->createMock(SetupManagerFactory::class));
}
- public function testFind() {
+ public function testFind(): void {
$rootMount = new \OC\Files\Mount\MountPoint(new Temporary([]), '/');
$this->manager->addMount($rootMount);
$this->assertEquals($rootMount, $this->manager->find('/'));
@@ -52,7 +52,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals([$mount1, $mount3], $this->manager->findByStorageId($id));
}
- public function testLong() {
+ public function testLong(): void {
$storage = new LongId([]);
$mount = new \OC\Files\Mount\MountPoint($storage, '/foo');
$this->manager->addMount($mount);
diff --git a/tests/lib/Files/Mount/MountPointTest.php b/tests/lib/Files/Mount/MountPointTest.php
index 189667df276..eda61feb249 100644
--- a/tests/lib/Files/Mount/MountPointTest.php
+++ b/tests/lib/Files/Mount/MountPointTest.php
@@ -14,7 +14,7 @@ class DummyStorage {
}
class MountPointTest extends \Test\TestCase {
- public function testGetStorage() {
+ public function testGetStorage(): void {
$storage = $this->createMock(Storage::class);
$storage->expects($this->once())
->method('getId')
@@ -41,7 +41,7 @@ class MountPointTest extends \Test\TestCase {
$this->assertEquals('/another/', $mountPoint->getMountPoint());
}
- public function testInvalidStorage() {
+ public function testInvalidStorage(): void {
$loader = $this->createMock(StorageFactory::class);
$loader->expects($this->once())
->method('wrap')
diff --git a/tests/lib/Files/Mount/MountTest.php b/tests/lib/Files/Mount/MountTest.php
index 0b4c6a214f3..76d70cdd214 100644
--- a/tests/lib/Files/Mount/MountTest.php
+++ b/tests/lib/Files/Mount/MountTest.php
@@ -11,7 +11,7 @@ use OC\Files\Storage\StorageFactory;
use OC\Files\Storage\Wrapper\Wrapper;
class MountTest extends \Test\TestCase {
- public function testFromStorageObject() {
+ public function testFromStorageObject(): void {
$storage = $this->getMockBuilder('\OC\Files\Storage\Temporary')
->disableOriginalConstructor()
->getMock();
@@ -19,12 +19,12 @@ class MountTest extends \Test\TestCase {
$this->assertInstanceOf('\OC\Files\Storage\Temporary', $mount->getStorage());
}
- public function testFromStorageClassname() {
+ public function testFromStorageClassname(): void {
$mount = new \OC\Files\Mount\MountPoint('\OC\Files\Storage\Temporary', '/foo');
$this->assertInstanceOf('\OC\Files\Storage\Temporary', $mount->getStorage());
}
- public function testWrapper() {
+ public function testWrapper(): void {
$test = $this;
$wrapper = function ($mountPoint, $storage) use (&$test) {
$test->assertEquals('/foo/', $mountPoint);
diff --git a/tests/lib/Files/Mount/ObjectHomeMountProviderTest.php b/tests/lib/Files/Mount/ObjectHomeMountProviderTest.php
index 9b6aaeccfeb..f787c168130 100644
--- a/tests/lib/Files/Mount/ObjectHomeMountProviderTest.php
+++ b/tests/lib/Files/Mount/ObjectHomeMountProviderTest.php
@@ -34,7 +34,7 @@ class ObjectHomeMountProviderTest extends \Test\TestCase {
$this->provider = new ObjectHomeMountProvider($this->config);
}
- public function testSingleBucket() {
+ public function testSingleBucket(): void {
$this->config->expects($this->once())
->method('getSystemValue')
->with($this->equalTo('objectstore'), '')
@@ -56,7 +56,7 @@ class ObjectHomeMountProviderTest extends \Test\TestCase {
$this->assertInstanceOf('Test\Files\Mount\FakeObjectStore', $config['arguments']['objectstore']);
}
- public function testMultiBucket() {
+ public function testMultiBucket(): void {
$this->config->expects($this->exactly(2))
->method('getSystemValue')
->with($this->equalTo('objectstore_multibucket'), '')
@@ -100,7 +100,7 @@ class ObjectHomeMountProviderTest extends \Test\TestCase {
$this->assertEquals('49', $config['arguments']['bucket']);
}
- public function testMultiBucketWithPrefix() {
+ public function testMultiBucketWithPrefix(): void {
$this->config->expects($this->exactly(2))
->method('getSystemValue')
->with('objectstore_multibucket')
@@ -147,7 +147,7 @@ class ObjectHomeMountProviderTest extends \Test\TestCase {
$this->assertEquals('myBucketPrefix49', $config['arguments']['bucket']);
}
- public function testMultiBucketBucketAlreadySet() {
+ public function testMultiBucketBucketAlreadySet(): void {
$this->config->expects($this->once())
->method('getSystemValue')
->with('objectstore_multibucket')
@@ -187,7 +187,7 @@ class ObjectHomeMountProviderTest extends \Test\TestCase {
$this->assertEquals('awesomeBucket1', $config['arguments']['bucket']);
}
- public function testMultiBucketConfigFirst() {
+ public function testMultiBucketConfigFirst(): void {
$this->config->expects($this->exactly(2))
->method('getSystemValue')
->with('objectstore_multibucket')
@@ -203,7 +203,7 @@ class ObjectHomeMountProviderTest extends \Test\TestCase {
$this->assertInstanceOf('OC\Files\Mount\MountPoint', $mount);
}
- public function testMultiBucketConfigFirstFallBackSingle() {
+ public function testMultiBucketConfigFirstFallBackSingle(): void {
$this->config->expects($this->exactly(2))
->method('getSystemValue')
->withConsecutive(
@@ -224,7 +224,7 @@ class ObjectHomeMountProviderTest extends \Test\TestCase {
$this->assertInstanceOf('OC\Files\Mount\MountPoint', $mount);
}
- public function testNoObjectStore() {
+ public function testNoObjectStore(): void {
$this->config->expects($this->exactly(2))
->method('getSystemValue')
->willReturn('');
diff --git a/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php b/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php
index b22224aa7db..9060bf0d5f5 100644
--- a/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php
+++ b/tests/lib/Files/Mount/ObjectStorePreviewCacheMountProviderTest.php
@@ -43,7 +43,7 @@ class ObjectStorePreviewCacheMountProviderTest extends \Test\TestCase {
$this->provider = new ObjectStorePreviewCacheMountProvider($this->logger, $this->config);
}
- public function testNoMultibucketObjectStorage() {
+ public function testNoMultibucketObjectStorage(): void {
$this->config->expects($this->once())
->method('getSystemValue')
->with('objectstore_multibucket')
@@ -52,7 +52,7 @@ class ObjectStorePreviewCacheMountProviderTest extends \Test\TestCase {
$this->assertEquals([], $this->provider->getRootMounts($this->loader));
}
- public function testMultibucketObjectStorage() {
+ public function testMultibucketObjectStorage(): void {
$objectstoreConfig = [
'class' => S3::class,
'arguments' => [
diff --git a/tests/lib/Files/Mount/RootMountProviderTest.php b/tests/lib/Files/Mount/RootMountProviderTest.php
index f3f43a8457c..2613cfd4b7b 100644
--- a/tests/lib/Files/Mount/RootMountProviderTest.php
+++ b/tests/lib/Files/Mount/RootMountProviderTest.php
@@ -44,7 +44,7 @@ class RootMountProviderTest extends TestCase {
return $provider;
}
- public function testLocal() {
+ public function testLocal(): void {
$provider = $this->getProvider([
'datadirectory' => '/data',
]);
@@ -58,7 +58,7 @@ class RootMountProviderTest extends TestCase {
$this->assertEquals('/data/', $storage->getSourcePath(''));
}
- public function testObjectStore() {
+ public function testObjectStore(): void {
$provider = $this->getProvider([
'objectstore' => [
'class' => "OC\Files\ObjectStore\S3",
@@ -91,7 +91,7 @@ class RootMountProviderTest extends TestCase {
$this->assertEquals('nextcloud', $objectStore->getBucket());
}
- public function testObjectStoreMultiBucket() {
+ public function testObjectStoreMultiBucket(): void {
$provider = $this->getProvider([
'objectstore_multibucket' => [
'class' => "OC\Files\ObjectStore\S3",
diff --git a/tests/lib/Files/Node/FileTest.php b/tests/lib/Files/Node/FileTest.php
index 35c2443aeff..a67c9433663 100644
--- a/tests/lib/Files/Node/FileTest.php
+++ b/tests/lib/Files/Node/FileTest.php
@@ -35,7 +35,7 @@ class FileTest extends NodeTest {
return 'unlink';
}
- public function testGetContent() {
+ public function testGetContent(): void {
/** @var \OC\Files\Node\Root|\PHPUnit\Framework\MockObject\MockObject $root */
$root = $this->getMockBuilder('\OC\Files\Node\Root')
->setConstructorArgs([$this->manager, $this->view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory])
@@ -63,7 +63,7 @@ class FileTest extends NodeTest {
}
- public function testGetContentNotPermitted() {
+ public function testGetContentNotPermitted(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
/** @var \OC\Files\Node\Root|\PHPUnit\Framework\MockObject\MockObject $root */
@@ -84,7 +84,7 @@ class FileTest extends NodeTest {
$node->getContent();
}
- public function testPutContent() {
+ public function testPutContent(): void {
/** @var \OC\Files\Node\Root|\PHPUnit\Framework\MockObject\MockObject $root */
$root = $this->getMockBuilder('\OC\Files\Node\Root')
->setConstructorArgs([$this->manager, $this->view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory])
@@ -109,7 +109,7 @@ class FileTest extends NodeTest {
}
- public function testPutContentNotPermitted() {
+ public function testPutContentNotPermitted(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
/** @var \OC\Files\Node\Root|\PHPUnit\Framework\MockObject\MockObject $root */
@@ -126,7 +126,7 @@ class FileTest extends NodeTest {
$node->putContent('bar');
}
- public function testGetMimeType() {
+ public function testGetMimeType(): void {
/** @var \OC\Files\Node\Root|\PHPUnit\Framework\MockObject\MockObject $root */
$root = $this->getMockBuilder('\OC\Files\Node\Root')
->setConstructorArgs([$this->manager, $this->view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory])
@@ -141,7 +141,7 @@ class FileTest extends NodeTest {
$this->assertEquals('text/plain', $node->getMimeType());
}
- public function testFOpenRead() {
+ public function testFOpenRead(): void {
$stream = fopen('php://memory', 'w+');
fwrite($stream, 'bar');
rewind($stream);
@@ -180,7 +180,7 @@ class FileTest extends NodeTest {
$this->assertEquals('bar', fread($fh, 3));
}
- public function testFOpenWrite() {
+ public function testFOpenWrite(): void {
$stream = fopen('php://memory', 'w+');
$root = new \OC\Files\Node\Root(
@@ -221,7 +221,7 @@ class FileTest extends NodeTest {
}
- public function testFOpenReadNotPermitted() {
+ public function testFOpenReadNotPermitted(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$root = new \OC\Files\Node\Root(
@@ -248,7 +248,7 @@ class FileTest extends NodeTest {
}
- public function testFOpenReadWriteNoReadPermissions() {
+ public function testFOpenReadWriteNoReadPermissions(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$root = new \OC\Files\Node\Root(
@@ -275,7 +275,7 @@ class FileTest extends NodeTest {
}
- public function testFOpenReadWriteNoWritePermissions() {
+ public function testFOpenReadWriteNoWritePermissions(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$root = new \OC\Files\Node\Root(
diff --git a/tests/lib/Files/Node/FolderTest.php b/tests/lib/Files/Node/FolderTest.php
index 46fda6c3a76..2e3b6e369d3 100644
--- a/tests/lib/Files/Node/FolderTest.php
+++ b/tests/lib/Files/Node/FolderTest.php
@@ -62,7 +62,7 @@ class FolderTest extends NodeTest {
return 'rmdir';
}
- public function testGetDirectoryContent() {
+ public function testGetDirectoryContent(): void {
$manager = $this->createMock(Manager::class);
/**
* @var \OC\Files\View | \PHPUnit\Framework\MockObject\MockObject $view
@@ -97,7 +97,7 @@ class FolderTest extends NodeTest {
$this->assertEquals(3, $children[1]->getId());
}
- public function testGet() {
+ public function testGet(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -116,7 +116,7 @@ class FolderTest extends NodeTest {
self::assertEquals($node, $parentNode->get('asd'));
}
- public function testNodeExists() {
+ public function testNodeExists(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -136,7 +136,7 @@ class FolderTest extends NodeTest {
$this->assertTrue($node->nodeExists('asd'));
}
- public function testNodeExistsNotExists() {
+ public function testNodeExistsNotExists(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -154,7 +154,7 @@ class FolderTest extends NodeTest {
$this->assertFalse($node->nodeExists('asd'));
}
- public function testNewFolder() {
+ public function testNewFolder(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -178,7 +178,7 @@ class FolderTest extends NodeTest {
$this->assertEquals($child, $result);
}
- public function testNewFolderDeepParent() {
+ public function testNewFolderDeepParent(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -203,7 +203,7 @@ class FolderTest extends NodeTest {
}
- public function testNewFolderNotPermitted() {
+ public function testNewFolderNotPermitted(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$manager = $this->createMock(Manager::class);
@@ -222,7 +222,7 @@ class FolderTest extends NodeTest {
$node->newFolder('asd');
}
- public function testNewFile() {
+ public function testNewFile(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -247,7 +247,7 @@ class FolderTest extends NodeTest {
}
- public function testNewFileNotPermitted() {
+ public function testNewFileNotPermitted(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$manager = $this->createMock(Manager::class);
@@ -266,7 +266,7 @@ class FolderTest extends NodeTest {
$node->newFile('asd');
}
- public function testGetFreeSpace() {
+ public function testGetFreeSpace(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -283,7 +283,7 @@ class FolderTest extends NodeTest {
$this->assertEquals(100, $node->getFreeSpace());
}
- public function testSearch() {
+ public function testSearch(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -330,7 +330,7 @@ class FolderTest extends NodeTest {
$this->assertEquals('/bar/foo/qwerty', $result[0]->getPath());
}
- public function testSearchInRoot() {
+ public function testSearchInRoot(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -371,7 +371,7 @@ class FolderTest extends NodeTest {
$this->assertEquals('/foo', $result[0]->getPath());
}
- public function testSearchInStorageRoot() {
+ public function testSearchInStorageRoot(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -411,7 +411,7 @@ class FolderTest extends NodeTest {
$this->assertEquals('/bar/foo/qwerty', $result[0]->getPath());
}
- public function testSearchSubStorages() {
+ public function testSearchSubStorages(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -469,7 +469,7 @@ class FolderTest extends NodeTest {
$this->assertEquals(2, count($result));
}
- public function testIsSubNode() {
+ public function testIsSubNode(): void {
$rootFolderMock = $this->createMock(IRootFolder::class);
$file = new Node($rootFolderMock, $this->view, '/foo/bar');
$folder = new Folder($rootFolderMock, $this->view, '/foo');
@@ -480,7 +480,7 @@ class FolderTest extends NodeTest {
$this->assertFalse($folder->isSubNode($file));
}
- public function testGetById() {
+ public function testGetById(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -527,7 +527,7 @@ class FolderTest extends NodeTest {
$this->assertEquals('/bar/foo/qwerty', $result[0]->getPath());
}
- public function testGetByIdMountRoot() {
+ public function testGetByIdMountRoot(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -570,7 +570,7 @@ class FolderTest extends NodeTest {
$this->assertEquals('/bar', $result[0]->getPath());
}
- public function testGetByIdOutsideFolder() {
+ public function testGetByIdOutsideFolder(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -612,7 +612,7 @@ class FolderTest extends NodeTest {
$this->assertEquals(0, count($result));
}
- public function testGetByIdMultipleStorages() {
+ public function testGetByIdMultipleStorages(): void {
$manager = $this->createMock(Manager::class);
$view = $this->getRootViewMock();
$root = $this->getMockBuilder(Root::class)
@@ -673,7 +673,7 @@ class FolderTest extends NodeTest {
/**
* @dataProvider uniqueNameProvider
*/
- public function testGetUniqueName($name, $existingFiles, $expected) {
+ public function testGetUniqueName($name, $existingFiles, $expected): void {
$manager = $this->createMock(Manager::class);
$folderPath = '/bar/foo';
$view = $this->getRootViewMock();
@@ -762,7 +762,7 @@ class FolderTest extends NodeTest {
$this->assertEquals([$id1, $id2, $id3], $ids);
}
- public function testRecentFolder() {
+ public function testRecentFolder(): void {
$manager = $this->createMock(Manager::class);
$folderPath = '/bar/foo';
$view = $this->getRootViewMock();
@@ -826,7 +826,7 @@ class FolderTest extends NodeTest {
$this->assertEquals($baseTime - 100, $nodes[1]->getMTime());
}
- public function testRecentJail() {
+ public function testRecentJail(): void {
$manager = $this->createMock(Manager::class);
$folderPath = '/bar/foo';
$view = $this->getRootViewMock();
@@ -909,7 +909,7 @@ class FolderTest extends NodeTest {
* @throws NotFoundException
* @throws \OCP\Files\InvalidPathException
*/
- public function testSearchSubStoragesLimitOffset(int $offset, int $limit, array $expectedPaths, array $ordering) {
+ public function testSearchSubStoragesLimitOffset(int $offset, int $limit, array $expectedPaths, array $ordering): void {
if (!$ordering) {
$ordering = [new SearchOrder(ISearchOrder::DIRECTION_ASCENDING, 'fileid')];
}
diff --git a/tests/lib/Files/Node/HookConnectorTest.php b/tests/lib/Files/Node/HookConnectorTest.php
index ac1672ca4be..1a3337b9ddc 100644
--- a/tests/lib/Files/Node/HookConnectorTest.php
+++ b/tests/lib/Files/Node/HookConnectorTest.php
@@ -152,7 +152,7 @@ class HookConnectorTest extends TestCase {
* @param string $expectedHook
* @dataProvider viewToNodeProvider
*/
- public function testViewToNode(callable $operation, $expectedHook, $expectedLegacyEvent, $expectedEvent) {
+ public function testViewToNode(callable $operation, $expectedHook, $expectedLegacyEvent, $expectedEvent): void {
$connector = new HookConnector($this->root, $this->view, $this->eventDispatcher, $this->logger);
$connector->viewToNode();
$hookCalled = false;
@@ -221,7 +221,7 @@ class HookConnectorTest extends TestCase {
* @param string $expectedHook
* @dataProvider viewToNodeProviderCopyRename
*/
- public function testViewToNodeCopyRename(callable $operation, $expectedHook, $expectedLegacyEvent, $expectedEvent) {
+ public function testViewToNodeCopyRename(callable $operation, $expectedHook, $expectedLegacyEvent, $expectedEvent): void {
$connector = new HookConnector($this->root, $this->view, $this->eventDispatcher, $this->logger);
$connector->viewToNode();
$hookCalled = false;
@@ -276,7 +276,7 @@ class HookConnectorTest extends TestCase {
$this->assertEquals('/' . $this->userId . '/files/target', $newDispatcherTargetNode->getPath());
}
- public function testPostDeleteMeta() {
+ public function testPostDeleteMeta(): void {
$connector = new HookConnector($this->root, $this->view, $this->eventDispatcher, $this->logger);
$connector->viewToNode();
$hookCalled = false;
diff --git a/tests/lib/Files/Node/IntegrationTest.php b/tests/lib/Files/Node/IntegrationTest.php
index fe6fe779ad0..c90a6115f2a 100644
--- a/tests/lib/Files/Node/IntegrationTest.php
+++ b/tests/lib/Files/Node/IntegrationTest.php
@@ -88,7 +88,7 @@ class IntegrationTest extends \Test\TestCase {
parent::tearDown();
}
- public function testBasicFile() {
+ public function testBasicFile(): void {
$file = $this->root->newFile('/foo.txt');
$this->assertCount(2, $this->root->getDirectoryListing());
$this->assertTrue($this->root->nodeExists('/foo.txt'));
@@ -111,7 +111,7 @@ class IntegrationTest extends \Test\TestCase {
$this->assertEquals('qwerty', $file->getContent());
}
- public function testBasicFolder() {
+ public function testBasicFolder(): void {
$folder = $this->root->newFolder('/foo');
$this->assertTrue($this->root->nodeExists('/foo'));
$file = $folder->newFile('/bar');
diff --git a/tests/lib/Files/Node/NodeTest.php b/tests/lib/Files/Node/NodeTest.php
index b00d9e1b4de..d12448a2481 100644
--- a/tests/lib/Files/Node/NodeTest.php
+++ b/tests/lib/Files/Node/NodeTest.php
@@ -127,7 +127,7 @@ abstract class NodeTest extends \Test\TestCase {
return new FileInfo('', $this->getMockStorage(), $internalPath, $data, $mount);
}
- public function testDelete() {
+ public function testDelete(): void {
$this->root->expects($this->exactly(2))
->method('emit')
->willReturn(true);
@@ -149,7 +149,7 @@ abstract class NodeTest extends \Test\TestCase {
$node->delete();
}
- public function testDeleteHooks() {
+ public function testDeleteHooks(): void {
$test = $this;
$hooksRun = 0;
/**
@@ -205,7 +205,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testDeleteNotPermitted() {
+ public function testDeleteNotPermitted(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$this->root->expects($this->any())
@@ -222,7 +222,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testStat() {
+ public function testStat(): void {
$this->root->expects($this->any())
->method('getUser')
->willReturn($this->user);
@@ -244,7 +244,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->assertEquals($stat, $node->stat());
}
- public function testGetId() {
+ public function testGetId(): void {
$this->root->expects($this->any())
->method('getUser')
->willReturn($this->user);
@@ -265,7 +265,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->assertEquals(1, $node->getId());
}
- public function testGetSize() {
+ public function testGetSize(): void {
$this->root->expects($this->any())
->method('getUser')
->willReturn($this->user);
@@ -287,7 +287,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->assertEquals(100, $node->getSize());
}
- public function testGetEtag() {
+ public function testGetEtag(): void {
$this->root->expects($this->any())
->method('getUser')
->willReturn($this->user);
@@ -308,7 +308,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->assertEquals('qwerty', $node->getEtag());
}
- public function testGetMTime() {
+ public function testGetMTime(): void {
$this->root->expects($this->any())
->method('getUser')
->willReturn($this->user);
@@ -329,7 +329,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->assertEquals(50, $node->getMTime());
}
- public function testGetStorage() {
+ public function testGetStorage(): void {
$this->root->expects($this->any())
->method('getUser')
->willReturn($this->user);
@@ -344,7 +344,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->assertEquals($storage, $node->getStorage());
}
- public function testGetPath() {
+ public function testGetPath(): void {
$this->root->expects($this->any())
->method('getUser')
->willReturn($this->user);
@@ -353,7 +353,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->assertEquals('/bar/foo', $node->getPath());
}
- public function testGetInternalPath() {
+ public function testGetInternalPath(): void {
$this->root->expects($this->any())
->method('getUser')
->willReturn($this->user);
@@ -374,7 +374,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->assertEquals('foo', $node->getInternalPath());
}
- public function testGetName() {
+ public function testGetName(): void {
$this->root->expects($this->any())
->method('getUser')
->willReturn($this->user);
@@ -383,7 +383,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->assertEquals('foo', $node->getName());
}
- public function testTouchSetMTime() {
+ public function testTouchSetMTime(): void {
$this->root->expects($this->any())
->method('getUser')
->willReturn($this->user);
@@ -403,7 +403,7 @@ abstract class NodeTest extends \Test\TestCase {
$this->assertEquals(100, $node->getMTime());
}
- public function testTouchHooks() {
+ public function testTouchHooks(): void {
$test = $this;
$hooksRun = 0;
/**
@@ -453,7 +453,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testTouchNotPermitted() {
+ public function testTouchNotPermitted(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$this->root->expects($this->any())
@@ -470,14 +470,14 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testInvalidPath() {
+ public function testInvalidPath(): void {
$this->expectException(\OCP\Files\InvalidPathException::class);
$node = $this->createTestNode($this->root, $this->view, '/../foo');
$node->getFileInfo();
}
- public function testCopySameStorage() {
+ public function testCopySameStorage(): void {
$this->view->expects($this->any())
->method('copy')
->with('/bar/foo', '/bar/asd')
@@ -503,7 +503,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testCopyNotPermitted() {
+ public function testCopyNotPermitted(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
/**
@@ -534,7 +534,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testCopyNoParent() {
+ public function testCopyNoParent(): void {
$this->expectException(\OCP\Files\NotFoundException::class);
$this->view->expects($this->never())
@@ -551,7 +551,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testCopyParentIsFile() {
+ public function testCopyParentIsFile(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$this->view->expects($this->never())
@@ -569,7 +569,7 @@ abstract class NodeTest extends \Test\TestCase {
$node->copy('/bar/asd');
}
- public function testMoveSameStorage() {
+ public function testMoveSameStorage(): void {
$this->view->expects($this->any())
->method('rename')
->with('/bar/foo', '/bar/asd')
@@ -606,7 +606,7 @@ abstract class NodeTest extends \Test\TestCase {
* @param string $preHookName
* @param string $postHookName
*/
- public function testMoveCopyHooks($operationMethod, $viewMethod, $preHookName, $postHookName) {
+ public function testMoveCopyHooks($operationMethod, $viewMethod, $preHookName, $postHookName): void {
/** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject $root */
$root = $this->getMockBuilder('\OC\Files\Node\Root')
->setConstructorArgs([$this->manager, $this->view, $this->user, $this->userMountCache, $this->logger, $this->userManager, $this->eventDispatcher, $this->cacheFactory])
@@ -674,7 +674,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testMoveNotPermitted() {
+ public function testMoveNotPermitted(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$this->view->expects($this->any())
@@ -696,7 +696,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testMoveNoParent() {
+ public function testMoveNoParent(): void {
$this->expectException(\OCP\Files\NotFoundException::class);
/**
@@ -718,7 +718,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testMoveParentIsFile() {
+ public function testMoveParentIsFile(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$this->view->expects($this->never())
@@ -736,7 +736,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testMoveFailed() {
+ public function testMoveFailed(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$this->view->expects($this->any())
@@ -759,7 +759,7 @@ abstract class NodeTest extends \Test\TestCase {
}
- public function testCopyFailed() {
+ public function testCopyFailed(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$this->view->expects($this->any())
diff --git a/tests/lib/Files/Node/RootTest.php b/tests/lib/Files/Node/RootTest.php
index 9b3139cf78b..f2ef1a0e3ee 100644
--- a/tests/lib/Files/Node/RootTest.php
+++ b/tests/lib/Files/Node/RootTest.php
@@ -75,7 +75,7 @@ class RootTest extends \Test\TestCase {
return new FileInfo('', null, '', $data, null);
}
- public function testGet() {
+ public function testGet(): void {
/**
* @var \OC\Files\Storage\Storage $storage
*/
@@ -106,7 +106,7 @@ class RootTest extends \Test\TestCase {
}
- public function testGetNotFound() {
+ public function testGetNotFound(): void {
$this->expectException(\OCP\Files\NotFoundException::class);
/**
@@ -137,7 +137,7 @@ class RootTest extends \Test\TestCase {
}
- public function testGetInvalidPath() {
+ public function testGetInvalidPath(): void {
$this->expectException(\OCP\Files\NotPermittedException::class);
$view = $this->getRootViewMock();
@@ -156,7 +156,7 @@ class RootTest extends \Test\TestCase {
}
- public function testGetNoStorages() {
+ public function testGetNoStorages(): void {
$this->expectException(\OCP\Files\NotFoundException::class);
$view = $this->getRootViewMock();
@@ -174,7 +174,7 @@ class RootTest extends \Test\TestCase {
$root->get('/bar/foo');
}
- public function testGetUserFolder() {
+ public function testGetUserFolder(): void {
$root = new \OC\Files\Node\Root(
$this->manager,
$this->getRootViewMock(),
@@ -213,7 +213,7 @@ class RootTest extends \Test\TestCase {
}
- public function testGetUserFolderWithNoUserObj() {
+ public function testGetUserFolderWithNoUserObj(): void {
$this->expectException(\OC\User\NoUserException::class);
$this->expectExceptionMessage('Backends provided no user object');
diff --git a/tests/lib/Files/ObjectStore/AzureTest.php b/tests/lib/Files/ObjectStore/AzureTest.php
index 5d4234532a6..c82ed988434 100644
--- a/tests/lib/Files/ObjectStore/AzureTest.php
+++ b/tests/lib/Files/ObjectStore/AzureTest.php
@@ -21,7 +21,7 @@ class AzureTest extends ObjectStoreTest {
return new Azure($config['arguments']);
}
- public function testFseekSize() {
+ public function testFseekSize(): void {
$this->markTestSkipped('azure does not support seeking at the moment');
}
}
diff --git a/tests/lib/Files/ObjectStore/MapperTest.php b/tests/lib/Files/ObjectStore/MapperTest.php
index 19269f13355..15a2d497fc3 100644
--- a/tests/lib/Files/ObjectStore/MapperTest.php
+++ b/tests/lib/Files/ObjectStore/MapperTest.php
@@ -47,7 +47,7 @@ class MapperTest extends \Test\TestCase {
* @param int $numBuckets
* @param string $expectedBucket
*/
- public function testGetBucket($username, $numBuckets, $bucketShift, $expectedBucket) {
+ public function testGetBucket($username, $numBuckets, $bucketShift, $expectedBucket): void {
$this->user->expects($this->once())
->method('getUID')
->willReturn($username);
diff --git a/tests/lib/Files/ObjectStore/ObjectStoreScannerTest.php b/tests/lib/Files/ObjectStore/ObjectStoreScannerTest.php
index 425dc8c2581..4f6254cdb94 100644
--- a/tests/lib/Files/ObjectStore/ObjectStoreScannerTest.php
+++ b/tests/lib/Files/ObjectStore/ObjectStoreScannerTest.php
@@ -31,7 +31,7 @@ class ObjectStoreScannerTest extends TestCase {
$this->realScanner = new Scanner($this->storage);
}
- public function testFile() {
+ public function testFile(): void {
$data = "dummy file data\n";
$this->storage->file_put_contents('foo.txt', $data);
@@ -51,7 +51,7 @@ class ObjectStoreScannerTest extends TestCase {
$this->storage->file_put_contents('folder/bar.txt', $textData);
}
- public function testFolder() {
+ public function testFolder(): void {
$this->fillTestFolders();
$this->assertEquals(
@@ -61,7 +61,7 @@ class ObjectStoreScannerTest extends TestCase {
);
}
- public function testBackgroundScan() {
+ public function testBackgroundScan(): void {
$this->fillTestFolders();
$this->storage->mkdir('folder2');
$this->storage->file_put_contents('folder2/bar.txt', 'foobar');
diff --git a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php
index 8ffd27f0069..09402d5706a 100644
--- a/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php
+++ b/tests/lib/Files/ObjectStore/ObjectStoreStorageTest.php
@@ -43,7 +43,7 @@ class ObjectStoreStorageTest extends Storage {
parent::tearDown();
}
- public function testStat() {
+ public function testStat(): void {
$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
$ctimeStart = time();
$this->instance->file_put_contents('/lorem.txt', file_get_contents($textFile));
@@ -67,14 +67,14 @@ class ObjectStoreStorageTest extends Storage {
}
}
- public function testCheckUpdate() {
+ public function testCheckUpdate(): void {
$this->markTestSkipped('Detecting external changes is not supported on object storages');
}
/**
* @dataProvider copyAndMoveProvider
*/
- public function testMove($source, $target) {
+ public function testMove($source, $target): void {
$this->initSourceAndTarget($source);
$sourceId = $this->instance->getCache()->getId(ltrim('/', $source));
$this->assertNotEquals(-1, $sourceId);
@@ -89,7 +89,7 @@ class ObjectStoreStorageTest extends Storage {
$this->assertSame($sourceId, $targetId, 'fileid must be stable on move or shares will break');
}
- public function testRenameDirectory() {
+ public function testRenameDirectory(): void {
$this->instance->mkdir('source');
$this->instance->file_put_contents('source/test1.txt', 'foo');
$this->instance->file_put_contents('source/test2.txt', 'qwerty');
@@ -118,7 +118,7 @@ class ObjectStoreStorageTest extends Storage {
$this->assertSame($sourceId, $targetId, 'fileid must be stable on move or shares will break');
}
- public function testRenameOverWriteDirectory() {
+ public function testRenameOverWriteDirectory(): void {
$this->instance->mkdir('source');
$this->instance->file_put_contents('source/test1.txt', 'foo');
$sourceId = $this->instance->getCache()->getId('source');
@@ -138,7 +138,7 @@ class ObjectStoreStorageTest extends Storage {
$this->assertSame($sourceId, $targetId, 'fileid must be stable on move or shares will break');
}
- public function testRenameOverWriteDirectoryOverFile() {
+ public function testRenameOverWriteDirectoryOverFile(): void {
$this->instance->mkdir('source');
$this->instance->file_put_contents('source/test1.txt', 'foo');
$sourceId = $this->instance->getCache()->getId('source');
@@ -155,7 +155,7 @@ class ObjectStoreStorageTest extends Storage {
$this->assertSame($sourceId, $targetId, 'fileid must be stable on move or shares will break');
}
- public function testWriteObjectSilentFailure() {
+ public function testWriteObjectSilentFailure(): void {
$objectStore = $this->instance->getObjectStore();
$this->instance->setObjectStore(new FailWriteObjectStore($objectStore));
@@ -168,7 +168,7 @@ class ObjectStoreStorageTest extends Storage {
$this->assertFalse($this->instance->file_exists('test.txt'));
}
- public function testWriteObjectSilentFailureNoCheck() {
+ public function testWriteObjectSilentFailureNoCheck(): void {
$objectStore = $this->instance->getObjectStore();
$this->instance->setObjectStore(new FailWriteObjectStore($objectStore));
$this->instance->setValidateWrites(false);
@@ -177,7 +177,7 @@ class ObjectStoreStorageTest extends Storage {
$this->assertTrue($this->instance->file_exists('test.txt'));
}
- public function testDeleteObjectFailureKeepCache() {
+ public function testDeleteObjectFailureKeepCache(): void {
$objectStore = $this->instance->getObjectStore();
$this->instance->setObjectStore(new FailDeleteObjectStore($objectStore));
$cache = $this->instance->getCache();
@@ -202,7 +202,7 @@ class ObjectStoreStorageTest extends Storage {
$this->assertTrue($cache->inCache('foo/test.txt'));
}
- public function testCopyBetweenJails() {
+ public function testCopyBetweenJails(): void {
$this->instance->mkdir('a');
$this->instance->mkdir('b');
$jailA = new Jail([
@@ -225,7 +225,7 @@ class ObjectStoreStorageTest extends Storage {
$this->assertEquals('3', $this->instance->file_get_contents('b/target/sub/3.txt'));
}
- public function testCopyPreservesPermissions() {
+ public function testCopyPreservesPermissions(): void {
$cache = $this->instance->getCache();
$this->instance->file_put_contents('test.txt', 'foo');
@@ -244,7 +244,7 @@ class ObjectStoreStorageTest extends Storage {
* Test that copying files will drop permissions like local storage does
* TODO: Drop this and fix local storage
*/
- public function testCopyGrantsPermissions() {
+ public function testCopyGrantsPermissions(): void {
$config['objectstore'] = $this->objectStorage;
$config['handleCopiesAsOwned'] = true;
$instance = new ObjectStoreStorageOverwrite($config);
diff --git a/tests/lib/Files/ObjectStore/ObjectStoreTest.php b/tests/lib/Files/ObjectStore/ObjectStoreTest.php
index 74f047a8663..4a4f85dfb91 100644
--- a/tests/lib/Files/ObjectStore/ObjectStoreTest.php
+++ b/tests/lib/Files/ObjectStore/ObjectStoreTest.php
@@ -38,7 +38,7 @@ abstract class ObjectStoreTest extends TestCase {
return $stream;
}
- public function testWriteRead() {
+ public function testWriteRead(): void {
$stream = $this->stringToStream('foobar');
$instance = $this->getInstance();
@@ -51,7 +51,7 @@ abstract class ObjectStoreTest extends TestCase {
$this->assertEquals('foobar', stream_get_contents($result));
}
- public function testDelete() {
+ public function testDelete(): void {
$stream = $this->stringToStream('foobar');
$instance = $this->getInstance();
@@ -70,7 +70,7 @@ abstract class ObjectStoreTest extends TestCase {
}
}
- public function testReadNonExisting() {
+ public function testReadNonExisting(): void {
$instance = $this->getInstance();
try {
@@ -82,7 +82,7 @@ abstract class ObjectStoreTest extends TestCase {
}
}
- public function testDeleteNonExisting() {
+ public function testDeleteNonExisting(): void {
$instance = $this->getInstance();
try {
@@ -94,7 +94,7 @@ abstract class ObjectStoreTest extends TestCase {
}
}
- public function testExists() {
+ public function testExists(): void {
$stream = $this->stringToStream('foobar');
$instance = $this->getInstance();
@@ -109,7 +109,7 @@ abstract class ObjectStoreTest extends TestCase {
$this->assertFalse($instance->objectExists('2'));
}
- public function testCopy() {
+ public function testCopy(): void {
$this->cleanupAfter('source');
$this->cleanupAfter('target');
@@ -128,7 +128,7 @@ abstract class ObjectStoreTest extends TestCase {
$this->assertEquals('foobar', stream_get_contents($instance->readObject('target')));
}
- public function testFseekSize() {
+ public function testFseekSize(): void {
$instance = $this->getInstance();
$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
diff --git a/tests/lib/Files/ObjectStore/S3Test.php b/tests/lib/Files/ObjectStore/S3Test.php
index 6a8fad52476..1501f575f9a 100644
--- a/tests/lib/Files/ObjectStore/S3Test.php
+++ b/tests/lib/Files/ObjectStore/S3Test.php
@@ -60,7 +60,7 @@ class S3Test extends ObjectStoreTest {
return new S3($config['arguments']);
}
- public function testUploadNonSeekable() {
+ public function testUploadNonSeekable(): void {
$this->cleanupAfter('multiparttest');
$s3 = $this->getInstance();
@@ -72,7 +72,7 @@ class S3Test extends ObjectStoreTest {
$this->assertEquals(file_get_contents(__FILE__), stream_get_contents($result));
}
- public function testSeek() {
+ public function testSeek(): void {
$this->cleanupAfter('seek');
$data = file_get_contents(__FILE__);
@@ -101,7 +101,7 @@ class S3Test extends ObjectStoreTest {
$this->assertArrayNotHasKey('Uploads', $uploads, 'Assert is not uploaded');
}
- public function testEmptyUpload() {
+ public function testEmptyUpload(): void {
$s3 = $this->getInstance();
$emptyStream = fopen('php://memory', 'r');
@@ -133,7 +133,7 @@ class S3Test extends ObjectStoreTest {
}
/** @dataProvider dataFileSizes */
- public function testFileSizes($size) {
+ public function testFileSizes($size): void {
if (str_starts_with(PHP_VERSION, '8.3') && getenv('CI')) {
$this->markTestSkipped('Test is unreliable and skipped on 8.3');
}
diff --git a/tests/lib/Files/ObjectStore/SwiftTest.php b/tests/lib/Files/ObjectStore/SwiftTest.php
index 8c9a0d524ed..8a34d25e57b 100644
--- a/tests/lib/Files/ObjectStore/SwiftTest.php
+++ b/tests/lib/Files/ObjectStore/SwiftTest.php
@@ -25,7 +25,7 @@ class SwiftTest extends ObjectStoreTest {
return new Swift($config['arguments']);
}
- public function testFseekSize() {
+ public function testFseekSize(): void {
$this->markTestSkipped('Swift does not support seeking at the moment');
}
}
diff --git a/tests/lib/Files/PathVerificationTest.php b/tests/lib/Files/PathVerificationTest.php
index f256a954f9f..fcbe0a6957f 100644
--- a/tests/lib/Files/PathVerificationTest.php
+++ b/tests/lib/Files/PathVerificationTest.php
@@ -30,7 +30,7 @@ class PathVerificationTest extends \Test\TestCase {
}
- public function testPathVerificationFileNameTooLong() {
+ public function testPathVerificationFileNameTooLong(): void {
$this->expectException(\OCP\Files\InvalidPathException::class);
$this->expectExceptionMessage('Filename is too long');
@@ -42,7 +42,7 @@ class PathVerificationTest extends \Test\TestCase {
/**
* @dataProvider providesEmptyFiles
*/
- public function testPathVerificationEmptyFileName($fileName) {
+ public function testPathVerificationEmptyFileName($fileName): void {
$this->expectException(\OCP\Files\InvalidPathException::class);
$this->expectExceptionMessage('Empty filename is not allowed');
@@ -59,7 +59,7 @@ class PathVerificationTest extends \Test\TestCase {
/**
* @dataProvider providesDotFiles
*/
- public function testPathVerificationDotFiles($fileName) {
+ public function testPathVerificationDotFiles($fileName): void {
$this->expectException(\OCP\Files\InvalidPathException::class);
$this->expectExceptionMessage('Dot files are not allowed');
@@ -82,7 +82,7 @@ class PathVerificationTest extends \Test\TestCase {
/**
* @dataProvider providesAstralPlane
*/
- public function testPathVerificationAstralPlane($fileName) {
+ public function testPathVerificationAstralPlane($fileName): void {
$connection = \OC::$server->getDatabaseConnection();
if (!$connection->supports4ByteText()) {
@@ -109,7 +109,7 @@ class PathVerificationTest extends \Test\TestCase {
/**
* @dataProvider providesValidPosixPaths
*/
- public function testPathVerificationValidPaths($fileName) {
+ public function testPathVerificationValidPaths($fileName): void {
$storage = new Local(['datadir' => '']);
self::invokePrivate($storage, 'verifyPosixPath', [$fileName]);
diff --git a/tests/lib/Files/Search/QueryOptimizer/CombinedTests.php b/tests/lib/Files/Search/QueryOptimizer/CombinedTests.php
index 4e7f13cd33e..e6cb11a7eba 100644
--- a/tests/lib/Files/Search/QueryOptimizer/CombinedTests.php
+++ b/tests/lib/Files/Search/QueryOptimizer/CombinedTests.php
@@ -21,7 +21,7 @@ class CombinedTests extends TestCase {
$this->optimizer = new QueryOptimizer();
}
- public function testBasicOrOfAnds() {
+ public function testBasicOrOfAnds(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
@@ -46,7 +46,7 @@ class CombinedTests extends TestCase {
$this->assertEquals('(storage eq 1 and path in ["foo","bar","asd"])', $operator->__toString());
}
- public function testComplexSearchPattern1() {
+ public function testComplexSearchPattern1(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
@@ -85,7 +85,7 @@ class CombinedTests extends TestCase {
$this->assertEquals('(storage eq 1 or (storage eq 2 and (path eq "201" or path like "201\/%")) or (storage eq 3 and path in ["301","302"]) or (storage eq 4 and path in ["401","402"]))', $operator->__toString());
}
- public function testComplexSearchPattern2() {
+ public function testComplexSearchPattern2(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
@@ -122,7 +122,7 @@ class CombinedTests extends TestCase {
$this->assertEquals('(storage eq 1 or (storage eq 2 and (path eq "201" or path like "201\/%")) or (storage eq 3 and path in ["301","302"]) or (storage eq 4 and path in ["401","402"]))', $operator->__toString());
}
- public function testApplySearchConstraints1() {
+ public function testApplySearchConstraints1(): void {
$operator = new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_AND, [
new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_AND, [
new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_OR, [
@@ -156,7 +156,7 @@ class CombinedTests extends TestCase {
$this->assertEquals('(mimetype in ["image\/png","image\/jpeg"] and ((storage eq 1 and (path eq "files" or path like "files\/%")) or storage eq 2 or (storage eq 3 and path in ["files\/301","files\/302"])))', $operator->__toString());
}
- public function testApplySearchConstraints2() {
+ public function testApplySearchConstraints2(): void {
$operator = new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_AND, [
new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_AND, [
new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_OR, [
diff --git a/tests/lib/Files/Search/QueryOptimizer/FlattenNestedBoolTest.php b/tests/lib/Files/Search/QueryOptimizer/FlattenNestedBoolTest.php
index 778b20541a5..6777047d68b 100644
--- a/tests/lib/Files/Search/QueryOptimizer/FlattenNestedBoolTest.php
+++ b/tests/lib/Files/Search/QueryOptimizer/FlattenNestedBoolTest.php
@@ -24,7 +24,7 @@ class FlattenNestedBoolTest extends TestCase {
$this->simplifier = new FlattenSingleArgumentBinaryOperation();
}
- public function testOrs() {
+ public function testOrs(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
diff --git a/tests/lib/Files/Search/QueryOptimizer/MergeDistributiveOperationsTest.php b/tests/lib/Files/Search/QueryOptimizer/MergeDistributiveOperationsTest.php
index a7e6dc63b15..4f933d0c371 100644
--- a/tests/lib/Files/Search/QueryOptimizer/MergeDistributiveOperationsTest.php
+++ b/tests/lib/Files/Search/QueryOptimizer/MergeDistributiveOperationsTest.php
@@ -24,7 +24,7 @@ class MergeDistributiveOperationsTest extends TestCase {
$this->simplifier = new FlattenSingleArgumentBinaryOperation();
}
- public function testBasicOrOfAnds() {
+ public function testBasicOrOfAnds(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
@@ -50,7 +50,7 @@ class MergeDistributiveOperationsTest extends TestCase {
$this->assertEquals('(storage eq 1 and (path eq "foo" or path eq "bar" or path eq "asd"))', $operator->__toString());
}
- public function testDontTouchIfNotSame() {
+ public function testDontTouchIfNotSame(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
@@ -76,7 +76,7 @@ class MergeDistributiveOperationsTest extends TestCase {
$this->assertEquals('((storage eq 1 and path eq "foo") or (storage eq 2 and path eq "bar") or (storage eq 3 and path eq "asd"))', $operator->__toString());
}
- public function testMergePartial() {
+ public function testMergePartial(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
@@ -102,7 +102,7 @@ class MergeDistributiveOperationsTest extends TestCase {
$this->assertEquals('((storage eq 1 and (path eq "foo" or path eq "bar")) or (storage eq 2 and path eq "asd"))', $operator->__toString());
}
- public function testOptimizeInside() {
+ public function testOptimizeInside(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_AND,
[
@@ -134,7 +134,7 @@ class MergeDistributiveOperationsTest extends TestCase {
$this->assertEquals('((storage eq 1 and (path eq "foo" or path eq "bar" or path eq "asd")) and mimetype eq "text")', $operator->__toString());
}
- public function testMoveInnerOperations() {
+ public function testMoveInnerOperations(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
diff --git a/tests/lib/Files/Search/QueryOptimizer/OrEqualsToInTest.php b/tests/lib/Files/Search/QueryOptimizer/OrEqualsToInTest.php
index d0ab70323ba..8b1c3b992b2 100644
--- a/tests/lib/Files/Search/QueryOptimizer/OrEqualsToInTest.php
+++ b/tests/lib/Files/Search/QueryOptimizer/OrEqualsToInTest.php
@@ -24,7 +24,7 @@ class OrEqualsToInTest extends TestCase {
$this->simplifier = new FlattenSingleArgumentBinaryOperation();
}
- public function testOrs() {
+ public function testOrs(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
@@ -41,7 +41,7 @@ class OrEqualsToInTest extends TestCase {
$this->assertEquals('path in ["foo","bar","asd"]', $operator->__toString());
}
- public function testOrsMultipleFields() {
+ public function testOrsMultipleFields(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
@@ -60,7 +60,7 @@ class OrEqualsToInTest extends TestCase {
$this->assertEquals('(path in ["foo","bar"] or fileid in [1,2] or mimetype eq "asd")', $operator->__toString());
}
- public function testPreserveHints() {
+ public function testPreserveHints(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
@@ -81,7 +81,7 @@ class OrEqualsToInTest extends TestCase {
$this->assertEquals(false, $operator->getQueryHint(ISearchComparison::HINT_PATH_EQ_HASH, true));
}
- public function testOrSomeEq() {
+ public function testOrSomeEq(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_OR,
[
@@ -98,7 +98,7 @@ class OrEqualsToInTest extends TestCase {
$this->assertEquals('(path in ["foo","bar"] or path like "foo%")', $operator->__toString());
}
- public function testOrsInside() {
+ public function testOrsInside(): void {
$operator = new SearchBinaryOperator(
ISearchBinaryOperator::OPERATOR_AND,
[
diff --git a/tests/lib/Files/Search/SearchIntegrationTest.php b/tests/lib/Files/Search/SearchIntegrationTest.php
index c1017537a0c..0ca67285fd5 100644
--- a/tests/lib/Files/Search/SearchIntegrationTest.php
+++ b/tests/lib/Files/Search/SearchIntegrationTest.php
@@ -29,7 +29,7 @@ class SearchIntegrationTest extends TestCase {
}
- public function testThousandAndOneFilters() {
+ public function testThousandAndOneFilters(): void {
$id = $this->cache->put('file10', ['size' => 1, 'mtime' => 50, 'mimetype' => 'foo/folder']);
$comparisons = [];
diff --git a/tests/lib/Files/SimpleFS/InMemoryFileTest.php b/tests/lib/Files/SimpleFS/InMemoryFileTest.php
index dfd6c44ac7e..43587acdce9 100644
--- a/tests/lib/Files/SimpleFS/InMemoryFileTest.php
+++ b/tests/lib/Files/SimpleFS/InMemoryFileTest.php
@@ -44,7 +44,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testPutContent() {
+ public function testPutContent(): void {
$this->testPdf->putContent('test');
self::assertEquals('test', $this->testPdf->getContent());
}
@@ -54,7 +54,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testDelete() {
+ public function testDelete(): void {
$this->testPdf->delete();
// assert true, otherwise phpunit complains about not doing any assert
self::assertTrue(true);
@@ -65,7 +65,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testGetName() {
+ public function testGetName(): void {
self::assertEquals('test.pdf', $this->testPdf->getName());
}
@@ -74,7 +74,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testGetSize() {
+ public function testGetSize(): void {
self::assertEquals(7083, $this->testPdf->getSize());
}
@@ -83,7 +83,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testGetContent() {
+ public function testGetContent(): void {
self::assertEquals(
file_get_contents(__DIR__ . '/../../../data/test.pdf'),
$this->testPdf->getContent()
@@ -95,7 +95,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testGetMTime() {
+ public function testGetMTime(): void {
self::assertTrue(is_int($this->testPdf->getMTime()));
}
@@ -104,7 +104,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testGetMimeType() {
+ public function testGetMimeType(): void {
self::assertEquals('application/pdf', $this->testPdf->getMimeType());
}
@@ -114,7 +114,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testRead() {
+ public function testRead(): void {
self::expectException(NotPermittedException::class);
$this->testPdf->read();
}
@@ -124,7 +124,7 @@ class InMemoryFileTest extends TestCase {
*
* @return void
*/
- public function testWrite() {
+ public function testWrite(): void {
self::expectException(NotPermittedException::class);
$this->testPdf->write();
}
diff --git a/tests/lib/Files/SimpleFS/SimpleFileTest.php b/tests/lib/Files/SimpleFS/SimpleFileTest.php
index 6dbd663068e..d0676eae70f 100644
--- a/tests/lib/Files/SimpleFS/SimpleFileTest.php
+++ b/tests/lib/Files/SimpleFS/SimpleFileTest.php
@@ -25,7 +25,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->simpleFile = new SimpleFile($this->file);
}
- public function testGetName() {
+ public function testGetName(): void {
$this->file->expects($this->once())
->method('getName')
->willReturn('myname');
@@ -33,7 +33,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals('myname', $this->simpleFile->getName());
}
- public function testGetSize() {
+ public function testGetSize(): void {
$this->file->expects($this->once())
->method('getSize')
->willReturn(42);
@@ -41,7 +41,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals(42, $this->simpleFile->getSize());
}
- public function testGetETag() {
+ public function testGetETag(): void {
$this->file->expects($this->once())
->method('getETag')
->willReturn('etag');
@@ -49,7 +49,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals('etag', $this->simpleFile->getETag());
}
- public function testGetMTime() {
+ public function testGetMTime(): void {
$this->file->expects($this->once())
->method('getMTime')
->willReturn(101);
@@ -57,7 +57,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals(101, $this->simpleFile->getMTime());
}
- public function testGetContent() {
+ public function testGetContent(): void {
$this->file->expects($this->once())
->method('getContent')
->willReturn('foo');
@@ -65,7 +65,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals('foo', $this->simpleFile->getContent());
}
- public function testPutContent() {
+ public function testPutContent(): void {
$this->file->expects($this->once())
->method('putContent')
->with($this->equalTo('bar'));
@@ -73,14 +73,14 @@ class SimpleFileTest extends \Test\TestCase {
$this->simpleFile->putContent('bar');
}
- public function testDelete() {
+ public function testDelete(): void {
$this->file->expects($this->once())
->method('delete');
$this->simpleFile->delete();
}
- public function testGetMimeType() {
+ public function testGetMimeType(): void {
$this->file->expects($this->once())
->method('getMimeType')
->willReturn('app/awesome');
@@ -88,7 +88,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->assertEquals('app/awesome', $this->simpleFile->getMimeType());
}
- public function testGetContentInvalidAppData() {
+ public function testGetContentInvalidAppData(): void {
$this->file->method('getContent')
->willReturn(false);
$this->file->method('stat')->willReturn(false);
@@ -107,7 +107,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->simpleFile->getContent();
}
- public function testRead() {
+ public function testRead(): void {
$this->file->expects($this->once())
->method('fopen')
->with('r');
@@ -115,7 +115,7 @@ class SimpleFileTest extends \Test\TestCase {
$this->simpleFile->read();
}
- public function testWrite() {
+ public function testWrite(): void {
$this->file->expects($this->once())
->method('fopen')
->with('w');
diff --git a/tests/lib/Files/SimpleFS/SimpleFolderTest.php b/tests/lib/Files/SimpleFS/SimpleFolderTest.php
index 139a6cb703c..6897aab1f02 100644
--- a/tests/lib/Files/SimpleFS/SimpleFolderTest.php
+++ b/tests/lib/Files/SimpleFS/SimpleFolderTest.php
@@ -47,24 +47,24 @@ class SimpleFolderTest extends \Test\TestCase {
$this->simpleFolder = new SimpleFolder($this->folder);
}
- public function testGetName() {
+ public function testGetName(): void {
$this->assertEquals('test', $this->simpleFolder->getName());
}
- public function testDelete() {
+ public function testDelete(): void {
$this->assertTrue($this->parentFolder->nodeExists('test'));
$this->simpleFolder->delete();
$this->assertFalse($this->parentFolder->nodeExists('test'));
}
- public function testFileExists() {
+ public function testFileExists(): void {
$this->folder->newFile('exists');
$this->assertFalse($this->simpleFolder->fileExists('not-exists'));
$this->assertTrue($this->simpleFolder->fileExists('exists'));
}
- public function testGetFile() {
+ public function testGetFile(): void {
$this->folder->newFile('exists');
$result = $this->simpleFolder->getFile('exists');
@@ -74,7 +74,7 @@ class SimpleFolderTest extends \Test\TestCase {
$this->simpleFolder->getFile('not-exists');
}
- public function testNewFile() {
+ public function testNewFile(): void {
$result = $this->simpleFolder->newFile('file');
$this->assertInstanceOf(ISimpleFile::class, $result);
$this->assertFalse($this->folder->nodeExists('file'));
@@ -84,7 +84,7 @@ class SimpleFolderTest extends \Test\TestCase {
$this->assertEquals('bar', $result->getContent());
}
- public function testGetDirectoryListing() {
+ public function testGetDirectoryListing(): void {
$this->folder->newFile('file1');
$this->folder->newFile('file2');
@@ -94,7 +94,7 @@ class SimpleFolderTest extends \Test\TestCase {
$this->assertInstanceOf(ISimpleFile::class, $result[1]);
}
- public function testGetFolder() {
+ public function testGetFolder(): void {
$this->folder->newFolder('exists');
$result = $this->simpleFolder->getFolder('exists');
@@ -104,7 +104,7 @@ class SimpleFolderTest extends \Test\TestCase {
$this->simpleFolder->getFolder('not-exists');
}
- public function testNewFolder() {
+ public function testNewFolder(): void {
$result = $this->simpleFolder->newFolder('folder');
$this->assertInstanceOf(ISimpleFolder::class, $result);
$result->newFile('file');
diff --git a/tests/lib/Files/Storage/CommonTest.php b/tests/lib/Files/Storage/CommonTest.php
index 321894cc23b..b51b35be8f9 100644
--- a/tests/lib/Files/Storage/CommonTest.php
+++ b/tests/lib/Files/Storage/CommonTest.php
@@ -42,7 +42,7 @@ class CommonTest extends Storage {
parent::tearDown();
}
- public function testVerifyPath() {
+ public function testVerifyPath(): void {
$this->filenameValidator
->expects($this->once())
->method('validateFilename')
@@ -53,7 +53,7 @@ class CommonTest extends Storage {
$this->instance->verifyPath('/', 'invalid:char.txt');
}
- public function testVerifyPathSucceed() {
+ public function testVerifyPathSucceed(): void {
$this->filenameValidator
->expects($this->once())
->method('validateFilename')
@@ -62,7 +62,7 @@ class CommonTest extends Storage {
$this->instance->verifyPath('/', 'valid-char.txt');
}
- public function testMoveFromStorageWrapped() {
+ public function testMoveFromStorageWrapped(): void {
/** @var \OC\Files\Storage\CommonTest|MockObject $instance */
$instance = $this->getMockBuilder(\OC\Files\Storage\CommonTest::class)
->onlyMethods(['copyFromStorage', 'rmdir', 'unlink'])
@@ -80,7 +80,7 @@ class CommonTest extends Storage {
$this->assertTrue($instance->file_exists('bar.txt'));
}
- public function testMoveFromStorageJailed() {
+ public function testMoveFromStorageJailed(): void {
/** @var \OC\Files\Storage\CommonTest|MockObject $instance */
$instance = $this->getMockBuilder(\OC\Files\Storage\CommonTest::class)
->onlyMethods(['copyFromStorage', 'rmdir', 'unlink'])
@@ -103,7 +103,7 @@ class CommonTest extends Storage {
$this->assertTrue($instance->file_exists('bar.txt'));
}
- public function testMoveFromStorageNestedJail() {
+ public function testMoveFromStorageNestedJail(): void {
/** @var \OC\Files\Storage\CommonTest|MockObject $instance */
$instance = $this->getMockBuilder(\OC\Files\Storage\CommonTest::class)
->onlyMethods(['copyFromStorage', 'rmdir', 'unlink'])
diff --git a/tests/lib/Files/Storage/HomeTest.php b/tests/lib/Files/Storage/HomeTest.php
index c3111e74259..b6d0f1aa85a 100644
--- a/tests/lib/Files/Storage/HomeTest.php
+++ b/tests/lib/Files/Storage/HomeTest.php
@@ -69,18 +69,18 @@ class HomeTest extends Storage {
/**
* Tests that the home id is in the format home::user1
*/
- public function testId() {
+ public function testId(): void {
$this->assertEquals('home::' . $this->userId, $this->instance->getId());
}
/**
* Tests that getCache() returns an instance of HomeCache
*/
- public function testGetCacheReturnsHomeCache() {
+ public function testGetCacheReturnsHomeCache(): void {
$this->assertInstanceOf('\OC\Files\Cache\HomeCache', $this->instance->getCache());
}
- public function testGetOwner() {
+ public function testGetOwner(): void {
$this->assertEquals($this->userId, $this->instance->getOwner(''));
}
}
diff --git a/tests/lib/Files/Storage/LocalTest.php b/tests/lib/Files/Storage/LocalTest.php
index efe5dd04e47..4a98970f233 100644
--- a/tests/lib/Files/Storage/LocalTest.php
+++ b/tests/lib/Files/Storage/LocalTest.php
@@ -32,14 +32,14 @@ class LocalTest extends Storage {
parent::tearDown();
}
- public function testStableEtag() {
+ public function testStableEtag(): void {
$this->instance->file_put_contents('test.txt', 'foobar');
$etag1 = $this->instance->getETag('test.txt');
$etag2 = $this->instance->getETag('test.txt');
$this->assertEquals($etag1, $etag2);
}
- public function testEtagChange() {
+ public function testEtagChange(): void {
$this->instance->file_put_contents('test.txt', 'foo');
$this->instance->touch('test.txt', time() - 2);
$etag1 = $this->instance->getETag('test.txt');
@@ -49,21 +49,21 @@ class LocalTest extends Storage {
}
- public function testInvalidArgumentsEmptyArray() {
+ public function testInvalidArgumentsEmptyArray(): void {
$this->expectException(\InvalidArgumentException::class);
new \OC\Files\Storage\Local([]);
}
- public function testInvalidArgumentsNoArray() {
+ public function testInvalidArgumentsNoArray(): void {
$this->expectException(\InvalidArgumentException::class);
new \OC\Files\Storage\Local(null);
}
- public function testDisallowSymlinksOutsideDatadir() {
+ public function testDisallowSymlinksOutsideDatadir(): void {
$this->expectException(\OCP\Files\ForbiddenException::class);
$subDir1 = $this->tmpDir . 'sub1';
@@ -79,7 +79,7 @@ class LocalTest extends Storage {
$storage->file_put_contents('sym/foo', 'bar');
}
- public function testDisallowSymlinksInsideDatadir() {
+ public function testDisallowSymlinksInsideDatadir(): void {
$subDir1 = $this->tmpDir . 'sub1';
$subDir2 = $this->tmpDir . 'sub1/sub2';
$sym = $this->tmpDir . 'sub1/sym';
@@ -94,21 +94,21 @@ class LocalTest extends Storage {
$this->addToAssertionCount(1);
}
- public function testWriteUmaskFilePutContents() {
+ public function testWriteUmaskFilePutContents(): void {
$oldMask = umask(0333);
$this->instance->file_put_contents('test.txt', 'sad');
umask($oldMask);
$this->assertTrue($this->instance->isUpdatable('test.txt'));
}
- public function testWriteUmaskMkdir() {
+ public function testWriteUmaskMkdir(): void {
$oldMask = umask(0333);
$this->instance->mkdir('test.txt');
umask($oldMask);
$this->assertTrue($this->instance->isUpdatable('test.txt'));
}
- public function testWriteUmaskFopen() {
+ public function testWriteUmaskFopen(): void {
$oldMask = umask(0333);
$handle = $this->instance->fopen('test.txt', 'w');
fwrite($handle, 'foo');
@@ -117,7 +117,7 @@ class LocalTest extends Storage {
$this->assertTrue($this->instance->isUpdatable('test.txt'));
}
- public function testWriteUmaskCopy() {
+ public function testWriteUmaskCopy(): void {
$this->instance->file_put_contents('source.txt', 'sad');
$oldMask = umask(0333);
$this->instance->copy('source.txt', 'test.txt');
@@ -125,12 +125,12 @@ class LocalTest extends Storage {
$this->assertTrue($this->instance->isUpdatable('test.txt'));
}
- public function testUnavailableExternal() {
+ public function testUnavailableExternal(): void {
$this->expectException(\OCP\Files\StorageNotAvailableException::class);
$this->instance = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir . '/unexist', 'isExternal' => true]);
}
- public function testUnavailableNonExternal() {
+ public function testUnavailableNonExternal(): void {
$this->instance = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir . '/unexist']);
// no exception thrown
$this->assertNotNull($this->instance);
diff --git a/tests/lib/Files/Storage/Storage.php b/tests/lib/Files/Storage/Storage.php
index 747cb4b6f43..5b0bbf2f95b 100644
--- a/tests/lib/Files/Storage/Storage.php
+++ b/tests/lib/Files/Storage/Storage.php
@@ -30,7 +30,7 @@ abstract class Storage extends \Test\TestCase {
/**
* the root folder of the storage should always exist, be readable and be recognized as a directory
*/
- public function testRoot() {
+ public function testRoot(): void {
$this->assertTrue($this->instance->file_exists('/'), 'Root folder does not exist');
$this->assertTrue($this->instance->isReadable('/'), 'Root folder is not readable');
$this->assertTrue($this->instance->is_dir('/'), 'Root folder is not a directory');
@@ -44,14 +44,14 @@ abstract class Storage extends \Test\TestCase {
/**
* Check that the test() function works
*/
- public function testTestFunction() {
+ public function testTestFunction(): void {
$this->assertTrue($this->instance->test());
}
/**
* @dataProvider directoryProvider
*/
- public function testDirectories($directory) {
+ public function testDirectories($directory): void {
$this->assertFalse($this->instance->file_exists('/' . $directory));
$this->assertTrue($this->instance->mkdir('/' . $directory));
@@ -144,7 +144,7 @@ abstract class Storage extends \Test\TestCase {
*
* @dataProvider loremFileProvider
*/
- public function testGetPutContents($sourceFile) {
+ public function testGetPutContents($sourceFile): void {
$sourceText = file_get_contents($sourceFile);
//fill a file with string data
@@ -160,7 +160,7 @@ abstract class Storage extends \Test\TestCase {
/**
* test various known mimetypes
*/
- public function testMimeType() {
+ public function testMimeType(): void {
$this->assertEquals('httpd/unix-directory', $this->instance->getMimeType('/'));
$this->assertEquals(false, $this->instance->getMimeType('/non/existing/file'));
@@ -212,7 +212,7 @@ abstract class Storage extends \Test\TestCase {
/**
* @dataProvider copyAndMoveProvider
*/
- public function testCopy($source, $target) {
+ public function testCopy($source, $target): void {
$this->initSourceAndTarget($source);
$this->instance->copy($source, $target);
@@ -225,7 +225,7 @@ abstract class Storage extends \Test\TestCase {
/**
* @dataProvider copyAndMoveProvider
*/
- public function testMove($source, $target) {
+ public function testMove($source, $target): void {
$this->initSourceAndTarget($source);
$this->instance->rename($source, $target);
@@ -239,7 +239,7 @@ abstract class Storage extends \Test\TestCase {
/**
* @dataProvider copyAndMoveProvider
*/
- public function testCopyOverwrite($source, $target) {
+ public function testCopyOverwrite($source, $target): void {
$this->initSourceAndTarget($source, $target);
$this->instance->copy($source, $target);
@@ -253,7 +253,7 @@ abstract class Storage extends \Test\TestCase {
/**
* @dataProvider copyAndMoveProvider
*/
- public function testMoveOverwrite($source, $target) {
+ public function testMoveOverwrite($source, $target): void {
$this->initSourceAndTarget($source, $target);
$this->instance->rename($source, $target);
@@ -263,7 +263,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertSameAsLorem($target);
}
- public function testLocal() {
+ public function testLocal(): void {
$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
$this->instance->file_put_contents('/lorem.txt', file_get_contents($textFile));
$localFile = $this->instance->getLocalFile('/lorem.txt');
@@ -290,7 +290,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals(file_get_contents($localFile), 'foo');
}
- public function testStat() {
+ public function testStat(): void {
$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
$ctimeStart = time();
$this->instance->file_put_contents('/lorem.txt', file_get_contents($textFile));
@@ -325,7 +325,7 @@ abstract class Storage extends \Test\TestCase {
* Test whether checkUpdate properly returns false when there was
* no change.
*/
- public function testCheckUpdate() {
+ public function testCheckUpdate(): void {
if ($this->instance instanceof \OC\Files\Storage\Wrapper\Wrapper) {
$this->markTestSkipped('Cannot test update check on wrappers');
}
@@ -337,7 +337,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertFalse($watcher->checkUpdate('/lorem.txt'), 'No update');
}
- public function testUnlink() {
+ public function testUnlink(): void {
$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
$this->instance->file_put_contents('/lorem.txt', file_get_contents($textFile));
@@ -352,7 +352,7 @@ abstract class Storage extends \Test\TestCase {
/**
* @dataProvider fileNameProvider
*/
- public function testFOpen($fileName) {
+ public function testFOpen($fileName): void {
$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
$fh = @$this->instance->fopen($fileName, 'r');
@@ -372,14 +372,14 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals(file_get_contents($textFile), $content);
}
- public function testTouchCreateFile() {
+ public function testTouchCreateFile(): void {
$this->assertFalse($this->instance->file_exists('touch'));
// returns true on success
$this->assertTrue($this->instance->touch('touch'));
$this->assertTrue($this->instance->file_exists('touch'));
}
- public function testRecursiveRmdir() {
+ public function testRecursiveRmdir(): void {
$this->instance->mkdir('folder');
$this->instance->mkdir('folder/bar');
$this->wait();
@@ -393,14 +393,14 @@ abstract class Storage extends \Test\TestCase {
$this->assertFalse($this->instance->file_exists('folder'));
}
- public function testRmdirEmptyFolder() {
+ public function testRmdirEmptyFolder(): void {
$this->assertTrue($this->instance->mkdir('empty'));
$this->wait();
$this->assertTrue($this->instance->rmdir('empty'));
$this->assertFalse($this->instance->file_exists('empty'));
}
- public function testRecursiveUnlink() {
+ public function testRecursiveUnlink(): void {
$this->instance->mkdir('folder');
$this->instance->mkdir('folder/bar');
$this->instance->file_put_contents('folder/asd.txt', 'foobar');
@@ -424,13 +424,13 @@ abstract class Storage extends \Test\TestCase {
/**
* @dataProvider hashProvider
*/
- public function testHash($data, $type) {
+ public function testHash($data, $type): void {
$this->instance->file_put_contents('hash.txt', $data);
$this->assertEquals(hash($type, $data), $this->instance->hash($type, 'hash.txt'));
$this->assertEquals(hash($type, $data, true), $this->instance->hash($type, 'hash.txt', true));
}
- public function testHashInFileName() {
+ public function testHashInFileName(): void {
$this->instance->file_put_contents('#test.txt', 'data');
$this->assertEquals('data', $this->instance->file_get_contents('#test.txt'));
@@ -449,14 +449,14 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals(['test.txt'], $content);
}
- public function testCopyOverWriteFile() {
+ public function testCopyOverWriteFile(): void {
$this->instance->file_put_contents('target.txt', 'foo');
$this->instance->file_put_contents('source.txt', 'bar');
$this->instance->copy('source.txt', 'target.txt');
$this->assertEquals('bar', $this->instance->file_get_contents('target.txt'));
}
- public function testRenameOverWriteFile() {
+ public function testRenameOverWriteFile(): void {
$this->instance->file_put_contents('target.txt', 'foo');
$this->instance->file_put_contents('source.txt', 'bar');
$this->instance->rename('source.txt', 'target.txt');
@@ -464,7 +464,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertFalse($this->instance->file_exists('source.txt'));
}
- public function testRenameDirectory() {
+ public function testRenameDirectory(): void {
$this->instance->mkdir('source');
$this->instance->file_put_contents('source/test1.txt', 'foo');
$this->instance->file_put_contents('source/test2.txt', 'qwerty');
@@ -492,7 +492,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals('bar', $this->instance->file_get_contents('target/subfolder/test.txt'));
}
- public function testRenameOverWriteDirectory() {
+ public function testRenameOverWriteDirectory(): void {
$this->instance->mkdir('source');
$this->instance->file_put_contents('source/test1.txt', 'foo');
@@ -508,7 +508,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals('foo', $this->instance->file_get_contents('target/test1.txt'), 'target/test1.txt has not been overwritten');
}
- public function testRenameOverWriteDirectoryOverFile() {
+ public function testRenameOverWriteDirectoryOverFile(): void {
$this->instance->mkdir('source');
$this->instance->file_put_contents('source/test1.txt', 'foo');
@@ -521,7 +521,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals('foo', $this->instance->file_get_contents('target/test1.txt'));
}
- public function testCopyDirectory() {
+ public function testCopyDirectory(): void {
$this->instance->mkdir('source');
$this->instance->file_put_contents('source/test1.txt', 'foo');
$this->instance->file_put_contents('source/test2.txt', 'qwerty');
@@ -546,7 +546,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals('bar', $this->instance->file_get_contents('target/subfolder/test.txt'));
}
- public function testCopyOverWriteDirectory() {
+ public function testCopyOverWriteDirectory(): void {
$this->instance->mkdir('source');
$this->instance->file_put_contents('source/test1.txt', 'foo');
@@ -560,7 +560,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals('foo', $this->instance->file_get_contents('target/test1.txt'));
}
- public function testCopyOverWriteDirectoryOverFile() {
+ public function testCopyOverWriteDirectoryOverFile(): void {
$this->instance->mkdir('source');
$this->instance->file_put_contents('source/test1.txt', 'foo');
@@ -571,7 +571,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals('foo', $this->instance->file_get_contents('target/test1.txt'));
}
- public function testInstanceOfStorage() {
+ public function testInstanceOfStorage(): void {
$this->assertTrue($this->instance->instanceOfStorage('\OCP\Files\Storage'));
$this->assertTrue($this->instance->instanceOfStorage(get_class($this->instance)));
$this->assertFalse($this->instance->instanceOfStorage('\OC'));
@@ -580,7 +580,7 @@ abstract class Storage extends \Test\TestCase {
/**
* @dataProvider copyAndMoveProvider
*/
- public function testCopyFromSameStorage($source, $target) {
+ public function testCopyFromSameStorage($source, $target): void {
$this->initSourceAndTarget($source);
$this->instance->copyFromStorage($this->instance, $source, $target);
@@ -590,32 +590,32 @@ abstract class Storage extends \Test\TestCase {
$this->assertTrue($this->instance->file_exists($source), $source . ' was deleted');
}
- public function testIsCreatable() {
+ public function testIsCreatable(): void {
$this->instance->mkdir('source');
$this->assertTrue($this->instance->isCreatable('source'));
}
- public function testIsReadable() {
+ public function testIsReadable(): void {
$this->instance->mkdir('source');
$this->assertTrue($this->instance->isReadable('source'));
}
- public function testIsUpdatable() {
+ public function testIsUpdatable(): void {
$this->instance->mkdir('source');
$this->assertTrue($this->instance->isUpdatable('source'));
}
- public function testIsDeletable() {
+ public function testIsDeletable(): void {
$this->instance->mkdir('source');
$this->assertTrue($this->instance->isDeletable('source'));
}
- public function testIsShareable() {
+ public function testIsShareable(): void {
$this->instance->mkdir('source');
$this->assertTrue($this->instance->isSharable('source'));
}
- public function testStatAfterWrite() {
+ public function testStatAfterWrite(): void {
$this->instance->file_put_contents('foo.txt', 'bar');
$stat = $this->instance->stat('foo.txt');
$this->assertEquals(3, $stat['size']);
@@ -628,13 +628,13 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals(6, $stat['size']);
}
- public function testPartFile() {
+ public function testPartFile(): void {
$this->instance->file_put_contents('bar.txt.part', 'bar');
$this->instance->rename('bar.txt.part', 'bar.txt');
$this->assertEquals('bar', $this->instance->file_get_contents('bar.txt'));
}
- public function testWriteStream() {
+ public function testWriteStream(): void {
$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
if (!$this->instance->instanceOfStorage(IWriteStreamStorage::class)) {
@@ -651,7 +651,7 @@ abstract class Storage extends \Test\TestCase {
$this->assertEquals('resource (closed)', gettype($source));
}
- public function testFseekSize() {
+ public function testFseekSize(): void {
$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
$this->instance->file_put_contents('bar.txt', file_get_contents($textFile));
diff --git a/tests/lib/Files/Storage/StorageFactoryTest.php b/tests/lib/Files/Storage/StorageFactoryTest.php
index ee23f6199c9..66f2a2af9a6 100644
--- a/tests/lib/Files/Storage/StorageFactoryTest.php
+++ b/tests/lib/Files/Storage/StorageFactoryTest.php
@@ -25,7 +25,7 @@ class DummyWrapper extends Wrapper {
}
class StorageFactoryTest extends TestCase {
- public function testSimpleWrapper() {
+ public function testSimpleWrapper(): void {
$instance = new \OC\Files\Storage\StorageFactory();
$mount = new MountPoint('\OC\Files\Storage\Temporary', '/foo', [[]], $instance);
$instance->addStorageWrapper('dummy', function ($mountPoint, IStorage $storage, IMountPoint $mount) {
@@ -38,7 +38,7 @@ class StorageFactoryTest extends TestCase {
$this->assertInstanceOf('\Test\Files\Storage\DummyWrapper', $wrapped);
}
- public function testRemoveWrapper() {
+ public function testRemoveWrapper(): void {
$instance = new \OC\Files\Storage\StorageFactory();
$mount = new MountPoint('\OC\Files\Storage\Temporary', '/foo', [[]], $instance);
$instance->addStorageWrapper('dummy', function ($mountPoint, IStorage $storage) {
@@ -49,7 +49,7 @@ class StorageFactoryTest extends TestCase {
$this->assertInstanceOf('\OC\Files\Storage\Temporary', $wrapped);
}
- public function testWrapperPriority() {
+ public function testWrapperPriority(): void {
$instance = new \OC\Files\Storage\StorageFactory();
$mount = new MountPoint('\OC\Files\Storage\Temporary', '/foo', [[]], $instance);
$instance->addStorageWrapper('dummy1', function ($mountPoint, IStorage $storage) {
diff --git a/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php b/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php
index 8e64269a2f4..616fd023414 100644
--- a/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php
+++ b/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php
@@ -36,7 +36,7 @@ class AvailabilityTest extends \Test\TestCase {
/**
* Storage is available
*/
- public function testAvailable() {
+ public function testAvailable(): void {
$this->storage->expects($this->once())
->method('getAvailability')
->willReturn(['available' => true, 'last_checked' => 0]);
@@ -52,7 +52,7 @@ class AvailabilityTest extends \Test\TestCase {
* Storage marked unavailable, TTL not expired
*
*/
- public function testUnavailable() {
+ public function testUnavailable(): void {
$this->expectException(\OCP\Files\StorageNotAvailableException::class);
$this->storage->expects($this->once())
@@ -69,7 +69,7 @@ class AvailabilityTest extends \Test\TestCase {
/**
* Storage marked unavailable, TTL expired
*/
- public function testUnavailableRecheck() {
+ public function testUnavailableRecheck(): void {
$this->storage->expects($this->once())
->method('getAvailability')
->willReturn(['available' => false, 'last_checked' => 0]);
@@ -92,7 +92,7 @@ class AvailabilityTest extends \Test\TestCase {
* Storage marked available, but throws StorageNotAvailableException
*
*/
- public function testAvailableThrowStorageNotAvailable() {
+ public function testAvailableThrowStorageNotAvailable(): void {
$this->expectException(\OCP\Files\StorageNotAvailableException::class);
$this->storage->expects($this->once())
@@ -114,7 +114,7 @@ class AvailabilityTest extends \Test\TestCase {
* Storage available, but call fails
* Method failure does not indicate storage unavailability
*/
- public function testAvailableFailure() {
+ public function testAvailableFailure(): void {
$this->storage->expects($this->once())
->method('getAvailability')
->willReturn(['available' => true, 'last_checked' => 0]);
@@ -134,7 +134,7 @@ class AvailabilityTest extends \Test\TestCase {
* Standard exception does not indicate storage unavailability
*
*/
- public function testAvailableThrow() {
+ public function testAvailableThrow(): void {
$this->expectException(\Exception::class);
$this->storage->expects($this->once())
diff --git a/tests/lib/Files/Storage/Wrapper/EncodingTest.php b/tests/lib/Files/Storage/Wrapper/EncodingTest.php
index ae6a6ece742..4256337f08e 100644
--- a/tests/lib/Files/Storage/Wrapper/EncodingTest.php
+++ b/tests/lib/Files/Storage/Wrapper/EncodingTest.php
@@ -57,7 +57,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
/**
* @dataProvider accessNameProvider
*/
- public function testFputEncoding($accessName) {
+ public function testFputEncoding($accessName): void {
$this->sourceStorage->file_put_contents(self::NFD_NAME, 'bar');
$this->assertEquals('bar', $this->instance->file_get_contents($accessName));
}
@@ -65,7 +65,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
/**
* @dataProvider accessNameProvider
*/
- public function testFopenReadEncoding($accessName) {
+ public function testFopenReadEncoding($accessName): void {
$this->sourceStorage->file_put_contents(self::NFD_NAME, 'bar');
$fh = $this->instance->fopen($accessName, 'r');
$data = fgets($fh);
@@ -76,7 +76,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
/**
* @dataProvider accessNameProvider
*/
- public function testFopenOverwriteEncoding($accessName) {
+ public function testFopenOverwriteEncoding($accessName): void {
$this->sourceStorage->file_put_contents(self::NFD_NAME, 'bar');
$fh = $this->instance->fopen($accessName, 'w');
$data = fputs($fh, 'test');
@@ -89,7 +89,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
/**
* @dataProvider accessNameProvider
*/
- public function testFileExistsEncoding($accessName) {
+ public function testFileExistsEncoding($accessName): void {
$this->sourceStorage->file_put_contents(self::NFD_NAME, 'bar');
$this->assertTrue($this->instance->file_exists($accessName));
}
@@ -97,14 +97,14 @@ class EncodingTest extends \Test\Files\Storage\Storage {
/**
* @dataProvider accessNameProvider
*/
- public function testUnlinkEncoding($accessName) {
+ public function testUnlinkEncoding($accessName): void {
$this->sourceStorage->file_put_contents(self::NFD_NAME, 'bar');
$this->assertTrue($this->instance->unlink($accessName));
$this->assertFalse($this->sourceStorage->file_exists(self::NFC_NAME));
$this->assertFalse($this->sourceStorage->file_exists(self::NFD_NAME));
}
- public function testNfcHigherPriority() {
+ public function testNfcHigherPriority(): void {
$this->sourceStorage->file_put_contents(self::NFC_NAME, 'nfc');
$this->sourceStorage->file_put_contents(self::NFD_NAME, 'nfd');
$this->assertEquals('nfc', $this->instance->file_get_contents(self::NFC_NAME));
@@ -121,7 +121,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
/**
* @dataProvider encodedDirectoriesProvider
*/
- public function testOperationInsideDirectory($sourceDir, $accessDir) {
+ public function testOperationInsideDirectory($sourceDir, $accessDir): void {
$this->sourceStorage->mkdir($sourceDir);
$this->instance->file_put_contents($accessDir . '/test.txt', 'bar');
$this->assertTrue($this->instance->file_exists($accessDir . '/test.txt'));
@@ -138,7 +138,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
$this->assertTrue($this->instance->file_exists($accessDir . '/' . self::NFC_NAME));
}
- public function testCacheExtraSlash() {
+ public function testCacheExtraSlash(): void {
$this->sourceStorage->file_put_contents(self::NFD_NAME, 'foo');
$this->assertEquals(3, $this->instance->file_put_contents(self::NFC_NAME, 'bar'));
$this->assertEquals('bar', $this->instance->file_get_contents(self::NFC_NAME));
@@ -162,7 +162,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
/**
* @dataProvider sourceAndTargetDirectoryProvider
*/
- public function testCopyAndMoveEncodedFolder($sourceDir, $targetDir) {
+ public function testCopyAndMoveEncodedFolder($sourceDir, $targetDir): void {
$this->sourceStorage->mkdir($sourceDir);
$this->sourceStorage->mkdir($targetDir);
$this->sourceStorage->file_put_contents($sourceDir . '/test.txt', 'bar');
@@ -182,7 +182,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
/**
* @dataProvider sourceAndTargetDirectoryProvider
*/
- public function testCopyAndMoveFromStorageEncodedFolder($sourceDir, $targetDir) {
+ public function testCopyAndMoveFromStorageEncodedFolder($sourceDir, $targetDir): void {
$this->sourceStorage->mkdir($sourceDir);
$this->sourceStorage->mkdir($targetDir);
$this->sourceStorage->file_put_contents($sourceDir . '/test.txt', 'bar');
@@ -199,7 +199,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
$this->assertEquals('bar', $this->instance->file_get_contents(self::NFC_NAME . '2/test2.txt'));
}
- public function testNormalizedDirectoryEntriesOpenDir() {
+ public function testNormalizedDirectoryEntriesOpenDir(): void {
$this->sourceStorage->mkdir('/test');
$this->sourceStorage->mkdir('/test/' . self::NFD_NAME);
@@ -218,7 +218,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
$this->assertEquals(self::NFC_NAME, $content[0]);
}
- public function testNormalizedDirectoryEntriesGetDirectoryContent() {
+ public function testNormalizedDirectoryEntriesGetDirectoryContent(): void {
$this->sourceStorage->mkdir('/test');
$this->sourceStorage->mkdir('/test/' . self::NFD_NAME);
@@ -230,7 +230,7 @@ class EncodingTest extends \Test\Files\Storage\Storage {
$this->assertEquals(self::NFC_NAME, $content[0]['name']);
}
- public function testNormalizedGetMetaData() {
+ public function testNormalizedGetMetaData(): void {
$this->sourceStorage->mkdir('/test');
$this->sourceStorage->mkdir('/test/' . self::NFD_NAME);
diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
index 74b91216c37..2a131a1ea39 100644
--- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
+++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
@@ -251,7 +251,7 @@ class EncryptionTest extends Storage {
* @param int $storedUnencryptedSize
* @param array $expected
*/
- public function testGetMetaData($path, $metaData, $encrypted, $unencryptedSizeSet, $storedUnencryptedSize, $expected) {
+ public function testGetMetaData($path, $metaData, $encrypted, $unencryptedSizeSet, $storedUnencryptedSize, $expected): void {
$sourceStorage = $this->getMockBuilder('\OC\Files\Storage\Storage')
->disableOriginalConstructor()->getMock();
@@ -329,7 +329,7 @@ class EncryptionTest extends Storage {
];
}
- public function testFilesize() {
+ public function testFilesize(): void {
$cache = $this->getMockBuilder('\OC\Files\Cache\Cache')
->disableOriginalConstructor()->getMock();
$cache->expects($this->any())
@@ -369,7 +369,7 @@ class EncryptionTest extends Storage {
* @param bool $failure
* @param int $expected
*/
- public function testVerifyUnencryptedSize($encryptedSize, $unencryptedSize, $failure, $expected) {
+ public function testVerifyUnencryptedSize($encryptedSize, $unencryptedSize, $failure, $expected): void {
$sourceStorage = $this->getMockBuilder('\OC\Files\Storage\Storage')
->disableOriginalConstructor()->getMock();
@@ -428,7 +428,7 @@ class EncryptionTest extends Storage {
public function testRename($source,
$target,
$encryptionEnabled,
- $renameKeysReturn) {
+ $renameKeysReturn): void {
if ($encryptionEnabled) {
$this->keyStore
->expects($this->once())
@@ -448,7 +448,7 @@ class EncryptionTest extends Storage {
$this->instance->rename($source, $target);
}
- public function testCopyEncryption() {
+ public function testCopyEncryption(): void {
$this->instance->file_put_contents('source.txt', 'bar');
$this->instance->copy('source.txt', 'target.txt');
$this->assertSame('bar', $this->instance->file_get_contents('target.txt'));
@@ -473,7 +473,7 @@ class EncryptionTest extends Storage {
];
}
- public function testIsLocal() {
+ public function testIsLocal(): void {
$this->encryptionManager->expects($this->once())
->method('isEnabled')->willReturn(true);
$this->assertFalse($this->instance->isLocal());
@@ -487,7 +487,7 @@ class EncryptionTest extends Storage {
* @param boolean $isExcluded
* @param boolean $encryptionEnabled
*/
- public function testRmdir($path, $rmdirResult, $isExcluded, $encryptionEnabled) {
+ public function testRmdir($path, $rmdirResult, $isExcluded, $encryptionEnabled): void {
$sourceStorage = $this->getMockBuilder('\OC\Files\Storage\Storage')
->disableOriginalConstructor()->getMock();
@@ -536,7 +536,7 @@ class EncryptionTest extends Storage {
* @param boolean $excluded
* @param boolean $expected
*/
- public function testCopyKeys($excluded, $expected) {
+ public function testCopyKeys($excluded, $expected): void {
$this->util->expects($this->once())
->method('isExcluded')
->willReturn($excluded);
@@ -566,7 +566,7 @@ class EncryptionTest extends Storage {
* @param bool $strippedPathExists
* @param string $strippedPath
*/
- public function testGetHeader($path, $strippedPathExists, $strippedPath) {
+ public function testGetHeader($path, $strippedPathExists, $strippedPath): void {
$sourceStorage = $this->getMockBuilder('\OC\Files\Storage\Storage')
->disableOriginalConstructor()->getMock();
@@ -647,7 +647,7 @@ class EncryptionTest extends Storage {
*
* @dataProvider dataTestGetHeaderAddLegacyModule
*/
- public function testGetHeaderAddLegacyModule($header, $isEncrypted, $exists, $expected) {
+ public function testGetHeaderAddLegacyModule($header, $isEncrypted, $exists, $expected): void {
$sourceStorage = $this->getMockBuilder('\OC\Files\Storage\Storage')
->disableOriginalConstructor()->getMock();
@@ -717,7 +717,7 @@ class EncryptionTest extends Storage {
];
}
- public function testCopyBetweenStorageMinimumEncryptedVersion() {
+ public function testCopyBetweenStorageMinimumEncryptedVersion(): void {
$storage2 = $this->createMock(\OC\Files\Storage\Storage::class);
$sourceInternalPath = $targetInternalPath = 'file.txt';
@@ -766,7 +766,7 @@ class EncryptionTest extends Storage {
* @param bool $mountPointEncryptionEnabled
* @param bool $expectedEncrypted
*/
- public function testCopyBetweenStorage($encryptionEnabled, $mountPointEncryptionEnabled, $expectedEncrypted) {
+ public function testCopyBetweenStorage($encryptionEnabled, $mountPointEncryptionEnabled, $expectedEncrypted): void {
$storage2 = $this->createMock(\OC\Files\Storage\Storage::class);
$sourceInternalPath = $targetInternalPath = 'file.txt';
@@ -827,7 +827,7 @@ class EncryptionTest extends Storage {
* @param bool $copyResult
* @param bool $encrypted
*/
- public function testCopyBetweenStorageVersions($sourceInternalPath, $targetInternalPath, $copyResult, $encrypted) {
+ public function testCopyBetweenStorageVersions($sourceInternalPath, $targetInternalPath, $copyResult, $encrypted): void {
$sourceStorage = $this->createMock(\OC\Files\Storage\Storage::class);
$targetStorage = $this->createMock(\OC\Files\Storage\Storage::class);
@@ -919,7 +919,7 @@ class EncryptionTest extends Storage {
* @param string $path
* @param bool $expected
*/
- public function testIsVersion($path, $expected) {
+ public function testIsVersion($path, $expected): void {
$this->assertSame($expected,
$this->invokePrivate($this->instance, 'isVersion', [$path])
);
@@ -949,7 +949,7 @@ class EncryptionTest extends Storage {
$encryptionModule,
$encryptionModuleShouldEncrypt,
$expected
- ) {
+ ): void {
$encryptionManager = $this->createMock(\OC\Encryption\Manager::class);
$util = $this->createMock(Util::class);
$fileHelper = $this->createMock(IFile::class);
diff --git a/tests/lib/Files/Storage/Wrapper/JailTest.php b/tests/lib/Files/Storage/Wrapper/JailTest.php
index fb2d05d0691..fbc4e1d09ee 100644
--- a/tests/lib/Files/Storage/Wrapper/JailTest.php
+++ b/tests/lib/Files/Storage/Wrapper/JailTest.php
@@ -37,12 +37,12 @@ class JailTest extends \Test\Files\Storage\Storage {
parent::tearDown();
}
- public function testMkDirRooted() {
+ public function testMkDirRooted(): void {
$this->instance->mkdir('bar');
$this->assertTrue($this->sourceStorage->is_dir('foo/bar'));
}
- public function testFilePutContentsRooted() {
+ public function testFilePutContentsRooted(): void {
$this->instance->file_put_contents('bar', 'asd');
$this->assertEquals('asd', $this->sourceStorage->file_get_contents('foo/bar'));
}
diff --git a/tests/lib/Files/Storage/Wrapper/KnownMtimeTest.php b/tests/lib/Files/Storage/Wrapper/KnownMtimeTest.php
index ccc95de1002..bbeb48c5cef 100644
--- a/tests/lib/Files/Storage/Wrapper/KnownMtimeTest.php
+++ b/tests/lib/Files/Storage/Wrapper/KnownMtimeTest.php
@@ -50,7 +50,7 @@ class KnownMtimeTest extends Storage {
]);
}
- public function testNewerKnownMtime() {
+ public function testNewerKnownMtime(): void {
$future = time() + 1000;
$this->fakeTime = $future;
diff --git a/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php b/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php
index 0b2d444700a..5c0a035d094 100644
--- a/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php
+++ b/tests/lib/Files/Storage/Wrapper/PermissionsMaskTest.php
@@ -38,13 +38,13 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage {
]);
}
- public function testMkdirNoCreate() {
+ public function testMkdirNoCreate(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE);
$this->assertFalse($storage->mkdir('foo'));
$this->assertFalse($storage->file_exists('foo'));
}
- public function testRmdirNoDelete() {
+ public function testRmdirNoDelete(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_DELETE);
$this->assertTrue($storage->mkdir('foo'));
$this->assertTrue($storage->file_exists('foo'));
@@ -52,25 +52,25 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage {
$this->assertTrue($storage->file_exists('foo'));
}
- public function testTouchNewFileNoCreate() {
+ public function testTouchNewFileNoCreate(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE);
$this->assertFalse($storage->touch('foo'));
$this->assertFalse($storage->file_exists('foo'));
}
- public function testTouchNewFileNoUpdate() {
+ public function testTouchNewFileNoUpdate(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE);
$this->assertTrue($storage->touch('foo'));
$this->assertTrue($storage->file_exists('foo'));
}
- public function testTouchExistingFileNoUpdate() {
+ public function testTouchExistingFileNoUpdate(): void {
$this->sourceStorage->touch('foo');
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE);
$this->assertFalse($storage->touch('foo'));
}
- public function testUnlinkNoDelete() {
+ public function testUnlinkNoDelete(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_DELETE);
$this->assertTrue($storage->touch('foo'));
$this->assertTrue($storage->file_exists('foo'));
@@ -78,35 +78,35 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage {
$this->assertTrue($storage->file_exists('foo'));
}
- public function testPutContentsNewFileNoUpdate() {
+ public function testPutContentsNewFileNoUpdate(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE);
$this->assertEquals(3, $storage->file_put_contents('foo', 'bar'));
$this->assertEquals('bar', $storage->file_get_contents('foo'));
}
- public function testPutContentsNewFileNoCreate() {
+ public function testPutContentsNewFileNoCreate(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE);
$this->assertFalse($storage->file_put_contents('foo', 'bar'));
}
- public function testPutContentsExistingFileNoUpdate() {
+ public function testPutContentsExistingFileNoUpdate(): void {
$this->sourceStorage->touch('foo');
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE);
$this->assertFalse($storage->file_put_contents('foo', 'bar'));
}
- public function testFopenExistingFileNoUpdate() {
+ public function testFopenExistingFileNoUpdate(): void {
$this->sourceStorage->touch('foo');
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE);
$this->assertFalse($storage->fopen('foo', 'w'));
}
- public function testFopenNewFileNoCreate() {
+ public function testFopenNewFileNoCreate(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_ALL - Constants::PERMISSION_CREATE);
$this->assertFalse($storage->fopen('foo', 'w'));
}
- public function testScanNewFiles() {
+ public function testScanNewFiles(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_READ + Constants::PERMISSION_CREATE);
$storage->file_put_contents('foo', 'bar');
$storage->getScanner()->scan('');
@@ -115,7 +115,7 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage {
$this->assertEquals(Constants::PERMISSION_READ, $storage->getCache()->get('foo')->getPermissions());
}
- public function testScanNewWrappedFiles() {
+ public function testScanNewWrappedFiles(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_READ + Constants::PERMISSION_CREATE);
$wrappedStorage = new Wrapper(['storage' => $storage]);
$wrappedStorage->file_put_contents('foo', 'bar');
@@ -125,7 +125,7 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage {
$this->assertEquals(Constants::PERMISSION_READ, $storage->getCache()->get('foo')->getPermissions());
}
- public function testScanNewFilesNested() {
+ public function testScanNewFilesNested(): void {
$storage = $this->getMaskedStorage(Constants::PERMISSION_READ + Constants::PERMISSION_CREATE + Constants::PERMISSION_UPDATE);
$nestedStorage = new \OC\Files\Storage\Wrapper\PermissionsMask([
'storage' => $storage,
@@ -140,7 +140,7 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage {
$this->assertEquals(Constants::PERMISSION_READ, $wrappedStorage->getCache()->get('foo')->getPermissions());
}
- public function testScanUnchanged() {
+ public function testScanUnchanged(): void {
$this->sourceStorage->mkdir('foo');
$this->sourceStorage->file_put_contents('foo/bar.txt', 'bar');
@@ -157,7 +157,7 @@ class PermissionsMaskTest extends \Test\Files\Storage\Storage {
$this->assertFalse($called);
}
- public function testScanUnchangedWrapped() {
+ public function testScanUnchangedWrapped(): void {
$this->sourceStorage->mkdir('foo');
$this->sourceStorage->file_put_contents('foo/bar.txt', 'bar');
diff --git a/tests/lib/Files/Storage/Wrapper/QuotaTest.php b/tests/lib/Files/Storage/Wrapper/QuotaTest.php
index b24b44c6a56..f07e6021e4e 100644
--- a/tests/lib/Files/Storage/Wrapper/QuotaTest.php
+++ b/tests/lib/Files/Storage/Wrapper/QuotaTest.php
@@ -49,24 +49,24 @@ class QuotaTest extends \Test\Files\Storage\Storage {
return new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => $limit]);
}
- public function testFilePutContentsNotEnoughSpace() {
+ public function testFilePutContentsNotEnoughSpace(): void {
$instance = $this->getLimitedStorage(3);
$this->assertFalse($instance->file_put_contents('files/foo', 'foobar'));
}
- public function testCopyNotEnoughSpace() {
+ public function testCopyNotEnoughSpace(): void {
$instance = $this->getLimitedStorage(9);
$this->assertEquals(6, $instance->file_put_contents('files/foo', 'foobar'));
$instance->getScanner()->scan('');
$this->assertFalse($instance->copy('files/foo', 'files/bar'));
}
- public function testFreeSpace() {
+ public function testFreeSpace(): void {
$instance = $this->getLimitedStorage(9);
$this->assertEquals(9, $instance->free_space(''));
}
- public function testFreeSpaceWithUsedSpace() {
+ public function testFreeSpaceWithUsedSpace(): void {
$instance = $this->getLimitedStorage(9);
$instance->getCache()->put(
'', ['size' => 3]
@@ -74,7 +74,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
$this->assertEquals(6, $instance->free_space(''));
}
- public function testFreeSpaceWithUnknownDiskSpace() {
+ public function testFreeSpaceWithUnknownDiskSpace(): void {
$storage = $this->getMockBuilder(Local::class)
->setMethods(['free_space'])
->setConstructorArgs([['datadir' => $this->tmpDir]])
@@ -91,7 +91,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
$this->assertEquals(6, $instance->free_space(''));
}
- public function testFreeSpaceWithUsedSpaceAndEncryption() {
+ public function testFreeSpaceWithUsedSpaceAndEncryption(): void {
$instance = $this->getLimitedStorage(9);
$instance->getCache()->put(
'', ['size' => 7]
@@ -99,7 +99,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
$this->assertEquals(2, $instance->free_space(''));
}
- public function testFWriteNotEnoughSpace() {
+ public function testFWriteNotEnoughSpace(): void {
$instance = $this->getLimitedStorage(9);
$stream = $instance->fopen('files/foo', 'w+');
$this->assertEquals(6, fwrite($stream, 'foobar'));
@@ -108,7 +108,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
$this->assertEquals('foobarqwe', $instance->file_get_contents('files/foo'));
}
- public function testStreamCopyWithEnoughSpace() {
+ public function testStreamCopyWithEnoughSpace(): void {
$instance = $this->getLimitedStorage(16);
$inputStream = fopen('data://text/plain,foobarqwerty', 'r');
$outputStream = $instance->fopen('files/foo', 'w+');
@@ -119,7 +119,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
fclose($outputStream);
}
- public function testStreamCopyNotEnoughSpace() {
+ public function testStreamCopyNotEnoughSpace(): void {
$instance = $this->getLimitedStorage(9);
$inputStream = fopen('data://text/plain,foobarqwerty', 'r');
$outputStream = $instance->fopen('files/foo', 'w+');
@@ -130,7 +130,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
fclose($outputStream);
}
- public function testReturnFalseWhenFopenFailed() {
+ public function testReturnFalseWhenFopenFailed(): void {
$failStorage = $this->getMockBuilder(Local::class)
->setMethods(['fopen'])
->setConstructorArgs([['datadir' => $this->tmpDir]])
@@ -144,7 +144,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
$this->assertFalse($instance->fopen('failedfopen', 'r'));
}
- public function testReturnRegularStreamOnRead() {
+ public function testReturnRegularStreamOnRead(): void {
$instance = $this->getLimitedStorage(9);
// create test file first
@@ -163,7 +163,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
fclose($stream);
}
- public function testReturnRegularStreamWhenOutsideFiles() {
+ public function testReturnRegularStreamWhenOutsideFiles(): void {
$instance = $this->getLimitedStorage(9);
$instance->mkdir('files_other');
@@ -174,7 +174,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
fclose($stream);
}
- public function testReturnQuotaStreamOnWrite() {
+ public function testReturnQuotaStreamOnWrite(): void {
$instance = $this->getLimitedStorage(9);
$stream = $instance->fopen('files/foo', 'w+');
$meta = stream_get_meta_data($stream);
@@ -183,7 +183,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
fclose($stream);
}
- public function testSpaceRoot() {
+ public function testSpaceRoot(): void {
$storage = $this->getMockBuilder(Local::class)->disableOriginalConstructor()->getMock();
$cache = $this->getMockBuilder('\OC\Files\Cache\Cache')->disableOriginalConstructor()->getMock();
$storage->expects($this->once())
@@ -202,19 +202,19 @@ class QuotaTest extends \Test\Files\Storage\Storage {
$this->assertEquals(1024 - 50, $instance->free_space(''));
}
- public function testInstanceOfStorageWrapper() {
+ public function testInstanceOfStorageWrapper(): void {
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Local'));
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Wrapper'));
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota'));
}
- public function testNoMkdirQuotaZero() {
+ public function testNoMkdirQuotaZero(): void {
$instance = $this->getLimitedStorage(0.0);
$this->assertFalse($instance->mkdir('files'));
$this->assertFalse($instance->mkdir('files/foobar'));
}
- public function testMkdirQuotaZeroTrashbin() {
+ public function testMkdirQuotaZeroTrashbin(): void {
$instance = $this->getLimitedStorage(0.0);
$this->assertTrue($instance->mkdir('files_trashbin'));
$this->assertTrue($instance->mkdir('files_trashbin/files'));
@@ -222,7 +222,7 @@ class QuotaTest extends \Test\Files\Storage\Storage {
$this->assertTrue($instance->mkdir('cache'));
}
- public function testNoTouchQuotaZero() {
+ public function testNoTouchQuotaZero(): void {
$instance = $this->getLimitedStorage(0.0);
$this->assertFalse($instance->touch('foobar'));
}
diff --git a/tests/lib/Files/Storage/Wrapper/WrapperTest.php b/tests/lib/Files/Storage/Wrapper/WrapperTest.php
index 0244c78da8b..1d0f41bf3ed 100644
--- a/tests/lib/Files/Storage/Wrapper/WrapperTest.php
+++ b/tests/lib/Files/Storage/Wrapper/WrapperTest.php
@@ -26,7 +26,7 @@ class WrapperTest extends \Test\Files\Storage\Storage {
parent::tearDown();
}
- public function testInstanceOfStorageWrapper() {
+ public function testInstanceOfStorageWrapper(): void {
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Local'));
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Wrapper'));
}
diff --git a/tests/lib/Files/Stream/EncryptionTest.php b/tests/lib/Files/Stream/EncryptionTest.php
index 4f8d0b88de2..c29a38f2b09 100644
--- a/tests/lib/Files/Stream/EncryptionTest.php
+++ b/tests/lib/Files/Stream/EncryptionTest.php
@@ -88,7 +88,7 @@ class EncryptionTest extends \Test\TestCase {
$expectedSharePath,
$expectedSize,
$expectedUnencryptedSize,
- $expectedReadOnly) {
+ $expectedReadOnly): void {
// build mocks
$encryptionModuleMock = $this->getMockBuilder('\OCP\Encryption\IEncryptionModule')
->disableOriginalConstructor()->getMock();
@@ -189,7 +189,7 @@ class EncryptionTest extends \Test\TestCase {
];
}
- public function testWriteRead() {
+ public function testWriteRead(): void {
$fileName = tempnam('/tmp', 'FOO');
$stream = $this->getStream($fileName, 'w+', 0, self::DEFAULT_WRAPPER, 6);
$this->assertEquals(6, fwrite($stream, 'foobar'));
@@ -210,7 +210,7 @@ class EncryptionTest extends \Test\TestCase {
unlink($fileName);
}
- public function testRewind() {
+ public function testRewind(): void {
$fileName = tempnam('/tmp', 'FOO');
$stream = $this->getStream($fileName, 'w+', 0, self::DEFAULT_WRAPPER, 6);
$this->assertEquals(6, fwrite($stream, 'foobar'));
@@ -227,7 +227,7 @@ class EncryptionTest extends \Test\TestCase {
unlink($fileName);
}
- public function testSeek() {
+ public function testSeek(): void {
$fileName = tempnam('/tmp', 'FOO');
$stream = $this->getStream($fileName, 'w+', 0, self::DEFAULT_WRAPPER, 9);
@@ -260,7 +260,7 @@ class EncryptionTest extends \Test\TestCase {
/**
* @dataProvider dataFilesProvider
*/
- public function testWriteReadBigFile($testFile) {
+ public function testWriteReadBigFile($testFile): void {
$expectedData = file_get_contents(\OC::$SERVERROOT . '/tests/data/' . $testFile);
// write it
$fileName = tempnam('/tmp', 'FOO');
@@ -297,7 +297,7 @@ class EncryptionTest extends \Test\TestCase {
*
* @dataProvider dataFilesProvider
*/
- public function testWriteToNonSeekableStorage($testFile) {
+ public function testWriteToNonSeekableStorage($testFile): void {
$wrapper = $this->getMockBuilder('\OC\Files\Stream\Encryption')
->setMethods(['parentSeekStream'])->getMock();
$wrapper->expects($this->any())->method('parentSeekStream')->willReturn(false);
diff --git a/tests/lib/Files/Stream/HashWrapperTest.php b/tests/lib/Files/Stream/HashWrapperTest.php
index 686fcbec82a..ee50fe3b13a 100644
--- a/tests/lib/Files/Stream/HashWrapperTest.php
+++ b/tests/lib/Files/Stream/HashWrapperTest.php
@@ -15,7 +15,7 @@ class HashWrapperTest extends TestCase {
/**
* @dataProvider hashProvider
*/
- public function testHashStream($data, string $algo, string $hash) {
+ public function testHashStream($data, string $algo, string $hash): void {
if (!is_resource($data)) {
$tmpData = fopen('php://temp', 'r+');
if ($data !== null) {
diff --git a/tests/lib/Files/Stream/QuotaTest.php b/tests/lib/Files/Stream/QuotaTest.php
index 17ad14b7e44..2df767d6c60 100644
--- a/tests/lib/Files/Stream/QuotaTest.php
+++ b/tests/lib/Files/Stream/QuotaTest.php
@@ -18,21 +18,21 @@ class QuotaTest extends \Test\TestCase {
return \OC\Files\Stream\Quota::wrap($source, $limit);
}
- public function testWriteEnoughSpace() {
+ public function testWriteEnoughSpace(): void {
$stream = $this->getStream('w+', 100);
$this->assertEquals(6, fwrite($stream, 'foobar'));
rewind($stream);
$this->assertEquals('foobar', fread($stream, 100));
}
- public function testWriteNotEnoughSpace() {
+ public function testWriteNotEnoughSpace(): void {
$stream = $this->getStream('w+', 3);
$this->assertEquals(3, fwrite($stream, 'foobar'));
rewind($stream);
$this->assertEquals('foo', fread($stream, 100));
}
- public function testWriteNotEnoughSpaceSecondTime() {
+ public function testWriteNotEnoughSpaceSecondTime(): void {
$stream = $this->getStream('w+', 9);
$this->assertEquals(6, fwrite($stream, 'foobar'));
$this->assertEquals(3, fwrite($stream, 'qwerty'));
@@ -40,7 +40,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals('foobarqwe', fread($stream, 100));
}
- public function testWriteEnoughSpaceRewind() {
+ public function testWriteEnoughSpaceRewind(): void {
$stream = $this->getStream('w+', 6);
$this->assertEquals(6, fwrite($stream, 'foobar'));
rewind($stream);
@@ -49,7 +49,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals('qwebar', fread($stream, 100));
}
- public function testWriteNotEnoughSpaceRead() {
+ public function testWriteNotEnoughSpaceRead(): void {
$stream = $this->getStream('w+', 6);
$this->assertEquals(6, fwrite($stream, 'foobar'));
rewind($stream);
@@ -57,7 +57,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals(0, fwrite($stream, 'qwe'));
}
- public function testWriteNotEnoughSpaceExistingStream() {
+ public function testWriteNotEnoughSpaceExistingStream(): void {
$source = fopen('php://temp', 'w+');
fwrite($source, 'foobar');
$stream = \OC\Files\Stream\Quota::wrap($source, 3);
@@ -66,7 +66,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals('foobarfoo', fread($stream, 100));
}
- public function testWriteNotEnoughSpaceExistingStreamRewind() {
+ public function testWriteNotEnoughSpaceExistingStreamRewind(): void {
$source = fopen('php://temp', 'w+');
fwrite($source, 'foobar');
$stream = \OC\Files\Stream\Quota::wrap($source, 3);
@@ -76,7 +76,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals('qwerty', fread($stream, 100));
}
- public function testFseekReturnsSuccess() {
+ public function testFseekReturnsSuccess(): void {
$stream = $this->getStream('w+', 100);
fwrite($stream, '0123456789');
$this->assertEquals(0, fseek($stream, 3, SEEK_SET));
@@ -84,7 +84,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals(0, fseek($stream, -4, SEEK_END));
}
- public function testWriteAfterSeekEndWithEnoughSpace() {
+ public function testWriteAfterSeekEndWithEnoughSpace(): void {
$stream = $this->getStream('w+', 100);
fwrite($stream, '0123456789');
fseek($stream, -3, SEEK_END);
@@ -93,7 +93,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals('0123456abcdefghijk', fread($stream, 100));
}
- public function testWriteAfterSeekEndWithNotEnoughSpace() {
+ public function testWriteAfterSeekEndWithNotEnoughSpace(): void {
$stream = $this->getStream('w+', 13);
fwrite($stream, '0123456789');
// seek forward first to potentially week out
@@ -106,7 +106,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals('0123456abcdef', fread($stream, 100));
}
- public function testWriteAfterSeekSetWithEnoughSpace() {
+ public function testWriteAfterSeekSetWithEnoughSpace(): void {
$stream = $this->getStream('w+', 100);
fwrite($stream, '0123456789');
fseek($stream, 7, SEEK_SET);
@@ -115,7 +115,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals('0123456abcdefghijk', fread($stream, 100));
}
- public function testWriteAfterSeekSetWithNotEnoughSpace() {
+ public function testWriteAfterSeekSetWithNotEnoughSpace(): void {
$stream = $this->getStream('w+', 13);
fwrite($stream, '0123456789');
fseek($stream, 7, SEEK_SET);
@@ -124,7 +124,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals('0123456abcdef', fread($stream, 100));
}
- public function testWriteAfterSeekCurWithEnoughSpace() {
+ public function testWriteAfterSeekCurWithEnoughSpace(): void {
$stream = $this->getStream('w+', 100);
fwrite($stream, '0123456789');
rewind($stream);
@@ -136,7 +136,7 @@ class QuotaTest extends \Test\TestCase {
$this->assertEquals('0123456abcdefghijk', fread($stream, 100));
}
- public function testWriteAfterSeekCurWithNotEnoughSpace() {
+ public function testWriteAfterSeekCurWithNotEnoughSpace(): void {
$stream = $this->getStream('w+', 13);
fwrite($stream, '0123456789');
rewind($stream);
diff --git a/tests/lib/Files/Type/DetectionTest.php b/tests/lib/Files/Type/DetectionTest.php
index e647fa064d4..dcbb455efc9 100644
--- a/tests/lib/Files/Type/DetectionTest.php
+++ b/tests/lib/Files/Type/DetectionTest.php
@@ -117,7 +117,7 @@ class DetectionTest extends \Test\TestCase {
$this->assertEquals($expected, $this->detection->getSecureMimeType($mimeType));
}
- public function testMimeTypeIcon() {
+ public function testMimeTypeIcon(): void {
if (!class_exists('org\\bovigo\\vfs\\vfsStream')) {
$this->markTestSkipped('Package vfsStream not installed');
}
diff --git a/tests/lib/Files/Type/LoaderTest.php b/tests/lib/Files/Type/LoaderTest.php
index cd2788bd208..6eaf6ac2013 100644
--- a/tests/lib/Files/Type/LoaderTest.php
+++ b/tests/lib/Files/Type/LoaderTest.php
@@ -30,7 +30,7 @@ class LoaderTest extends TestCase {
}
- public function testGetMimetype() {
+ public function testGetMimetype(): void {
$qb = $this->db->getQueryBuilder();
$qb->insert('mimetypes')
->values([
@@ -46,13 +46,13 @@ class LoaderTest extends TestCase {
$this->assertEquals('testing/mymimetype', $mimetype);
}
- public function testGetNonexistentMimetype() {
+ public function testGetNonexistentMimetype(): void {
$this->assertFalse($this->loader->exists('testing/nonexistent'));
// hopefully this ID doesn't exist
$this->assertNull($this->loader->getMimetypeById(12345));
}
- public function testStore() {
+ public function testStore(): void {
$this->assertFalse($this->loader->exists('testing/mymimetype'));
$mimetypeId = $this->loader->getId('testing/mymimetype');
@@ -70,7 +70,7 @@ class LoaderTest extends TestCase {
$this->assertEquals($mimetypeId, $this->loader->getId('testing/mymimetype'));
}
- public function testStoreExists() {
+ public function testStoreExists(): void {
$mimetypeId = $this->loader->getId('testing/mymimetype');
$mimetypeId2 = $this->loader->getId('testing/mymimetype');
diff --git a/tests/lib/Files/Utils/ScannerTest.php b/tests/lib/Files/Utils/ScannerTest.php
index c3ba696ac5c..f66bb72e865 100644
--- a/tests/lib/Files/Utils/ScannerTest.php
+++ b/tests/lib/Files/Utils/ScannerTest.php
@@ -61,7 +61,7 @@ class ScannerTest extends \Test\TestCase {
parent::tearDown();
}
- public function testReuseExistingRoot() {
+ public function testReuseExistingRoot(): void {
$storage = new Temporary([]);
$mount = new MountPoint($storage, '');
Filesystem::getMountManager()->addMount($mount);
@@ -83,7 +83,7 @@ class ScannerTest extends \Test\TestCase {
$this->assertEquals($oldRoot, $newRoot);
}
- public function testReuseExistingFile() {
+ public function testReuseExistingFile(): void {
$storage = new Temporary([]);
$mount = new MountPoint($storage, '');
Filesystem::getMountManager()->addMount($mount);
@@ -105,7 +105,7 @@ class ScannerTest extends \Test\TestCase {
$this->assertEquals($old, $new);
}
- public function testScanSubMount() {
+ public function testScanSubMount(): void {
$uid = $this->getUniqueID();
$this->userBackend->createUser($uid, 'test');
@@ -159,7 +159,7 @@ class ScannerTest extends \Test\TestCase {
* @dataProvider invalidPathProvider
* @param string $invalidPath
*/
- public function testInvalidPathScanning($invalidPath) {
+ public function testInvalidPathScanning($invalidPath): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid path to scan');
@@ -167,7 +167,7 @@ class ScannerTest extends \Test\TestCase {
$scanner->scan($invalidPath);
}
- public function testPropagateEtag() {
+ public function testPropagateEtag(): void {
$storage = new Temporary([]);
$mount = new MountPoint($storage, '');
Filesystem::getMountManager()->addMount($mount);
@@ -191,7 +191,7 @@ class ScannerTest extends \Test\TestCase {
$this->assertNotEquals($oldRoot->getEtag(), $newRoot->getEtag());
}
- public function testShallow() {
+ public function testShallow(): void {
$storage = new Temporary([]);
$mount = new MountPoint($storage, '');
Filesystem::getMountManager()->addMount($mount);
diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php
index e9e4d0e7573..0a029889fb1 100644
--- a/tests/lib/Files/ViewTest.php
+++ b/tests/lib/Files/ViewTest.php
@@ -147,7 +147,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testCacheAPI() {
+ public function testCacheAPI(): void {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
$storage3 = $this->getTestStorage();
@@ -230,7 +230,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testGetPath() {
+ public function testGetPath(): void {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
$storage3 = $this->getTestStorage();
@@ -257,7 +257,7 @@ class ViewTest extends \Test\TestCase {
}
- public function testGetPathNotExisting() {
+ public function testGetPathNotExisting(): void {
$this->expectException(\OCP\Files\NotFoundException::class);
$storage1 = $this->getTestStorage();
@@ -274,7 +274,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testMountPointOverwrite() {
+ public function testMountPointOverwrite(): void {
$storage1 = $this->getTestStorage(false);
$storage2 = $this->getTestStorage();
$storage1->mkdir('substorage');
@@ -296,7 +296,7 @@ class ViewTest extends \Test\TestCase {
/**
* @dataProvider sharingDisabledPermissionProvider
*/
- public function testRemoveSharePermissionWhenSharingDisabledForUser($excludeGroups, $excludeGroupsList, $expectedShareable) {
+ public function testRemoveSharePermissionWhenSharingDisabledForUser($excludeGroups, $excludeGroupsList, $expectedShareable): void {
// Reset sharing disabled for users cache
self::invokePrivate(\OC::$server->get(ShareDisableChecker::class), 'sharingDisabledForUsersCache', [new CappedMemoryCache()]);
@@ -326,7 +326,7 @@ class ViewTest extends \Test\TestCase {
self::invokePrivate(\OC::$server->get(ShareDisableChecker::class), 'sharingDisabledForUsersCache', [new CappedMemoryCache()]);
}
- public function testCacheIncompleteFolder() {
+ public function testCacheIncompleteFolder(): void {
$storage1 = $this->getTestStorage(false);
Filesystem::mount($storage1, [], '/incomplete');
$rootView = new View('/incomplete');
@@ -339,7 +339,7 @@ class ViewTest extends \Test\TestCase {
$this->assertCount(1, $entries);
}
- public function testAutoScan() {
+ public function testAutoScan(): void {
$storage1 = $this->getTestStorage(false);
$storage2 = $this->getTestStorage(false);
Filesystem::mount($storage1, [], '/');
@@ -360,7 +360,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testSearch() {
+ public function testSearch(): void {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
$storage3 = $this->getTestStorage();
@@ -410,7 +410,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testWatcher() {
+ public function testWatcher(): void {
$storage1 = $this->getTestStorage();
Filesystem::mount($storage1, [], '/');
$storage1->getWatcher()->setPolicy(Watcher::CHECK_ALWAYS);
@@ -431,7 +431,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testCopyBetweenStorageNoCross() {
+ public function testCopyBetweenStorageNoCross(): void {
$storage1 = $this->getTestStorage(true, TemporaryNoCross::class);
$storage2 = $this->getTestStorage(true, TemporaryNoCross::class);
$this->copyBetweenStorages($storage1, $storage2);
@@ -440,7 +440,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testCopyBetweenStorageCross() {
+ public function testCopyBetweenStorageCross(): void {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
$this->copyBetweenStorages($storage1, $storage2);
@@ -449,7 +449,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testCopyBetweenStorageCrossNonLocal() {
+ public function testCopyBetweenStorageCrossNonLocal(): void {
$storage1 = $this->getTestStorage(true, TemporaryNoLocal::class);
$storage2 = $this->getTestStorage(true, TemporaryNoLocal::class);
$this->copyBetweenStorages($storage1, $storage2);
@@ -477,7 +477,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testMoveBetweenStorageNoCross() {
+ public function testMoveBetweenStorageNoCross(): void {
$storage1 = $this->getTestStorage(true, TemporaryNoCross::class);
$storage2 = $this->getTestStorage(true, TemporaryNoCross::class);
$this->moveBetweenStorages($storage1, $storage2);
@@ -486,7 +486,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testMoveBetweenStorageCross() {
+ public function testMoveBetweenStorageCross(): void {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
$this->moveBetweenStorages($storage1, $storage2);
@@ -495,7 +495,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testMoveBetweenStorageCrossNonLocal() {
+ public function testMoveBetweenStorageCrossNonLocal(): void {
$storage1 = $this->getTestStorage(true, TemporaryNoLocal::class);
$storage2 = $this->getTestStorage(true, TemporaryNoLocal::class);
$this->moveBetweenStorages($storage1, $storage2);
@@ -518,7 +518,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testUnlink() {
+ public function testUnlink(): void {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
Filesystem::mount($storage1, [], '/');
@@ -545,7 +545,7 @@ class ViewTest extends \Test\TestCase {
/**
* @dataProvider rmdirOrUnlinkDataProvider
*/
- public function testRmdir($method) {
+ public function testRmdir($method): void {
$storage1 = $this->getTestStorage();
Filesystem::mount($storage1, [], '/');
@@ -564,7 +564,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testUnlinkRootMustFail() {
+ public function testUnlinkRootMustFail(): void {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
Filesystem::mount($storage1, [], '/');
@@ -583,7 +583,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testTouch() {
+ public function testTouch(): void {
$storage = $this->getTestStorage(true, TemporaryNoTouch::class);
Filesystem::mount($storage, [], '/');
@@ -607,7 +607,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testTouchFloat() {
+ public function testTouchFloat(): void {
$storage = $this->getTestStorage(true, TemporaryNoTouch::class);
Filesystem::mount($storage, [], '/');
@@ -624,7 +624,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testViewHooks() {
+ public function testViewHooks(): void {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
$defaultRoot = Filesystem::getRoot();
@@ -649,7 +649,7 @@ class ViewTest extends \Test\TestCase {
$this->hookPath = $params['path'];
}
- public function testSearchNotOutsideView() {
+ public function testSearchNotOutsideView(): void {
$storage1 = $this->getTestStorage();
Filesystem::mount($storage1, [], '/');
$storage1->rename('folder', 'foo');
@@ -690,7 +690,7 @@ class ViewTest extends \Test\TestCase {
/**
* @medium
*/
- public function testViewHooksIfRootStartsTheSame() {
+ public function testViewHooksIfRootStartsTheSame(): void {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
$defaultRoot = Filesystem::getRoot();
@@ -721,7 +721,7 @@ class ViewTest extends \Test\TestCase {
$this->hookCreatePath = $params['path'];
}
- public function testEditNoCreateHook() {
+ public function testEditNoCreateHook(): void {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
$defaultRoot = Filesystem::getRoot();
@@ -754,7 +754,7 @@ class ViewTest extends \Test\TestCase {
/**
* @dataProvider resolvePathTestProvider
*/
- public function testResolvePath($expected, $pathToTest) {
+ public function testResolvePath($expected, $pathToTest): void {
$storage1 = $this->getTestStorage();
Filesystem::mount($storage1, [], '/');
@@ -785,7 +785,7 @@ class ViewTest extends \Test\TestCase {
];
}
- public function testUTF8Names() {
+ public function testUTF8Names(): void {
$names = ['虚', '和知しゃ和で', 'regular ascii', 'sɨˈrɪlɪk', 'ѨѬ', 'أنا أحب القراءة كثيرا'];
$storage = new Temporary([]);
@@ -864,7 +864,7 @@ class ViewTest extends \Test\TestCase {
}
}
- public function testTouchNotSupported() {
+ public function testTouchNotSupported(): void {
$storage = new TemporaryNoTouch([]);
$scanner = $storage->getScanner();
Filesystem::mount($storage, [], '/test/');
@@ -881,7 +881,7 @@ class ViewTest extends \Test\TestCase {
$this->assertSame($info['etag'], $info2['etag']);
}
- public function testWatcherEtagCrossStorage() {
+ public function testWatcherEtagCrossStorage(): void {
$storage1 = new Temporary([]);
$storage2 = new Temporary([]);
$scanner1 = $storage1->getScanner();
@@ -916,12 +916,12 @@ class ViewTest extends \Test\TestCase {
/**
* @dataProvider absolutePathProvider
*/
- public function testGetAbsolutePath($expectedPath, $relativePath) {
+ public function testGetAbsolutePath($expectedPath, $relativePath): void {
$view = new View('/files');
$this->assertEquals($expectedPath, $view->getAbsolutePath($relativePath));
}
- public function testPartFileInfo() {
+ public function testPartFileInfo(): void {
$storage = new Temporary([]);
$scanner = $storage->getScanner();
Filesystem::mount($storage, [], '/test/');
@@ -950,7 +950,7 @@ class ViewTest extends \Test\TestCase {
/**
* @dataProvider chrootRelativePathProvider
*/
- public function testChrootGetRelativePath($root, $absolutePath, $expectedPath) {
+ public function testChrootGetRelativePath($root, $absolutePath, $expectedPath): void {
$view = new View('/files');
$view->chroot($root);
$this->assertEquals($expectedPath, $view->getRelativePath($absolutePath));
@@ -963,7 +963,7 @@ class ViewTest extends \Test\TestCase {
/**
* @dataProvider initRelativePathProvider
*/
- public function testInitGetRelativePath($root, $absolutePath, $expectedPath) {
+ public function testInitGetRelativePath($root, $absolutePath, $expectedPath): void {
$view = new View($root);
$this->assertEquals($expectedPath, $view->getRelativePath($absolutePath));
}
@@ -1043,7 +1043,7 @@ class ViewTest extends \Test\TestCase {
];
}
- public function testFileView() {
+ public function testFileView(): void {
$storage = new Temporary([]);
$scanner = $storage->getScanner();
$storage->file_put_contents('foo.txt', 'bar');
@@ -1062,7 +1062,7 @@ class ViewTest extends \Test\TestCase {
/**
* @dataProvider tooLongPathDataProvider
*/
- public function testTooLongPath($operation, $param0 = null) {
+ public function testTooLongPath($operation, $param0 = null): void {
$this->expectException(\OCP\Files\InvalidPathException::class);
@@ -1137,7 +1137,7 @@ class ViewTest extends \Test\TestCase {
];
}
- public function testRenameCrossStoragePreserveMtime() {
+ public function testRenameCrossStoragePreserveMtime(): void {
$storage1 = new Temporary([]);
$storage2 = new Temporary([]);
$storage1->mkdir('sub');
@@ -1162,11 +1162,11 @@ class ViewTest extends \Test\TestCase {
$this->assertEquals($time, $view->filemtime('/test/sub/storage/foo/bar.txt'));
}
- public function testRenameFailDeleteTargetKeepSource() {
+ public function testRenameFailDeleteTargetKeepSource(): void {
$this->doTestCopyRenameFail('rename');
}
- public function testCopyFailDeleteTargetKeepSource() {
+ public function testCopyFailDeleteTargetKeepSource(): void {
$this->doTestCopyRenameFail('copy');
}
@@ -1217,7 +1217,7 @@ class ViewTest extends \Test\TestCase {
$this->assertFalse($storage2->getCache()->get('dirtomove/indir2.txt'));
}
- public function testDeleteFailKeepCache() {
+ public function testDeleteFailKeepCache(): void {
/** @var Temporary|\PHPUnit\Framework\MockObject\MockObject $storage */
$storage = $this->getMockBuilder(Temporary::class)
->setConstructorArgs([[]])
@@ -1250,13 +1250,13 @@ class ViewTest extends \Test\TestCase {
* @dataProvider directoryTraversalProvider
* @param string $root
*/
- public function testConstructDirectoryTraversalException($root) {
+ public function testConstructDirectoryTraversalException($root): void {
$this->expectException(\Exception::class);
new View($root);
}
- public function testRenameOverWrite() {
+ public function testRenameOverWrite(): void {
$storage = new Temporary([]);
$scanner = $storage->getScanner();
$storage->mkdir('sub');
@@ -1269,7 +1269,7 @@ class ViewTest extends \Test\TestCase {
$this->assertTrue($view->rename('/test/foo.txt', '/test/foo/bar.txt'));
}
- public function testSetMountOptionsInStorage() {
+ public function testSetMountOptionsInStorage(): void {
$mount = new MountPoint(Temporary::class, '/asd/', [[]], Filesystem::getLoader(), ['foo' => 'bar']);
Filesystem::getMountManager()->addMount($mount);
/** @var \OC\Files\Storage\Common $storage */
@@ -1277,7 +1277,7 @@ class ViewTest extends \Test\TestCase {
$this->assertEquals($storage->getMountOption('foo'), 'bar');
}
- public function testSetMountOptionsWatcherPolicy() {
+ public function testSetMountOptionsWatcherPolicy(): void {
$mount = new MountPoint(Temporary::class, '/asd/', [[]], Filesystem::getLoader(), ['filesystem_check_changes' => Watcher::CHECK_NEVER]);
Filesystem::getMountManager()->addMount($mount);
/** @var \OC\Files\Storage\Common $storage */
@@ -1286,18 +1286,18 @@ class ViewTest extends \Test\TestCase {
$this->assertEquals(Watcher::CHECK_NEVER, $watcher->getPolicy());
}
- public function testGetAbsolutePathOnNull() {
+ public function testGetAbsolutePathOnNull(): void {
$view = new View();
$this->assertNull($view->getAbsolutePath(null));
}
- public function testGetRelativePathOnNull() {
+ public function testGetRelativePathOnNull(): void {
$view = new View();
$this->assertNull($view->getRelativePath(null));
}
- public function testNullAsRoot() {
+ public function testNullAsRoot(): void {
$this->expectException(\TypeError::class);
new View(null);
@@ -1312,7 +1312,7 @@ class ViewTest extends \Test\TestCase {
* @param string $rootPath
* @param string $pathPrefix
*/
- public function testReadFromWriteLockedPath($rootPath, $pathPrefix) {
+ public function testReadFromWriteLockedPath($rootPath, $pathPrefix): void {
$this->expectException(\OCP\Lock\LockedException::class);
$rootPath = str_replace('{folder}', 'files', $rootPath);
@@ -1333,7 +1333,7 @@ class ViewTest extends \Test\TestCase {
* @param string $rootPath
* @param string $pathPrefix
*/
- public function testReadFromWriteUnlockablePath($rootPath, $pathPrefix) {
+ public function testReadFromWriteUnlockablePath($rootPath, $pathPrefix): void {
$rootPath = str_replace('{folder}', 'files_encryption', $rootPath);
$pathPrefix = str_replace('{folder}', 'files_encryption', $pathPrefix);
@@ -1353,7 +1353,7 @@ class ViewTest extends \Test\TestCase {
* @param string $rootPath
* @param string $pathPrefix
*/
- public function testWriteToReadLockedFile($rootPath, $pathPrefix) {
+ public function testWriteToReadLockedFile($rootPath, $pathPrefix): void {
$this->expectException(\OCP\Lock\LockedException::class);
$rootPath = str_replace('{folder}', 'files', $rootPath);
@@ -1374,7 +1374,7 @@ class ViewTest extends \Test\TestCase {
* @param string $rootPath
* @param string $pathPrefix
*/
- public function testWriteToReadUnlockableFile($rootPath, $pathPrefix) {
+ public function testWriteToReadUnlockableFile($rootPath, $pathPrefix): void {
$rootPath = str_replace('{folder}', 'files_encryption', $rootPath);
$pathPrefix = str_replace('{folder}', 'files_encryption', $pathPrefix);
@@ -1388,7 +1388,7 @@ class ViewTest extends \Test\TestCase {
/**
* Test that locks are on mount point paths instead of mount root
*/
- public function testLockLocalMountPointPathInsteadOfStorageRoot() {
+ public function testLockLocalMountPointPathInsteadOfStorageRoot(): void {
$lockingProvider = \OC::$server->get(ILockingProvider::class);
$view = new View('/testuser/files/');
$storage = new Temporary([]);
@@ -1418,7 +1418,7 @@ class ViewTest extends \Test\TestCase {
/**
* Test that locks are on mount point paths and also mount root when requested
*/
- public function testLockStorageRootButNotLocalMountPoint() {
+ public function testLockStorageRootButNotLocalMountPoint(): void {
$lockingProvider = \OC::$server->get(ILockingProvider::class);
$view = new View('/testuser/files/');
$storage = new Temporary([]);
@@ -1448,7 +1448,7 @@ class ViewTest extends \Test\TestCase {
/**
* Test that locks are on mount point paths and also mount root when requested
*/
- public function testLockMountPointPathFailReleasesBoth() {
+ public function testLockMountPointPathFailReleasesBoth(): void {
$lockingProvider = \OC::$server->get(ILockingProvider::class);
$view = new View('/testuser/files/');
$storage = new Temporary([]);
@@ -1499,7 +1499,7 @@ class ViewTest extends \Test\TestCase {
/**
* @dataProvider pathRelativeToFilesProvider
*/
- public function testGetPathRelativeToFiles($path, $expectedPath) {
+ public function testGetPathRelativeToFiles($path, $expectedPath): void {
$view = new View();
$this->assertEquals($expectedPath, $view->getPathRelativeToFiles($path));
}
@@ -1518,7 +1518,7 @@ class ViewTest extends \Test\TestCase {
* @dataProvider pathRelativeToFilesProviderExceptionCases
* @param string $path
*/
- public function testGetPathRelativeToFilesWithInvalidArgument($path) {
+ public function testGetPathRelativeToFilesWithInvalidArgument($path): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('$absolutePath must be relative to "files"');
@@ -1526,7 +1526,7 @@ class ViewTest extends \Test\TestCase {
$view->getPathRelativeToFiles($path);
}
- public function testChangeLock() {
+ public function testChangeLock(): void {
$view = new View('/testuser/files/');
$storage = new Temporary([]);
Filesystem::mount($storage, [], '/');
@@ -1565,7 +1565,7 @@ class ViewTest extends \Test\TestCase {
* @param $path
* @param $shouldEmit
*/
- public function testHookPaths($root, $path, $shouldEmit) {
+ public function testHookPaths($root, $path, $shouldEmit): void {
$filesystemReflection = new \ReflectionClass(Filesystem::class);
$defaultRootValue = $filesystemReflection->getProperty('defaultInstance');
$defaultRootValue->setAccessible(true);
@@ -1617,7 +1617,7 @@ class ViewTest extends \Test\TestCase {
/**
* Test mount point move
*/
- public function testMountPointMove() {
+ public function testMountPointMove(): void {
self::loginAsUser($this->user);
[$mount1, $mount2] = $this->createTestMovableMountPoints([
@@ -1642,7 +1642,7 @@ class ViewTest extends \Test\TestCase {
/**
* Test that moving a mount point into another is forbidden
*/
- public function testMoveMountPointIntoAnother() {
+ public function testMoveMountPointIntoAnother(): void {
self::loginAsUser($this->user);
[$mount1, $mount2] = $this->createTestMovableMountPoints([
@@ -1665,7 +1665,7 @@ class ViewTest extends \Test\TestCase {
/**
* Test that moving a mount point into a shared folder is forbidden
*/
- public function testMoveMountPointIntoSharedFolder() {
+ public function testMoveMountPointIntoSharedFolder(): void {
self::loginAsUser($this->user);
[$mount1, $mount2] = $this->createTestMovableMountPoints([
@@ -1856,7 +1856,7 @@ class ViewTest extends \Test\TestCase {
$expectedLockAfter = ILockingProvider::LOCK_SHARED,
$expectedStrayLock = null,
$returnValue = true,
- ) {
+ ): void {
$view = new View('/' . $this->user . '/files/');
/** @var Temporary|\PHPUnit\Framework\MockObject\MockObject $storage */
@@ -1905,7 +1905,7 @@ class ViewTest extends \Test\TestCase {
* Test locks for file_put_content with stream.
* This code path uses $storage->fopen instead
*/
- public function testLockFilePutContentWithStream() {
+ public function testLockFilePutContentWithStream(): void {
$view = new View('/' . $this->user . '/files/');
$path = 'test_file_put_contents.txt';
@@ -1944,7 +1944,7 @@ class ViewTest extends \Test\TestCase {
/**
* Test locks for fopen with fclose at the end
*/
- public function testLockFopen() {
+ public function testLockFopen(): void {
$view = new View('/' . $this->user . '/files/');
$path = 'test_file_put_contents.txt';
@@ -1997,7 +1997,7 @@ class ViewTest extends \Test\TestCase {
$operation,
$operationArgs,
$path
- ) {
+ ): void {
if ($operation === 'touch') {
$this->markTestSkipped('touch handles storage exceptions internally');
}
@@ -2036,7 +2036,7 @@ class ViewTest extends \Test\TestCase {
$this->assertNull($this->getFileLockType($view, $path), 'File got unlocked after exception');
}
- public function testLockBasicOperationUnlocksAfterLockException() {
+ public function testLockBasicOperationUnlocksAfterLockException(): void {
$view = new View('/' . $this->user . '/files/');
$storage = new Temporary([]);
@@ -2082,7 +2082,7 @@ class ViewTest extends \Test\TestCase {
$operationArgs,
$path,
$hookType
- ) {
+ ): void {
$view = new View('/' . $this->user . '/files/');
/** @var Temporary|\PHPUnit\Framework\MockObject\MockObject $storage */
@@ -2121,7 +2121,7 @@ class ViewTest extends \Test\TestCase {
* @param int $expectedLockTypeSourceDuring expected lock type on source file during
* the operation
*/
- public function testLockFileRename($operation, $expectedLockTypeSourceDuring) {
+ public function testLockFileRename($operation, $expectedLockTypeSourceDuring): void {
$view = new View('/' . $this->user . '/files/');
/** @var Temporary|\PHPUnit\Framework\MockObject\MockObject $storage */
@@ -2185,7 +2185,7 @@ class ViewTest extends \Test\TestCase {
* We expect that we catch the exception, free the lock and re-throw it.
*
*/
- public function testLockFileCopyException() {
+ public function testLockFileCopyException(): void {
$this->expectException(\Exception::class);
$view = new View('/' . $this->user . '/files/');
@@ -2228,7 +2228,7 @@ class ViewTest extends \Test\TestCase {
/**
* Test rename operation: unlock first path when second path was locked
*/
- public function testLockFileRenameUnlockOnException() {
+ public function testLockFileRenameUnlockOnException(): void {
self::loginAsUser('test');
$view = new View('/' . $this->user . '/files/');
@@ -2261,7 +2261,7 @@ class ViewTest extends \Test\TestCase {
/**
* Test rename operation: unlock first path when second path was locked
*/
- public function testGetOwner() {
+ public function testGetOwner(): void {
self::loginAsUser('test');
$view = new View('/test/files/');
@@ -2306,7 +2306,7 @@ class ViewTest extends \Test\TestCase {
* @param int $expectedLockTypeSourceDuring expected lock type on source file during
* the operation
*/
- public function testLockFileRenameCrossStorage($viewOperation, $storageOperation, $expectedLockTypeSourceDuring) {
+ public function testLockFileRenameCrossStorage($viewOperation, $storageOperation, $expectedLockTypeSourceDuring): void {
$view = new View('/' . $this->user . '/files/');
/** @var Temporary|\PHPUnit\Framework\MockObject\MockObject $storage */
@@ -2375,7 +2375,7 @@ class ViewTest extends \Test\TestCase {
/**
* Test locks when moving a mount point
*/
- public function testLockMoveMountPoint() {
+ public function testLockMoveMountPoint(): void {
self::loginAsUser('test');
[$mount] = $this->createTestMovableMountPoints([
@@ -2504,7 +2504,7 @@ class ViewTest extends \Test\TestCase {
}
- public function testRemoveMoveableMountPoint() {
+ public function testRemoveMoveableMountPoint(): void {
$mountPoint = '/' . $this->user . '/files/mount/';
// Mock the mount point
@@ -2565,7 +2565,7 @@ class ViewTest extends \Test\TestCase {
* @param string[] $expected
* @dataProvider mimeFilterProvider
*/
- public function testGetDirectoryContentMimeFilter($filter, $expected) {
+ public function testGetDirectoryContentMimeFilter($filter, $expected): void {
$storage1 = new Temporary();
$root = self::getUniqueID('/');
Filesystem::mount($storage1, [], $root . '/');
@@ -2586,7 +2586,7 @@ class ViewTest extends \Test\TestCase {
$this->assertEquals($expected, $files);
}
- public function testFilePutContentsClearsChecksum() {
+ public function testFilePutContentsClearsChecksum(): void {
$storage = new Temporary([]);
$scanner = $storage->getScanner();
$storage->file_put_contents('foo.txt', 'bar');
@@ -2607,7 +2607,7 @@ class ViewTest extends \Test\TestCase {
$this->assertEquals('', $data->getChecksum());
}
- public function testDeleteGhostFile() {
+ public function testDeleteGhostFile(): void {
$storage = new Temporary([]);
$scanner = $storage->getScanner();
$cache = $storage->getCache();
@@ -2630,7 +2630,7 @@ class ViewTest extends \Test\TestCase {
$this->assertEquals(0, $newInfo->getSize());
}
- public function testDeleteGhostFolder() {
+ public function testDeleteGhostFolder(): void {
$storage = new Temporary([]);
$scanner = $storage->getScanner();
$cache = $storage->getCache();
@@ -2656,7 +2656,7 @@ class ViewTest extends \Test\TestCase {
$this->assertEquals(0, $newInfo->getSize());
}
- public function testCreateParentDirectories() {
+ public function testCreateParentDirectories(): void {
$view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->setMethods([
@@ -2695,7 +2695,7 @@ class ViewTest extends \Test\TestCase {
$this->assertTrue(self::invokePrivate($view, 'createParentDirectories', ['/new/folder/structure']));
}
- public function testCreateParentDirectoriesWithExistingFile() {
+ public function testCreateParentDirectoriesWithExistingFile(): void {
$view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()
->setMethods([
@@ -2713,7 +2713,7 @@ class ViewTest extends \Test\TestCase {
$this->assertFalse(self::invokePrivate($view, 'createParentDirectories', ['/file.txt/folder/structure']));
}
- public function testCacheExtension() {
+ public function testCacheExtension(): void {
$storage = new Temporary([]);
$scanner = $storage->getScanner();
$storage->file_put_contents('foo.txt', 'bar');
@@ -2733,7 +2733,7 @@ class ViewTest extends \Test\TestCase {
$this->assertEquals(0, $info->getCreationTime());
}
- public function testFopenGone() {
+ public function testFopenGone(): void {
$storage = new Temporary([]);
$scanner = $storage->getScanner();
$storage->file_put_contents('foo.txt', 'bar');
@@ -2752,7 +2752,7 @@ class ViewTest extends \Test\TestCase {
$this->assertFalse($cache->inCache('foo.txt'));
}
- public function testMountpointParentsCreated() {
+ public function testMountpointParentsCreated(): void {
$storage1 = $this->getTestStorage();
Filesystem::mount($storage1, [], '/');
diff --git a/tests/lib/GlobalScale/ConfigTest.php b/tests/lib/GlobalScale/ConfigTest.php
index ca02332d02b..aa001268ecd 100644
--- a/tests/lib/GlobalScale/ConfigTest.php
+++ b/tests/lib/GlobalScale/ConfigTest.php
@@ -35,7 +35,7 @@ class ConfigTest extends TestCase {
return new Config($this->config);
}
- public function testIsGlobalScaleEnabled() {
+ public function testIsGlobalScaleEnabled(): void {
$gsConfig = $this->getInstance();
$this->config->expects($this->once())->method('getSystemValueBool')
->with('gs.enabled', false)->willReturn(true);
@@ -53,7 +53,7 @@ class ConfigTest extends TestCase {
* @param string $gsFederation
* @param bool $expected
*/
- public function testOnlyInternalFederation($gsEnabled, $gsFederation, $expected) {
+ public function testOnlyInternalFederation($gsEnabled, $gsFederation, $expected): void {
$gsConfig = $this->getInstance(['isGlobalScaleEnabled']);
$gsConfig->expects($this->any())->method('isGlobalScaleEnabled')->willReturn($gsEnabled);
diff --git a/tests/lib/Group/Backend.php b/tests/lib/Group/Backend.php
index 7eb71d0f22c..1b6bfe840f8 100644
--- a/tests/lib/Group/Backend.php
+++ b/tests/lib/Group/Backend.php
@@ -42,7 +42,7 @@ abstract class Backend extends \Test\TestCase {
return $this->getUniqueID('test_');
}
- public function testAddRemove() {
+ public function testAddRemove(): void {
//get the number of groups we start with, in case there are exising groups
$startCount = count($this->backend->getGroups());
@@ -66,7 +66,7 @@ abstract class Backend extends \Test\TestCase {
$this->assertFalse((array_search($name2, $this->backend->getGroups()) !== false));
}
- public function testUser() {
+ public function testUser(): void {
$group1 = $this->getGroupName();
$group2 = $this->getGroupName();
$this->backend->createGroup($group1);
@@ -101,7 +101,7 @@ abstract class Backend extends \Test\TestCase {
$this->assertFalse($this->backend->inGroup($user1, $group1));
}
- public function testSearchGroups() {
+ public function testSearchGroups(): void {
$name1 = $this->getGroupName('foobarbaz');
$name2 = $this->getGroupName('bazbarfoo');
$name3 = $this->getGroupName('notme');
@@ -114,7 +114,7 @@ abstract class Backend extends \Test\TestCase {
$this->assertSame(2, count($result));
}
- public function testSearchUsers() {
+ public function testSearchUsers(): void {
$group = $this->getGroupName();
$this->backend->createGroup($group);
@@ -133,7 +133,7 @@ abstract class Backend extends \Test\TestCase {
$this->assertSame(2, $result);
}
- public function testAddDouble() {
+ public function testAddDouble(): void {
$group = $this->getGroupName();
$this->backend->createGroup($group);
diff --git a/tests/lib/Group/GroupTest.php b/tests/lib/Group/GroupTest.php
index 9ca178d4a41..0730f827c64 100644
--- a/tests/lib/Group/GroupTest.php
+++ b/tests/lib/Group/GroupTest.php
@@ -60,7 +60,7 @@ class GroupTest extends \Test\TestCase {
return $userManager;
}
- public function testGetUsersSingleBackend() {
+ public function testGetUsersSingleBackend(): void {
$backend = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -81,7 +81,7 @@ class GroupTest extends \Test\TestCase {
$this->assertEquals('user2', $user2->getUID());
}
- public function testGetUsersMultipleBackends() {
+ public function testGetUsersMultipleBackends(): void {
$backend1 = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -112,7 +112,7 @@ class GroupTest extends \Test\TestCase {
$this->assertEquals('user3', $user3->getUID());
}
- public function testInGroupSingleBackend() {
+ public function testInGroupSingleBackend(): void {
$backend = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -130,7 +130,7 @@ class GroupTest extends \Test\TestCase {
$this->assertTrue($group->inGroup($this->newUser('user1', $userBackend)));
}
- public function testInGroupMultipleBackends() {
+ public function testInGroupMultipleBackends(): void {
$backend1 = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -156,7 +156,7 @@ class GroupTest extends \Test\TestCase {
$this->assertTrue($group->inGroup($this->newUser('user1', $userBackend)));
}
- public function testAddUser() {
+ public function testAddUser(): void {
$backend = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -181,7 +181,7 @@ class GroupTest extends \Test\TestCase {
$group->addUser($this->newUser('user1', $userBackend));
}
- public function testAddUserAlreadyInGroup() {
+ public function testAddUserAlreadyInGroup(): void {
$backend = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -205,7 +205,7 @@ class GroupTest extends \Test\TestCase {
$group->addUser($this->newUser('user1', $userBackend));
}
- public function testRemoveUser() {
+ public function testRemoveUser(): void {
$backend = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -230,7 +230,7 @@ class GroupTest extends \Test\TestCase {
$group->removeUser($this->newUser('user1', $userBackend));
}
- public function testRemoveUserNotInGroup() {
+ public function testRemoveUserNotInGroup(): void {
$backend = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -254,7 +254,7 @@ class GroupTest extends \Test\TestCase {
$group->removeUser($this->newUser('user1', $userBackend));
}
- public function testRemoveUserMultipleBackends() {
+ public function testRemoveUserMultipleBackends(): void {
$backend1 = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -294,7 +294,7 @@ class GroupTest extends \Test\TestCase {
$group->removeUser($this->newUser('user1', $userBackend));
}
- public function testSearchUsers() {
+ public function testSearchUsers(): void {
$backend = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -313,7 +313,7 @@ class GroupTest extends \Test\TestCase {
$this->assertEquals('user2', $user2->getUID());
}
- public function testSearchUsersMultipleBackends() {
+ public function testSearchUsersMultipleBackends(): void {
$backend1 = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -339,7 +339,7 @@ class GroupTest extends \Test\TestCase {
$this->assertEquals('user2', $user2->getUID());
}
- public function testSearchUsersLimitAndOffset() {
+ public function testSearchUsersLimitAndOffset(): void {
$backend = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -358,7 +358,7 @@ class GroupTest extends \Test\TestCase {
$this->assertEquals('user2', $user2->getUID());
}
- public function testSearchUsersMultipleBackendsLimitAndOffset() {
+ public function testSearchUsersMultipleBackendsLimitAndOffset(): void {
$backend1 = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -386,7 +386,7 @@ class GroupTest extends \Test\TestCase {
$this->assertEquals('user1', $user1->getUID());
}
- public function testCountUsers() {
+ public function testCountUsers(): void {
$backend1 = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -407,7 +407,7 @@ class GroupTest extends \Test\TestCase {
$this->assertSame(3, $users);
}
- public function testCountUsersMultipleBackends() {
+ public function testCountUsersMultipleBackends(): void {
$backend1 = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -438,7 +438,7 @@ class GroupTest extends \Test\TestCase {
$this->assertSame(7, $users);
}
- public function testCountUsersNoMethod() {
+ public function testCountUsersNoMethod(): void {
$backend1 = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
@@ -456,7 +456,7 @@ class GroupTest extends \Test\TestCase {
$this->assertSame(false, $users);
}
- public function testDelete() {
+ public function testDelete(): void {
$backend = $this->getMockBuilder('OC\Group\Database')
->disableOriginalConstructor()
->getMock();
diff --git a/tests/lib/Group/ManagerTest.php b/tests/lib/Group/ManagerTest.php
index d652d5ec96c..0f8d7a5ecc3 100644
--- a/tests/lib/Group/ManagerTest.php
+++ b/tests/lib/Group/ManagerTest.php
@@ -99,7 +99,7 @@ class ManagerTest extends TestCase {
return $backend;
}
- public function testGet() {
+ public function testGet(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -117,13 +117,13 @@ class ManagerTest extends TestCase {
$this->assertEquals('group1', $group->getGID());
}
- public function testGetNoBackend() {
+ public function testGetNoBackend(): void {
$manager = new \OC\Group\Manager($this->userManager, $this->dispatcher, $this->logger, $this->cache, $this->remoteIpAddress);
$this->assertNull($manager->get('group1'));
}
- public function testGetNotExists() {
+ public function testGetNotExists(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -139,7 +139,7 @@ class ManagerTest extends TestCase {
$this->assertNull($manager->get('group1'));
}
- public function testGetDeleted() {
+ public function testGetDeleted(): void {
$backend = new \Test\Util\Group\Dummy();
$backend->createGroup('group1');
@@ -151,7 +151,7 @@ class ManagerTest extends TestCase {
$this->assertNull($manager->get('group1'));
}
- public function testGetMultipleBackends() {
+ public function testGetMultipleBackends(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend1
*/
@@ -179,7 +179,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('group1', $group->getGID());
}
- public function testCreate() {
+ public function testCreate(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Group\Backend $backend */
$backendGroupCreated = false;
$backend = $this->getTestBackend();
@@ -203,7 +203,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('group1', $group->getGID());
}
- public function testCreateFailure() {
+ public function testCreateFailure(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Group\Backend $backend */
$backendGroupCreated = false;
$backend = $this->getTestBackend(
@@ -232,7 +232,7 @@ class ManagerTest extends TestCase {
$this->assertEquals(null, $group);
}
- public function testCreateTooLong() {
+ public function testCreateTooLong(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Group\Backend $backend */
$backendGroupCreated = false;
$backend = $this->getTestBackend(
@@ -256,7 +256,7 @@ class ManagerTest extends TestCase {
$group = $manager->createGroup($groupName);
}
- public function testCreateExists() {
+ public function testCreateExists(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Group\Backend $backend */
$backend = $this->getTestBackend();
$backend->expects($this->any())
@@ -273,7 +273,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('group1', $group->getGID());
}
- public function testSearch() {
+ public function testSearch(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -296,7 +296,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('group1', $group1->getGID());
}
- public function testSearchMultipleBackends() {
+ public function testSearchMultipleBackends(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend1
*/
@@ -333,7 +333,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('group12', $group12->getGID());
}
- public function testSearchMultipleBackendsLimitAndOffset() {
+ public function testSearchMultipleBackendsLimitAndOffset(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend1
*/
@@ -370,7 +370,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('group12', $group12->getGID());
}
- public function testSearchResultExistsButGroupDoesNot() {
+ public function testSearchResultExistsButGroupDoesNot(): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|\OC\Group\Backend $backend */
$backend = $this->createMock(Database::class);
$backend->expects($this->once())
@@ -394,7 +394,7 @@ class ManagerTest extends TestCase {
$this->assertEmpty($groups);
}
- public function testGetUserGroups() {
+ public function testGetUserGroups(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -417,7 +417,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('group1', $group1->getGID());
}
- public function testGetUserGroupIds() {
+ public function testGetUserGroupIds(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -442,7 +442,7 @@ class ManagerTest extends TestCase {
}
}
- public function testGetUserGroupsWithDeletedGroup() {
+ public function testGetUserGroupsWithDeletedGroup(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -469,7 +469,7 @@ class ManagerTest extends TestCase {
$this->assertEmpty($groups);
}
- public function testInGroup() {
+ public function testInGroup(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -488,7 +488,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($manager->isInGroup('user1', 'group1'));
}
- public function testIsAdmin() {
+ public function testIsAdmin(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -507,7 +507,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($manager->isAdmin('user1'));
}
- public function testNotAdmin() {
+ public function testNotAdmin(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -526,7 +526,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($manager->isAdmin('user1'));
}
- public function testGetUserGroupsMultipleBackends() {
+ public function testGetUserGroupsMultipleBackends(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend1
*/
@@ -563,7 +563,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('group2', $group2->getGID());
}
- public function testDisplayNamesInGroupWithOneUserBackend() {
+ public function testDisplayNamesInGroupWithOneUserBackend(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -621,7 +621,7 @@ class ManagerTest extends TestCase {
$this->assertTrue(isset($users['user33']));
}
- public function testDisplayNamesInGroupWithOneUserBackendWithLimitSpecified() {
+ public function testDisplayNamesInGroupWithOneUserBackendWithLimitSpecified(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -682,7 +682,7 @@ class ManagerTest extends TestCase {
$this->assertFalse(isset($users['user333']));
}
- public function testDisplayNamesInGroupWithOneUserBackendWithLimitAndOffsetSpecified() {
+ public function testDisplayNamesInGroupWithOneUserBackendWithLimitAndOffsetSpecified(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -746,7 +746,7 @@ class ManagerTest extends TestCase {
$this->assertTrue(isset($users['user333']));
}
- public function testDisplayNamesInGroupWithOneUserBackendAndSearchEmpty() {
+ public function testDisplayNamesInGroupWithOneUserBackendAndSearchEmpty(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject|\OC\Group\Backend $backend
*/
@@ -774,7 +774,7 @@ class ManagerTest extends TestCase {
$this->assertTrue(isset($users['user33']));
}
- public function testDisplayNamesInGroupWithOneUserBackendAndSearchEmptyAndLimitSpecified() {
+ public function testDisplayNamesInGroupWithOneUserBackendAndSearchEmptyAndLimitSpecified(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -802,7 +802,7 @@ class ManagerTest extends TestCase {
$this->assertFalse(isset($users['user33']));
}
- public function testDisplayNamesInGroupWithOneUserBackendAndSearchEmptyAndLimitAndOffsetSpecified() {
+ public function testDisplayNamesInGroupWithOneUserBackendAndSearchEmptyAndLimitAndOffsetSpecified(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -830,7 +830,7 @@ class ManagerTest extends TestCase {
$this->assertTrue(isset($users['user33']));
}
- public function testGetUserGroupsWithAddUser() {
+ public function testGetUserGroupsWithAddUser(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -867,7 +867,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('group1', $group1->getGID());
}
- public function testGetUserGroupsWithRemoveUser() {
+ public function testGetUserGroupsWithRemoveUser(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -910,7 +910,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($expectedGroups, $groups);
}
- public function testGetUserIdGroups() {
+ public function testGetUserIdGroups(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
@@ -927,7 +927,7 @@ class ManagerTest extends TestCase {
$this->assertEquals([], $groups);
}
- public function testGroupDisplayName() {
+ public function testGroupDisplayName(): void {
/**
* @var \PHPUnit\Framework\MockObject\MockObject | \OC\Group\Backend $backend
*/
diff --git a/tests/lib/Group/MetaDataTest.php b/tests/lib/Group/MetaDataTest.php
index 0c9029aaf56..70f2022ae78 100644
--- a/tests/lib/Group/MetaDataTest.php
+++ b/tests/lib/Group/MetaDataTest.php
@@ -59,7 +59,7 @@ class MetaDataTest extends \Test\TestCase {
}
- public function testGet() {
+ public function testGet(): void {
$group = $this->getGroupMock();
$groups = array_fill(0, 3, $group);
@@ -78,7 +78,7 @@ class MetaDataTest extends \Test\TestCase {
$this->assertSame(0, $ordinaryGroups[0]['usercount']);
}
- public function testGetWithSorting() {
+ public function testGetWithSorting(): void {
$this->groupMetadata->setSorting(1);
$group = $this->getGroupMock(3);
$groups = array_fill(0, 3, $group);
@@ -97,7 +97,7 @@ class MetaDataTest extends \Test\TestCase {
$this->assertSame(5, $ordinaryGroups[0]['usercount']);
}
- public function testGetWithCache() {
+ public function testGetWithCache(): void {
$group = $this->getGroupMock();
$groups = array_fill(0, 3, $group);
@@ -115,7 +115,7 @@ class MetaDataTest extends \Test\TestCase {
//get() does not need to be tested with search parameters, because they are
//solely and only passed to GroupManager and Group.
- public function testGetGroupsAsAdmin() {
+ public function testGetGroupsAsAdmin(): void {
$this->groupManager
->expects($this->once())
->method('search')
diff --git a/tests/lib/HelperStorageTest.php b/tests/lib/HelperStorageTest.php
index ddf32d94724..4d5002de3ab 100644
--- a/tests/lib/HelperStorageTest.php
+++ b/tests/lib/HelperStorageTest.php
@@ -84,7 +84,7 @@ class HelperStorageTest extends \Test\TestCase {
/**
* Test getting the storage info
*/
- public function testGetStorageInfo() {
+ public function testGetStorageInfo(): void {
$homeStorage = $this->getStorageMock(12);
\OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$homeStorage->file_put_contents('test.txt', '01234');
@@ -111,7 +111,7 @@ class HelperStorageTest extends \Test\TestCase {
/**
* Test getting the storage info, ignoring extra mount points
*/
- public function testGetStorageInfoExcludingExtStorage() {
+ public function testGetStorageInfoExcludingExtStorage(): void {
$homeStorage = $this->getStorageMock(12);
\OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$homeStorage->file_put_contents('test.txt', '01234');
@@ -133,7 +133,7 @@ class HelperStorageTest extends \Test\TestCase {
/**
* Test getting the storage info, including extra mount points
*/
- public function testGetStorageInfoIncludingExtStorage() {
+ public function testGetStorageInfoIncludingExtStorage(): void {
$homeStorage = new \OC\Files\Storage\Temporary([]);
\OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$homeStorage->file_put_contents('test.txt', '01234');
@@ -162,7 +162,7 @@ class HelperStorageTest extends \Test\TestCase {
* when user has no quota set, even when quota ext storage option
* was set
*/
- public function testGetStorageInfoIncludingExtStorageWithNoUserQuota() {
+ public function testGetStorageInfoIncludingExtStorageWithNoUserQuota(): void {
$homeStorage = $this->getStorageMock(12);
\OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$homeStorage->file_put_contents('test.txt', '01234');
@@ -186,7 +186,7 @@ class HelperStorageTest extends \Test\TestCase {
/**
* Test getting the storage info with quota enabled
*/
- public function testGetStorageInfoWithQuota() {
+ public function testGetStorageInfoWithQuota(): void {
$homeStorage = $this->getStorageMock(12);
$homeStorage->file_put_contents('test.txt', '01234');
$homeStorage = new \OC\Files\Storage\Wrapper\Quota(
@@ -206,7 +206,7 @@ class HelperStorageTest extends \Test\TestCase {
/**
* Test getting the storage info when data exceeds quota
*/
- public function testGetStorageInfoWhenSizeExceedsQuota() {
+ public function testGetStorageInfoWhenSizeExceedsQuota(): void {
$homeStorage = $this->getStorageMock(12);
$homeStorage->file_put_contents('test.txt', '0123456789');
$homeStorage = new \OC\Files\Storage\Wrapper\Quota(
@@ -228,7 +228,7 @@ class HelperStorageTest extends \Test\TestCase {
* Test getting the storage info when the remaining
* free storage space is less than the quota
*/
- public function testGetStorageInfoWhenFreeSpaceLessThanQuota() {
+ public function testGetStorageInfoWhenFreeSpaceLessThanQuota(): void {
$homeStorage = $this->getStorageMock(12);
$homeStorage->file_put_contents('test.txt', '01234');
$homeStorage = new \OC\Files\Storage\Wrapper\Quota(
diff --git a/tests/lib/Hooks/BasicEmitterTest.php b/tests/lib/Hooks/BasicEmitterTest.php
index 82e5a64ecae..98f746d38ae 100644
--- a/tests/lib/Hooks/BasicEmitterTest.php
+++ b/tests/lib/Hooks/BasicEmitterTest.php
@@ -50,7 +50,7 @@ class BasicEmitterTest extends \Test\TestCase {
}
- public function testAnonymousFunction() {
+ public function testAnonymousFunction(): void {
$this->expectException(\Test\Hooks\EmittedException::class);
$this->emitter->listen('Test', 'test', function () {
@@ -60,7 +60,7 @@ class BasicEmitterTest extends \Test\TestCase {
}
- public function testStaticCallback() {
+ public function testStaticCallback(): void {
$this->expectException(\Test\Hooks\EmittedException::class);
$this->emitter->listen('Test', 'test', ['\Test\Hooks\BasicEmitterTest', 'staticCallBack']);
@@ -68,14 +68,14 @@ class BasicEmitterTest extends \Test\TestCase {
}
- public function testNonStaticCallback() {
+ public function testNonStaticCallback(): void {
$this->expectException(\Test\Hooks\EmittedException::class);
$this->emitter->listen('Test', 'test', [$this, 'nonStaticCallBack']);
$this->emitter->emitEvent('Test', 'test');
}
- public function testOnlyCallOnce() {
+ public function testOnlyCallOnce(): void {
$count = 0;
$listener = function () use (&$count) {
$count++;
@@ -86,7 +86,7 @@ class BasicEmitterTest extends \Test\TestCase {
$this->assertEquals(1, $count, 'Listener called an invalid number of times (' . $count . ') expected 1');
}
- public function testDifferentMethods() {
+ public function testDifferentMethods(): void {
$count = 0;
$listener = function () use (&$count) {
$count++;
@@ -98,7 +98,7 @@ class BasicEmitterTest extends \Test\TestCase {
$this->assertEquals(2, $count, 'Listener called an invalid number of times (' . $count . ') expected 2');
}
- public function testDifferentScopes() {
+ public function testDifferentScopes(): void {
$count = 0;
$listener = function () use (&$count) {
$count++;
@@ -110,7 +110,7 @@ class BasicEmitterTest extends \Test\TestCase {
$this->assertEquals(2, $count, 'Listener called an invalid number of times (' . $count . ') expected 2');
}
- public function testDifferentCallbacks() {
+ public function testDifferentCallbacks(): void {
$count = 0;
$listener1 = function () use (&$count) {
$count++;
@@ -125,7 +125,7 @@ class BasicEmitterTest extends \Test\TestCase {
}
- public function testArguments() {
+ public function testArguments(): void {
$this->expectException(\Test\Hooks\EmittedException::class);
$this->emitter->listen('Test', 'test', function ($foo, $bar) {
@@ -137,7 +137,7 @@ class BasicEmitterTest extends \Test\TestCase {
}
- public function testNamedArguments() {
+ public function testNamedArguments(): void {
$this->expectException(\Test\Hooks\EmittedException::class);
$this->emitter->listen('Test', 'test', function ($foo, $bar) {
@@ -148,7 +148,7 @@ class BasicEmitterTest extends \Test\TestCase {
$this->emitter->emitEvent('Test', 'test', ['foo' => 'foo', 'bar' => 'bar']);
}
- public function testRemoveAllSpecified() {
+ public function testRemoveAllSpecified(): void {
$listener = function () {
throw new EmittedException;
};
@@ -159,7 +159,7 @@ class BasicEmitterTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testRemoveWildcardListener() {
+ public function testRemoveWildcardListener(): void {
$listener1 = function () {
throw new EmittedException;
};
@@ -174,7 +174,7 @@ class BasicEmitterTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testRemoveWildcardMethod() {
+ public function testRemoveWildcardMethod(): void {
$listener = function () {
throw new EmittedException;
};
@@ -187,7 +187,7 @@ class BasicEmitterTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testRemoveWildcardScope() {
+ public function testRemoveWildcardScope(): void {
$listener = function () {
throw new EmittedException;
};
@@ -200,7 +200,7 @@ class BasicEmitterTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testRemoveWildcardScopeAndMethod() {
+ public function testRemoveWildcardScopeAndMethod(): void {
$listener = function () {
throw new EmittedException;
};
@@ -216,7 +216,7 @@ class BasicEmitterTest extends \Test\TestCase {
}
- public function testRemoveKeepOtherCallback() {
+ public function testRemoveKeepOtherCallback(): void {
$this->expectException(\Test\Hooks\EmittedException::class);
$listener1 = function () {
@@ -234,7 +234,7 @@ class BasicEmitterTest extends \Test\TestCase {
}
- public function testRemoveKeepOtherMethod() {
+ public function testRemoveKeepOtherMethod(): void {
$this->expectException(\Test\Hooks\EmittedException::class);
$listener = function () {
@@ -249,7 +249,7 @@ class BasicEmitterTest extends \Test\TestCase {
}
- public function testRemoveKeepOtherScope() {
+ public function testRemoveKeepOtherScope(): void {
$this->expectException(\Test\Hooks\EmittedException::class);
$listener = function () {
@@ -264,7 +264,7 @@ class BasicEmitterTest extends \Test\TestCase {
}
- public function testRemoveNonExistingName() {
+ public function testRemoveNonExistingName(): void {
$this->expectException(\Test\Hooks\EmittedException::class);
$listener = function () {
diff --git a/tests/lib/Http/Client/DnsPinMiddlewareTest.php b/tests/lib/Http/Client/DnsPinMiddlewareTest.php
index d265ce3e71c..9d71af15c5d 100644
--- a/tests/lib/Http/Client/DnsPinMiddlewareTest.php
+++ b/tests/lib/Http/Client/DnsPinMiddlewareTest.php
@@ -42,7 +42,7 @@ class DnsPinMiddlewareTest extends TestCase {
->getMock();
}
- public function testPopulateDnsCacheIPv4() {
+ public function testPopulateDnsCacheIPv4(): void {
$mockHandler = new MockHandler([
static function (RequestInterface $request, array $options) {
self::arrayHasKey('curl', $options);
@@ -135,7 +135,7 @@ class DnsPinMiddlewareTest extends TestCase {
);
}
- public function testPopulateDnsCacheIPv6() {
+ public function testPopulateDnsCacheIPv6(): void {
$mockHandler = new MockHandler([
static function (RequestInterface $request, array $options) {
self::arrayHasKey('curl', $options);
@@ -250,7 +250,7 @@ class DnsPinMiddlewareTest extends TestCase {
);
}
- public function testAllowLocalAddress() {
+ public function testAllowLocalAddress(): void {
$mockHandler = new MockHandler([
static function (RequestInterface $request, array $options) {
self::assertArrayNotHasKey('curl', $options);
@@ -268,7 +268,7 @@ class DnsPinMiddlewareTest extends TestCase {
);
}
- public function testRejectIPv4() {
+ public function testRejectIPv4(): void {
$this->expectException(LocalServerException::class);
$this->expectExceptionMessage('violates local access rules');
@@ -315,7 +315,7 @@ class DnsPinMiddlewareTest extends TestCase {
);
}
- public function testRejectIPv6() {
+ public function testRejectIPv6(): void {
$this->expectException(LocalServerException::class);
$this->expectExceptionMessage('violates local access rules');
@@ -362,7 +362,7 @@ class DnsPinMiddlewareTest extends TestCase {
);
}
- public function testRejectCanonicalName() {
+ public function testRejectCanonicalName(): void {
$this->expectException(LocalServerException::class);
$this->expectExceptionMessage('violates local access rules');
@@ -452,7 +452,7 @@ class DnsPinMiddlewareTest extends TestCase {
);
}
- public function testRejectFaultyResponse() {
+ public function testRejectFaultyResponse(): void {
$this->expectException(LocalServerException::class);
$this->expectExceptionMessage('No DNS record found for www.example.com');
@@ -478,7 +478,7 @@ class DnsPinMiddlewareTest extends TestCase {
);
}
- public function testIgnoreSubdomainForSoaQuery() {
+ public function testIgnoreSubdomainForSoaQuery(): void {
$mockHandler = new MockHandler([
static function (RequestInterface $request, array $options) {
// The handler should not be called
diff --git a/tests/lib/Http/Client/NegativeDnsCacheTest.php b/tests/lib/Http/Client/NegativeDnsCacheTest.php
index bcde25ddf85..ba91e95a906 100644
--- a/tests/lib/Http/Client/NegativeDnsCacheTest.php
+++ b/tests/lib/Http/Client/NegativeDnsCacheTest.php
@@ -43,7 +43,7 @@ class NegativeDnsCacheTest extends \Test\TestCase {
$this->negativeDnsCache->setNegativeCacheForDnsType('www.example.com', DNS_A, 3600);
}
- public function testIsNegativeCached() {
+ public function testIsNegativeCached(): void {
$this->cache
->expects($this->once())
->method('hasKey')
diff --git a/tests/lib/Http/Client/ResponseTest.php b/tests/lib/Http/Client/ResponseTest.php
index c0d9770e2fb..291dc287148 100644
--- a/tests/lib/Http/Client/ResponseTest.php
+++ b/tests/lib/Http/Client/ResponseTest.php
@@ -23,22 +23,22 @@ class ResponseTest extends \Test\TestCase {
$this->guzzleResponse = new GuzzleResponse(418);
}
- public function testGetBody() {
+ public function testGetBody(): void {
$response = new Response($this->guzzleResponse->withBody(Utils::streamFor('MyResponse')));
$this->assertSame('MyResponse', $response->getBody());
}
- public function testGetStatusCode() {
+ public function testGetStatusCode(): void {
$response = new Response($this->guzzleResponse);
$this->assertSame(418, $response->getStatusCode());
}
- public function testGetHeader() {
+ public function testGetHeader(): void {
$response = new Response($this->guzzleResponse->withHeader('bar', 'foo'));
$this->assertSame('foo', $response->getHeader('bar'));
}
- public function testGetHeaders() {
+ public function testGetHeaders(): void {
$response = new Response($this->guzzleResponse
->withHeader('bar', 'foo')
->withHeader('x-awesome', 'yes')
diff --git a/tests/lib/ImageTest.php b/tests/lib/ImageTest.php
index 80cf22a9442..76b110df521 100644
--- a/tests/lib/ImageTest.php
+++ b/tests/lib/ImageTest.php
@@ -20,7 +20,7 @@ class ImageTest extends \Test\TestCase {
parent::tearDownAfterClass();
}
- public function testConstructDestruct() {
+ public function testConstructDestruct(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$this->assertInstanceOf('\OC\Image', $img);
@@ -47,7 +47,7 @@ class ImageTest extends \Test\TestCase {
unset($img);
}
- public function testValid() {
+ public function testValid(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$this->assertTrue($img->valid());
@@ -61,7 +61,7 @@ class ImageTest extends \Test\TestCase {
$this->assertFalse($img->valid());
}
- public function testMimeType() {
+ public function testMimeType(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$this->assertEquals('image/png', $img->mimeType());
@@ -78,7 +78,7 @@ class ImageTest extends \Test\TestCase {
$this->assertEquals('image/gif', $img->mimeType());
}
- public function testWidth() {
+ public function testWidth(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$this->assertEquals(128, $img->width());
@@ -95,7 +95,7 @@ class ImageTest extends \Test\TestCase {
$this->assertEquals(-1, $img->width());
}
- public function testHeight() {
+ public function testHeight(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$this->assertEquals(128, $img->height());
@@ -112,7 +112,7 @@ class ImageTest extends \Test\TestCase {
$this->assertEquals(-1, $img->height());
}
- public function testSave() {
+ public function testSave(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$img->resize(16);
@@ -126,7 +126,7 @@ class ImageTest extends \Test\TestCase {
$this->assertEquals(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage2.jpg'), $img->data());
}
- public function testData() {
+ public function testData(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$raw = imagecreatefromstring(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.png'));
@@ -166,7 +166,7 @@ class ImageTest extends \Test\TestCase {
$this->assertEquals($expected, $img->data());
}
- public function testDataNoResource() {
+ public function testDataNoResource(): void {
$img = new Image();
$this->assertNull($img->data());
}
@@ -174,7 +174,7 @@ class ImageTest extends \Test\TestCase {
/**
* @depends testData
*/
- public function testToString() {
+ public function testToString(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$expected = base64_encode($img->data());
@@ -191,7 +191,7 @@ class ImageTest extends \Test\TestCase {
$this->assertEquals($expected, (string)$img);
}
- public function testResize() {
+ public function testResize(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$this->assertTrue($img->resize(32));
@@ -211,7 +211,7 @@ class ImageTest extends \Test\TestCase {
$this->assertEquals(100, $img->height());
}
- public function testPreciseResize() {
+ public function testPreciseResize(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$this->assertTrue($img->preciseResize(128, 512));
@@ -231,7 +231,7 @@ class ImageTest extends \Test\TestCase {
$this->assertEquals(1337, $img->height());
}
- public function testCenterCrop() {
+ public function testCenterCrop(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$img->centerCrop();
@@ -251,7 +251,7 @@ class ImageTest extends \Test\TestCase {
$this->assertEquals(512, $img->height());
}
- public function testCrop() {
+ public function testCrop(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$this->assertTrue($img->crop(0, 0, 50, 20));
@@ -286,7 +286,7 @@ class ImageTest extends \Test\TestCase {
* @param int[] $asked
* @param int[] $expected
*/
- public function testFitIn($filename, $asked, $expected) {
+ public function testFitIn($filename, $asked, $expected): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT . '/tests/data/' . $filename);
$this->assertTrue($img->fitIn($asked[0], $asked[1]));
@@ -309,7 +309,7 @@ class ImageTest extends \Test\TestCase {
*
* @param string $filename
*/
- public function testScaleDownToFitWhenSmallerAlready($filename) {
+ public function testScaleDownToFitWhenSmallerAlready($filename): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/' . $filename);
$currentWidth = $img->width();
@@ -342,7 +342,7 @@ class ImageTest extends \Test\TestCase {
* @param int[] $asked
* @param int[] $expected
*/
- public function testScaleDownWhenBigger($filename, $asked, $expected) {
+ public function testScaleDownWhenBigger($filename, $asked, $expected): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/' . $filename);
//$this->assertTrue($img->scaleDownToFit($asked[0], $asked[1]));
@@ -362,7 +362,7 @@ class ImageTest extends \Test\TestCase {
/**
* @dataProvider convertDataProvider
*/
- public function testConvert($mimeType) {
+ public function testConvert($mimeType): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage.png');
$tempFile = tempnam(sys_get_temp_dir(), 'img-test');
@@ -371,13 +371,13 @@ class ImageTest extends \Test\TestCase {
$this->assertEquals($mimeType, image_type_to_mime_type(exif_imagetype($tempFile)));
}
- public function testMemoryLimitFromFile() {
+ public function testMemoryLimitFromFile(): void {
$img = new Image();
$img->loadFromFile(OC::$SERVERROOT.'/tests/data/testimage-badheader.jpg');
$this->assertFalse($img->valid());
}
- public function testMemoryLimitFromData() {
+ public function testMemoryLimitFromData(): void {
$data = file_get_contents(OC::$SERVERROOT.'/tests/data/testimage-badheader.jpg');
$img = new Image();
$img->loadFromData($data);
diff --git a/tests/lib/InfoXmlTest.php b/tests/lib/InfoXmlTest.php
index 1527e363bd7..461a2ecafa8 100644
--- a/tests/lib/InfoXmlTest.php
+++ b/tests/lib/InfoXmlTest.php
@@ -52,7 +52,7 @@ class InfoXmlTest extends TestCase {
*
* @param string $app
*/
- public function testClasses($app) {
+ public function testClasses($app): void {
$appInfo = $this->appManager->getAppInfo($app);
$appPath = $this->appManager->getAppPath($app);
\OC_App::registerAutoloading($app, $appPath);
diff --git a/tests/lib/InstallerTest.php b/tests/lib/InstallerTest.php
index 1fd48ea4fc9..d27ca6e2159 100644
--- a/tests/lib/InstallerTest.php
+++ b/tests/lib/InstallerTest.php
@@ -86,7 +86,7 @@ class InstallerTest extends TestCase {
parent::tearDown();
}
- public function testInstallApp() {
+ public function testInstallApp(): void {
// Read the current version of the app to check for bug #2572
\OCP\Server::get(IAppManager::class)->getAppVersion('testapp', true);
@@ -149,7 +149,7 @@ class InstallerTest extends TestCase {
* @param array $appArray
* @param string|bool $updateAvailable
*/
- public function testIsUpdateAvailable(array $appArray, $updateAvailable) {
+ public function testIsUpdateAvailable(array $appArray, $updateAvailable): void {
$this->appFetcher
->expects($this->once())
->method('get')
@@ -161,7 +161,7 @@ class InstallerTest extends TestCase {
}
- public function testDownloadAppWithRevokedCertificate() {
+ public function testDownloadAppWithRevokedCertificate(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Certificate "4112" has been revoked');
@@ -205,7 +205,7 @@ gLgK8d8sKL60JMmKHN3boHrsThKBVA==
}
- public function testDownloadAppWithNotNextcloudCertificate() {
+ public function testDownloadAppWithNotNextcloudCertificate(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('App with id news has a certificate not issued by a trusted Code Signing Authority');
@@ -248,7 +248,7 @@ YSu356M=
}
- public function testDownloadAppWithDifferentCN() {
+ public function testDownloadAppWithDifferentCN(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('App with id news has a cert issued to passman');
@@ -291,7 +291,7 @@ u/spPSSVhaun5BA1FlphB2TkgnzlCmxJa63nFY045e/Jq+IKMcqqZl/092gbI2EQ
}
- public function testDownloadAppWithInvalidSignature() {
+ public function testDownloadAppWithInvalidSignature(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('App with id passman has invalid signature');
@@ -359,7 +359,7 @@ u/spPSSVhaun5BA1FlphB2TkgnzlCmxJa63nFY045e/Jq+IKMcqqZl/092gbI2EQ
}
- public function testDownloadAppWithMoreThanOneFolderDownloaded() {
+ public function testDownloadAppWithMoreThanOneFolderDownloaded(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Extracted app testapp has more than 1 folder');
@@ -443,7 +443,7 @@ YwDVP+QmNRzx72jtqAN/Kc3CvQ9nkgYhU65B95aX0xA=',
}
- public function testDownloadAppWithMismatchingIdentifier() {
+ public function testDownloadAppWithMismatchingIdentifier(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('App for id testapp has a wrong app ID in info.xml: testapp1');
@@ -525,7 +525,7 @@ YwDVP+QmNRzx72jtqAN/Kc3CvQ9nkgYhU65B95aX0xA=',
$installer->downloadApp('testapp');
}
- public function testDownloadAppSuccessful() {
+ public function testDownloadAppSuccessful(): void {
$appArray = [
[
'id' => 'testapp',
@@ -608,7 +608,7 @@ MPLX6f5V9tCJtlH6ztmEcDROfvuVc0U3rEhqx2hphoyo+MZrPFpdcJL8KkIdMKbY
}
- public function testDownloadAppWithDowngrade() {
+ public function testDownloadAppWithDowngrade(): void {
// Use previous test to download the application in version 0.9
$this->testDownloadAppSuccessful();
diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php
index 05607f8113c..8d579cda529 100644
--- a/tests/lib/IntegrityCheck/CheckerTest.php
+++ b/tests/lib/IntegrityCheck/CheckerTest.php
@@ -74,7 +74,7 @@ class CheckerTest extends TestCase {
}
- public function testWriteAppSignatureOfNotExistingApp() {
+ public function testWriteAppSignatureOfNotExistingApp(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Exception message');
@@ -99,7 +99,7 @@ class CheckerTest extends TestCase {
}
- public function testWriteAppSignatureWrongPermissions() {
+ public function testWriteAppSignatureWrongPermissions(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessageMatches('/[a-zA-Z\\/_-]+ is not writable/');
@@ -117,7 +117,7 @@ class CheckerTest extends TestCase {
$this->checker->writeAppSignature(\OC::$SERVERROOT . '/tests/data/integritycheck/app/', $x509, $rsa);
}
- public function testWriteAppSignature() {
+ public function testWriteAppSignature(): void {
$expectedSignatureFileData = '{
"hashes": {
"AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112",
@@ -148,7 +148,7 @@ class CheckerTest extends TestCase {
$this->checker->writeAppSignature(\OC::$SERVERROOT . '/tests/data/integritycheck/app/', $x509, $rsa);
}
- public function testVerifyAppSignatureWithoutSignatureData() {
+ public function testVerifyAppSignatureWithoutSignatureData(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -168,7 +168,7 @@ class CheckerTest extends TestCase {
$this->assertSame($expected, $this->checker->verifyAppSignature('SomeApp'));
}
- public function testVerifyAppSignatureWithValidSignatureData() {
+ public function testVerifyAppSignatureWithValidSignatureData(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -207,7 +207,7 @@ class CheckerTest extends TestCase {
$this->assertSame([], $this->checker->verifyAppSignature('SomeApp'));
}
- public function testVerifyAppSignatureWithTamperedSignatureData() {
+ public function testVerifyAppSignatureWithTamperedSignatureData(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -252,7 +252,7 @@ class CheckerTest extends TestCase {
$this->assertEquals($expected, $this->checker->verifyAppSignature('SomeApp'));
}
- public function testVerifyAppSignatureWithTamperedFiles() {
+ public function testVerifyAppSignatureWithTamperedFiles(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -313,7 +313,7 @@ class CheckerTest extends TestCase {
$this->assertSame($expected, $this->checker->verifyAppSignature('SomeApp'));
}
- public function testVerifyAppSignatureWithTamperedFilesAndAlternatePath() {
+ public function testVerifyAppSignatureWithTamperedFilesAndAlternatePath(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -373,7 +373,7 @@ class CheckerTest extends TestCase {
$this->assertSame($expected, $this->checker->verifyAppSignature('SomeApp', \OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData/'));
}
- public function testVerifyAppWithDifferentScope() {
+ public function testVerifyAppWithDifferentScope(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -417,7 +417,7 @@ class CheckerTest extends TestCase {
$this->assertSame($expected, $this->checker->verifyAppSignature('SomeApp'));
}
- public function testVerifyAppWithDifferentScopeAndAlwaysTrustedCore() {
+ public function testVerifyAppWithDifferentScopeAndAlwaysTrustedCore(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -456,7 +456,7 @@ class CheckerTest extends TestCase {
}
- public function testWriteCoreSignatureWithException() {
+ public function testWriteCoreSignatureWithException(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Exception message');
@@ -480,7 +480,7 @@ class CheckerTest extends TestCase {
}
- public function testWriteCoreSignatureWrongPermissions() {
+ public function testWriteCoreSignatureWrongPermissions(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessageMatches('/[a-zA-Z\\/_-]+ is not writable/');
@@ -503,7 +503,7 @@ class CheckerTest extends TestCase {
$this->checker->writeCoreSignature($x509, $rsa, __DIR__);
}
- public function testWriteCoreSignature() {
+ public function testWriteCoreSignature(): void {
$expectedSignatureFileData = '{
"hashes": {
"AnotherFile.txt": "1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112",
@@ -538,7 +538,7 @@ class CheckerTest extends TestCase {
$this->checker->writeCoreSignature($x509, $rsa, \OC::$SERVERROOT . '/tests/data/integritycheck/app/');
}
- public function testWriteCoreSignatureWithUnmodifiedHtaccess() {
+ public function testWriteCoreSignatureWithUnmodifiedHtaccess(): void {
$expectedSignatureFileData = '{
"hashes": {
".htaccess": "dc479770a6232061e04a768ee1f9133fdb3aea7b3a99f7105b0e0b6197474733e8d14b5b2bbad054e6b62a410fe5d0b3d790242dee1e0f11274af2100f5289e2",
@@ -573,7 +573,7 @@ class CheckerTest extends TestCase {
$this->checker->writeCoreSignature($x509, $rsa, \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessUnmodified/');
}
- public function testWriteCoreSignatureWithInvalidModifiedHtaccess() {
+ public function testWriteCoreSignatureWithInvalidModifiedHtaccess(): void {
$expectedSignatureFileData = '{
"hashes": {
".htaccess": "4a54273dc8d697b2ca615acf2ae2c1ee3c1c643492cb04f42b10984fa9aacff1420dc829fd82f93ad3476fbd0cdab0251142c887dc8f872d03e39a3a3eb6d381"
@@ -603,7 +603,7 @@ class CheckerTest extends TestCase {
$this->checker->writeCoreSignature($x509, $rsa, \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithInvalidModifiedContent/');
}
- public function testWriteCoreSignatureWithValidModifiedHtaccess() {
+ public function testWriteCoreSignatureWithValidModifiedHtaccess(): void {
$expectedSignatureFileData = '{
"hashes": {
".htaccess": "7e6a7a4d8ee4f3fbc45dd579407c643471575a9d127d1c75f6d0a49e80766c3c587104b2139ef76d2a4bffce3f45777900605aaa49519c9532909b71e5030227",
@@ -638,7 +638,7 @@ class CheckerTest extends TestCase {
$this->checker->writeCoreSignature($x509, $rsa, \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent');
}
- public function testVerifyCoreSignatureWithoutSignatureData() {
+ public function testVerifyCoreSignatureWithoutSignatureData(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -658,7 +658,7 @@ class CheckerTest extends TestCase {
$this->assertSame($expected, $this->checker->verifyCoreSignature());
}
- public function testVerifyCoreSignatureWithValidSignatureData() {
+ public function testVerifyCoreSignatureWithValidSignatureData(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -695,7 +695,7 @@ class CheckerTest extends TestCase {
$this->assertSame([], $this->checker->verifyCoreSignature());
}
- public function testVerifyCoreSignatureWithValidModifiedHtaccessSignatureData() {
+ public function testVerifyCoreSignatureWithValidModifiedHtaccessSignatureData(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -736,7 +736,7 @@ class CheckerTest extends TestCase {
/**
* See inline instruction on how to update the test assets when changing mimetypealiases.dist.json
*/
- public function testVerifyCoreSignatureWithModifiedMimetypelistSignatureData() {
+ public function testVerifyCoreSignatureWithModifiedMimetypelistSignatureData(): void {
$shippedMimetypeAliases = (array)json_decode(file_get_contents(\OC::$SERVERROOT . '/resources/config/mimetypealiases.dist.json'));
$allAliases = array_merge($shippedMimetypeAliases, ['my-custom/mimetype' => 'custom']);
@@ -785,7 +785,7 @@ class CheckerTest extends TestCase {
$this->assertSame([], $this->checker->verifyCoreSignature());
}
- public function testVerifyCoreSignatureWithValidSignatureDataAndNotAlphabeticOrder() {
+ public function testVerifyCoreSignatureWithValidSignatureDataAndNotAlphabeticOrder(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -822,7 +822,7 @@ class CheckerTest extends TestCase {
$this->assertSame([], $this->checker->verifyCoreSignature());
}
- public function testVerifyCoreSignatureWithTamperedSignatureData() {
+ public function testVerifyCoreSignatureWithTamperedSignatureData(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -865,7 +865,7 @@ class CheckerTest extends TestCase {
$this->assertSame($expected, $this->checker->verifyCoreSignature());
}
- public function testVerifyCoreSignatureWithTamperedFiles() {
+ public function testVerifyCoreSignatureWithTamperedFiles(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -923,7 +923,7 @@ class CheckerTest extends TestCase {
$this->assertSame($expected, $this->checker->verifyCoreSignature());
}
- public function testVerifyCoreWithInvalidCertificate() {
+ public function testVerifyCoreWithInvalidCertificate(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -966,7 +966,7 @@ class CheckerTest extends TestCase {
$this->assertSame($expected, $this->checker->verifyCoreSignature());
}
- public function testVerifyCoreWithDifferentScope() {
+ public function testVerifyCoreWithDifferentScope(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -1009,7 +1009,7 @@ class CheckerTest extends TestCase {
$this->assertSame($expected, $this->checker->verifyCoreSignature());
}
- public function testRunInstanceVerification() {
+ public function testRunInstanceVerification(): void {
$this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker')
->setConstructorArgs([
$this->environmentHelper,
@@ -1089,7 +1089,7 @@ class CheckerTest extends TestCase {
$this->checker->runInstanceVerification();
}
- public function testVerifyAppSignatureWithoutSignatureDataAndCodeCheckerDisabled() {
+ public function testVerifyAppSignatureWithoutSignatureDataAndCodeCheckerDisabled(): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -1119,7 +1119,7 @@ class CheckerTest extends TestCase {
* @param bool $isCodeSigningEnforced
* @dataProvider channelDataProvider
*/
- public function testIsCodeCheckEnforced($channel, $isCodeSigningEnforced) {
+ public function testIsCodeCheckEnforced($channel, $isCodeSigningEnforced): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
@@ -1137,7 +1137,7 @@ class CheckerTest extends TestCase {
* @param string $channel
* @dataProvider channelDataProvider
*/
- public function testIsCodeCheckEnforcedWithDisabledConfigSwitch($channel) {
+ public function testIsCodeCheckEnforcedWithDisabledConfigSwitch($channel): void {
$this->environmentHelper
->expects($this->once())
->method('getChannel')
diff --git a/tests/lib/IntegrityCheck/Helpers/AppLocatorTest.php b/tests/lib/IntegrityCheck/Helpers/AppLocatorTest.php
index d99a42e0d63..6d3006bb3c4 100644
--- a/tests/lib/IntegrityCheck/Helpers/AppLocatorTest.php
+++ b/tests/lib/IntegrityCheck/Helpers/AppLocatorTest.php
@@ -19,12 +19,12 @@ class AppLocatorTest extends TestCase {
$this->locator = new AppLocator();
}
- public function testGetAppPath() {
+ public function testGetAppPath(): void {
$this->assertSame(\OC_App::getAppPath('files'), $this->locator->getAppPath('files'));
}
- public function testGetAppPathNotExistentApp() {
+ public function testGetAppPathNotExistentApp(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('App not found');
diff --git a/tests/lib/IntegrityCheck/Helpers/EnvironmentHelperTest.php b/tests/lib/IntegrityCheck/Helpers/EnvironmentHelperTest.php
index 001733309a3..b8280d9816a 100644
--- a/tests/lib/IntegrityCheck/Helpers/EnvironmentHelperTest.php
+++ b/tests/lib/IntegrityCheck/Helpers/EnvironmentHelperTest.php
@@ -19,11 +19,11 @@ class EnvironmentHelperTest extends TestCase {
parent::setUp();
}
- public function testGetServerRoot() {
+ public function testGetServerRoot(): void {
$this->assertSame(\OC::$SERVERROOT, $this->environmentHelper->getServerRoot());
}
- public function testGetChannel() {
+ public function testGetChannel(): void {
$this->assertSame(\OC_Util::getChannel(), $this->environmentHelper->getChannel());
}
}
diff --git a/tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php b/tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php
index ea90b611f5e..866850b7cff 100644
--- a/tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php
+++ b/tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php
@@ -19,7 +19,7 @@ class FileAccessHelperTest extends TestCase {
$this->fileAccessHelper = new FileAccessHelper();
}
- public function testReadAndWrite() {
+ public function testReadAndWrite(): void {
$tempManager = \OC::$server->getTempManager();
$filePath = $tempManager->getTemporaryFile();
$data = 'SomeDataGeneratedByIntegrityCheck';
@@ -29,27 +29,27 @@ class FileAccessHelperTest extends TestCase {
}
- public function testFile_put_contentsWithException() {
+ public function testFile_put_contentsWithException(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Failed to write into /anabsolutelynotexistingfolder/on/the/system.txt');
$this->fileAccessHelper->file_put_contents('/anabsolutelynotexistingfolder/on/the/system.txt', 'MyFiles');
}
- public function testIs_writable() {
+ public function testIs_writable(): void {
$this->assertFalse($this->fileAccessHelper->is_writable('/anabsolutelynotexistingfolder/on/the/system.txt'));
$this->assertTrue($this->fileAccessHelper->is_writable(\OC::$server->getTempManager()->getTemporaryFile('MyFile')));
}
- public function testAssertDirectoryExistsWithException() {
+ public function testAssertDirectoryExistsWithException(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Directory /anabsolutelynotexistingfolder/on/the/system does not exist.');
$this->fileAccessHelper->assertDirectoryExists('/anabsolutelynotexistingfolder/on/the/system');
}
- public function testAssertDirectoryExists() {
+ public function testAssertDirectoryExists(): void {
$this->fileAccessHelper->assertDirectoryExists(\OC::$server->getTempManager()->getTemporaryFolder('/testfolder/'));
$this->addToAssertionCount(1);
}
diff --git a/tests/lib/L10N/L10nTest.php b/tests/lib/L10N/L10nTest.php
index 92e40bf0e57..26f39e41c13 100644
--- a/tests/lib/L10N/L10nTest.php
+++ b/tests/lib/L10N/L10nTest.php
@@ -46,7 +46,7 @@ class L10nTest extends TestCase {
$this->assertEquals('Files:', $l->t('Files:'));
}
- public function testGermanPluralTranslations() {
+ public function testGermanPluralTranslations(): void {
$transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json';
$l = new L10N($this->getFactory(), 'test', 'de', 'de_AT', [$transFile]);
@@ -54,7 +54,7 @@ class L10nTest extends TestCase {
$this->assertEquals('2 Dateien', (string)$l->n('%n file', '%n files', 2));
}
- public function testRussianPluralTranslations() {
+ public function testRussianPluralTranslations(): void {
$transFile = \OC::$SERVERROOT.'/tests/data/l10n/ru.json';
$l = new L10N($this->getFactory(), 'test', 'ru', 'ru_UA', [$transFile]);
@@ -78,7 +78,7 @@ class L10nTest extends TestCase {
*/
}
- public function testCzechPluralTranslations() {
+ public function testCzechPluralTranslations(): void {
$transFile = \OC::$SERVERROOT.'/tests/data/l10n/cs.json';
$l = new L10N($this->getFactory(), 'test', 'cs', 'cs_CZ', [$transFile]);
@@ -87,7 +87,7 @@ class L10nTest extends TestCase {
$this->assertEquals('5 oken', (string)$l->n('%n window', '%n windows', 5));
}
- public function testGermanPluralWithCzechLocaleTranslations() {
+ public function testGermanPluralWithCzechLocaleTranslations(): void {
$transFile = \OC::$SERVERROOT.'/tests/data/l10n/de.json';
$l = new L10N($this->getFactory(), 'test', 'de', 'cs_CZ', [$transFile]);
@@ -156,7 +156,7 @@ class L10nTest extends TestCase {
/**
* @dataProvider localizationData
*/
- public function testNumericStringLocalization($expectedDate, $lang, $locale, $type, $value) {
+ public function testNumericStringLocalization($expectedDate, $lang, $locale, $type, $value): void {
$l = new L10N($this->getFactory(), 'test', $lang, $locale, []);
$this->assertSame($expectedDate, $l->l($type, $value));
}
@@ -174,7 +174,7 @@ class L10nTest extends TestCase {
* @param $lang
* @param $locale
*/
- public function testFirstWeekDay($expected, $lang, $locale) {
+ public function testFirstWeekDay($expected, $lang, $locale): void {
$l = new L10N($this->getFactory(), 'test', $lang, $locale, []);
$this->assertSame($expected, $l->l('firstday', 'firstday'));
}
@@ -192,22 +192,22 @@ class L10nTest extends TestCase {
* @param $lang
* @param $locale
*/
- public function testJSDate($expected, $lang, $locale) {
+ public function testJSDate($expected, $lang, $locale): void {
$l = new L10N($this->getFactory(), 'test', $lang, $locale, []);
$this->assertSame($expected, $l->l('jsdate', 'jsdate'));
}
- public function testFactoryGetLanguageCode() {
+ public function testFactoryGetLanguageCode(): void {
$l = $this->getFactory()->get('lib', 'de');
$this->assertEquals('de', $l->getLanguageCode());
}
- public function testServiceGetLanguageCode() {
+ public function testServiceGetLanguageCode(): void {
$l = \OCP\Util::getL10N('lib', 'de');
$this->assertEquals('de', $l->getLanguageCode());
}
- public function testWeekdayName() {
+ public function testWeekdayName(): void {
$l = \OCP\Util::getL10N('lib', 'de');
$this->assertEquals('Mo.', $l->l('weekdayName', new \DateTime('2017-11-6'), ['width' => 'abbreviated']));
}
@@ -217,7 +217,7 @@ class L10nTest extends TestCase {
* @param $locale
* @param $language
*/
- public function testFindLanguageFromLocale($locale, $language) {
+ public function testFindLanguageFromLocale($locale, $language): void {
$this->assertEquals(
$language,
\OC::$server->get(IFactory::class)->findLanguageFromLocale('lib', $locale)
diff --git a/tests/lib/L10N/LanguageIteratorTest.php b/tests/lib/L10N/LanguageIteratorTest.php
index 02c17a842d3..79998c36354 100644
--- a/tests/lib/L10N/LanguageIteratorTest.php
+++ b/tests/lib/L10N/LanguageIteratorTest.php
@@ -60,7 +60,7 @@ class LanguageIteratorTest extends TestCase {
/**
* @dataProvider languageSettingsProvider
*/
- public function testIterator($forcedLang, $userLang, $sysLang, $expectedValues) {
+ public function testIterator($forcedLang, $userLang, $sysLang, $expectedValues): void {
$this->config->expects($this->any())
->method('getSystemValue')
->willReturnMap([
diff --git a/tests/lib/LargeFileHelperGetFileSizeTest.php b/tests/lib/LargeFileHelperGetFileSizeTest.php
index b239c10e20a..247886fee6a 100644
--- a/tests/lib/LargeFileHelperGetFileSizeTest.php
+++ b/tests/lib/LargeFileHelperGetFileSizeTest.php
@@ -58,7 +58,7 @@ class LargeFileHelperGetFileSizeTest extends TestCase {
/**
* @dataProvider dataFileNameProvider
*/
- public function testGetFileSizeViaExec($filename, $fileSize) {
+ public function testGetFileSizeViaExec($filename, $fileSize): void {
if (escapeshellarg('strängé') !== '\'strängé\'') {
$this->markTestSkipped('Your escapeshell args removes accents');
}
@@ -76,7 +76,7 @@ class LargeFileHelperGetFileSizeTest extends TestCase {
/**
* @dataProvider dataFileNameProvider
*/
- public function testGetFileSizeNative($filename, $fileSize) {
+ public function testGetFileSizeNative($filename, $fileSize): void {
$this->assertSame(
$fileSize,
$this->helper->getFileSizeNative($filename)
diff --git a/tests/lib/LargeFileHelperTest.php b/tests/lib/LargeFileHelperTest.php
index 66c83f122af..2cccfa441ab 100644
--- a/tests/lib/LargeFileHelperTest.php
+++ b/tests/lib/LargeFileHelperTest.php
@@ -15,21 +15,21 @@ class LargeFileHelperTest extends TestCase {
$this->helper = new \OC\LargeFileHelper;
}
- public function testFormatUnsignedIntegerFloat() {
+ public function testFormatUnsignedIntegerFloat(): void {
$this->assertSame(
'9007199254740992',
$this->helper->formatUnsignedInteger((float)9007199254740992)
);
}
- public function testFormatUnsignedIntegerInt() {
+ public function testFormatUnsignedIntegerInt(): void {
$this->assertSame(
PHP_INT_SIZE === 4 ? '4294967295' : '18446744073709551615',
$this->helper->formatUnsignedInteger(-1)
);
}
- public function testFormatUnsignedIntegerString() {
+ public function testFormatUnsignedIntegerString(): void {
$this->assertSame(
'9007199254740993',
$this->helper->formatUnsignedInteger('9007199254740993')
@@ -37,7 +37,7 @@ class LargeFileHelperTest extends TestCase {
}
- public function testFormatUnsignedIntegerStringException() {
+ public function testFormatUnsignedIntegerStringException(): void {
$this->expectException(\UnexpectedValueException::class);
$this->helper->formatUnsignedInteger('900ABCD254740993');
diff --git a/tests/lib/LegacyHelperTest.php b/tests/lib/LegacyHelperTest.php
index 85960ef6f08..ea359d4e50c 100644
--- a/tests/lib/LegacyHelperTest.php
+++ b/tests/lib/LegacyHelperTest.php
@@ -26,7 +26,7 @@ class LegacyHelperTest extends \Test\TestCase {
/**
* @dataProvider humanFileSizeProvider
*/
- public function testHumanFileSize($expected, $input) {
+ public function testHumanFileSize($expected, $input): void {
$result = OC_Helper::humanFileSize($input);
$this->assertEquals($expected, $result);
}
@@ -46,7 +46,7 @@ class LegacyHelperTest extends \Test\TestCase {
/**
* @dataProvider providesComputerFileSize
*/
- public function testComputerFileSize($expected, $input) {
+ public function testComputerFileSize($expected, $input): void {
$result = OC_Helper::computerFileSize($input);
$this->assertEquals($expected, $result);
}
@@ -62,7 +62,7 @@ class LegacyHelperTest extends \Test\TestCase {
];
}
- public function testMb_array_change_key_case() {
+ public function testMb_array_change_key_case(): void {
$arrayStart = [
'Foo' => 'bar',
'Bar' => 'foo',
@@ -88,7 +88,7 @@ class LegacyHelperTest extends \Test\TestCase {
$this->assertEquals($result, $expected);
}
- public function testRecursiveArraySearch() {
+ public function testRecursiveArraySearch(): void {
$haystack = [
'Foo' => 'own',
'Bar' => 'Cloud',
@@ -102,7 +102,7 @@ class LegacyHelperTest extends \Test\TestCase {
$this->assertFalse($result);
}
- public function testBuildNotExistingFileNameForView() {
+ public function testBuildNotExistingFileNameForView(): void {
$viewMock = $this->createMock(View::class);
$this->assertEquals('/filename', OC_Helper::buildNotExistingFileNameForView('/', 'filename', $viewMock));
$this->assertEquals('dir/filename.ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename.ext', $viewMock));
@@ -205,7 +205,7 @@ class LegacyHelperTest extends \Test\TestCase {
/**
* @dataProvider streamCopyDataProvider
*/
- public function testStreamCopy($expectedCount, $expectedResult, $source, $target) {
+ public function testStreamCopy($expectedCount, $expectedResult, $source, $target): void {
if (is_string($source)) {
$source = fopen($source, 'r');
}
@@ -239,7 +239,7 @@ class LegacyHelperTest extends \Test\TestCase {
/**
* Tests recursive folder deletion with rmdirr()
*/
- public function testRecursiveFolderDeletion() {
+ public function testRecursiveFolderDeletion(): void {
$baseDir = \OC::$server->getTempManager()->getTemporaryFolder() . '/';
mkdir($baseDir . 'a/b/c/d/e', 0777, true);
mkdir($baseDir . 'a/b/c1/d/e', 0777, true);
diff --git a/tests/lib/Lock/DBLockingProviderTest.php b/tests/lib/Lock/DBLockingProviderTest.php
index 356b55f577e..1c02e8d7d77 100644
--- a/tests/lib/Lock/DBLockingProviderTest.php
+++ b/tests/lib/Lock/DBLockingProviderTest.php
@@ -59,7 +59,7 @@ class DBLockingProviderTest extends LockingProvider {
parent::tearDown();
}
- public function testCleanEmptyLocks() {
+ public function testCleanEmptyLocks(): void {
$this->currentTime = 100;
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
$this->instance->acquireLock('asd', ILockingProvider::LOCK_EXCLUSIVE);
@@ -96,7 +96,7 @@ class DBLockingProviderTest extends LockingProvider {
return $rows;
}
- public function testDoubleShared() {
+ public function testDoubleShared(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
diff --git a/tests/lib/Lock/LockingProvider.php b/tests/lib/Lock/LockingProvider.php
index 2aa3980542b..b7e301c55a6 100644
--- a/tests/lib/Lock/LockingProvider.php
+++ b/tests/lib/Lock/LockingProvider.php
@@ -27,19 +27,19 @@ abstract class LockingProvider extends TestCase {
$this->instance = $this->getInstance();
}
- public function testExclusiveLock() {
+ public function testExclusiveLock(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
}
- public function testSharedLock() {
+ public function testSharedLock(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
}
- public function testDoubleSharedLock() {
+ public function testDoubleSharedLock(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
@@ -47,7 +47,7 @@ abstract class LockingProvider extends TestCase {
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
}
- public function testReleaseSharedLock() {
+ public function testReleaseSharedLock(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
@@ -60,7 +60,7 @@ abstract class LockingProvider extends TestCase {
}
- public function testDoubleExclusiveLock() {
+ public function testDoubleExclusiveLock(): void {
$this->expectException(\OCP\Lock\LockedException::class);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
@@ -68,7 +68,7 @@ abstract class LockingProvider extends TestCase {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
}
- public function testReleaseExclusiveLock() {
+ public function testReleaseExclusiveLock(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
$this->instance->releaseLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
@@ -77,7 +77,7 @@ abstract class LockingProvider extends TestCase {
}
- public function testExclusiveLockAfterShared() {
+ public function testExclusiveLockAfterShared(): void {
$this->expectException(\OCP\Lock\LockedException::class);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
@@ -85,7 +85,7 @@ abstract class LockingProvider extends TestCase {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
}
- public function testExclusiveLockAfterSharedReleased() {
+ public function testExclusiveLockAfterSharedReleased(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
$this->instance->releaseLock('foo', ILockingProvider::LOCK_SHARED);
@@ -93,7 +93,7 @@ abstract class LockingProvider extends TestCase {
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
}
- public function testReleaseAll() {
+ public function testReleaseAll(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('bar', ILockingProvider::LOCK_SHARED);
@@ -108,7 +108,7 @@ abstract class LockingProvider extends TestCase {
$this->assertFalse($this->instance->isLocked('fizz#A=23', ILockingProvider::LOCK_EXCLUSIVE));
}
- public function testReleaseAllAfterChange() {
+ public function testReleaseAllAfterChange(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('bar', ILockingProvider::LOCK_SHARED);
@@ -124,7 +124,7 @@ abstract class LockingProvider extends TestCase {
$this->assertFalse($this->instance->isLocked('asd', ILockingProvider::LOCK_EXCLUSIVE));
}
- public function testReleaseAllAfterUnlock() {
+ public function testReleaseAllAfterUnlock(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('bar', ILockingProvider::LOCK_SHARED);
@@ -138,7 +138,7 @@ abstract class LockingProvider extends TestCase {
$this->assertFalse($this->instance->isLocked('asd', ILockingProvider::LOCK_EXCLUSIVE));
}
- public function testReleaseAfterReleaseAll() {
+ public function testReleaseAfterReleaseAll(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
@@ -151,7 +151,7 @@ abstract class LockingProvider extends TestCase {
- public function testSharedLockAfterExclusive() {
+ public function testSharedLockAfterExclusive(): void {
$this->expectException(\OCP\Lock\LockedException::class);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
@@ -159,7 +159,7 @@ abstract class LockingProvider extends TestCase {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
}
- public function testLockedExceptionHasPathForShared() {
+ public function testLockedExceptionHasPathForShared(): void {
try {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
@@ -171,7 +171,7 @@ abstract class LockingProvider extends TestCase {
}
}
- public function testLockedExceptionHasPathForExclusive() {
+ public function testLockedExceptionHasPathForExclusive(): void {
try {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
@@ -183,14 +183,14 @@ abstract class LockingProvider extends TestCase {
}
}
- public function testChangeLockToExclusive() {
+ public function testChangeLockToExclusive(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
}
- public function testChangeLockToShared() {
+ public function testChangeLockToShared(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
$this->instance->changeLock('foo', ILockingProvider::LOCK_SHARED);
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
@@ -198,7 +198,7 @@ abstract class LockingProvider extends TestCase {
}
- public function testChangeLockToExclusiveDoubleShared() {
+ public function testChangeLockToExclusiveDoubleShared(): void {
$this->expectException(\OCP\Lock\LockedException::class);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
@@ -207,14 +207,14 @@ abstract class LockingProvider extends TestCase {
}
- public function testChangeLockToExclusiveNoShared() {
+ public function testChangeLockToExclusiveNoShared(): void {
$this->expectException(\OCP\Lock\LockedException::class);
$this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
}
- public function testChangeLockToExclusiveFromExclusive() {
+ public function testChangeLockToExclusiveFromExclusive(): void {
$this->expectException(\OCP\Lock\LockedException::class);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
@@ -222,21 +222,21 @@ abstract class LockingProvider extends TestCase {
}
- public function testChangeLockToSharedNoExclusive() {
+ public function testChangeLockToSharedNoExclusive(): void {
$this->expectException(\OCP\Lock\LockedException::class);
$this->instance->changeLock('foo', ILockingProvider::LOCK_SHARED);
}
- public function testChangeLockToSharedFromShared() {
+ public function testChangeLockToSharedFromShared(): void {
$this->expectException(\OCP\Lock\LockedException::class);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->changeLock('foo', ILockingProvider::LOCK_SHARED);
}
- public function testReleaseNonExistingShared() {
+ public function testReleaseNonExistingShared(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->releaseLock('foo', ILockingProvider::LOCK_SHARED);
diff --git a/tests/lib/Lock/NonCachingDBLockingProviderTest.php b/tests/lib/Lock/NonCachingDBLockingProviderTest.php
index 5750d02fc4e..b79709a08e7 100644
--- a/tests/lib/Lock/NonCachingDBLockingProviderTest.php
+++ b/tests/lib/Lock/NonCachingDBLockingProviderTest.php
@@ -22,7 +22,7 @@ class NonCachingDBLockingProviderTest extends DBLockingProviderTest {
return new \OC\Lock\DBLockingProvider($this->connection, $this->timeFactory, 3600, false);
}
- public function testDoubleShared() {
+ public function testDoubleShared(): void {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
diff --git a/tests/lib/Lockdown/Filesystem/NoFSTest.php b/tests/lib/Lockdown/Filesystem/NoFSTest.php
index 7a636fbaaaa..dedcf580992 100644
--- a/tests/lib/Lockdown/Filesystem/NoFSTest.php
+++ b/tests/lib/Lockdown/Filesystem/NoFSTest.php
@@ -38,7 +38,7 @@ class NoFSTest extends \Test\TestCase {
$this->createUser('foo', 'var');
}
- public function testSetupFS() {
+ public function testSetupFS(): void {
\OC_Util::tearDownFS();
\OC_Util::setupFS('foo');
diff --git a/tests/lib/Lockdown/Filesystem/NullCacheTest.php b/tests/lib/Lockdown/Filesystem/NullCacheTest.php
index eda4e10b1a6..5e120e9bdc7 100644
--- a/tests/lib/Lockdown/Filesystem/NullCacheTest.php
+++ b/tests/lib/Lockdown/Filesystem/NullCacheTest.php
@@ -22,15 +22,15 @@ class NulLCacheTest extends \Test\TestCase {
$this->cache = new NullCache();
}
- public function testGetNumericStorageId() {
+ public function testGetNumericStorageId(): void {
$this->assertSame(-1, $this->cache->getNumericStorageId());
}
- public function testGetEmpty() {
+ public function testGetEmpty(): void {
$this->assertNull($this->cache->get('foo'));
}
- public function testGet() {
+ public function testGet(): void {
$data = $this->cache->get('');
$this->assertEquals(-1, $data['fileid']);
@@ -44,63 +44,63 @@ class NulLCacheTest extends \Test\TestCase {
$this->assertEquals(Constants::PERMISSION_READ, $data['permissions']);
}
- public function testGetFolderContents() {
+ public function testGetFolderContents(): void {
$this->assertSame([], $this->cache->getFolderContents('foo'));
}
- public function testGetFolderContentsById() {
+ public function testGetFolderContentsById(): void {
$this->assertSame([], $this->cache->getFolderContentsById(42));
}
- public function testPut() {
+ public function testPut(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->cache->put('foo', ['size' => 100]);
}
- public function testInsert() {
+ public function testInsert(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->cache->insert('foo', ['size' => 100]);
}
- public function testUpdate() {
+ public function testUpdate(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->cache->update('foo', ['size' => 100]);
}
- public function testGetId() {
+ public function testGetId(): void {
$this->assertSame(-1, $this->cache->getId('foo'));
}
- public function testGetParentId() {
+ public function testGetParentId(): void {
$this->assertSame(-1, $this->cache->getParentId('foo'));
}
- public function testInCache() {
+ public function testInCache(): void {
$this->assertTrue($this->cache->inCache(''));
$this->assertFalse($this->cache->inCache('foo'));
}
- public function testRemove() {
+ public function testRemove(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->cache->remove('foo');
}
- public function testMove() {
+ public function testMove(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->cache->move('foo', 'bar');
}
- public function testMoveFromCache() {
+ public function testMoveFromCache(): void {
$sourceCache = $this->createMock(ICache::class);
$this->expectException(ForbiddenException::class);
@@ -109,27 +109,27 @@ class NulLCacheTest extends \Test\TestCase {
$this->cache->moveFromCache($sourceCache, 'foo', 'bar');
}
- public function testGetStatus() {
+ public function testGetStatus(): void {
$this->assertSame(ICache::COMPLETE, $this->cache->getStatus('foo'));
}
- public function testSearch() {
+ public function testSearch(): void {
$this->assertSame([], $this->cache->search('foo'));
}
- public function testSearchByMime() {
+ public function testSearchByMime(): void {
$this->assertSame([], $this->cache->searchByMime('foo'));
}
- public function testGetIncomplete() {
+ public function testGetIncomplete(): void {
$this->assertSame([], $this->cache->getIncomplete());
}
- public function testGetPathById() {
+ public function testGetPathById(): void {
$this->assertSame('', $this->cache->getPathById(42));
}
- public function testNormalize() {
+ public function testNormalize(): void {
$this->assertSame('foo/ bar /', $this->cache->normalize('foo/ bar /'));
}
}
diff --git a/tests/lib/Lockdown/Filesystem/NullStorageTest.php b/tests/lib/Lockdown/Filesystem/NullStorageTest.php
index 727ccb83e21..331adeb8a54 100644
--- a/tests/lib/Lockdown/Filesystem/NullStorageTest.php
+++ b/tests/lib/Lockdown/Filesystem/NullStorageTest.php
@@ -24,178 +24,178 @@ class NullStorageTest extends TestCase {
$this->storage = new NullStorage([]);
}
- public function testGetId() {
+ public function testGetId(): void {
$this->assertSame('null', $this->storage->getId());
}
- public function testMkdir() {
+ public function testMkdir(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->mkdir('foo');
}
- public function testRmdir() {
+ public function testRmdir(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->rmdir('foo');
}
- public function testOpendir() {
+ public function testOpendir(): void {
$this->assertInstanceOf(IteratorDirectory::class, $this->storage->opendir('foo'));
}
- public function testIs_dir() {
+ public function testIs_dir(): void {
$this->assertTrue($this->storage->is_dir(''));
$this->assertFalse($this->storage->is_dir('foo'));
}
- public function testIs_file() {
+ public function testIs_file(): void {
$this->assertFalse($this->storage->is_file('foo'));
}
- public function testStat() {
+ public function testStat(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->stat('foo');
}
- public function testFiletype() {
+ public function testFiletype(): void {
$this->assertSame('dir', $this->storage->filetype(''));
$this->assertFalse($this->storage->filetype('foo'));
}
- public function testFilesize() {
+ public function testFilesize(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->filesize('foo');
}
- public function testIsCreatable() {
+ public function testIsCreatable(): void {
$this->assertFalse($this->storage->isCreatable('foo'));
}
- public function testIsReadable() {
+ public function testIsReadable(): void {
$this->assertTrue($this->storage->isReadable(''));
$this->assertFalse($this->storage->isReadable('foo'));
}
- public function testIsUpdatable() {
+ public function testIsUpdatable(): void {
$this->assertFalse($this->storage->isUpdatable('foo'));
}
- public function testIsDeletable() {
+ public function testIsDeletable(): void {
$this->assertFalse($this->storage->isDeletable('foo'));
}
- public function testIsSharable() {
+ public function testIsSharable(): void {
$this->assertFalse($this->storage->isSharable('foo'));
}
- public function testGetPermissions() {
+ public function testGetPermissions(): void {
$this->assertNull($this->storage->getPermissions('foo'));
}
- public function testFile_exists() {
+ public function testFile_exists(): void {
$this->assertTrue($this->storage->file_exists(''));
$this->assertFalse($this->storage->file_exists('foo'));
}
- public function testFilemtime() {
+ public function testFilemtime(): void {
$this->assertFalse($this->storage->filemtime('foo'));
}
- public function testFile_get_contents() {
+ public function testFile_get_contents(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->file_get_contents('foo');
}
- public function testFile_put_contents() {
+ public function testFile_put_contents(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->file_put_contents('foo', 'bar');
}
- public function testUnlink() {
+ public function testUnlink(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->unlink('foo');
}
- public function testRename() {
+ public function testRename(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->rename('foo', 'bar');
}
- public function testCopy() {
+ public function testCopy(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->copy('foo', 'bar');
}
- public function testFopen() {
+ public function testFopen(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->fopen('foo', 'R');
}
- public function testGetMimeType() {
+ public function testGetMimeType(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->getMimeType('foo');
}
- public function testHash() {
+ public function testHash(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->hash('md5', 'foo', true);
}
- public function testFree_space() {
+ public function testFree_space(): void {
$this->assertSame(FileInfo::SPACE_UNKNOWN, $this->storage->free_space('foo'));
}
- public function testTouch() {
+ public function testTouch(): void {
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
$this->storage->touch('foo');
}
- public function testGetLocalFile() {
+ public function testGetLocalFile(): void {
$this->assertFalse($this->storage->getLocalFile('foo'));
}
- public function testHasUpdated() {
+ public function testHasUpdated(): void {
$this->assertFalse($this->storage->hasUpdated('foo', 42));
}
- public function testGetETag() {
+ public function testGetETag(): void {
$this->assertSame('', $this->storage->getETag('foo'));
}
- public function testIsLocal() {
+ public function testIsLocal(): void {
$this->assertFalse($this->storage->isLocal());
}
- public function testGetDirectDownload() {
+ public function testGetDirectDownload(): void {
$this->assertFalse($this->storage->getDirectDownload('foo'));
}
- public function testCopyFromStorage() {
+ public function testCopyFromStorage(): void {
$sourceStorage = $this->createMock(Storage::class);
$this->expectException(ForbiddenException::class);
@@ -204,7 +204,7 @@ class NullStorageTest extends TestCase {
$this->storage->copyFromStorage($sourceStorage, 'foo', 'bar');
}
- public function testMoveFromStorage() {
+ public function testMoveFromStorage(): void {
$sourceStorage = $this->createMock(Storage::class);
$this->expectException(ForbiddenException::class);
@@ -218,11 +218,11 @@ class NullStorageTest extends TestCase {
return true;
}
- public function testGetOwner() {
+ public function testGetOwner(): void {
$this->assertNull($this->storage->getOwner('foo'));
}
- public function testGetCache() {
+ public function testGetCache(): void {
$this->assertInstanceOf(NullCache::class, $this->storage->getCache('foo'));
}
}
diff --git a/tests/lib/Lockdown/LockdownManagerTest.php b/tests/lib/Lockdown/LockdownManagerTest.php
index bb71a6e63de..1f747378c02 100644
--- a/tests/lib/Lockdown/LockdownManagerTest.php
+++ b/tests/lib/Lockdown/LockdownManagerTest.php
@@ -23,12 +23,12 @@ class LockdownManagerTest extends TestCase {
};
}
- public function testCanAccessFilesystemDisabled() {
+ public function testCanAccessFilesystemDisabled(): void {
$manager = new LockdownManager($this->sessionCallback);
$this->assertTrue($manager->canAccessFilesystem());
}
- public function testCanAccessFilesystemAllowed() {
+ public function testCanAccessFilesystemAllowed(): void {
$token = new PublicKeyToken();
$token->setScope([IToken::SCOPE_FILESYSTEM => true]);
$manager = new LockdownManager($this->sessionCallback);
@@ -36,7 +36,7 @@ class LockdownManagerTest extends TestCase {
$this->assertTrue($manager->canAccessFilesystem());
}
- public function testCanAccessFilesystemNotAllowed() {
+ public function testCanAccessFilesystemNotAllowed(): void {
$token = new PublicKeyToken();
$token->setScope([IToken::SCOPE_FILESYSTEM => false]);
$manager = new LockdownManager($this->sessionCallback);
diff --git a/tests/lib/Log/ExceptionSerializerTest.php b/tests/lib/Log/ExceptionSerializerTest.php
index 1ec422fb53d..6d5bc5cf19f 100644
--- a/tests/lib/Log/ExceptionSerializerTest.php
+++ b/tests/lib/Log/ExceptionSerializerTest.php
@@ -42,7 +42,7 @@ class ExceptionSerializerTest extends TestCase {
* exception was passed to the logger. The token was replaced, the original
* variable overwritten.
*/
- public function testSerializer() {
+ public function testSerializer(): void {
try {
$secret = ['Secret'];
$this->emit([&$secret]);
@@ -53,7 +53,7 @@ class ExceptionSerializerTest extends TestCase {
}
}
- public function testSerializerWithRegisteredMethods() {
+ public function testSerializerWithRegisteredMethods(): void {
$this->serializer->enlistSensitiveMethods(self::class, ['customMagicAuthThing']);
try {
$this->customMagicAuthThing('u57474', 'Secret');
diff --git a/tests/lib/Log/FileTest.php b/tests/lib/Log/FileTest.php
index 9deb6c8136c..b483da969f4 100644
--- a/tests/lib/Log/FileTest.php
+++ b/tests/lib/Log/FileTest.php
@@ -47,7 +47,7 @@ class FileTest extends TestCase {
parent::tearDown();
}
- public function testLogging() {
+ public function testLogging(): void {
$config = \OC::$server->get(IConfig::class);
# delete old logfile
unlink($config->getSystemValue('logfile'));
@@ -68,7 +68,7 @@ class FileTest extends TestCase {
$this->assertEquals('Testing logging', $values['message']);
}
- public function testMicrosecondsLogTimestamp() {
+ public function testMicrosecondsLogTimestamp(): void {
$config = \OC::$server->getConfig();
# delete old logfile
unlink($config->getSystemValue('logfile'));
diff --git a/tests/lib/Log/LogFactoryTest.php b/tests/lib/Log/LogFactoryTest.php
index c1232f7b28d..22ee0dfb268 100644
--- a/tests/lib/Log/LogFactoryTest.php
+++ b/tests/lib/Log/LogFactoryTest.php
@@ -61,7 +61,7 @@ class LogFactoryTest extends TestCase {
* @dataProvider fileTypeProvider
* @throws \OCP\AppFramework\QueryException
*/
- public function testFile(string $type) {
+ public function testFile(string $type): void {
$datadir = \OC::$SERVERROOT.'/data';
$defaultLog = $datadir . '/nextcloud.log';
@@ -91,7 +91,7 @@ class LogFactoryTest extends TestCase {
* @dataProvider logFilePathProvider
* @throws \OCP\AppFramework\QueryException
*/
- public function testFileCustomPath($path, $expected) {
+ public function testFileCustomPath($path, $expected): void {
$datadir = \OC::$SERVERROOT.'/data';
$defaultLog = $datadir . '/nextcloud.log';
@@ -108,7 +108,7 @@ class LogFactoryTest extends TestCase {
/**
* @throws \OCP\AppFramework\QueryException
*/
- public function testErrorLog() {
+ public function testErrorLog(): void {
$log = $this->factory->get('errorlog');
$this->assertInstanceOf(Errorlog::class, $log);
}
@@ -116,7 +116,7 @@ class LogFactoryTest extends TestCase {
/**
* @throws \OCP\AppFramework\QueryException
*/
- public function testSystemLog() {
+ public function testSystemLog(): void {
$this->c->expects($this->once())
->method('resolve')
->with(Syslog::class)
@@ -129,7 +129,7 @@ class LogFactoryTest extends TestCase {
/**
* @throws \OCP\AppFramework\QueryException
*/
- public function testSystemdLog() {
+ public function testSystemdLog(): void {
$this->c->expects($this->once())
->method('resolve')
->with(Systemdlog::class)
diff --git a/tests/lib/LoggerTest.php b/tests/lib/LoggerTest.php
index ff99a416904..c7c60e892aa 100644
--- a/tests/lib/LoggerTest.php
+++ b/tests/lib/LoggerTest.php
@@ -43,7 +43,7 @@ class LoggerTest extends TestCase implements IWriter {
])));
}
- public function testInterpolation() {
+ public function testInterpolation(): void {
$this->mockDefaultLogLevel();
$logger = $this->logger;
$logger->warning('{Message {nothing} {user} {foo.bar} a}', ['user' => 'Bob', 'foo.bar' => 'Bar']);
@@ -52,7 +52,7 @@ class LoggerTest extends TestCase implements IWriter {
$this->assertEquals($expected, $this->getLogs());
}
- public function testAppCondition() {
+ public function testAppCondition(): void {
$this->config->expects($this->any())
->method('getValue')
->will(($this->returnValueMap([
diff --git a/tests/lib/Mail/EMailTemplateTest.php b/tests/lib/Mail/EMailTemplateTest.php
index 45ccf543848..76b37d48ff3 100644
--- a/tests/lib/Mail/EMailTemplateTest.php
+++ b/tests/lib/Mail/EMailTemplateTest.php
@@ -45,7 +45,7 @@ class EMailTemplateTest extends TestCase {
);
}
- public function testEMailTemplateCustomFooter() {
+ public function testEMailTemplateCustomFooter(): void {
$this->defaults
->expects($this->any())
->method('getDefaultColorPrimary')
@@ -86,7 +86,7 @@ class EMailTemplateTest extends TestCase {
$this->assertSame($expectedTXT, $this->emailTemplate->renderText());
}
- public function testEMailTemplateDefaultFooter() {
+ public function testEMailTemplateDefaultFooter(): void {
$this->defaults
->expects($this->any())
->method('getDefaultColorPrimary')
@@ -129,7 +129,7 @@ class EMailTemplateTest extends TestCase {
$this->assertSame($expectedTXT, $this->emailTemplate->renderText());
}
- public function testEMailTemplateSingleButton() {
+ public function testEMailTemplateSingleButton(): void {
$this->defaults
->expects($this->any())
->method('getDefaultColorPrimary')
@@ -174,7 +174,7 @@ class EMailTemplateTest extends TestCase {
- public function testEMailTemplateAlternativePlainTexts() {
+ public function testEMailTemplateAlternativePlainTexts(): void {
$this->defaults
->expects($this->any())
->method('getDefaultColorPrimary')
diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php
index be95307da6d..9f37b776f17 100644
--- a/tests/lib/Mail/MailerTest.php
+++ b/tests/lib/Mail/MailerTest.php
@@ -77,7 +77,7 @@ class MailerTest extends TestCase {
* @param $sendmailMode
* @param $binaryParam
*/
- public function testGetSendmailInstanceSendMail($sendmailMode, $binaryParam) {
+ public function testGetSendmailInstanceSendMail($sendmailMode, $binaryParam): void {
$this->config
->expects($this->exactly(2))
->method('getSystemValueString')
@@ -100,7 +100,7 @@ class MailerTest extends TestCase {
* @param $sendmailMode
* @param $binaryParam
*/
- public function testGetSendmailInstanceSendMailQmail($sendmailMode, $binaryParam) {
+ public function testGetSendmailInstanceSendMailQmail($sendmailMode, $binaryParam): void {
$this->config
->expects($this->exactly(2))
->method('getSystemValueString')
@@ -113,7 +113,7 @@ class MailerTest extends TestCase {
$this->assertEquals($sendmail, self::invokePrivate($this->mailer, 'getSendMailInstance'));
}
- public function testGetInstanceDefault() {
+ public function testGetInstanceDefault(): void {
$this->config
->method('getSystemValue')
->willReturnMap([
@@ -127,7 +127,7 @@ class MailerTest extends TestCase {
$this->assertInstanceOf(EsmtpTransport::class, $transport);
}
- public function testGetInstanceSendmail() {
+ public function testGetInstanceSendmail(): void {
$this->config
->method('getSystemValueString')
->willReturnMap([
@@ -141,7 +141,7 @@ class MailerTest extends TestCase {
$this->assertInstanceOf(SendmailTransport::class, $transport);
}
- public function testEvents() {
+ public function testEvents(): void {
$this->config
->method('getSystemValue')
->willReturnMap([
@@ -173,7 +173,7 @@ class MailerTest extends TestCase {
$this->mailer->send($message);
}
- public function testCreateMessage() {
+ public function testCreateMessage(): void {
$this->config
->expects($this->any())
->method('getSystemValueBool')
@@ -183,7 +183,7 @@ class MailerTest extends TestCase {
}
- public function testSendInvalidMailException() {
+ public function testSendInvalidMailException(): void {
$this->config
->method('getSystemValue')
->willReturnMap([
@@ -223,7 +223,7 @@ class MailerTest extends TestCase {
/**
* @dataProvider mailAddressProvider
*/
- public function testValidateMailAddress($email, $expected, $strict) {
+ public function testValidateMailAddress($email, $expected, $strict): void {
$this->config
->expects($this->atMost(1))
->method('getAppValue')
@@ -232,7 +232,7 @@ class MailerTest extends TestCase {
$this->assertSame($expected, $this->mailer->validateMailAddress($email));
}
- public function testCreateEMailTemplate() {
+ public function testCreateEMailTemplate(): void {
$this->config->method('getSystemValueString')
->with('mail_template_class', '')
->willReturnArgument(1);
@@ -243,7 +243,7 @@ class MailerTest extends TestCase {
$this->assertSame(EMailTemplate::class, get_class($this->mailer->createEMailTemplate('tests.MailerTest')));
}
- public function testStreamingOptions() {
+ public function testStreamingOptions(): void {
$this->config->method('getSystemValue')
->willReturnMap([
['mail_smtpstreamoptions', [], ['foo' => 1]],
@@ -267,7 +267,7 @@ class MailerTest extends TestCase {
$this->assertTrue(isset($transport->getStream()->getStreamOptions()['foo']));
}
- public function testStreamingOptionsWrongType() {
+ public function testStreamingOptionsWrongType(): void {
$this->config->method('getSystemValue')
->willReturnMap([
['mail_smtpstreamoptions', [], 'bar'],
diff --git a/tests/lib/Mail/MessageTest.php b/tests/lib/Mail/MessageTest.php
index 456d532d766..681ec033380 100644
--- a/tests/lib/Mail/MessageTest.php
+++ b/tests/lib/Mail/MessageTest.php
@@ -77,7 +77,7 @@ class MessageTest extends TestCase {
* @param string $unconverted
* @param string $expected
*/
- public function testConvertAddresses($unconverted, $expected) {
+ public function testConvertAddresses($unconverted, $expected): void {
$this->assertEquals($expected, self::invokePrivate($this->message, 'convertAddresses', [$unconverted]));
}
@@ -112,7 +112,7 @@ class MessageTest extends TestCase {
$this->message->setRecipients();
}
- public function testSetTo() {
+ public function testSetTo(): void {
$expected = ['pierres-general-store@stardewvalley.com' => 'Pierres General Store'];
$message = $this->message->setTo(['pierres-general-store@stardewvalley.com' => 'Pierres General Store']);
@@ -141,7 +141,7 @@ class MessageTest extends TestCase {
$message->setRecipients();
}
- public function testSetGetFrom() {
+ public function testSetGetFrom(): void {
$expected = ['pierres-general-store@stardewvalley.com' => 'Pierres General Store'];
$message = $this->message->setFrom(['pierres-general-store@stardewvalley.com' => 'Pierres General Store']);
@@ -149,7 +149,7 @@ class MessageTest extends TestCase {
$this->assertEquals($expected, $message->getFrom());
}
- public function testSetGetTo() {
+ public function testSetGetTo(): void {
$expected = ['lewis-tent@stardewvalley.com' => "Lewis' Tent Life"];
$message = $this->message->setTo(['lewis-tent@stardewvalley.com' => "Lewis' Tent Life"]);
@@ -157,7 +157,7 @@ class MessageTest extends TestCase {
$this->assertEquals($expected, $message->getTo());
}
- public function testSetGetReplyTo() {
+ public function testSetGetReplyTo(): void {
$expected = ['penny@stardewvalley-library.co.edu' => 'Penny'];
$message = $this->message->setReplyTo(['penny@stardewvalley-library.co.edu' => 'Penny']);
@@ -165,7 +165,7 @@ class MessageTest extends TestCase {
$this->assertEquals($expected, $message->getReplyTo());
}
- public function testSetGetCC() {
+ public function testSetGetCC(): void {
$expected = ['gunther@stardewvalley-library.co.edu' => 'Gunther'];
$message = $this->message->setCc(['gunther@stardewvalley-library.co.edu' => 'Gunther']);
@@ -173,7 +173,7 @@ class MessageTest extends TestCase {
$this->assertEquals($expected, $message->getCc());
}
- public function testSetGetBCC() {
+ public function testSetGetBCC(): void {
$expected = ['pam@stardewvalley-bus.com' => 'Pam'];
$message = $this->message->setBcc(['pam@stardewvalley-bus.com' => 'Pam']);
@@ -181,7 +181,7 @@ class MessageTest extends TestCase {
$this->assertEquals($expected, $message->getBcc());
}
- public function testSetPlainBody() {
+ public function testSetPlainBody(): void {
$this->symfonyEmail
->expects($this->once())
->method('text')
@@ -190,7 +190,7 @@ class MessageTest extends TestCase {
$this->message->setPlainBody('Fancy Body');
}
- public function testGetPlainBody() {
+ public function testGetPlainBody(): void {
$this->symfonyEmail
->expects($this->once())
->method('getTextBody')
@@ -199,7 +199,7 @@ class MessageTest extends TestCase {
$this->assertSame('Fancy Body', $this->message->getPlainBody());
}
- public function testSetHtmlBody() {
+ public function testSetHtmlBody(): void {
$this->symfonyEmail
->expects($this->once())
->method('html')
@@ -208,7 +208,7 @@ class MessageTest extends TestCase {
$this->message->setHtmlBody('<blink>Fancy Body</blink>');
}
- public function testPlainTextRenderOption() {
+ public function testPlainTextRenderOption(): void {
/** @var MockObject|Email $symfonyEmail */
$symfonyEmail = $this->getMockBuilder(Email::class)
->disableOriginalConstructor()->getMock();
@@ -231,7 +231,7 @@ class MessageTest extends TestCase {
$message->useTemplate($template);
}
- public function testBothRenderingOptions() {
+ public function testBothRenderingOptions(): void {
/** @var MockObject|Email $symfonyEmail */
$symfonyEmail = $this->getMockBuilder(Email::class)
->disableOriginalConstructor()->getMock();
@@ -254,7 +254,7 @@ class MessageTest extends TestCase {
$message->useTemplate($template);
}
- public function testSetAutoSubmitted1() {
+ public function testSetAutoSubmitted1(): void {
$headers = new Headers($this->createMock(HeaderInterface::class));
$headers->addTextHeader(AutoSubmitted::HEADER, 'yes');
$symfonyEmail = $this->createMock(Email::class);
@@ -267,7 +267,7 @@ class MessageTest extends TestCase {
$this->assertNotSame('no', $message->getAutoSubmitted());
}
- public function testSetAutoSubmitted2() {
+ public function testSetAutoSubmitted2(): void {
$headers = new Headers($this->createMock(HeaderInterface::class));
$headers->addTextHeader(AutoSubmitted::HEADER, 'no');
$symfonyEmail = $this->createMock(Email::class);
@@ -280,7 +280,7 @@ class MessageTest extends TestCase {
$this->assertSame('auto-generated', $message->getAutoSubmitted());
}
- public function testGetAutoSubmitted() {
+ public function testGetAutoSubmitted(): void {
$headers = new Headers($this->createMock(HeaderInterface::class));
$headers->addTextHeader(AutoSubmitted::HEADER, 'no');
$symfonyEmail = $this->createMock(Email::class);
diff --git a/tests/lib/Memcache/APCuTest.php b/tests/lib/Memcache/APCuTest.php
index c13d30da136..cb465d1f07a 100644
--- a/tests/lib/Memcache/APCuTest.php
+++ b/tests/lib/Memcache/APCuTest.php
@@ -23,13 +23,13 @@ class APCuTest extends Cache {
$this->instance = new \OC\Memcache\APCu($this->getUniqueID());
}
- public function testCasIntChanged() {
+ public function testCasIntChanged(): void {
$this->instance->set('foo', 1);
$this->assertTrue($this->instance->cas('foo', 1, 2));
$this->assertEquals(2, $this->instance->get('foo'));
}
- public function testCasIntNotChanged() {
+ public function testCasIntNotChanged(): void {
$this->instance->set('foo', 1);
$this->assertFalse($this->instance->cas('foo', 2, 3));
$this->assertEquals(1, $this->instance->get('foo'));
diff --git a/tests/lib/Memcache/Cache.php b/tests/lib/Memcache/Cache.php
index 4749e223fd5..5845d426311 100644
--- a/tests/lib/Memcache/Cache.php
+++ b/tests/lib/Memcache/Cache.php
@@ -14,65 +14,65 @@ abstract class Cache extends \Test\Cache\TestCache {
*/
protected $instance;
- public function testExistsAfterSet() {
+ public function testExistsAfterSet(): void {
$this->assertFalse($this->instance->hasKey('foo'));
$this->instance->set('foo', 'bar');
$this->assertTrue($this->instance->hasKey('foo'));
}
- public function testGetAfterSet() {
+ public function testGetAfterSet(): void {
$this->assertNull($this->instance->get('foo'));
$this->instance->set('foo', 'bar');
$this->assertEquals('bar', $this->instance->get('foo'));
}
- public function testGetArrayAfterSet() {
+ public function testGetArrayAfterSet(): void {
$this->assertNull($this->instance->get('foo'));
$this->instance->set('foo', ['bar']);
$this->assertEquals(['bar'], $this->instance->get('foo'));
}
- public function testDoesNotExistAfterRemove() {
+ public function testDoesNotExistAfterRemove(): void {
$this->instance->set('foo', 'bar');
$this->instance->remove('foo');
$this->assertFalse($this->instance->hasKey('foo'));
}
- public function testRemoveNonExisting() {
+ public function testRemoveNonExisting(): void {
$this->instance->remove('foo');
$this->assertFalse($this->instance->hasKey('foo'));
}
- public function testArrayAccessSet() {
+ public function testArrayAccessSet(): void {
$this->instance['foo'] = 'bar';
$this->assertEquals('bar', $this->instance->get('foo'));
}
- public function testArrayAccessGet() {
+ public function testArrayAccessGet(): void {
$this->instance->set('foo', 'bar');
$this->assertEquals('bar', $this->instance['foo']);
}
- public function testArrayAccessExists() {
+ public function testArrayAccessExists(): void {
$this->assertFalse(isset($this->instance['foo']));
$this->instance->set('foo', 'bar');
$this->assertTrue(isset($this->instance['foo']));
}
- public function testArrayAccessUnset() {
+ public function testArrayAccessUnset(): void {
$this->instance->set('foo', 'bar');
unset($this->instance['foo']);
$this->assertFalse($this->instance->hasKey('foo'));
}
- public function testAdd() {
+ public function testAdd(): void {
$this->assertTrue($this->instance->add('foo', 'bar'));
$this->assertEquals('bar', $this->instance->get('foo'));
$this->assertFalse($this->instance->add('foo', 'asd'));
$this->assertEquals('bar', $this->instance->get('foo'));
}
- public function testInc() {
+ public function testInc(): void {
$this->assertEquals(1, $this->instance->inc('foo'));
$this->assertEquals(1, $this->instance->get('foo'));
$this->assertEquals(2, $this->instance->inc('foo'));
@@ -85,7 +85,7 @@ abstract class Cache extends \Test\Cache\TestCache {
$this->assertEquals('bar', $this->instance->get('foo'));
}
- public function testDec() {
+ public function testDec(): void {
$this->assertFalse($this->instance->dec('foo'));
$this->instance->set('foo', 20);
$this->assertEquals(19, $this->instance->dec('foo'));
@@ -97,51 +97,51 @@ abstract class Cache extends \Test\Cache\TestCache {
$this->assertEquals('bar', $this->instance->get('foo'));
}
- public function testCasNotChanged() {
+ public function testCasNotChanged(): void {
$this->instance->set('foo', 'bar');
$this->assertTrue($this->instance->cas('foo', 'bar', 'asd'));
$this->assertEquals('asd', $this->instance->get('foo'));
}
- public function testCasChanged() {
+ public function testCasChanged(): void {
$this->instance->set('foo', 'bar1');
$this->assertFalse($this->instance->cas('foo', 'bar', 'asd'));
$this->assertEquals('bar1', $this->instance->get('foo'));
}
- public function testCasNotSet() {
+ public function testCasNotSet(): void {
$this->assertFalse($this->instance->cas('foo', 'bar', 'asd'));
}
- public function testCadNotChanged() {
+ public function testCadNotChanged(): void {
$this->instance->set('foo', 'bar');
$this->assertTrue($this->instance->cad('foo', 'bar'));
$this->assertFalse($this->instance->hasKey('foo'));
}
- public function testCadChanged() {
+ public function testCadChanged(): void {
$this->instance->set('foo', 'bar1');
$this->assertFalse($this->instance->cad('foo', 'bar'));
$this->assertTrue($this->instance->hasKey('foo'));
}
- public function testCadNotSet() {
+ public function testCadNotSet(): void {
$this->assertFalse($this->instance->cad('foo', 'bar'));
}
- public function testNcadNotChanged() {
+ public function testNcadNotChanged(): void {
$this->instance->set('foo', 'bar');
$this->assertFalse($this->instance->ncad('foo', 'bar'));
$this->assertTrue($this->instance->hasKey('foo'));
}
- public function testNcadChanged() {
+ public function testNcadChanged(): void {
$this->instance->set('foo', 'bar1');
$this->assertTrue($this->instance->ncad('foo', 'bar'));
$this->assertFalse($this->instance->hasKey('foo'));
}
- public function testNcadNotSet() {
+ public function testNcadNotSet(): void {
$this->assertFalse($this->instance->ncad('foo', 'bar'));
}
diff --git a/tests/lib/Memcache/CasTraitTest.php b/tests/lib/Memcache/CasTraitTest.php
index 1c09a0e08f8..129819045f2 100644
--- a/tests/lib/Memcache/CasTraitTest.php
+++ b/tests/lib/Memcache/CasTraitTest.php
@@ -46,14 +46,14 @@ class CasTraitTest extends TestCase {
return $mock;
}
- public function testCasNotChanged() {
+ public function testCasNotChanged(): void {
$cache = $this->getCache();
$cache->set('foo', 'bar');
$this->assertTrue($cache->cas('foo', 'bar', 'asd'));
$this->assertEquals('asd', $cache->get('foo'));
}
- public function testCasChanged() {
+ public function testCasChanged(): void {
$cache = $this->getCache();
$cache->set('foo', 'bar1');
$this->assertFalse($cache->cas('foo', 'bar', 'asd'));
diff --git a/tests/lib/Memcache/FactoryTest.php b/tests/lib/Memcache/FactoryTest.php
index b973b5065ea..fa0d80c5153 100644
--- a/tests/lib/Memcache/FactoryTest.php
+++ b/tests/lib/Memcache/FactoryTest.php
@@ -107,7 +107,7 @@ class FactoryTest extends \Test\TestCase {
* @dataProvider cacheAvailabilityProvider
*/
public function testCacheAvailability($localCache, $distributedCache, $lockingCache,
- $expectedLocalCache, $expectedDistributedCache, $expectedLockingCache) {
+ $expectedLocalCache, $expectedDistributedCache, $expectedLockingCache): void {
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
$profiler = $this->getMockBuilder(IProfiler::class)->getMock();
$factory = new \OC\Memcache\Factory(fn () => 'abc', $logger, $profiler, $localCache, $distributedCache, $lockingCache);
@@ -119,7 +119,7 @@ class FactoryTest extends \Test\TestCase {
/**
* @dataProvider cacheUnavailableProvider
*/
- public function testCacheNotAvailableException($localCache, $distributedCache) {
+ public function testCacheNotAvailableException($localCache, $distributedCache): void {
$this->expectException(\OCP\HintException::class);
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
diff --git a/tests/lib/Memcache/MemcachedTest.php b/tests/lib/Memcache/MemcachedTest.php
index 48f93a45ed9..346530e191d 100644
--- a/tests/lib/Memcache/MemcachedTest.php
+++ b/tests/lib/Memcache/MemcachedTest.php
@@ -30,7 +30,7 @@ class MemcachedTest extends Cache {
$this->instance = new \OC\Memcache\Memcached($this->getUniqueID());
}
- public function testClear() {
+ public function testClear(): void {
// Memcached is sometimes broken with clear(), so we don't test it thoroughly
$value = 'ipsum lorum';
$this->instance->set('1_value1', $value);
diff --git a/tests/lib/Memcache/RedisTest.php b/tests/lib/Memcache/RedisTest.php
index 8df286b2f93..d76da03eb85 100644
--- a/tests/lib/Memcache/RedisTest.php
+++ b/tests/lib/Memcache/RedisTest.php
@@ -63,20 +63,20 @@ class RedisTest extends Cache {
$this->instance = new \OC\Memcache\Redis($this->getUniqueID());
}
- public function testScriptHashes() {
+ public function testScriptHashes(): void {
foreach (\OC\Memcache\Redis::LUA_SCRIPTS as $script) {
$this->assertEquals(sha1($script[0]), $script[1]);
}
}
- public function testCasTtlNotChanged() {
+ public function testCasTtlNotChanged(): void {
$this->instance->set('foo', 'bar', 50);
$this->assertTrue($this->instance->compareSetTTL('foo', 'bar', 100));
// allow for 1s of inaccuracy due to time moving forward
$this->assertLessThan(1, 100 - $this->instance->getTTL('foo'));
}
- public function testCasTtlChanged() {
+ public function testCasTtlChanged(): void {
$this->instance->set('foo', 'bar1', 50);
$this->assertFalse($this->instance->compareSetTTL('foo', 'bar', 100));
// allow for 1s of inaccuracy due to time moving forward
diff --git a/tests/lib/MemoryInfoTest.php b/tests/lib/MemoryInfoTest.php
index fb9c9ac7bd4..2477de2d799 100644
--- a/tests/lib/MemoryInfoTest.php
+++ b/tests/lib/MemoryInfoTest.php
@@ -59,7 +59,7 @@ class MemoryInfoTest extends TestCase {
* @param int|float $expected The expected detected memory limit.
* @dataProvider getMemoryLimitTestData
*/
- public function testMemoryLimit(string $iniValue, int|float $expected) {
+ public function testMemoryLimit(string $iniValue, int|float $expected): void {
ini_set('memory_limit', $iniValue);
$memoryInfo = new MemoryInfo();
self::assertEquals($expected, $memoryInfo->getMemoryLimit());
@@ -87,7 +87,7 @@ class MemoryInfoTest extends TestCase {
* @dataProvider getSufficientMemoryTestData
* @return void
*/
- public function testIsMemoryLimitSufficient(int $memoryLimit, bool $expected) {
+ public function testIsMemoryLimitSufficient(int $memoryLimit, bool $expected): void {
/* @var MemoryInfo|MockObject $memoryInfo */
$memoryInfo = $this->getMockBuilder(MemoryInfo::class)
->setMethods(['getMemoryLimit',])
diff --git a/tests/lib/Migration/BackgroundRepairTest.php b/tests/lib/Migration/BackgroundRepairTest.php
index 2744ac5cefb..585ebc420ad 100644
--- a/tests/lib/Migration/BackgroundRepairTest.php
+++ b/tests/lib/Migration/BackgroundRepairTest.php
@@ -70,12 +70,12 @@ class BackgroundRepairTest extends TestCase {
->getMock();
}
- public function testNoArguments() {
+ public function testNoArguments(): void {
$this->jobList->expects($this->once())->method('remove');
$this->job->start($this->jobList);
}
- public function testAppUpgrading() {
+ public function testAppUpgrading(): void {
$this->jobList->expects($this->never())->method('remove');
$this->job->expects($this->once())->method('loadApp')->with('test')->willThrowException(new NeedsUpdateException());
$this->job->setArgument([
@@ -85,7 +85,7 @@ class BackgroundRepairTest extends TestCase {
$this->job->start($this->jobList);
}
- public function testUnknownStep() {
+ public function testUnknownStep(): void {
$this->dispatcher->expects($this->never())->method('dispatchTyped');
$this->jobList->expects($this->once())->method('remove');
@@ -98,7 +98,7 @@ class BackgroundRepairTest extends TestCase {
$this->job->start($this->jobList);
}
- public function testWorkingStep() {
+ public function testWorkingStep(): void {
$this->dispatcher->expects($this->once())->method('dispatchTyped')
->with($this->equalTo(new RepairStepEvent('A test repair step')));
diff --git a/tests/lib/NaturalSortTest.php b/tests/lib/NaturalSortTest.php
index a053687eaf9..3a07c5ceb66 100644
--- a/tests/lib/NaturalSortTest.php
+++ b/tests/lib/NaturalSortTest.php
@@ -11,7 +11,7 @@ class NaturalSortTest extends \Test\TestCase {
/**
* @dataProvider naturalSortDataProvider
*/
- public function testNaturalSortCompare($array, $sorted) {
+ public function testNaturalSortCompare($array, $sorted): void {
if (!class_exists('Collator')) {
$this->markTestSkipped('The intl module is not available, natural sorting might not work as expected.');
return;
@@ -24,7 +24,7 @@ class NaturalSortTest extends \Test\TestCase {
/**
* @dataProvider defaultCollatorDataProvider
*/
- public function testDefaultCollatorCompare($array, $sorted) {
+ public function testDefaultCollatorCompare($array, $sorted): void {
$comparator = new \OC\NaturalSort(new \OC\NaturalSort_DefaultCollator());
usort($array, [$comparator, 'compare']);
$this->assertEquals($sorted, $array);
diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php
index 27f14e97bb0..1297bfdf669 100644
--- a/tests/lib/NavigationManagerTest.php
+++ b/tests/lib/NavigationManagerTest.php
@@ -118,7 +118,7 @@ class NavigationManagerTest extends TestCase {
* @param array $entry
* @param array $expectedEntry
*/
- public function testAddArray(array $entry, array $expectedEntry) {
+ public function testAddArray(array $entry, array $expectedEntry): void {
$this->assertEmpty($this->navigationManager->getAll('all'), 'Expected no navigation entry exists');
$this->navigationManager->add($entry);
@@ -136,7 +136,7 @@ class NavigationManagerTest extends TestCase {
* @param array $entry
* @param array $expectedEntry
*/
- public function testAddClosure(array $entry, array $expectedEntry) {
+ public function testAddClosure(array $entry, array $expectedEntry): void {
global $testAddClosureNumberOfCalls;
$testAddClosureNumberOfCalls = 0;
@@ -163,7 +163,7 @@ class NavigationManagerTest extends TestCase {
$this->assertEmpty($this->navigationManager->getAll('all'), 'Expected no navigation entry exists after clear()');
}
- public function testAddArrayClearGetAll() {
+ public function testAddArrayClearGetAll(): void {
$entry = [
'id' => 'entry id',
'name' => 'link text',
@@ -178,7 +178,7 @@ class NavigationManagerTest extends TestCase {
$this->assertEmpty($this->navigationManager->getAll(), 'Expected no navigation entry exists after clear()');
}
- public function testAddClosureClearGetAll() {
+ public function testAddClosureClearGetAll(): void {
$this->assertEmpty($this->navigationManager->getAll(), 'Expected no navigation entry exists');
$entry = [
@@ -209,7 +209,7 @@ class NavigationManagerTest extends TestCase {
/**
* @dataProvider providesNavigationConfig
*/
- public function testWithAppManager($expected, $navigation, $isAdmin = false) {
+ public function testWithAppManager($expected, $navigation, $isAdmin = false): void {
$l = $this->createMock(IL10N::class);
$l->expects($this->any())->method('t')->willReturnCallback(function ($text, $parameters = []) {
return vsprintf($text, $parameters);
@@ -489,7 +489,7 @@ class NavigationManagerTest extends TestCase {
];
}
- public function testWithAppManagerAndApporder() {
+ public function testWithAppManagerAndApporder(): void {
$l = $this->createMock(IL10N::class);
$l->expects($this->any())->method('t')->willReturnCallback(function ($text, $parameters = []) {
return vsprintf($text, $parameters);
@@ -693,7 +693,7 @@ class NavigationManagerTest extends TestCase {
/**
* @dataProvider provideDefaultEntries
*/
- public function testGetDefaultEntryIdForUser($defaultApps, $userDefaultApps, $userApporder, $withFallbacks, $expectedApp) {
+ public function testGetDefaultEntryIdForUser($defaultApps, $userDefaultApps, $userApporder, $withFallbacks, $expectedApp): void {
$this->navigationManager->add([
'id' => 'files',
]);
@@ -725,7 +725,7 @@ class NavigationManagerTest extends TestCase {
$this->assertEquals($expectedApp, $this->navigationManager->getDefaultEntryIdForUser(null, $withFallbacks));
}
- public function testDefaultEntryUpdated() {
+ public function testDefaultEntryUpdated(): void {
$this->appManager->method('getInstalledApps')->willReturn([]);
$user = $this->createMock(IUser::class);
diff --git a/tests/lib/Notification/ActionTest.php b/tests/lib/Notification/ActionTest.php
index bfcfbbe75db..3ae4b1db7e7 100644
--- a/tests/lib/Notification/ActionTest.php
+++ b/tests/lib/Notification/ActionTest.php
@@ -32,7 +32,7 @@ class ActionTest extends TestCase {
* @dataProvider dataSetLabel
* @param string $label
*/
- public function testSetLabel($label) {
+ public function testSetLabel($label): void {
$this->assertSame('', $this->action->getLabel());
$this->assertSame($this->action, $this->action->setLabel($label));
$this->assertSame($label, $this->action->getLabel());
@@ -50,7 +50,7 @@ class ActionTest extends TestCase {
* @param mixed $label
*
*/
- public function testSetLabelInvalid($label) {
+ public function testSetLabelInvalid($label): void {
$this->expectException(\InvalidArgumentException::class);
$this->action->setLabel($label);
@@ -68,7 +68,7 @@ class ActionTest extends TestCase {
* @dataProvider dataSetParsedLabel
* @param string $label
*/
- public function testSetParsedLabel($label) {
+ public function testSetParsedLabel($label): void {
$this->assertSame('', $this->action->getParsedLabel());
$this->assertSame($this->action, $this->action->setParsedLabel($label));
$this->assertSame($label, $this->action->getParsedLabel());
@@ -85,7 +85,7 @@ class ActionTest extends TestCase {
* @param mixed $label
*
*/
- public function testSetParsedLabelInvalid($label) {
+ public function testSetParsedLabelInvalid($label): void {
$this->expectException(\InvalidArgumentException::class);
$this->action->setParsedLabel($label);
@@ -105,7 +105,7 @@ class ActionTest extends TestCase {
* @param string $link
* @param string $type
*/
- public function testSetLink($link, $type) {
+ public function testSetLink($link, $type): void {
$this->assertSame('', $this->action->getLink());
$this->assertSame($this->action, $this->action->setLink($link, $type));
$this->assertSame($link, $this->action->getLink());
@@ -129,7 +129,7 @@ class ActionTest extends TestCase {
* @param mixed $type
*
*/
- public function testSetLinkInvalid($link, $type) {
+ public function testSetLinkInvalid($link, $type): void {
$this->expectException(\InvalidArgumentException::class);
$this->action->setLink($link, $type);
@@ -146,13 +146,13 @@ class ActionTest extends TestCase {
* @dataProvider dataSetPrimary
* @param bool $primary
*/
- public function testSetPrimary($primary) {
+ public function testSetPrimary($primary): void {
$this->assertSame(false, $this->action->isPrimary());
$this->assertSame($this->action, $this->action->setPrimary($primary));
$this->assertSame($primary, $this->action->isPrimary());
}
- public function testIsValid() {
+ public function testIsValid(): void {
$this->assertFalse($this->action->isValid());
$this->assertFalse($this->action->isValidParsed());
$this->action->setLabel('label');
@@ -163,7 +163,7 @@ class ActionTest extends TestCase {
$this->assertFalse($this->action->isValidParsed());
}
- public function testIsValidParsed() {
+ public function testIsValidParsed(): void {
$this->assertFalse($this->action->isValid());
$this->assertFalse($this->action->isValidParsed());
$this->action->setParsedLabel('label');
diff --git a/tests/lib/Notification/NotificationTest.php b/tests/lib/Notification/NotificationTest.php
index 9afc74db495..48a78bd0fe7 100644
--- a/tests/lib/Notification/NotificationTest.php
+++ b/tests/lib/Notification/NotificationTest.php
@@ -57,7 +57,7 @@ class NotificationTest extends TestCase {
* @dataProvider dataSetApp
* @param string $app
*/
- public function testSetApp($app) {
+ public function testSetApp($app): void {
$this->assertSame('', $this->notification->getApp());
$this->assertSame($this->notification, $this->notification->setApp($app));
$this->assertSame($app, $this->notification->getApp());
@@ -72,7 +72,7 @@ class NotificationTest extends TestCase {
* @param mixed $app
*
*/
- public function testSetAppInvalid($app) {
+ public function testSetAppInvalid($app): void {
$this->expectException(\InvalidArgumentException::class);
$this->notification->setApp($app);
@@ -87,7 +87,7 @@ class NotificationTest extends TestCase {
* @dataProvider dataSetUser
* @param string $user
*/
- public function testSetUser($user) {
+ public function testSetUser($user): void {
$this->assertSame('', $this->notification->getUser());
$this->assertSame($this->notification, $this->notification->setUser($user));
$this->assertSame($user, $this->notification->getUser());
@@ -102,7 +102,7 @@ class NotificationTest extends TestCase {
* @param mixed $user
*
*/
- public function testSetUserInvalid($user) {
+ public function testSetUserInvalid($user): void {
$this->expectException(\InvalidArgumentException::class);
$this->notification->setUser($user);
@@ -126,7 +126,7 @@ class NotificationTest extends TestCase {
* @dataProvider dataSetDateTime
* @param \DateTime $dateTime
*/
- public function testSetDateTime(\DateTime $dateTime) {
+ public function testSetDateTime(\DateTime $dateTime): void {
$this->assertSame(0, $this->notification->getDateTime()->getTimestamp());
$this->assertSame($this->notification, $this->notification->setDateTime($dateTime));
$this->assertSame($dateTime, $this->notification->getDateTime());
@@ -146,7 +146,7 @@ class NotificationTest extends TestCase {
*
* @expectedMessage 'The given date time is invalid'
*/
- public function testSetDateTimeZero($dateTime) {
+ public function testSetDateTimeZero($dateTime): void {
$this->expectException(\InvalidArgumentException::class);
$this->notification->setDateTime($dateTime);
@@ -164,7 +164,7 @@ class NotificationTest extends TestCase {
* @param string $type
* @param string $id
*/
- public function testSetObject($type, $id) {
+ public function testSetObject($type, $id): void {
$this->assertSame('', $this->notification->getObjectType());
$this->assertSame('', $this->notification->getObjectId());
$this->assertSame($this->notification, $this->notification->setObject($type, $id));
@@ -189,7 +189,7 @@ class NotificationTest extends TestCase {
*
* @expectedMessage 'The given object id is invalid'
*/
- public function testSetObjectIdInvalid($id) {
+ public function testSetObjectIdInvalid($id): void {
$this->expectException(\InvalidArgumentException::class);
$this->notification->setObject('object', $id);
@@ -208,7 +208,7 @@ class NotificationTest extends TestCase {
* @param string $subject
* @param array $parameters
*/
- public function testSetSubject($subject, $parameters) {
+ public function testSetSubject($subject, $parameters): void {
$this->assertSame('', $this->notification->getSubject());
$this->assertSame([], $this->notification->getSubjectParameters());
$this->assertSame($this->notification, $this->notification->setSubject($subject, $parameters));
@@ -225,7 +225,7 @@ class NotificationTest extends TestCase {
* @param mixed $subject
*
*/
- public function testSetSubjectInvalidSubject($subject) {
+ public function testSetSubjectInvalidSubject($subject): void {
$this->expectException(\InvalidArgumentException::class);
$this->notification->setSubject($subject, []);
@@ -239,7 +239,7 @@ class NotificationTest extends TestCase {
* @dataProvider dataSetParsedSubject
* @param string $subject
*/
- public function testSetParsedSubject($subject) {
+ public function testSetParsedSubject($subject): void {
$this->assertSame('', $this->notification->getParsedSubject());
$this->assertSame($this->notification, $this->notification->setParsedSubject($subject));
$this->assertSame($subject, $this->notification->getParsedSubject());
@@ -254,7 +254,7 @@ class NotificationTest extends TestCase {
* @param mixed $subject
*
*/
- public function testSetParsedSubjectInvalid($subject) {
+ public function testSetParsedSubjectInvalid($subject): void {
$this->expectException(\InvalidArgumentException::class);
$this->notification->setParsedSubject($subject);
@@ -273,7 +273,7 @@ class NotificationTest extends TestCase {
* @param string $message
* @param array $parameters
*/
- public function testSetMessage($message, $parameters) {
+ public function testSetMessage($message, $parameters): void {
$this->assertSame('', $this->notification->getMessage());
$this->assertSame([], $this->notification->getMessageParameters());
$this->assertSame($this->notification, $this->notification->setMessage($message, $parameters));
@@ -290,7 +290,7 @@ class NotificationTest extends TestCase {
* @param mixed $message
*
*/
- public function testSetMessageInvalidMessage($message) {
+ public function testSetMessageInvalidMessage($message): void {
$this->expectException(\InvalidArgumentException::class);
$this->notification->setMessage($message, []);
@@ -304,7 +304,7 @@ class NotificationTest extends TestCase {
* @dataProvider dataSetParsedMessage
* @param string $message
*/
- public function testSetParsedMessage($message) {
+ public function testSetParsedMessage($message): void {
$this->assertSame('', $this->notification->getParsedMessage());
$this->assertSame($this->notification, $this->notification->setParsedMessage($message));
$this->assertSame($message, $this->notification->getParsedMessage());
@@ -319,7 +319,7 @@ class NotificationTest extends TestCase {
* @param mixed $message
*
*/
- public function testSetParsedMessageInvalid($message) {
+ public function testSetParsedMessageInvalid($message): void {
$this->expectException(\InvalidArgumentException::class);
$this->notification->setParsedMessage($message);
@@ -333,7 +333,7 @@ class NotificationTest extends TestCase {
* @dataProvider dataSetLink
* @param string $link
*/
- public function testSetLink($link) {
+ public function testSetLink($link): void {
$this->assertSame('', $this->notification->getLink());
$this->assertSame($this->notification, $this->notification->setLink($link));
$this->assertSame($link, $this->notification->getLink());
@@ -348,7 +348,7 @@ class NotificationTest extends TestCase {
* @param mixed $link
*
*/
- public function testSetLinkInvalid($link) {
+ public function testSetLinkInvalid($link): void {
$this->expectException(\InvalidArgumentException::class);
$this->notification->setLink($link);
@@ -362,7 +362,7 @@ class NotificationTest extends TestCase {
* @dataProvider dataSetIcon
* @param string $icon
*/
- public function testSetIcon($icon) {
+ public function testSetIcon($icon): void {
$this->assertSame('', $this->notification->getIcon());
$this->assertSame($this->notification, $this->notification->setIcon($icon));
$this->assertSame($icon, $this->notification->getIcon());
@@ -377,18 +377,18 @@ class NotificationTest extends TestCase {
* @param mixed $icon
*
*/
- public function testSetIconInvalid($icon) {
+ public function testSetIconInvalid($icon): void {
$this->expectException(\InvalidArgumentException::class);
$this->notification->setIcon($icon);
}
- public function testCreateAction() {
+ public function testCreateAction(): void {
$action = $this->notification->createAction();
$this->assertInstanceOf(IAction::class, $action);
}
- public function testAddAction() {
+ public function testAddAction(): void {
/** @var \OCP\Notification\IAction|\PHPUnit\Framework\MockObject\MockObject $action */
$action = $this->createMock(IAction::class);
$action->expects($this->once())
@@ -404,7 +404,7 @@ class NotificationTest extends TestCase {
}
- public function testAddActionInvalid() {
+ public function testAddActionInvalid(): void {
$this->expectException(\InvalidArgumentException::class);
/** @var \OCP\Notification\IAction|\PHPUnit\Framework\MockObject\MockObject $action */
@@ -418,7 +418,7 @@ class NotificationTest extends TestCase {
$this->notification->addAction($action);
}
- public function testAddActionSecondPrimary() {
+ public function testAddActionSecondPrimary(): void {
/** @var \OCP\Notification\IAction|\PHPUnit\Framework\MockObject\MockObject $action */
$action = $this->createMock(IAction::class);
$action->expects($this->exactly(2))
@@ -434,7 +434,7 @@ class NotificationTest extends TestCase {
$this->notification->addAction($action);
}
- public function testAddParsedAction() {
+ public function testAddParsedAction(): void {
/** @var \OCP\Notification\IAction|\PHPUnit\Framework\MockObject\MockObject $action */
$action = $this->createMock(IAction::class);
$action->expects($this->once())
@@ -450,7 +450,7 @@ class NotificationTest extends TestCase {
}
- public function testAddParsedActionInvalid() {
+ public function testAddParsedActionInvalid(): void {
$this->expectException(\InvalidArgumentException::class);
/** @var \OCP\Notification\IAction|\PHPUnit\Framework\MockObject\MockObject $action */
@@ -464,7 +464,7 @@ class NotificationTest extends TestCase {
$this->notification->addParsedAction($action);
}
- public function testAddActionSecondParsedPrimary() {
+ public function testAddActionSecondParsedPrimary(): void {
/** @var \OCP\Notification\IAction|\PHPUnit\Framework\MockObject\MockObject $action */
$action = $this->createMock(IAction::class);
$action->expects($this->exactly(2))
@@ -480,7 +480,7 @@ class NotificationTest extends TestCase {
$this->notification->addParsedAction($action);
}
- public function testAddActionParsedPrimaryEnd() {
+ public function testAddActionParsedPrimaryEnd(): void {
/** @var \OCP\Notification\IAction|\PHPUnit\Framework\MockObject\MockObject $action */
$action1 = $this->createMock(IAction::class);
$action1->expects($this->exactly(2))
@@ -521,7 +521,7 @@ class NotificationTest extends TestCase {
* @param string $subject
* @param bool $expected
*/
- public function testIsValid($isValidCommon, $subject, $expected) {
+ public function testIsValid($isValidCommon, $subject, $expected): void {
/** @var \OCP\Notification\INotification|\PHPUnit\Framework\MockObject\MockObject $notification */
$notification = $this->getMockBuilder(Notification::class)
->setMethods([
@@ -554,7 +554,7 @@ class NotificationTest extends TestCase {
* @param string $subject
* @param bool $expected
*/
- public function testIsParsedValid($isValidCommon, $subject, $expected) {
+ public function testIsParsedValid($isValidCommon, $subject, $expected): void {
/** @var \OCP\Notification\INotification|\PHPUnit\Framework\MockObject\MockObject $notification */
$notification = $this->getMockBuilder(Notification::class)
->setMethods([
@@ -601,7 +601,7 @@ class NotificationTest extends TestCase {
* @param string $objectId
* @param bool $expected
*/
- public function testIsValidCommon($app, $user, $timestamp, $objectType, $objectId, $expected) {
+ public function testIsValidCommon($app, $user, $timestamp, $objectType, $objectId, $expected): void {
/** @var \OCP\Notification\INotification|\PHPUnit\Framework\MockObject\MockObject $notification */
$notification = $this->getMockBuilder(Notification::class)
->setMethods([
diff --git a/tests/lib/OCS/DiscoveryServiceTest.php b/tests/lib/OCS/DiscoveryServiceTest.php
index c3961c15a7a..3db3163e11d 100644
--- a/tests/lib/OCS/DiscoveryServiceTest.php
+++ b/tests/lib/OCS/DiscoveryServiceTest.php
@@ -40,7 +40,7 @@ class DiscoveryServiceTest extends TestCase {
* @param string $url
* @param bool $expected
*/
- public function testIsSafeUrl($url, $expected) {
+ public function testIsSafeUrl($url, $expected): void {
$result = $this->invokePrivate($this->discoveryService, 'isSafeUrl', [$url]);
$this->assertSame($expected, $result);
}
@@ -64,7 +64,7 @@ class DiscoveryServiceTest extends TestCase {
* @param string $service
* @param array $expected
*/
- public function testGetEndpoints($decodedServices, $service, $expected) {
+ public function testGetEndpoints($decodedServices, $service, $expected): void {
$result = $this->invokePrivate($this->discoveryService, 'getEndpoints', [$decodedServices, $service]);
$this->assertSame($expected, $result);
}
diff --git a/tests/lib/OCS/ProviderTest.php b/tests/lib/OCS/ProviderTest.php
index c1efa7d873e..3834c1d613e 100644
--- a/tests/lib/OCS/ProviderTest.php
+++ b/tests/lib/OCS/ProviderTest.php
@@ -25,7 +25,7 @@ class ProviderTest extends \Test\TestCase {
$this->ocsProvider = new Provider('ocs_provider', $this->request, $this->appManager);
}
- public function testBuildProviderListWithoutAnythingEnabled() {
+ public function testBuildProviderListWithoutAnythingEnabled(): void {
$this->appManager
->expects($this->exactly(4))
->method('isEnabledForUser')
@@ -56,7 +56,7 @@ class ProviderTest extends \Test\TestCase {
$this->assertEquals($expected, $this->ocsProvider->buildProviderList());
}
- public function testBuildProviderListWithSharingEnabled() {
+ public function testBuildProviderListWithSharingEnabled(): void {
$this->appManager
->expects($this->exactly(4))
->method('isEnabledForUser')
@@ -105,7 +105,7 @@ class ProviderTest extends \Test\TestCase {
$this->assertEquals($expected, $this->ocsProvider->buildProviderList());
}
- public function testBuildProviderListWithFederationEnabled() {
+ public function testBuildProviderListWithFederationEnabled(): void {
$this->appManager
->expects($this->exactly(4))
->method('isEnabledForUser')
@@ -149,7 +149,7 @@ class ProviderTest extends \Test\TestCase {
$this->assertEquals($expected, $this->ocsProvider->buildProviderList());
}
- public function testBuildProviderListWithEverythingEnabled() {
+ public function testBuildProviderListWithEverythingEnabled(): void {
$this->appManager
->expects($this->any())
->method('isEnabledForUser')
diff --git a/tests/lib/Preview/BackgroundCleanupJobTest.php b/tests/lib/Preview/BackgroundCleanupJobTest.php
index 82f19797728..d9ea1718491 100644
--- a/tests/lib/Preview/BackgroundCleanupJobTest.php
+++ b/tests/lib/Preview/BackgroundCleanupJobTest.php
@@ -121,7 +121,7 @@ class BackgroundCleanupJobTest extends \Test\TestCase {
return $i;
}
- public function testCleanupSystemCron() {
+ public function testCleanupSystemCron(): void {
$files = $this->setup11Previews();
$fileIds = array_map(function (File $f) {
return $f->getId();
@@ -145,7 +145,7 @@ class BackgroundCleanupJobTest extends \Test\TestCase {
$this->assertSame(0, $this->countPreviews($root, $fileIds));
}
- public function testCleanupAjax() {
+ public function testCleanupAjax(): void {
if ($this->connection->getShardDefinition('filecache')) {
$this->markTestSkipped('ajax cron is not supported for sharded setups');
return;
@@ -177,7 +177,7 @@ class BackgroundCleanupJobTest extends \Test\TestCase {
$this->assertSame(0, $this->countPreviews($root, $fileIds));
}
- public function testOldPreviews() {
+ public function testOldPreviews(): void {
if ($this->connection->getShardDefinition('filecache')) {
$this->markTestSkipped('old previews are not supported for sharded setups');
return;
diff --git a/tests/lib/Preview/GeneratorTest.php b/tests/lib/Preview/GeneratorTest.php
index d458062f561..7bd121250fb 100644
--- a/tests/lib/Preview/GeneratorTest.php
+++ b/tests/lib/Preview/GeneratorTest.php
@@ -57,7 +57,7 @@ class GeneratorTest extends \Test\TestCase {
);
}
- public function testGetCachedPreview() {
+ public function testGetCachedPreview(): void {
$file = $this->createMock(File::class);
$file->method('isReadable')
->willReturn(true);
@@ -97,7 +97,7 @@ class GeneratorTest extends \Test\TestCase {
$this->assertSame($previewFile, $result);
}
- public function testGetNewPreview() {
+ public function testGetNewPreview(): void {
$file = $this->createMock(File::class);
$file->method('isReadable')
->willReturn(true);
@@ -225,7 +225,7 @@ class GeneratorTest extends \Test\TestCase {
$this->assertSame($previewFile, $result);
}
- public function testInvalidMimeType() {
+ public function testInvalidMimeType(): void {
$this->expectException(NotFoundException::class);
$file = $this->createMock(File::class);
@@ -263,7 +263,7 @@ class GeneratorTest extends \Test\TestCase {
$this->generator->getPreview($file, 1024, 512, true, IPreview::MODE_COVER, 'invalidType');
}
- public function testReturnCachedPreviewsWithoutCheckingSupportedMimetype() {
+ public function testReturnCachedPreviewsWithoutCheckingSupportedMimetype(): void {
$file = $this->createMock(File::class);
$file->method('isReadable')
->willReturn(true);
@@ -301,7 +301,7 @@ class GeneratorTest extends \Test\TestCase {
$this->assertSame($preview, $result);
}
- public function testNoProvider() {
+ public function testNoProvider(): void {
$file = $this->createMock(File::class);
$file->method('isReadable')
->willReturn(true);
@@ -398,7 +398,7 @@ class GeneratorTest extends \Test\TestCase {
* @param int $expectedX
* @param int $expectedY
*/
- public function testCorrectSize($maxX, $maxY, $reqX, $reqY, $crop, $mode, $expectedX, $expectedY) {
+ public function testCorrectSize($maxX, $maxY, $reqX, $reqY, $crop, $mode, $expectedX, $expectedY): void {
$file = $this->createMock(File::class);
$file->method('isReadable')
->willReturn(true);
@@ -458,7 +458,7 @@ class GeneratorTest extends \Test\TestCase {
}
}
- public function testUnreadbleFile() {
+ public function testUnreadbleFile(): void {
$file = $this->createMock(File::class);
$file->method('isReadable')
->willReturn(false);
diff --git a/tests/lib/Preview/Provider.php b/tests/lib/Preview/Provider.php
index 6cecd8a0762..41a2a4ca3c4 100644
--- a/tests/lib/Preview/Provider.php
+++ b/tests/lib/Preview/Provider.php
@@ -78,7 +78,7 @@ abstract class Provider extends \Test\TestCase {
* @param int $widthAdjustment
* @param int $heightAdjustment
*/
- public function testGetThumbnail($widthAdjustment, $heightAdjustment) {
+ public function testGetThumbnail($widthAdjustment, $heightAdjustment): void {
$ratio = round($this->width / $this->height, 2);
$this->maxWidth = $this->width - $widthAdjustment;
$this->maxHeight = $this->height - $heightAdjustment;
diff --git a/tests/lib/PublicNamespace/UtilTest.php b/tests/lib/PublicNamespace/UtilTest.php
index 6931b191a4d..4fa31bd902a 100644
--- a/tests/lib/PublicNamespace/UtilTest.php
+++ b/tests/lib/PublicNamespace/UtilTest.php
@@ -13,7 +13,7 @@ class UtilTest extends \Test\TestCase {
*
* @param string $channel
*/
- public function testOverrideChannel($channel) {
+ public function testOverrideChannel($channel): void {
\OCP\Util::setChannel($channel);
$actual = \OCP\Util::getChannel($channel);
$this->assertEquals($channel, $actual);
diff --git a/tests/lib/Remote/Api/OCSTest.php b/tests/lib/Remote/Api/OCSTest.php
index d47bb50cc35..3fcc486f246 100644
--- a/tests/lib/Remote/Api/OCSTest.php
+++ b/tests/lib/Remote/Api/OCSTest.php
@@ -40,7 +40,7 @@ class OCSTest extends TestCase {
return 'https://example.com/ocs/v2.php/' . $url;
}
- public function testGetUser() {
+ public function testGetUser(): void {
$client = $this->getOCSClient();
$this->expectGetRequest($this->getOCSUrl('cloud/users/user'),
@@ -53,7 +53,7 @@ class OCSTest extends TestCase {
}
- public function testGetUserInvalidResponse() {
+ public function testGetUserInvalidResponse(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Invalid user response, expected field email not found');
@@ -67,7 +67,7 @@ class OCSTest extends TestCase {
}
- public function testInvalidPassword() {
+ public function testInvalidPassword(): void {
$this->expectException(\OC\ForbiddenException::class);
$client = $this->getOCSClient();
diff --git a/tests/lib/Remote/InstanceTest.php b/tests/lib/Remote/InstanceTest.php
index 3e4ffda15b7..027a67010be 100644
--- a/tests/lib/Remote/InstanceTest.php
+++ b/tests/lib/Remote/InstanceTest.php
@@ -24,7 +24,7 @@ class InstanceTest extends TestCase {
$this->cache = new ArrayCache();
}
- public function testBasicStatus() {
+ public function testBasicStatus(): void {
$instance = new Instance('example.com', $this->cache, $this->getClientService());
$this->expectGetRequest('https://example.com/status.php', '{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"13.0.0.5","versionstring":"13.0.0 alpha","edition":"","productname":"Nextcloud"}');
@@ -34,7 +34,7 @@ class InstanceTest extends TestCase {
$this->assertEquals('https://example.com', $instance->getFullUrl());
}
- public function testHttpFallback() {
+ public function testHttpFallback(): void {
$instance = new Instance('example.com', $this->cache, $this->getClientService());
$this->expectGetRequest('https://example.com/status.php', new \Exception());
$this->expectGetRequest('http://example.com/status.php', '{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"13.0.0.5","versionstring":"13.0.0 alpha","edition":"","productname":"Nextcloud"}');
@@ -43,7 +43,7 @@ class InstanceTest extends TestCase {
$this->assertEquals('http://example.com', $instance->getFullUrl());
}
- public function testRerequestHttps() {
+ public function testRerequestHttps(): void {
$instance = new Instance('example.com', $this->cache, $this->getClientService());
$this->expectGetRequest('https://example.com/status.php', '{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"13.0.0.5","versionstring":"13.0.0 alpha","edition":"","productname":"Nextcloud"}');
@@ -58,7 +58,7 @@ class InstanceTest extends TestCase {
}
- public function testPreventDowngradeAttach() {
+ public function testPreventDowngradeAttach(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('refusing to connect to remote instance(example.com) over http that was previously accessible over https');
diff --git a/tests/lib/Repair/CleanTagsTest.php b/tests/lib/Repair/CleanTagsTest.php
index 11430cc1215..13aca706a5a 100644
--- a/tests/lib/Repair/CleanTagsTest.php
+++ b/tests/lib/Repair/CleanTagsTest.php
@@ -69,7 +69,7 @@ class CleanTagsTest extends \Test\TestCase {
->execute();
}
- public function testRun() {
+ public function testRun(): void {
$cat1 = $this->addTagCategory('TestRepairCleanTags', 'files'); // Retained
$cat2 = $this->addTagCategory('TestRepairCleanTags2', 'files'); // Deleted: Category will be empty
$this->addTagCategory('TestRepairCleanTags3', 'files'); // Deleted: Category is empty
diff --git a/tests/lib/Repair/ClearFrontendCachesTest.php b/tests/lib/Repair/ClearFrontendCachesTest.php
index 640e272f3b7..e48db295d45 100644
--- a/tests/lib/Repair/ClearFrontendCachesTest.php
+++ b/tests/lib/Repair/ClearFrontendCachesTest.php
@@ -36,7 +36,7 @@ class ClearFrontendCachesTest extends \Test\TestCase {
}
- public function testRun() {
+ public function testRun(): void {
$imagePathCache = $this->createMock(ICache::class);
$imagePathCache->expects($this->once())
->method('clear')
diff --git a/tests/lib/Repair/ClearGeneratedAvatarCacheTest.php b/tests/lib/Repair/ClearGeneratedAvatarCacheTest.php
index 994e2a49f1a..c03b9082446 100644
--- a/tests/lib/Repair/ClearGeneratedAvatarCacheTest.php
+++ b/tests/lib/Repair/ClearGeneratedAvatarCacheTest.php
@@ -57,7 +57,7 @@ class ClearGeneratedAvatarCacheTest extends \Test\TestCase {
* @param string $from
* @param boolean $expected
*/
- public function testShouldRun($from, $expected) {
+ public function testShouldRun($from, $expected): void {
$this->config->expects($this->any())
->method('getSystemValueString')
->with('version', '0.0.0.0')
diff --git a/tests/lib/Repair/OldGroupMembershipSharesTest.php b/tests/lib/Repair/OldGroupMembershipSharesTest.php
index 4678bd174eb..5d3590499e6 100644
--- a/tests/lib/Repair/OldGroupMembershipSharesTest.php
+++ b/tests/lib/Repair/OldGroupMembershipSharesTest.php
@@ -51,7 +51,7 @@ class OldGroupMembershipSharesTest extends \Test\TestCase {
$qb->delete('share')->execute();
}
- public function testRun() {
+ public function testRun(): void {
$repair = new OldGroupMembershipShares(
$this->connection,
$this->groupManager
diff --git a/tests/lib/Repair/RepairCollationTest.php b/tests/lib/Repair/RepairCollationTest.php
index 234f68892b3..2b5091ad927 100644
--- a/tests/lib/Repair/RepairCollationTest.php
+++ b/tests/lib/Repair/RepairCollationTest.php
@@ -76,7 +76,7 @@ class RepairCollationTest extends TestCase {
parent::tearDown();
}
- public function testCollationConvert() {
+ public function testCollationConvert(): void {
$tables = $this->repair->getAllNonUTF8BinTables($this->connection);
$this->assertGreaterThanOrEqual(1, count($tables));
diff --git a/tests/lib/Repair/RepairDavSharesTest.php b/tests/lib/Repair/RepairDavSharesTest.php
index 9831365e974..3a97de4d25d 100644
--- a/tests/lib/Repair/RepairDavSharesTest.php
+++ b/tests/lib/Repair/RepairDavSharesTest.php
@@ -52,7 +52,7 @@ class RepairDavSharesTest extends TestCase {
);
}
- public function testRun() {
+ public function testRun(): void {
$this->config->expects($this->any())
->method('getSystemValueString')
->with('version', '0.0.0')
diff --git a/tests/lib/Repair/RepairInvalidSharesTest.php b/tests/lib/Repair/RepairInvalidSharesTest.php
index eb0e46c61db..d728e0c7ecd 100644
--- a/tests/lib/Repair/RepairInvalidSharesTest.php
+++ b/tests/lib/Repair/RepairInvalidSharesTest.php
@@ -60,7 +60,7 @@ class RepairInvalidSharesTest extends TestCase {
/**
* Test remove shares where the parent share does not exist anymore
*/
- public function testSharesNonExistingParent() {
+ public function testSharesNonExistingParent(): void {
$qb = $this->connection->getQueryBuilder();
$shareValues = [
'share_type' => $qb->expr()->literal(IShare::TYPE_USER),
@@ -153,7 +153,7 @@ class RepairInvalidSharesTest extends TestCase {
*
* @dataProvider fileSharePermissionsProvider
*/
- public function testFileSharePermissions($itemType, $testPerms, $expectedPerms) {
+ public function testFileSharePermissions($itemType, $testPerms, $expectedPerms): void {
$qb = $this->connection->getQueryBuilder();
$qb->insert('share')
->values([
diff --git a/tests/lib/Repair/RepairMimeTypesTest.php b/tests/lib/Repair/RepairMimeTypesTest.php
index fbccd393fd0..0f1a945bd8d 100644
--- a/tests/lib/Repair/RepairMimeTypesTest.php
+++ b/tests/lib/Repair/RepairMimeTypesTest.php
@@ -113,7 +113,7 @@ class RepairMimeTypesTest extends \Test\TestCase {
/**
* Test renaming the additional image mime types
*/
- public function testRenameImageTypes() {
+ public function testRenameImageTypes(): void {
$currentMimeTypes = [
['test.jp2', 'application/octet-stream'],
['test.webp', 'application/octet-stream'],
@@ -130,7 +130,7 @@ class RepairMimeTypesTest extends \Test\TestCase {
/**
* Test renaming the richdocuments additional office mime types
*/
- public function testRenameWindowsProgramTypes() {
+ public function testRenameWindowsProgramTypes(): void {
$currentMimeTypes = [
['test.htaccess', 'application/octet-stream'],
['.htaccess', 'application/octet-stream'],
@@ -152,7 +152,7 @@ class RepairMimeTypesTest extends \Test\TestCase {
* Test that nothing happens and no error happens when all mimetypes are
* already correct and no old ones exist..
*/
- public function testDoNothingWhenOnlyNewFiles() {
+ public function testDoNothingWhenOnlyNewFiles(): void {
$currentMimeTypes = [
['test.doc', 'application/msword'],
['test.docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
@@ -267,7 +267,7 @@ class RepairMimeTypesTest extends \Test\TestCase {
/**
* Test that mime type renaming does not affect folders
*/
- public function testDoNotChangeFolderMimeType() {
+ public function testDoNotChangeFolderMimeType(): void {
$currentMimeTypes = [
['test.conf', 'httpd/unix-directory'],
['test.cnf', 'httpd/unix-directory'],
diff --git a/tests/lib/RepairTest.php b/tests/lib/RepairTest.php
index ab60b14d47e..97c278a1d10 100644
--- a/tests/lib/RepairTest.php
+++ b/tests/lib/RepairTest.php
@@ -61,7 +61,7 @@ class RepairTest extends TestCase {
});
}
- public function testRunRepairStep() {
+ public function testRunRepairStep(): void {
$this->repair->addStep(new TestRepairStep(false));
$this->repair->run();
@@ -74,7 +74,7 @@ class RepairTest extends TestCase {
);
}
- public function testRunRepairStepThatFail() {
+ public function testRunRepairStepThatFail(): void {
$this->repair->addStep(new TestRepairStep(true));
$this->repair->run();
@@ -87,7 +87,7 @@ class RepairTest extends TestCase {
);
}
- public function testRunRepairStepsWithException() {
+ public function testRunRepairStepsWithException(): void {
$mock = $this->createMock(TestRepairStep::class);
$mock->expects($this->any())
->method('run')
@@ -119,7 +119,7 @@ class RepairTest extends TestCase {
);
}
- public function testRunRepairStepsContinueAfterWarning() {
+ public function testRunRepairStepsContinueAfterWarning(): void {
$this->repair->addStep(new TestRepairStep(true));
$this->repair->addStep(new TestRepairStep(false));
$this->repair->run();
diff --git a/tests/lib/RichObjectStrings/DefinitionsTest.php b/tests/lib/RichObjectStrings/DefinitionsTest.php
index efe372a25e8..9299a556972 100644
--- a/tests/lib/RichObjectStrings/DefinitionsTest.php
+++ b/tests/lib/RichObjectStrings/DefinitionsTest.php
@@ -20,7 +20,7 @@ class DefinitionsTest extends TestCase {
}
- public function testGetDefinitionNotExisting() {
+ public function testGetDefinitionNotExisting(): void {
$this->expectException(\OCP\RichObjectStrings\InvalidObjectExeption::class);
$this->expectExceptionMessage('Object type is undefined');
@@ -33,7 +33,7 @@ class DefinitionsTest extends TestCase {
* @param string $type
* @param array $expected
*/
- public function testGetDefinition($type, array $expected) {
+ public function testGetDefinition($type, array $expected): void {
$definitions = new Definitions();
$definition = $definitions->getDefinition($type);
diff --git a/tests/lib/RichObjectStrings/ValidatorTest.php b/tests/lib/RichObjectStrings/ValidatorTest.php
index 91fe10916d2..e5230efe462 100644
--- a/tests/lib/RichObjectStrings/ValidatorTest.php
+++ b/tests/lib/RichObjectStrings/ValidatorTest.php
@@ -12,7 +12,7 @@ use OCP\RichObjectStrings\InvalidObjectExeption;
use Test\TestCase;
class ValidatorTest extends TestCase {
- public function test() {
+ public function test(): void {
$v = new Validator(new Definitions());
$v->validate('test', []);
$v->validate('test {string1} test {foo} test {bar}.', [
diff --git a/tests/lib/Security/Bruteforce/ThrottlerTest.php b/tests/lib/Security/Bruteforce/ThrottlerTest.php
index 69d20cccd3a..a94f1849c8a 100644
--- a/tests/lib/Security/Bruteforce/ThrottlerTest.php
+++ b/tests/lib/Security/Bruteforce/ThrottlerTest.php
@@ -183,7 +183,7 @@ class ThrottlerTest extends TestCase {
*/
public function testIsIpWhiteListedWithEnabledProtection($ip,
$whitelists,
- $isWhiteListed) {
+ $isWhiteListed): void {
$this->isIpWhiteListedHelper(
$ip,
$whitelists,
@@ -201,7 +201,7 @@ class ThrottlerTest extends TestCase {
*/
public function testIsIpWhiteListedWithDisabledProtection($ip,
$whitelists,
- $isWhiteListed) {
+ $isWhiteListed): void {
$this->isIpWhiteListedHelper(
$ip,
$whitelists,
diff --git a/tests/lib/Security/CSP/AddContentSecurityPolicyEventTest.php b/tests/lib/Security/CSP/AddContentSecurityPolicyEventTest.php
index edc0c613655..39dd7a95890 100644
--- a/tests/lib/Security/CSP/AddContentSecurityPolicyEventTest.php
+++ b/tests/lib/Security/CSP/AddContentSecurityPolicyEventTest.php
@@ -15,7 +15,7 @@ use OCP\Security\CSP\AddContentSecurityPolicyEvent;
use Test\TestCase;
class AddContentSecurityPolicyEventTest extends TestCase {
- public function testAddEvent() {
+ public function testAddEvent(): void {
$cspManager = $this->createMock(ContentSecurityPolicyManager::class);
$policy = $this->createMock(ContentSecurityPolicy::class);
$event = new AddContentSecurityPolicyEvent($cspManager);
diff --git a/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php b/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php
index dc0fe7c8340..63a5565e7fa 100644
--- a/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php
+++ b/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php
@@ -28,12 +28,12 @@ class ContentSecurityPolicyManagerTest extends TestCase {
$this->contentSecurityPolicyManager = new ContentSecurityPolicyManager($this->dispatcher);
}
- public function testAddDefaultPolicy() {
+ public function testAddDefaultPolicy(): void {
$this->contentSecurityPolicyManager->addDefaultPolicy(new \OCP\AppFramework\Http\ContentSecurityPolicy());
$this->addToAssertionCount(1);
}
- public function testGetDefaultPolicyWithPolicies() {
+ public function testGetDefaultPolicyWithPolicies(): void {
$policy = new \OCP\AppFramework\Http\ContentSecurityPolicy();
$policy->addAllowedFontDomain('mydomain.com');
$policy->addAllowedImageDomain('anotherdomain.de');
@@ -64,7 +64,7 @@ class ContentSecurityPolicyManagerTest extends TestCase {
$this->assertSame($expectedStringPolicy, $this->contentSecurityPolicyManager->getDefaultPolicy()->buildPolicy());
}
- public function testGetDefaultPolicyWithPoliciesViaEvent() {
+ public function testGetDefaultPolicyWithPoliciesViaEvent(): void {
$this->dispatcher->addListener(AddContentSecurityPolicyEvent::class, function (AddContentSecurityPolicyEvent $e) {
$policy = new \OCP\AppFramework\Http\ContentSecurityPolicy();
$policy->addAllowedFontDomain('mydomain.com');
diff --git a/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php b/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php
index 54c8fe832cc..3765311155a 100644
--- a/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php
+++ b/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php
@@ -33,7 +33,7 @@ class ContentSecurityPolicyNonceManagerTest extends TestCase {
);
}
- public function testGetNonce() {
+ public function testGetNonce(): void {
$secret = base64_encode('secret');
$tokenValue = base64_encode('secret' ^ 'value_') . ':' . $secret;
$token = $this->createMock(CsrfToken::class);
@@ -52,7 +52,7 @@ class ContentSecurityPolicyNonceManagerTest extends TestCase {
$this->assertSame($secret, $this->nonceManager->getNonce());
}
- public function testGetNonceServerVar() {
+ public function testGetNonceServerVar(): void {
$token = 'SERVERNONCE';
$this->request
->method('__isset')
diff --git a/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php b/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php
index 8b92848341c..98eddf602ee 100644
--- a/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php
+++ b/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php
@@ -23,7 +23,7 @@ class CsrfTokenGeneratorTest extends \Test\TestCase {
$this->csrfTokenGenerator = new \OC\Security\CSRF\CsrfTokenGenerator($this->random);
}
- public function testGenerateTokenWithCustomNumber() {
+ public function testGenerateTokenWithCustomNumber(): void {
$this->random
->expects($this->once())
->method('generate')
@@ -32,7 +32,7 @@ class CsrfTokenGeneratorTest extends \Test\TestCase {
$this->assertSame('abc', $this->csrfTokenGenerator->generateToken(3));
}
- public function testGenerateTokenWithDefault() {
+ public function testGenerateTokenWithDefault(): void {
$this->random
->expects($this->once())
->method('generate')
diff --git a/tests/lib/Security/CSRF/CsrfTokenManagerTest.php b/tests/lib/Security/CSRF/CsrfTokenManagerTest.php
index 8c19bc6e82d..47f873bfe13 100644
--- a/tests/lib/Security/CSRF/CsrfTokenManagerTest.php
+++ b/tests/lib/Security/CSRF/CsrfTokenManagerTest.php
@@ -31,7 +31,7 @@ class CsrfTokenManagerTest extends \Test\TestCase {
);
}
- public function testGetTokenWithExistingToken() {
+ public function testGetTokenWithExistingToken(): void {
$this->storageInterface
->expects($this->once())
->method('hasToken')
@@ -45,7 +45,7 @@ class CsrfTokenManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $this->csrfTokenManager->getToken());
}
- public function testGetTokenWithExistingTokenKeepsOnSecondRequest() {
+ public function testGetTokenWithExistingTokenKeepsOnSecondRequest(): void {
$this->storageInterface
->expects($this->once())
->method('hasToken')
@@ -61,7 +61,7 @@ class CsrfTokenManagerTest extends \Test\TestCase {
$this->assertSame($token, $this->csrfTokenManager->getToken());
}
- public function testGetTokenWithoutExistingToken() {
+ public function testGetTokenWithoutExistingToken(): void {
$this->storageInterface
->expects($this->once())
->method('hasToken')
@@ -79,7 +79,7 @@ class CsrfTokenManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $this->csrfTokenManager->getToken());
}
- public function testRefreshToken() {
+ public function testRefreshToken(): void {
$this->tokenGenerator
->expects($this->once())
->method('generateToken')
@@ -93,7 +93,7 @@ class CsrfTokenManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $this->csrfTokenManager->refreshToken());
}
- public function testRemoveToken() {
+ public function testRemoveToken(): void {
$this->storageInterface
->expects($this->once())
->method('removeToken');
@@ -101,7 +101,7 @@ class CsrfTokenManagerTest extends \Test\TestCase {
$this->csrfTokenManager->removeToken();
}
- public function testIsTokenValidWithoutToken() {
+ public function testIsTokenValidWithoutToken(): void {
$this->storageInterface
->expects($this->once())
->method('hasToken')
@@ -111,7 +111,7 @@ class CsrfTokenManagerTest extends \Test\TestCase {
$this->assertSame(false, $this->csrfTokenManager->isTokenValid($token));
}
- public function testIsTokenValidWithWrongToken() {
+ public function testIsTokenValidWithWrongToken(): void {
$this->storageInterface
->expects($this->once())
->method('hasToken')
@@ -125,7 +125,7 @@ class CsrfTokenManagerTest extends \Test\TestCase {
$this->assertSame(false, $this->csrfTokenManager->isTokenValid($token));
}
- public function testIsTokenValidWithValidToken() {
+ public function testIsTokenValidWithValidToken(): void {
$a = 'abc';
$b = 'def';
$xorB64 = 'BQcF';
diff --git a/tests/lib/Security/CSRF/CsrfTokenTest.php b/tests/lib/Security/CSRF/CsrfTokenTest.php
index c6f9aaa5be7..9ecbbe9f23a 100644
--- a/tests/lib/Security/CSRF/CsrfTokenTest.php
+++ b/tests/lib/Security/CSRF/CsrfTokenTest.php
@@ -11,20 +11,20 @@ declare(strict_types=1);
namespace Test\Security\CSRF;
class CsrfTokenTest extends \Test\TestCase {
- public function testGetEncryptedValue() {
+ public function testGetEncryptedValue(): void {
$csrfToken = new \OC\Security\CSRF\CsrfToken('MyCsrfToken');
$this->assertSame(33, strlen($csrfToken->getEncryptedValue()));
$this->assertSame(':', $csrfToken->getEncryptedValue()[16]);
}
- public function testGetEncryptedValueStaysSameOnSecondRequest() {
+ public function testGetEncryptedValueStaysSameOnSecondRequest(): void {
$csrfToken = new \OC\Security\CSRF\CsrfToken('MyCsrfToken');
$tokenValue = $csrfToken->getEncryptedValue();
$this->assertSame($tokenValue, $csrfToken->getEncryptedValue());
$this->assertSame($tokenValue, $csrfToken->getEncryptedValue());
}
- public function testGetDecryptedValue() {
+ public function testGetDecryptedValue(): void {
$a = 'abc';
$b = 'def';
$xorB64 = 'BQcF';
diff --git a/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php b/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php
index 8e5c8b8e481..f8386124626 100644
--- a/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php
+++ b/tests/lib/Security/CSRF/TokenStorage/SessionStorageTest.php
@@ -44,7 +44,7 @@ class SessionStorageTest extends \Test\TestCase {
* @dataProvider getTokenDataProvider
*
*/
- public function testGetTokenWithEmptyToken($token) {
+ public function testGetTokenWithEmptyToken($token): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Session does not contain a requesttoken');
@@ -56,7 +56,7 @@ class SessionStorageTest extends \Test\TestCase {
$this->sessionStorage->getToken();
}
- public function testGetTokenWithValidToken() {
+ public function testGetTokenWithValidToken(): void {
$this->session
->expects($this->once())
->method('get')
@@ -65,7 +65,7 @@ class SessionStorageTest extends \Test\TestCase {
$this->assertSame('MyFancyCsrfToken', $this->sessionStorage->getToken());
}
- public function testSetToken() {
+ public function testSetToken(): void {
$this->session
->expects($this->once())
->method('set')
@@ -73,7 +73,7 @@ class SessionStorageTest extends \Test\TestCase {
$this->sessionStorage->setToken('TokenToSet');
}
- public function testRemoveToken() {
+ public function testRemoveToken(): void {
$this->session
->expects($this->once())
->method('remove')
@@ -81,7 +81,7 @@ class SessionStorageTest extends \Test\TestCase {
$this->sessionStorage->removeToken();
}
- public function testHasTokenWithExistingToken() {
+ public function testHasTokenWithExistingToken(): void {
$this->session
->expects($this->once())
->method('exists')
@@ -90,7 +90,7 @@ class SessionStorageTest extends \Test\TestCase {
$this->assertSame(true, $this->sessionStorage->hasToken());
}
- public function testHasTokenWithoutExistingToken() {
+ public function testHasTokenWithoutExistingToken(): void {
$this->session
->expects($this->once())
->method('exists')
@@ -99,7 +99,7 @@ class SessionStorageTest extends \Test\TestCase {
$this->assertSame(false, $this->sessionStorage->hasToken());
}
- public function testSetSession() {
+ public function testSetSession(): void {
$session = $this->createMock(ISession::class);
$session
->expects($this->once())
diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php
index e123ebeda25..14036b3dd3b 100644
--- a/tests/lib/Security/CertificateManagerTest.php
+++ b/tests/lib/Security/CertificateManagerTest.php
@@ -76,7 +76,7 @@ class CertificateManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $actual);
}
- public function testListCertificates() {
+ public function testListCertificates(): void {
// Test empty certificate bundle
$this->assertSame([], $this->certificateManager->listCertificates());
@@ -93,7 +93,7 @@ class CertificateManagerTest extends \Test\TestCase {
}
- public function testAddInvalidCertificate() {
+ public function testAddInvalidCertificate(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Certificate could not get parsed.');
@@ -115,21 +115,21 @@ class CertificateManagerTest extends \Test\TestCase {
* @dataProvider dangerousFileProvider
* @param string $filename
*/
- public function testAddDangerousFile($filename) {
+ public function testAddDangerousFile($filename): void {
$this->expectException(InvalidPathException::class);
$this->certificateManager->addCertificate(file_get_contents(__DIR__ . '/../../data/certificates/expiredCertificate.crt'), $filename);
}
- public function testRemoveDangerousFile() {
+ public function testRemoveDangerousFile(): void {
$this->assertFalse($this->certificateManager->removeCertificate('../../foo.txt'));
}
- public function testRemoveExistingFile() {
+ public function testRemoveExistingFile(): void {
$this->certificateManager->addCertificate(file_get_contents(__DIR__ . '/../../data/certificates/goodCertificate.crt'), 'GoodCertificate');
$this->assertTrue($this->certificateManager->removeCertificate('GoodCertificate'));
}
- public function testGetCertificateBundle() {
+ public function testGetCertificateBundle(): void {
$this->assertSame('/files_external/rootcerts.crt', $this->certificateManager->getCertificateBundle());
}
@@ -145,7 +145,7 @@ class CertificateManagerTest extends \Test\TestCase {
$targetBundleMtime,
$targetBundleExists,
$expected
- ) {
+ ): void {
$view = $this->getMockBuilder(View::class)
->disableOriginalConstructor()->getMock();
$config = $this->createMock(IConfig::class);
diff --git a/tests/lib/Security/CertificateTest.php b/tests/lib/Security/CertificateTest.php
index 6f4e736263b..8b084ca41b3 100644
--- a/tests/lib/Security/CertificateTest.php
+++ b/tests/lib/Security/CertificateTest.php
@@ -32,7 +32,7 @@ class CertificateTest extends \Test\TestCase {
}
- public function testBogusData() {
+ public function testBogusData(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Certificate could not get parsed.');
@@ -41,36 +41,36 @@ class CertificateTest extends \Test\TestCase {
}
- public function testCertificateStartingWithFileReference() {
+ public function testCertificateStartingWithFileReference(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Certificate could not get parsed.');
new Certificate('file://'.__DIR__ . '/../../data/certificates/goodCertificate.crt', 'bar');
}
- public function testGetName() {
+ public function testGetName(): void {
$this->assertSame('GoodCertificate', $this->goodCertificate->getName());
$this->assertSame('BadCertificate', $this->invalidCertificate->getName());
}
- public function testGetCommonName() {
+ public function testGetCommonName(): void {
$this->assertSame('security.owncloud.com', $this->goodCertificate->getCommonName());
$this->assertSame(null, $this->invalidCertificate->getCommonName());
}
- public function testGetOrganization() {
+ public function testGetOrganization(): void {
$this->assertSame('ownCloud Security', $this->goodCertificate->getOrganization());
$this->assertSame('Internet Widgits Pty Ltd', $this->invalidCertificate->getOrganization());
}
- public function testGetIssueDate() {
+ public function testGetIssueDate(): void {
$expected = new \DateTime('2015-08-27 20:03:42 GMT');
$this->assertEquals($expected->getTimestamp(), $this->goodCertificate->getIssueDate()->getTimestamp());
$expected = new \DateTime('2015-08-27 20:19:13 GMT');
$this->assertEquals($expected->getTimestamp(), $this->invalidCertificate->getIssueDate()->getTimestamp());
}
- public function testGetExpireDate() {
+ public function testGetExpireDate(): void {
$expected = new \DateTime('2025-08-24 20:03:42 GMT');
$this->assertEquals($expected->getTimestamp(), $this->goodCertificate->getExpireDate()->getTimestamp());
$expected = new \DateTime('2025-08-24 20:19:13 GMT');
@@ -79,19 +79,19 @@ class CertificateTest extends \Test\TestCase {
$this->assertEquals($expected->getTimestamp(), $this->expiredCertificate->getExpireDate()->getTimestamp());
}
- public function testIsExpired() {
+ public function testIsExpired(): void {
$this->assertSame(false, $this->goodCertificate->isExpired());
$this->assertSame(false, $this->invalidCertificate->isExpired());
$this->assertSame(true, $this->expiredCertificate->isExpired());
}
- public function testGetIssuerName() {
+ public function testGetIssuerName(): void {
$this->assertSame('security.owncloud.com', $this->goodCertificate->getIssuerName());
$this->assertSame(null, $this->invalidCertificate->getIssuerName());
$this->assertSame(null, $this->expiredCertificate->getIssuerName());
}
- public function testGetIssuerOrganization() {
+ public function testGetIssuerOrganization(): void {
$this->assertSame('ownCloud Security', $this->goodCertificate->getIssuerOrganization());
$this->assertSame('Internet Widgits Pty Ltd', $this->invalidCertificate->getIssuerOrganization());
$this->assertSame('Internet Widgits Pty Ltd', $this->expiredCertificate->getIssuerOrganization());
diff --git a/tests/lib/Security/CredentialsManagerTest.php b/tests/lib/Security/CredentialsManagerTest.php
index d9272627e5b..ce60a2f62a2 100644
--- a/tests/lib/Security/CredentialsManagerTest.php
+++ b/tests/lib/Security/CredentialsManagerTest.php
@@ -20,7 +20,7 @@ class CredentialsManagerTest extends \Test\TestCase {
/**
* @dataProvider credentialsProvider
*/
- public function testWithDB($userId, $identifier) {
+ public function testWithDB($userId, $identifier): void {
$credentialsManager = Server::get(ICredentialsManager::class);
$secrets = 'Open Sesame';
diff --git a/tests/lib/Security/CryptoTest.php b/tests/lib/Security/CryptoTest.php
index b65a9a36985..ef96f8d5ddb 100644
--- a/tests/lib/Security/CryptoTest.php
+++ b/tests/lib/Security/CryptoTest.php
@@ -32,13 +32,13 @@ class CryptoTest extends \Test\TestCase {
/**
* @dataProvider defaultEncryptionProvider
*/
- public function testDefaultEncrypt($stringToEncrypt) {
+ public function testDefaultEncrypt($stringToEncrypt): void {
$ciphertext = $this->crypto->encrypt($stringToEncrypt);
$this->assertEquals($stringToEncrypt, $this->crypto->decrypt($ciphertext));
}
- public function testWrongPassword() {
+ public function testWrongPassword(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('HMAC does not match.');
@@ -47,14 +47,14 @@ class CryptoTest extends \Test\TestCase {
$this->crypto->decrypt($ciphertext, 'A wrong password!');
}
- public function testLaterDecryption() {
+ public function testLaterDecryption(): void {
$stringToEncrypt = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.';
$encryptedString = '44a35023cca2e7a6125e06c29fc4b2ad9d8a33d0873a8b45b0de4ef9284f260c6c46bf25dc62120644c59b8bafe4281ddc47a70c35ae6c29ef7a63d79eefacc297e60b13042ac582733598d0a6b4de37311556bb5c480fd2633de4e6ebafa868c2d1e2d80a5d24f9660360dba4d6e0c8|lhrFgK0zd9U160Wo|a75e57ab701f9124e1113543fd1dc596f21e20d456a0d1e813d5a8aaec9adcb11213788e96598b67fe9486a9f0b99642c18296d0175db44b1ae426e4e91080ee';
$this->assertEquals($stringToEncrypt, $this->crypto->decrypt($encryptedString, 'ThisIsAVeryS3cur3P4ssw0rd'));
}
- public function testWrongIV() {
+ public function testWrongIV(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('HMAC does not match.');
@@ -63,7 +63,7 @@ class CryptoTest extends \Test\TestCase {
}
- public function testWrongParameters() {
+ public function testWrongParameters(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Authenticated ciphertext could not be decoded.');
@@ -71,14 +71,14 @@ class CryptoTest extends \Test\TestCase {
$this->crypto->decrypt($encryptedString, 'ThisIsAVeryS3cur3P4ssw0rd');
}
- public function testLegacy() {
+ public function testLegacy(): void {
$cipherText = 'e16599188e3d212f5c7f17fdc2abca46|M1WfLAxbcAmITeD6|509457885d6ca5e6c3bfd3741852687a7f2bffce197f8d5ae97b65818b15a1b7f616b68326ff312371540f4ca8ac55f8e2de4aa13aab3474bd3431e51214e3ee';
$password = 'mypass';
$this->assertSame('legacy test', $this->crypto->decrypt($cipherText, $password));
}
- public function testVersion2CiphertextDecryptsToCorrectPlaintext() {
+ public function testVersion2CiphertextDecryptsToCorrectPlaintext(): void {
$this->assertSame(
'This is a plaintext value that will be encrypted with version 2. Which addresses the reduced permutations on the IV.',
$this->crypto->decrypt(
@@ -88,7 +88,7 @@ class CryptoTest extends \Test\TestCase {
);
}
- public function testVersion3CiphertextDecryptsToCorrectPlaintext() {
+ public function testVersion3CiphertextDecryptsToCorrectPlaintext(): void {
$this->assertSame(
'Another plaintext value that will be encrypted with version 3. It addresses the related key issue. Old ciphertexts should be decrypted properly, but only use the better version for encryption.',
$this->crypto->decrypt(
diff --git a/tests/lib/Security/Events/GenerateSecurePasswordEventTest.php b/tests/lib/Security/Events/GenerateSecurePasswordEventTest.php
index 29002a90488..e589f20f62c 100644
--- a/tests/lib/Security/Events/GenerateSecurePasswordEventTest.php
+++ b/tests/lib/Security/Events/GenerateSecurePasswordEventTest.php
@@ -14,19 +14,19 @@ use OCP\Security\PasswordContext;
class GenerateSecurePasswordEventTest extends \Test\TestCase {
- public function testDefaultProperties() {
+ public function testDefaultProperties(): void {
$event = new GenerateSecurePasswordEvent();
$this->assertNull($event->getPassword());
$this->assertEquals(PasswordContext::ACCOUNT, $event->getContext());
}
- public function testSettingPassword() {
+ public function testSettingPassword(): void {
$event = new GenerateSecurePasswordEvent();
$event->setPassword('example');
$this->assertEquals('example', $event->getPassword());
}
- public function testSettingContext() {
+ public function testSettingContext(): void {
$event = new GenerateSecurePasswordEvent(PasswordContext::SHARING);
$this->assertEquals(PasswordContext::SHARING, $event->getContext());
}
diff --git a/tests/lib/Security/Events/ValidatePasswordPolicyEventTest.php b/tests/lib/Security/Events/ValidatePasswordPolicyEventTest.php
index 8a7bc3b2f29..272f34e31aa 100644
--- a/tests/lib/Security/Events/ValidatePasswordPolicyEventTest.php
+++ b/tests/lib/Security/Events/ValidatePasswordPolicyEventTest.php
@@ -14,14 +14,14 @@ use OCP\Security\PasswordContext;
class ValidatePasswordPolicyEventTest extends \Test\TestCase {
- public function testDefaultProperties() {
+ public function testDefaultProperties(): void {
$password = 'example';
$event = new ValidatePasswordPolicyEvent($password);
$this->assertEquals($password, $event->getPassword());
$this->assertEquals(PasswordContext::ACCOUNT, $event->getContext());
}
- public function testSettingContext() {
+ public function testSettingContext(): void {
$event = new ValidatePasswordPolicyEvent('example', PasswordContext::SHARING);
$this->assertEquals(PasswordContext::SHARING, $event->getContext());
}
diff --git a/tests/lib/Security/FeaturePolicy/AddFeaturePolicyEventTest.php b/tests/lib/Security/FeaturePolicy/AddFeaturePolicyEventTest.php
index 3c964972238..1fe01e26280 100644
--- a/tests/lib/Security/FeaturePolicy/AddFeaturePolicyEventTest.php
+++ b/tests/lib/Security/FeaturePolicy/AddFeaturePolicyEventTest.php
@@ -14,7 +14,7 @@ use OCP\Security\FeaturePolicy\AddFeaturePolicyEvent;
use Test\TestCase;
class AddFeaturePolicyEventTest extends TestCase {
- public function testAddEvent() {
+ public function testAddEvent(): void {
$manager = $this->createMock(FeaturePolicyManager::class);
$policy = $this->createMock(FeaturePolicy::class);
$event = new AddFeaturePolicyEvent($manager);
diff --git a/tests/lib/Security/FeaturePolicy/FeaturePolicyManagerTest.php b/tests/lib/Security/FeaturePolicy/FeaturePolicyManagerTest.php
index 7110effb261..7386aa023a9 100644
--- a/tests/lib/Security/FeaturePolicy/FeaturePolicyManagerTest.php
+++ b/tests/lib/Security/FeaturePolicy/FeaturePolicyManagerTest.php
@@ -27,12 +27,12 @@ class FeaturePolicyManagerTest extends TestCase {
$this->manager = new FeaturePolicyManager($this->dispatcher);
}
- public function testAddDefaultPolicy() {
+ public function testAddDefaultPolicy(): void {
$this->manager->addDefaultPolicy(new FeaturePolicy());
$this->addToAssertionCount(1);
}
- public function testGetDefaultPolicyWithPoliciesViaEvent() {
+ public function testGetDefaultPolicyWithPoliciesViaEvent(): void {
$this->dispatcher->addListener(AddFeaturePolicyEvent::class, function (AddFeaturePolicyEvent $e) {
$policy = new FeaturePolicy();
$policy->addAllowedMicrophoneDomain('mydomain.com');
diff --git a/tests/lib/Security/HasherTest.php b/tests/lib/Security/HasherTest.php
index f51b4ee39db..41cad7f323f 100644
--- a/tests/lib/Security/HasherTest.php
+++ b/tests/lib/Security/HasherTest.php
@@ -122,7 +122,7 @@ class HasherTest extends \Test\TestCase {
$this->hasher = new Hasher($this->config);
}
- public function testHash() {
+ public function testHash(): void {
$hash = $this->hasher->hash('String To Hash');
$this->assertNotNull($hash);
}
@@ -130,7 +130,7 @@ class HasherTest extends \Test\TestCase {
/**
* @dataProvider versionHashProvider
*/
- public function testSplitHash($hash, $expected) {
+ public function testSplitHash($hash, $expected): void {
$relativePath = self::invokePrivate($this->hasher, 'splitHash', [$hash]);
$this->assertSame($expected, $relativePath);
}
@@ -139,7 +139,7 @@ class HasherTest extends \Test\TestCase {
/**
* @dataProvider hashProviders70_71
*/
- public function testVerify($password, $hash, $expected) {
+ public function testVerify($password, $hash, $expected): void {
$this->config
->expects($this->any())
->method('getSystemValue')
@@ -157,7 +157,7 @@ class HasherTest extends \Test\TestCase {
/**
* @dataProvider hashProviders72
*/
- public function testVerifyArgon2i($password, $hash, $expected) {
+ public function testVerifyArgon2i($password, $hash, $expected): void {
if (!\defined('PASSWORD_ARGON2I')) {
$this->markTestSkipped('Need ARGON2 support to test ARGON2 hashes');
}
@@ -169,7 +169,7 @@ class HasherTest extends \Test\TestCase {
/**
* @dataProvider hashProviders73
*/
- public function testVerifyArgon2id(string $password, string $hash, bool $expected) {
+ public function testVerifyArgon2id(string $password, string $hash, bool $expected): void {
if (!\defined('PASSWORD_ARGON2ID')) {
$this->markTestSkipped('Need ARGON2ID support to test ARGON2ID hashes');
}
@@ -178,7 +178,7 @@ class HasherTest extends \Test\TestCase {
$this->assertSame($expected, $result);
}
- public function testUpgradeHashBlowFishToArgon2() {
+ public function testUpgradeHashBlowFishToArgon2(): void {
if (!\defined('PASSWORD_ARGON2I')) {
$this->markTestSkipped('Need ARGON2 support to test ARGON2 hashes');
}
@@ -203,7 +203,7 @@ class HasherTest extends \Test\TestCase {
$this->assertFalse(password_needs_rehash($relativePath['hash'], $newAlg, []));
}
- public function testUsePasswordDefaultArgon2iVerify() {
+ public function testUsePasswordDefaultArgon2iVerify(): void {
if (!\defined('PASSWORD_ARGON2I')) {
$this->markTestSkipped('Need ARGON2 support to test ARGON2 hashes');
}
@@ -227,7 +227,7 @@ class HasherTest extends \Test\TestCase {
$this->assertTrue(password_verify($message, $relativePath['hash']));
}
- public function testDoNotUsePasswordDefaultArgon2idVerify() {
+ public function testDoNotUsePasswordDefaultArgon2idVerify(): void {
if (!\defined('PASSWORD_ARGON2ID')) {
$this->markTestSkipped('Need ARGON2ID support to test ARGON2ID hashes');
}
@@ -245,7 +245,7 @@ class HasherTest extends \Test\TestCase {
$this->assertNull($newHash);
}
- public function testHashUsePasswordDefault() {
+ public function testHashUsePasswordDefault(): void {
if (!\defined('PASSWORD_ARGON2I')) {
$this->markTestSkipped('Need ARGON2 support to test ARGON2 hashes');
}
@@ -265,7 +265,7 @@ class HasherTest extends \Test\TestCase {
$this->assertEquals(PASSWORD_BCRYPT, $info['algo']);
}
- public function testValidHash() {
+ public function testValidHash(): void {
$hash = '3|$argon2id$v=19$m=65536,t=4,p=1$czFCSjk3LklVdXppZ2VCWA$li0NgdXe2/jwSRxgteGQPWlzJU0E0xdtfHbCbrpych0';
$isValid = $this->hasher->validate($hash);
@@ -273,7 +273,7 @@ class HasherTest extends \Test\TestCase {
$this->assertTrue($isValid);
}
- public function testValidGeneratedHash() {
+ public function testValidGeneratedHash(): void {
$message = 'secret';
$hash = $this->hasher->hash($message);
@@ -282,7 +282,7 @@ class HasherTest extends \Test\TestCase {
$this->assertTrue($isValid);
}
- public function testInvalidHash() {
+ public function testInvalidHash(): void {
$invalidHash = 'someInvalidHash';
$isValid = $this->hasher->validate($invalidHash);
diff --git a/tests/lib/Security/IdentityProof/KeyTest.php b/tests/lib/Security/IdentityProof/KeyTest.php
index 19dc02e2ad1..572bfbea619 100644
--- a/tests/lib/Security/IdentityProof/KeyTest.php
+++ b/tests/lib/Security/IdentityProof/KeyTest.php
@@ -22,11 +22,11 @@ class KeyTest extends TestCase {
$this->key = new Key('public', 'private');
}
- public function testGetPrivate() {
+ public function testGetPrivate(): void {
$this->assertSame('private', $this->key->getPrivate());
}
- public function testGetPublic() {
+ public function testGetPublic(): void {
$this->assertSame('public', $this->key->getPublic());
}
}
diff --git a/tests/lib/Security/IdentityProof/ManagerTest.php b/tests/lib/Security/IdentityProof/ManagerTest.php
index bb5b01d563c..722555efe01 100644
--- a/tests/lib/Security/IdentityProof/ManagerTest.php
+++ b/tests/lib/Security/IdentityProof/ManagerTest.php
@@ -79,7 +79,7 @@ class ManagerTest extends TestCase {
}
}
- public function testGetKeyWithExistingKey() {
+ public function testGetKeyWithExistingKey(): void {
$user = $this->createMock(IUser::class);
$user
->expects($this->once())
@@ -122,7 +122,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($expected, $this->manager->getKey($user));
}
- public function testGetKeyWithNotExistingKey() {
+ public function testGetKeyWithNotExistingKey(): void {
$user = $this->createMock(IUser::class);
$user
->expects($this->once())
@@ -177,7 +177,7 @@ class ManagerTest extends TestCase {
$this->assertEquals($expected, $this->manager->getKey($user));
}
- public function testGenerateKeyPair() {
+ public function testGenerateKeyPair(): void {
$manager = $this->getManager();
$data = 'MyTestData';
@@ -189,7 +189,7 @@ class ManagerTest extends TestCase {
$this->assertSame(2048, $details['bits']);
}
- public function testGetSystemKey() {
+ public function testGetSystemKey(): void {
$manager = $this->getManager(['retrieveKey']);
/** @var Key|\PHPUnit\Framework\MockObject\MockObject $key */
@@ -206,7 +206,7 @@ class ManagerTest extends TestCase {
- public function testGetSystemKeyFailure() {
+ public function testGetSystemKeyFailure(): void {
$this->expectException(\RuntimeException::class);
$manager = $this->getManager(['retrieveKey']);
diff --git a/tests/lib/Security/IdentityProof/SignerTest.php b/tests/lib/Security/IdentityProof/SignerTest.php
index 8b8d93e6b9a..6dc73c072e4 100644
--- a/tests/lib/Security/IdentityProof/SignerTest.php
+++ b/tests/lib/Security/IdentityProof/SignerTest.php
@@ -90,7 +90,7 @@ gQIDAQAB
);
}
- public function testSign() {
+ public function testSign(): void {
$user = $this->createMock(IUser::class);
$user->method('getCloudId')
->willReturn('foo@example.com');
@@ -123,7 +123,7 @@ gQIDAQAB
$this->assertEquals($expects, $result);
}
- public function testVerifyValid() {
+ public function testVerifyValid(): void {
$data = [
'message' => [
'data' => [
@@ -151,7 +151,7 @@ gQIDAQAB
$this->assertTrue($this->signer->verify($data));
}
- public function testVerifyInvalid() {
+ public function testVerifyInvalid(): void {
$data = [
'message' => [
'data' => [
@@ -179,7 +179,7 @@ gQIDAQAB
$this->assertFalse($this->signer->verify($data));
}
- public function testVerifyInvalidData() {
+ public function testVerifyInvalidData(): void {
$data = [
];
diff --git a/tests/lib/Security/Normalizer/IpAddressTest.php b/tests/lib/Security/Normalizer/IpAddressTest.php
index ae6b5cbc9ca..55cb149309a 100644
--- a/tests/lib/Security/Normalizer/IpAddressTest.php
+++ b/tests/lib/Security/Normalizer/IpAddressTest.php
@@ -60,11 +60,11 @@ class IpAddressTest extends TestCase {
* @param string $input
* @param string $expected
*/
- public function testGetSubnet($input, $expected) {
+ public function testGetSubnet($input, $expected): void {
$this->assertSame($expected, (new IpAddress($input))->getSubnet());
}
- public function testToString() {
+ public function testToString(): void {
$this->assertSame('127.0.0.1', (string)(new IpAddress('127.0.0.1')));
}
}
diff --git a/tests/lib/Security/RateLimiting/Backend/MemoryCacheBackendTest.php b/tests/lib/Security/RateLimiting/Backend/MemoryCacheBackendTest.php
index 27799ce4af5..24e3ab1a209 100644
--- a/tests/lib/Security/RateLimiting/Backend/MemoryCacheBackendTest.php
+++ b/tests/lib/Security/RateLimiting/Backend/MemoryCacheBackendTest.php
@@ -53,7 +53,7 @@ class MemoryCacheBackendTest extends TestCase {
);
}
- public function testGetAttemptsWithNoAttemptsBefore() {
+ public function testGetAttemptsWithNoAttemptsBefore(): void {
$this->cache
->expects($this->once())
->method('get')
@@ -63,7 +63,7 @@ class MemoryCacheBackendTest extends TestCase {
$this->assertSame(0, $this->memoryCache->getAttempts('Method', 'User'));
}
- public function testGetAttempts() {
+ public function testGetAttempts(): void {
$this->timeFactory
->expects($this->once())
->method('getTime')
@@ -84,7 +84,7 @@ class MemoryCacheBackendTest extends TestCase {
$this->assertSame(3, $this->memoryCache->getAttempts('Method', 'User'));
}
- public function testRegisterAttemptWithNoAttemptsBefore() {
+ public function testRegisterAttemptWithNoAttemptsBefore(): void {
$this->timeFactory
->expects($this->once())
->method('getTime')
@@ -106,7 +106,7 @@ class MemoryCacheBackendTest extends TestCase {
$this->memoryCache->registerAttempt('Method', 'User', 100);
}
- public function testRegisterAttempt() {
+ public function testRegisterAttempt(): void {
$this->timeFactory
->expects($this->once())
->method('getTime')
diff --git a/tests/lib/Security/RateLimiting/LimiterTest.php b/tests/lib/Security/RateLimiting/LimiterTest.php
index 332f26b81d0..92600e22de8 100644
--- a/tests/lib/Security/RateLimiting/LimiterTest.php
+++ b/tests/lib/Security/RateLimiting/LimiterTest.php
@@ -31,7 +31,7 @@ class LimiterTest extends TestCase {
}
- public function testRegisterAnonRequestExceeded() {
+ public function testRegisterAnonRequestExceeded(): void {
$this->expectException(\OC\Security\RateLimiting\Exception\RateLimitExceededException::class);
$this->expectExceptionMessage('Rate limit exceeded');
@@ -47,7 +47,7 @@ class LimiterTest extends TestCase {
$this->limiter->registerAnonRequest('MyIdentifier', 100, 100, '127.0.0.1');
}
- public function testRegisterAnonRequestSuccess() {
+ public function testRegisterAnonRequestSuccess(): void {
$this->backend
->expects($this->once())
->method('getAttempts')
@@ -69,7 +69,7 @@ class LimiterTest extends TestCase {
}
- public function testRegisterUserRequestExceeded() {
+ public function testRegisterUserRequestExceeded(): void {
$this->expectException(\OC\Security\RateLimiting\Exception\RateLimitExceededException::class);
$this->expectExceptionMessage('Rate limit exceeded');
@@ -91,7 +91,7 @@ class LimiterTest extends TestCase {
$this->limiter->registerUserRequest('MyIdentifier', 100, 100, $user);
}
- public function testRegisterUserRequestSuccess() {
+ public function testRegisterUserRequestSuccess(): void {
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
$user = $this->createMock(IUser::class);
$user
diff --git a/tests/lib/Security/SecureRandomTest.php b/tests/lib/Security/SecureRandomTest.php
index 6e5f3587630..08d33d4a1b3 100644
--- a/tests/lib/Security/SecureRandomTest.php
+++ b/tests/lib/Security/SecureRandomTest.php
@@ -43,7 +43,7 @@ class SecureRandomTest extends \Test\TestCase {
/**
* @dataProvider stringGenerationProvider
*/
- public function testGetLowStrengthGeneratorLength($length, $expectedLength) {
+ public function testGetLowStrengthGeneratorLength($length, $expectedLength): void {
$generator = $this->rng;
$this->assertEquals($expectedLength, strlen($generator->generate($length)));
@@ -52,7 +52,7 @@ class SecureRandomTest extends \Test\TestCase {
/**
* @dataProvider stringGenerationProvider
*/
- public function testMediumLowStrengthGeneratorLength($length, $expectedLength) {
+ public function testMediumLowStrengthGeneratorLength($length, $expectedLength): void {
$generator = $this->rng;
$this->assertEquals($expectedLength, strlen($generator->generate($length)));
@@ -61,14 +61,14 @@ class SecureRandomTest extends \Test\TestCase {
/**
* @dataProvider stringGenerationProvider
*/
- public function testUninitializedGenerate($length, $expectedLength) {
+ public function testUninitializedGenerate($length, $expectedLength): void {
$this->assertEquals($expectedLength, strlen($this->rng->generate($length)));
}
/**
* @dataProvider charCombinations
*/
- public function testScheme($charName, $chars) {
+ public function testScheme($charName, $chars): void {
$generator = $this->rng;
$scheme = constant('OCP\Security\ISecureRandom::' . $charName);
$randomString = $generator->generate(100, $scheme);
@@ -86,7 +86,7 @@ class SecureRandomTest extends \Test\TestCase {
/**
* @dataProvider invalidLengths
*/
- public function testInvalidLengths($length) {
+ public function testInvalidLengths($length): void {
$this->expectException(\LengthException::class);
$generator = $this->rng;
$generator->generate($length);
diff --git a/tests/lib/Security/TrustedDomainHelperTest.php b/tests/lib/Security/TrustedDomainHelperTest.php
index 3dbaf376b52..656b7a77206 100644
--- a/tests/lib/Security/TrustedDomainHelperTest.php
+++ b/tests/lib/Security/TrustedDomainHelperTest.php
@@ -32,7 +32,7 @@ class TrustedDomainHelperTest extends \Test\TestCase {
* @param string $testDomain
* @param bool $result
*/
- public function testIsTrustedUrl($trustedDomains, $testDomain, $result) {
+ public function testIsTrustedUrl($trustedDomains, $testDomain, $result): void {
$this->config->method('getSystemValue')
->willReturnMap([
['overwritehost', '', ''],
@@ -49,7 +49,7 @@ class TrustedDomainHelperTest extends \Test\TestCase {
* @param string $testDomain
* @param bool $result
*/
- public function testIsTrustedDomain($trustedDomains, $testDomain, $result) {
+ public function testIsTrustedDomain($trustedDomains, $testDomain, $result): void {
$this->config->method('getSystemValue')
->willReturnMap([
['overwritehost', '', ''],
@@ -134,7 +134,7 @@ class TrustedDomainHelperTest extends \Test\TestCase {
];
}
- public function testIsTrustedDomainOverwriteHost() {
+ public function testIsTrustedDomainOverwriteHost(): void {
$this->config->method('getSystemValue')
->with('overwritehost')
->willReturn('myproxyhost');
diff --git a/tests/lib/Security/VerificationToken/VerificationTokenTest.php b/tests/lib/Security/VerificationToken/VerificationTokenTest.php
index f8573478fa5..7123cc8b013 100644
--- a/tests/lib/Security/VerificationToken/VerificationTokenTest.php
+++ b/tests/lib/Security/VerificationToken/VerificationTokenTest.php
@@ -52,13 +52,13 @@ class VerificationTokenTest extends TestCase {
);
}
- public function testTokenUserUnknown() {
+ public function testTokenUserUnknown(): void {
$this->expectException(InvalidTokenException::class);
$this->expectExceptionCode(InvalidTokenException::USER_UNKNOWN);
$this->token->check('encryptedToken', null, 'fingerprintToken', 'foobar');
}
- public function testTokenUserUnknown2() {
+ public function testTokenUserUnknown2(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->atLeastOnce())
->method('isEnabled')
@@ -69,7 +69,7 @@ class VerificationTokenTest extends TestCase {
$this->token->check('encryptedToken', $user, 'fingerprintToken', 'foobar');
}
- public function testTokenNotFound() {
+ public function testTokenNotFound(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->atLeastOnce())
->method('isEnabled')
@@ -85,7 +85,7 @@ class VerificationTokenTest extends TestCase {
$this->token->check('encryptedToken', $user, 'fingerprintToken', 'foobar');
}
- public function testTokenDecryptionError() {
+ public function testTokenDecryptionError(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->atLeastOnce())
->method('isEnabled')
@@ -112,7 +112,7 @@ class VerificationTokenTest extends TestCase {
$this->token->check('encryptedToken', $user, 'fingerprintToken', 'foobar');
}
- public function testTokenInvalidFormat() {
+ public function testTokenInvalidFormat(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->atLeastOnce())
->method('isEnabled')
@@ -139,7 +139,7 @@ class VerificationTokenTest extends TestCase {
$this->token->check('encryptedToken', $user, 'fingerprintToken', 'foobar');
}
- public function testTokenExpired() {
+ public function testTokenExpired(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->atLeastOnce())
->method('isEnabled')
@@ -173,7 +173,7 @@ class VerificationTokenTest extends TestCase {
$this->token->check('encryptedToken', $user, 'fingerprintToken', 'foobar');
}
- public function testTokenExpiredByLogin() {
+ public function testTokenExpiredByLogin(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->atLeastOnce())
->method('isEnabled')
@@ -207,7 +207,7 @@ class VerificationTokenTest extends TestCase {
$this->token->check('encryptedToken', $user, 'fingerprintToken', 'foobar', true);
}
- public function testTokenMismatch() {
+ public function testTokenMismatch(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->atLeastOnce())
->method('isEnabled')
@@ -241,7 +241,7 @@ class VerificationTokenTest extends TestCase {
$this->token->check('encryptedToken', $user, 'fingerprintToken', 'foobar');
}
- public function testTokenSuccess() {
+ public function testTokenSuccess(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->atLeastOnce())
->method('isEnabled')
@@ -273,7 +273,7 @@ class VerificationTokenTest extends TestCase {
$this->token->check('barfoo', $user, 'fingerprintToken', 'foobar');
}
- public function testCreate() {
+ public function testCreate(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->any())
->method('getUID')
diff --git a/tests/lib/ServerTest.php b/tests/lib/ServerTest.php
index e43c10b9cde..7f7d3125fdd 100644
--- a/tests/lib/ServerTest.php
+++ b/tests/lib/ServerTest.php
@@ -152,16 +152,16 @@ class ServerTest extends \Test\TestCase {
* @param string $serviceName
* @param string $instanceOf
*/
- public function testQuery($serviceName, $instanceOf) {
+ public function testQuery($serviceName, $instanceOf): void {
$this->assertInstanceOf($instanceOf, $this->server->query($serviceName), 'Service "' . $serviceName . '"" did not return the right class');
}
- public function testGetCertificateManager() {
+ public function testGetCertificateManager(): void {
$this->assertInstanceOf('\OC\Security\CertificateManager', $this->server->getCertificateManager(), 'service returned by "getCertificateManager" did not return the right class');
$this->assertInstanceOf('\OCP\ICertificateManager', $this->server->getCertificateManager(), 'service returned by "getCertificateManager" did not return the right class');
}
- public function testOverwriteDefaultCommentsManager() {
+ public function testOverwriteDefaultCommentsManager(): void {
$config = $this->server->getConfig();
$defaultManagerFactory = $config->getSystemValue('comments.managerFactory', '\OC\Comments\ManagerFactory');
diff --git a/tests/lib/Session/CryptoWrappingTest.php b/tests/lib/Session/CryptoWrappingTest.php
index 093f2214929..8afbf61bddc 100644
--- a/tests/lib/Session/CryptoWrappingTest.php
+++ b/tests/lib/Session/CryptoWrappingTest.php
@@ -47,7 +47,7 @@ class CryptoWrappingTest extends TestCase {
$this->instance = new CryptoSessionData($this->wrappedSession, $this->crypto, 'PASS');
}
- public function testUnwrappingGet() {
+ public function testUnwrappingGet(): void {
$unencryptedValue = 'foobar';
$encryptedValue = $this->crypto->encrypt($unencryptedValue);
diff --git a/tests/lib/Session/MemoryTest.php b/tests/lib/Session/MemoryTest.php
index f5d9685039d..24bfc06b274 100644
--- a/tests/lib/Session/MemoryTest.php
+++ b/tests/lib/Session/MemoryTest.php
@@ -15,7 +15,7 @@ class MemoryTest extends Session {
}
- public function testThrowsExceptionOnGetId() {
+ public function testThrowsExceptionOnGetId(): void {
$this->expectException(\OCP\Session\Exceptions\SessionNotAvailableException::class);
$this->instance->getId();
diff --git a/tests/lib/Session/Session.php b/tests/lib/Session/Session.php
index 63fa4554477..1e2e9370825 100644
--- a/tests/lib/Session/Session.php
+++ b/tests/lib/Session/Session.php
@@ -19,43 +19,43 @@ abstract class Session extends \Test\TestCase {
parent::tearDown();
}
- public function testNotExistsEmpty() {
+ public function testNotExistsEmpty(): void {
$this->assertFalse($this->instance->exists('foo'));
}
- public function testExistsAfterSet() {
+ public function testExistsAfterSet(): void {
$this->instance->set('foo', 1);
$this->assertTrue($this->instance->exists('foo'));
}
- public function testNotExistsAfterRemove() {
+ public function testNotExistsAfterRemove(): void {
$this->instance->set('foo', 1);
$this->instance->remove('foo');
$this->assertFalse($this->instance->exists('foo'));
}
- public function testGetNonExisting() {
+ public function testGetNonExisting(): void {
$this->assertNull($this->instance->get('foo'));
}
- public function testGetAfterSet() {
+ public function testGetAfterSet(): void {
$this->instance->set('foo', 'bar');
$this->assertEquals('bar', $this->instance->get(('foo')));
}
- public function testRemoveNonExisting() {
+ public function testRemoveNonExisting(): void {
$this->assertFalse($this->instance->exists('foo'));
$this->instance->remove('foo');
$this->assertFalse($this->instance->exists('foo'));
}
- public function testNotExistsAfterClear() {
+ public function testNotExistsAfterClear(): void {
$this->instance->set('foo', 1);
$this->instance->clear();
$this->assertFalse($this->instance->exists('foo'));
}
- public function testArrayInterface() {
+ public function testArrayInterface(): void {
$this->assertFalse(isset($this->instance['foo']));
$this->instance['foo'] = 'bar';
$this->assertTrue(isset($this->instance['foo']));
diff --git a/tests/lib/Settings/ManagerTest.php b/tests/lib/Settings/ManagerTest.php
index 6ed8ed74359..90c195e6bd0 100644
--- a/tests/lib/Settings/ManagerTest.php
+++ b/tests/lib/Settings/ManagerTest.php
@@ -64,7 +64,7 @@ class ManagerTest extends TestCase {
);
}
- public function testGetAdminSections() {
+ public function testGetAdminSections(): void {
$this->manager->registerSection('admin', \OCA\WorkflowEngine\Settings\Section::class);
$section = \OC::$server->query(\OCA\WorkflowEngine\Settings\Section::class);
@@ -77,7 +77,7 @@ class ManagerTest extends TestCase {
], $this->manager->getAdminSections());
}
- public function testGetPersonalSections() {
+ public function testGetPersonalSections(): void {
$this->manager->registerSection('personal', \OCA\WorkflowEngine\Settings\Section::class);
$section = \OC::$server->query(\OCA\WorkflowEngine\Settings\Section::class);
@@ -90,11 +90,11 @@ class ManagerTest extends TestCase {
], $this->manager->getPersonalSections());
}
- public function testGetAdminSectionsEmptySection() {
+ public function testGetAdminSectionsEmptySection(): void {
$this->assertEquals([], $this->manager->getAdminSections());
}
- public function testGetPersonalSectionsEmptySection() {
+ public function testGetPersonalSectionsEmptySection(): void {
$this->l10nFactory
->expects($this->once())
->method('get')
@@ -108,7 +108,7 @@ class ManagerTest extends TestCase {
$this->assertEquals([], $this->manager->getPersonalSections());
}
- public function testGetAdminSettings() {
+ public function testGetAdminSettings(): void {
$section = $this->createMock(ISettings::class);
$section->method('getPriority')
->willReturn(13);
@@ -126,7 +126,7 @@ class ManagerTest extends TestCase {
], $settings);
}
- public function testGetAdminSettingsAsSubAdmin() {
+ public function testGetAdminSettingsAsSubAdmin(): void {
$section = $this->createMock(ISettings::class);
$section->method('getPriority')
->willReturn(13);
@@ -142,7 +142,7 @@ class ManagerTest extends TestCase {
$this->assertEquals([], $settings);
}
- public function testGetSubAdminSettingsAsSubAdmin() {
+ public function testGetSubAdminSettingsAsSubAdmin(): void {
$section = $this->createMock(ISubAdminSettings::class);
$section->method('getPriority')
->willReturn(13);
@@ -161,7 +161,7 @@ class ManagerTest extends TestCase {
], $settings);
}
- public function testGetPersonalSettings() {
+ public function testGetPersonalSettings(): void {
$section = $this->createMock(ISettings::class);
$section->method('getPriority')
->willReturn(16);
@@ -195,7 +195,7 @@ class ManagerTest extends TestCase {
], $settings);
}
- public function testSameSectionAsPersonalAndAdmin() {
+ public function testSameSectionAsPersonalAndAdmin(): void {
$this->l10nFactory
->expects($this->once())
->method('get')
diff --git a/tests/lib/Settings/SectionTest.php b/tests/lib/Settings/SectionTest.php
index 964256f303c..dd69f8ae110 100644
--- a/tests/lib/Settings/SectionTest.php
+++ b/tests/lib/Settings/SectionTest.php
@@ -10,13 +10,13 @@ use OC\Settings\Section;
use Test\TestCase;
class SectionTest extends TestCase {
- public function testGetID() {
+ public function testGetID(): void {
$this->assertSame('ldap', (new Section('ldap', 'name', 1))->getID());
}
- public function testGetName() {
+ public function testGetName(): void {
$this->assertSame('name', (new Section('ldap', 'name', 1))->getName());
}
- public function testGetPriority() {
+ public function testGetPriority(): void {
$this->assertSame(1, (new Section('ldap', 'name', 1))->getPriority());
}
}
diff --git a/tests/lib/SetupTest.php b/tests/lib/SetupTest.php
index 5216d2a730a..b5e1b7000c3 100644
--- a/tests/lib/SetupTest.php
+++ b/tests/lib/SetupTest.php
@@ -47,7 +47,7 @@ class SetupTest extends \Test\TestCase {
->getMock();
}
- public function testGetSupportedDatabasesWithOneWorking() {
+ public function testGetSupportedDatabasesWithOneWorking(): void {
$this->config
->expects($this->once())
->method('getValue')
@@ -70,7 +70,7 @@ class SetupTest extends \Test\TestCase {
$this->assertSame($expectedResult, $result);
}
- public function testGetSupportedDatabasesWithNoWorking() {
+ public function testGetSupportedDatabasesWithNoWorking(): void {
$this->config
->expects($this->once())
->method('getValue')
@@ -90,7 +90,7 @@ class SetupTest extends \Test\TestCase {
$this->assertSame([], $result);
}
- public function testGetSupportedDatabasesWithAllWorking() {
+ public function testGetSupportedDatabasesWithAllWorking(): void {
$this->config
->expects($this->once())
->method('getValue')
@@ -116,7 +116,7 @@ class SetupTest extends \Test\TestCase {
}
- public function testGetSupportedDatabaseException() {
+ public function testGetSupportedDatabaseException(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Supported databases are not properly configured.');
@@ -132,7 +132,7 @@ class SetupTest extends \Test\TestCase {
* @param $url
* @param $expected
*/
- public function testFindWebRootCli($url, $expected) {
+ public function testFindWebRootCli($url, $expected): void {
$cliState = \OC::$CLI;
$this->config
diff --git a/tests/lib/Share/HelperTest.php b/tests/lib/Share/HelperTest.php
index f92effebd5d..c923bb0480a 100644
--- a/tests/lib/Share/HelperTest.php
+++ b/tests/lib/Share/HelperTest.php
@@ -36,7 +36,7 @@ class HelperTest extends \Test\TestCase {
/**
* @dataProvider expireDateProvider
*/
- public function testCalculateExpireDate($defaultExpireSettings, $creationTime, $userExpireDate, $expected) {
+ public function testCalculateExpireDate($defaultExpireSettings, $creationTime, $userExpireDate, $expected): void {
$result = \OC\Share\Helper::calculateExpireDate($defaultExpireSettings, $creationTime, $userExpireDate);
$this->assertSame($expected, $result);
}
@@ -48,7 +48,7 @@ class HelperTest extends \Test\TestCase {
* @param string $server2
* @param bool $expected
*/
- public function testIsSameUserOnSameServer($user1, $server1, $user2, $server2, $expected) {
+ public function testIsSameUserOnSameServer($user1, $server1, $user2, $server2, $expected): void {
$this->assertSame($expected,
\OC\Share\Helper::isSameUserOnSameServer($user1, $server1, $user2, $server2)
);
diff --git a/tests/lib/Share/ShareTest.php b/tests/lib/Share/ShareTest.php
index d6ed54f06da..60891e10ca2 100644
--- a/tests/lib/Share/ShareTest.php
+++ b/tests/lib/Share/ShareTest.php
@@ -126,7 +126,7 @@ class ShareTest extends \Test\TestCase {
* @param string $url
* @param string $expectedResult
*/
- public function testRemoveProtocolFromUrl($url, $expectedResult) {
+ public function testRemoveProtocolFromUrl($url, $expectedResult): void {
$share = new Share();
$result = self::invokePrivate($share, 'removeProtocolFromUrl', [$url]);
$this->assertSame($expectedResult, $result);
@@ -145,7 +145,7 @@ class ShareTest extends \Test\TestCase {
* @param array $ungrouped
* @param array $grouped
*/
- public function testGroupItems($ungrouped, $grouped) {
+ public function testGroupItems($ungrouped, $grouped): void {
$result = DummyShareClass::groupItemsTest($ungrouped);
$this->compareArrays($grouped, $result);
diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php
index 50940819b15..36f070d7c99 100644
--- a/tests/lib/Share20/DefaultShareProviderTest.php
+++ b/tests/lib/Share20/DefaultShareProviderTest.php
@@ -175,13 +175,13 @@ class DefaultShareProviderTest extends \Test\TestCase {
- public function testGetShareByIdNotExist() {
+ public function testGetShareByIdNotExist(): void {
$this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
$this->provider->getShareById(1);
}
- public function testGetShareByIdUserShare() {
+ public function testGetShareByIdUserShare(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
@@ -228,7 +228,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('myTarget', $share->getTarget());
}
- public function testGetShareByIdLazy() {
+ public function testGetShareByIdLazy(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
@@ -263,7 +263,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('myTarget', $share->getTarget());
}
- public function testGetShareByIdLazy2() {
+ public function testGetShareByIdLazy2(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
@@ -307,7 +307,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('myTarget', $share->getTarget());
}
- public function testGetShareByIdGroupShare() {
+ public function testGetShareByIdGroupShare(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
@@ -350,7 +350,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('myTarget', $share->getTarget());
}
- public function testGetShareByIdUserGroupShare() {
+ public function testGetShareByIdUserGroupShare(): void {
$id = $this->addShareToDB(IShare::TYPE_GROUP, 'group0', 'user0', 'user0', 'file', 42, 'myTarget', 31, null, null);
$this->addShareToDB(2, 'user1', 'user0', 'user0', 'file', 42, 'userTarget', 0, null, null, $id);
@@ -390,7 +390,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('userTarget', $share->getTarget());
}
- public function testGetShareByIdLinkShare() {
+ public function testGetShareByIdLinkShare(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
@@ -437,7 +437,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('myTarget', $share->getTarget());
}
- public function testDeleteSingleShare() {
+ public function testDeleteSingleShare(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->values([
@@ -487,7 +487,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEmpty($result);
}
- public function testDeleteSingleShareLazy() {
+ public function testDeleteSingleShareLazy(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->values([
@@ -520,7 +520,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEmpty($result);
}
- public function testDeleteGroupShareWithUserGroupShares() {
+ public function testDeleteGroupShareWithUserGroupShares(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->values([
@@ -584,7 +584,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEmpty($result);
}
- public function testGetChildren() {
+ public function testGetChildren(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->values([
@@ -672,7 +672,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('myTarget2', $children[1]->getTarget());
}
- public function testCreateUserShare() {
+ public function testCreateUserShare(): void {
$share = new \OC\Share20\Share($this->rootFolder, $this->userManager);
$shareOwner = $this->createMock(IUser::class);
@@ -744,7 +744,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
);
}
- public function testCreateGroupShare() {
+ public function testCreateGroupShare(): void {
$share = new \OC\Share20\Share($this->rootFolder, $this->userManager);
$shareOwner = $this->createMock(IUser::class);
@@ -814,7 +814,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
);
}
- public function testCreateLinkShare() {
+ public function testCreateLinkShare(): void {
$share = new \OC\Share20\Share($this->rootFolder, $this->userManager);
$shareOwner = $this->createMock(IUser::class);
@@ -869,7 +869,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals($expireDate->getTimestamp(), $share2->getExpirationDate()->getTimestamp());
}
- public function testGetShareByToken() {
+ public function testGetShareByToken(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
@@ -904,7 +904,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
}
- public function testGetShareByTokenNotFound() {
+ public function testGetShareByTokenNotFound(): void {
$this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
$this->provider->getShareByToken('invalidtoken');
@@ -947,7 +947,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
/**
* @dataProvider storageAndFileNameProvider
*/
- public function testGetSharedWithUser($storageStringId, $fileName1, $fileName2) {
+ public function testGetSharedWithUser($storageStringId, $fileName1, $fileName2): void {
$storageId = $this->createTestStorageEntry($storageStringId);
$fileId = $this->createTestFileEntry($fileName1, $storageId);
$fileId2 = $this->createTestFileEntry($fileName2, $storageId);
@@ -998,7 +998,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
/**
* @dataProvider storageAndFileNameProvider
*/
- public function testGetSharedWithGroup($storageStringId, $fileName1, $fileName2) {
+ public function testGetSharedWithGroup($storageStringId, $fileName1, $fileName2): void {
$storageId = $this->createTestStorageEntry($storageStringId);
$fileId = $this->createTestFileEntry($fileName1, $storageId);
$fileId2 = $this->createTestFileEntry($fileName2, $storageId);
@@ -1072,7 +1072,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
/**
* @dataProvider storageAndFileNameProvider
*/
- public function testGetSharedWithGroupUserModified($storageStringId, $fileName1, $fileName2) {
+ public function testGetSharedWithGroupUserModified($storageStringId, $fileName1, $fileName2): void {
$storageId = $this->createTestStorageEntry($storageStringId);
$fileId = $this->createTestFileEntry($fileName1, $storageId);
$qb = $this->dbConn->getQueryBuilder();
@@ -1164,7 +1164,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
/**
* @dataProvider storageAndFileNameProvider
*/
- public function testGetSharedWithUserWithNode($storageStringId, $fileName1, $fileName2) {
+ public function testGetSharedWithUserWithNode($storageStringId, $fileName1, $fileName2): void {
$storageId = $this->createTestStorageEntry($storageStringId);
$fileId = $this->createTestFileEntry($fileName1, $storageId);
$fileId2 = $this->createTestFileEntry($fileName2, $storageId);
@@ -1206,7 +1206,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
/**
* @dataProvider storageAndFileNameProvider
*/
- public function testGetSharedWithGroupWithNode($storageStringId, $fileName1, $fileName2) {
+ public function testGetSharedWithGroupWithNode($storageStringId, $fileName1, $fileName2): void {
$storageId = $this->createTestStorageEntry($storageStringId);
$fileId = $this->createTestFileEntry($fileName1, $storageId);
$fileId2 = $this->createTestFileEntry($fileName2, $storageId);
@@ -1258,7 +1258,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
/**
* @dataProvider shareTypesProvider
*/
- public function testGetSharedWithWithDeletedFile($shareType, $trashed) {
+ public function testGetSharedWithWithDeletedFile($shareType, $trashed): void {
if ($trashed) {
// exists in database but is in trash
$storageId = $this->createTestStorageEntry('home::shareOwner');
@@ -1312,7 +1312,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertCount(0, $share);
}
- public function testGetSharesBy() {
+ public function testGetSharesBy(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->values([
@@ -1361,7 +1361,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('myTarget', $share->getTarget());
}
- public function testGetSharesNode() {
+ public function testGetSharesNode(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->values([
@@ -1411,7 +1411,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('myTarget', $share->getTarget());
}
- public function testGetSharesReshare() {
+ public function testGetSharesReshare(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->values([
@@ -1470,7 +1470,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('userTarget', $share->getTarget());
}
- public function testDeleteFromSelfGroupNoCustomShare() {
+ public function testDeleteFromSelfGroupNoCustomShare(): void {
$qb = $this->dbConn->getQueryBuilder();
$stmt = $qb->insert('share')
->values([
@@ -1527,7 +1527,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertEquals('user2', $share2['share_with']);
}
- public function testDeleteFromSelfGroupAlreadyCustomShare() {
+ public function testDeleteFromSelfGroupAlreadyCustomShare(): void {
$qb = $this->dbConn->getQueryBuilder();
$stmt = $qb->insert('share')
->values([
@@ -1600,7 +1600,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
}
- public function testDeleteFromSelfGroupUserNotInGroup() {
+ public function testDeleteFromSelfGroupUserNotInGroup(): void {
$qb = $this->dbConn->getQueryBuilder();
$stmt = $qb->insert('share')
->values([
@@ -1643,7 +1643,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
}
- public function testDeleteFromSelfGroupDoesNotExist() {
+ public function testDeleteFromSelfGroupDoesNotExist(): void {
$this->expectException(\OC\Share20\Exception\ProviderException::class);
$this->expectExceptionMessage('Group "group" does not exist');
@@ -1684,7 +1684,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->provider->deleteFromSelf($share, 'user2');
}
- public function testDeleteFromSelfUser() {
+ public function testDeleteFromSelfUser(): void {
$qb = $this->dbConn->getQueryBuilder();
$stmt = $qb->insert('share')
->values([
@@ -1734,7 +1734,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
}
- public function testDeleteFromSelfUserNotRecipient() {
+ public function testDeleteFromSelfUserNotRecipient(): void {
$this->expectException(\OC\Share20\Exception\ProviderException::class);
$this->expectExceptionMessage('Recipient does not match');
@@ -1777,7 +1777,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
}
- public function testDeleteFromSelfLink() {
+ public function testDeleteFromSelfLink(): void {
$this->expectException(\OC\Share20\Exception\ProviderException::class);
$this->expectExceptionMessage('Invalid shareType');
@@ -1813,7 +1813,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->provider->deleteFromSelf($share, $user1);
}
- public function testUpdateUser() {
+ public function testUpdateUser(): void {
$id = $this->addShareToDB(IShare::TYPE_USER, 'user0', 'user1', 'user2',
'file', 42, 'target', 31, null, null);
@@ -1871,7 +1871,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertSame(1, $share2->getPermissions());
}
- public function testUpdateLink() {
+ public function testUpdateLink(): void {
$id = $this->addShareToDB(IShare::TYPE_LINK, null, 'user1', 'user2',
'file', 42, 'target', 31, null, null);
@@ -1931,7 +1931,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertSame(1, $share2->getPermissions());
}
- public function testUpdateLinkRemovePassword() {
+ public function testUpdateLinkRemovePassword(): void {
$id = $this->addShareToDB(IShare::TYPE_LINK, 'foo', 'user1', 'user2',
'file', 42, 'target', 31, null, null);
@@ -1994,7 +1994,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertSame(1, $share2->getPermissions());
}
- public function testUpdateGroupNoSub() {
+ public function testUpdateGroupNoSub(): void {
$id = $this->addShareToDB(IShare::TYPE_GROUP, 'group0', 'user1', 'user2',
'file', 42, 'target', 31, null, null);
@@ -2067,7 +2067,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertSame(1, $share2->getPermissions());
}
- public function testUpdateGroupSubShares() {
+ public function testUpdateGroupSubShares(): void {
$id = $this->addShareToDB(IShare::TYPE_GROUP, 'group0', 'user1', 'user2',
'file', 42, 'target', 31, null, null);
@@ -2168,7 +2168,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$stmt->closeCursor();
}
- public function testMoveUserShare() {
+ public function testMoveUserShare(): void {
$id = $this->addShareToDB(IShare::TYPE_USER, 'user0', 'user1', 'user1', 'file',
42, 'mytaret', 31, null, null);
@@ -2199,7 +2199,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertSame('/newTarget', $share->getTarget());
}
- public function testMoveGroupShare() {
+ public function testMoveGroupShare(): void {
$id = $this->addShareToDB(IShare::TYPE_GROUP, 'group0', 'user1', 'user1', 'file',
42, 'mytaret', 31, null, null);
@@ -2270,7 +2270,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
* @param string $deletedUser The user that is deleted
* @param bool $rowDeleted Is the row deleted in this setup
*/
- public function testDeleteUser($type, $owner, $initiator, $recipient, $deletedUser, $rowDeleted) {
+ public function testDeleteUser($type, $owner, $initiator, $recipient, $deletedUser, $rowDeleted): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->setValue('share_type', $qb->createNamedParameter($type))
@@ -2318,7 +2318,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
* @param bool $groupShareDeleted
* @param bool $userGroupShareDeleted
*/
- public function testDeleteUserGroup($owner, $initiator, $recipient, $deletedUser, $groupShareDeleted, $userGroupShareDeleted) {
+ public function testDeleteUserGroup($owner, $initiator, $recipient, $deletedUser, $groupShareDeleted, $userGroupShareDeleted): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->setValue('share_type', $qb->createNamedParameter(IShare::TYPE_GROUP))
@@ -2421,7 +2421,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
* @param $groupToDelete
* @param $shouldBeDeleted
*/
- public function testGroupDeleted($shares, $groupToDelete, $shouldBeDeleted) {
+ public function testGroupDeleted($shares, $groupToDelete, $shouldBeDeleted): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->setValue('share_type', $qb->createNamedParameter($shares['type']))
@@ -2481,7 +2481,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
* @param string $user
* @param bool $toDelete
*/
- public function testUserDeletedFromGroup($group, $user, $toDelete) {
+ public function testUserDeletedFromGroup($group, $user, $toDelete): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
->setValue('share_type', $qb->createNamedParameter(IShare::TYPE_GROUP))
@@ -2520,7 +2520,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$this->assertCount($toDelete ? 0 : 1, $data);
}
- public function testGetSharesInFolder() {
+ public function testGetSharesInFolder(): void {
$userManager = \OC::$server->getUserManager();
$groupManager = \OC::$server->getGroupManager();
$rootFolder = \OC::$server->get(IRootFolder::class);
@@ -2620,7 +2620,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$g1->delete();
}
- public function testGetAccessListNoCurrentAccessRequired() {
+ public function testGetAccessListNoCurrentAccessRequired(): void {
$userManager = \OC::$server->getUserManager();
$groupManager = \OC::$server->getGroupManager();
$rootFolder = \OC::$server->get(IRootFolder::class);
@@ -2718,7 +2718,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$g1->delete();
}
- public function testGetAccessListCurrentAccessRequired() {
+ public function testGetAccessListCurrentAccessRequired(): void {
$userManager = \OC::$server->getUserManager();
$groupManager = \OC::$server->getGroupManager();
$rootFolder = \OC::$server->get(IRootFolder::class);
@@ -2815,7 +2815,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
$g1->delete();
}
- public function testGetAllShares() {
+ public function testGetAllShares(): void {
$qb = $this->dbConn->getQueryBuilder();
$qb->insert('share')
diff --git a/tests/lib/Share20/LegacyHooksTest.php b/tests/lib/Share20/LegacyHooksTest.php
index 87643614f74..0761eed592b 100644
--- a/tests/lib/Share20/LegacyHooksTest.php
+++ b/tests/lib/Share20/LegacyHooksTest.php
@@ -43,7 +43,7 @@ class LegacyHooksTest extends TestCase {
$this->manager = \OC::$server->get(IShareManager::class);
}
- public function testPreUnshare() {
+ public function testPreUnshare(): void {
$path = $this->createMock(File::class);
$path->method('getId')->willReturn(1);
@@ -84,7 +84,7 @@ class LegacyHooksTest extends TestCase {
$this->eventDispatcher->dispatchTyped($event);
}
- public function testPostUnshare() {
+ public function testPostUnshare(): void {
$path = $this->createMock(File::class);
$path->method('getId')->willReturn(1);
@@ -138,7 +138,7 @@ class LegacyHooksTest extends TestCase {
$this->eventDispatcher->dispatchTyped($event);
}
- public function testPostUnshareFromSelf() {
+ public function testPostUnshareFromSelf(): void {
$path = $this->createMock(File::class);
$path->method('getId')->willReturn(1);
@@ -194,7 +194,7 @@ class LegacyHooksTest extends TestCase {
$this->eventDispatcher->dispatchTyped($event);
}
- public function testPreShare() {
+ public function testPreShare(): void {
$path = $this->createMock(File::class);
$path->method('getId')->willReturn(1);
@@ -242,7 +242,7 @@ class LegacyHooksTest extends TestCase {
$this->eventDispatcher->dispatchTyped($event);
}
- public function testPreShareError() {
+ public function testPreShareError(): void {
$path = $this->createMock(File::class);
$path->method('getId')->willReturn(1);
@@ -297,7 +297,7 @@ class LegacyHooksTest extends TestCase {
$this->assertSame('I error', $event->getError());
}
- public function testPostShare() {
+ public function testPostShare(): void {
$path = $this->createMock(File::class);
$path->method('getId')->willReturn(1);
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php
index f7b8f1458b3..2250e28bd13 100644
--- a/tests/lib/Share20/ManagerTest.php
+++ b/tests/lib/Share20/ManagerTest.php
@@ -199,7 +199,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testDeleteNoShareId() {
+ public function testDeleteNoShareId(): void {
$this->expectException(\InvalidArgumentException::class);
$share = $this->manager->newShare();
@@ -225,7 +225,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider dataTestDelete
*/
- public function testDelete($shareType, $sharedWith) {
+ public function testDelete($shareType, $sharedWith): void {
$manager = $this->createManagerMock()
->setMethods(['getShareById', 'deleteChildren'])
->getMock();
@@ -267,7 +267,7 @@ class ManagerTest extends \Test\TestCase {
$manager->deleteShare($share);
}
- public function testDeleteLazyShare() {
+ public function testDeleteLazyShare(): void {
$manager = $this->createManagerMock()
->setMethods(['getShareById', 'deleteChildren'])
->getMock();
@@ -310,7 +310,7 @@ class ManagerTest extends \Test\TestCase {
$manager->deleteShare($share);
}
- public function testDeleteNested() {
+ public function testDeleteNested(): void {
$manager = $this->createManagerMock()
->setMethods(['getShareById'])
->getMock();
@@ -396,7 +396,7 @@ class ManagerTest extends \Test\TestCase {
$manager->deleteShare($share1);
}
- public function testDeleteFromSelf() {
+ public function testDeleteFromSelf(): void {
$manager = $this->createManagerMock()
->setMethods(['getShareById'])
->getMock();
@@ -429,7 +429,7 @@ class ManagerTest extends \Test\TestCase {
$manager->deleteFromSelf($share, $recipientId);
}
- public function testDeleteChildren() {
+ public function testDeleteChildren(): void {
$manager = $this->createManagerMock()
->setMethods(['deleteShare'])
->getMock();
@@ -469,7 +469,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertSame($shares, $result);
}
- public function testGetShareById() {
+ public function testGetShareById(): void {
$share = $this->createMock(IShare::class);
$this->defaultProvider
@@ -482,7 +482,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testGetExpiredShareById() {
+ public function testGetExpiredShareById(): void {
$this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
$manager = $this->createManagerMock()
@@ -509,7 +509,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testVerifyPasswordNullButEnforced() {
+ public function testVerifyPasswordNullButEnforced(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Passwords are enforced for link and mail shares');
@@ -521,7 +521,7 @@ class ManagerTest extends \Test\TestCase {
self::invokePrivate($this->manager, 'verifyPassword', [null]);
}
- public function testVerifyPasswordNotEnforcedGroup() {
+ public function testVerifyPasswordNotEnforcedGroup(): void {
$this->config->method('getAppValue')->willReturnMap([
['core', 'shareapi_enforce_links_password_excluded_groups', '', '["admin"]'],
['core', 'shareapi_enforce_links_password', 'no', 'yes'],
@@ -536,7 +536,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertNull($result);
}
- public function testVerifyPasswordNotEnforcedMultipleGroups() {
+ public function testVerifyPasswordNotEnforcedMultipleGroups(): void {
$this->config->method('getAppValue')->willReturnMap([
['core', 'shareapi_enforce_links_password_excluded_groups', '', '["admin", "special"]'],
['core', 'shareapi_enforce_links_password', 'no', 'yes'],
@@ -551,7 +551,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertNull($result);
}
- public function testVerifyPasswordNull() {
+ public function testVerifyPasswordNull(): void {
$this->config->method('getAppValue')->willReturnMap([
['core', 'shareapi_enforce_links_password_excluded_groups', '', ''],
['core', 'shareapi_enforce_links_password', 'no', 'no'],
@@ -561,7 +561,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertNull($result);
}
- public function testVerifyPasswordHook() {
+ public function testVerifyPasswordHook(): void {
$this->config->method('getAppValue')->willReturnMap([
['core', 'shareapi_enforce_links_password_excluded_groups', '', ''],
['core', 'shareapi_enforce_links_password', 'no', 'no'],
@@ -580,7 +580,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testVerifyPasswordHookFails() {
+ public function testVerifyPasswordHookFails(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('password not accepted');
@@ -778,7 +778,7 @@ class ManagerTest extends \Test\TestCase {
* @param $exceptionMessage
* @param $exception
*/
- public function testGeneralChecks($share, $exceptionMessage, $exception) {
+ public function testGeneralChecks($share, $exceptionMessage, $exception): void {
$thrown = null;
$this->userManager->method('userExists')->willReturnMap([
@@ -819,7 +819,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testGeneralCheckShareRoot() {
+ public function testGeneralCheckShareRoot(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('You cannot share your root folder');
@@ -851,7 +851,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalInPast($shareType) {
+ public function testValidateExpirationDateInternalInPast($shareType): void {
$this->expectException(\OCP\Share\Exceptions\GenericShareException::class);
$this->expectExceptionMessage('Expiration date is in the past');
@@ -869,7 +869,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalEnforceButNotSet($shareType) {
+ public function testValidateExpirationDateInternalEnforceButNotSet($shareType): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Expiration date is enforced');
@@ -896,7 +896,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalEnforceButNotEnabledAndNotSet($shareType) {
+ public function testValidateExpirationDateInternalEnforceButNotEnabledAndNotSet($shareType): void {
$share = $this->manager->newShare();
$share->setProviderId('foo')->setId('bar');
$share->setShareType($shareType);
@@ -921,7 +921,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalEnforceButNotSetNewShare($shareType) {
+ public function testValidateExpirationDateInternalEnforceButNotSetNewShare($shareType): void {
$share = $this->manager->newShare();
$share->setShareType($shareType);
@@ -956,7 +956,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalEnforceRelaxedDefaultButNotSetNewShare($shareType) {
+ public function testValidateExpirationDateInternalEnforceRelaxedDefaultButNotSetNewShare($shareType): void {
$share = $this->manager->newShare();
$share->setShareType($shareType);
@@ -991,7 +991,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalEnforceTooFarIntoFuture($shareType) {
+ public function testValidateExpirationDateInternalEnforceTooFarIntoFuture($shareType): void {
$this->expectException(\OCP\Share\Exceptions\GenericShareException::class);
$this->expectExceptionMessage('Cannot set expiration date more than 3 days in the future');
@@ -1024,7 +1024,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalEnforceValid($shareType) {
+ public function testValidateExpirationDateInternalEnforceValid($shareType): void {
$future = new \DateTime('now', $this->dateTimeZone->getTimeZone());
$future->add(new \DateInterval('P2D'));
$future->setTime(1, 2, 3);
@@ -1066,7 +1066,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalNoDefault($shareType) {
+ public function testValidateExpirationDateInternalNoDefault($shareType): void {
$date = new \DateTime('now', $this->dateTimeZone->getTimeZone());
$date->add(new \DateInterval('P5D'));
$date->setTime(1, 2, 3);
@@ -1092,7 +1092,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalNoDateNoDefault($shareType) {
+ public function testValidateExpirationDateInternalNoDateNoDefault($shareType): void {
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
$hookListener->expects($this->once())->method('listener')->with($this->callback(function ($data) {
@@ -1111,7 +1111,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalNoDateDefault($shareType) {
+ public function testValidateExpirationDateInternalNoDateDefault($shareType): void {
$share = $this->manager->newShare();
$share->setShareType($shareType);
@@ -1150,7 +1150,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalDefault($shareType) {
+ public function testValidateExpirationDateInternalDefault($shareType): void {
$future = new \DateTime('now', $this->timezone);
$future->add(new \DateInterval('P5D'));
$future->setTime(1, 2, 3);
@@ -1192,7 +1192,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalHookModification($shareType) {
+ public function testValidateExpirationDateInternalHookModification($shareType): void {
$nextWeek = new \DateTime('now', $this->timezone);
$nextWeek->add(new \DateInterval('P7D'));
$nextWeek->setTime(0, 0, 0);
@@ -1218,7 +1218,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalHookException($shareType) {
+ public function testValidateExpirationDateInternalHookException($shareType): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Invalid date!');
@@ -1243,7 +1243,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider validateExpirationDateInternalProvider
*/
- public function testValidateExpirationDateInternalExistingShareNoDefault($shareType) {
+ public function testValidateExpirationDateInternalExistingShareNoDefault($shareType): void {
$share = $this->manager->newShare();
$share->setShareType($shareType);
$share->setId('42')->setProviderId('foo');
@@ -1267,7 +1267,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals(null, $share->getExpirationDate());
}
- public function testValidateExpirationDateInPast() {
+ public function testValidateExpirationDateInPast(): void {
$this->expectException(\OCP\Share\Exceptions\GenericShareException::class);
$this->expectExceptionMessage('Expiration date is in the past');
@@ -1281,7 +1281,7 @@ class ManagerTest extends \Test\TestCase {
self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
}
- public function testValidateExpirationDateEnforceButNotSet() {
+ public function testValidateExpirationDateEnforceButNotSet(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Expiration date is enforced');
@@ -1297,7 +1297,7 @@ class ManagerTest extends \Test\TestCase {
self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
}
- public function testValidateExpirationDateEnforceButNotEnabledAndNotSet() {
+ public function testValidateExpirationDateEnforceButNotEnabledAndNotSet(): void {
$share = $this->manager->newShare();
$share->setProviderId('foo')->setId('bar');
@@ -1311,7 +1311,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertNull($share->getExpirationDate());
}
- public function testValidateExpirationDateEnforceButNotSetNewShare() {
+ public function testValidateExpirationDateEnforceButNotSetNewShare(): void {
$share = $this->manager->newShare();
$this->config->method('getAppValue')
@@ -1332,7 +1332,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $share->getExpirationDate());
}
- public function testValidateExpirationDateEnforceRelaxedDefaultButNotSetNewShare() {
+ public function testValidateExpirationDateEnforceRelaxedDefaultButNotSetNewShare(): void {
$share = $this->manager->newShare();
$this->config->method('getAppValue')
@@ -1353,7 +1353,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $share->getExpirationDate());
}
- public function testValidateExpirationDateEnforceTooFarIntoFuture() {
+ public function testValidateExpirationDateEnforceTooFarIntoFuture(): void {
$this->expectException(\OCP\Share\Exceptions\GenericShareException::class);
$this->expectExceptionMessage('Cannot set expiration date more than 3 days in the future');
@@ -1373,7 +1373,7 @@ class ManagerTest extends \Test\TestCase {
self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
}
- public function testValidateExpirationDateEnforceValid() {
+ public function testValidateExpirationDateEnforceValid(): void {
$future = new \DateTime('now', $this->timezone);
$future->add(new \DateInterval('P2D'));
$future->setTime(1, 2, 3);
@@ -1402,7 +1402,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $share->getExpirationDate());
}
- public function testValidateExpirationDateNoDefault() {
+ public function testValidateExpirationDateNoDefault(): void {
$date = new \DateTime('now', $this->timezone);
$date->add(new \DateInterval('P5D'));
$date->setTime(1, 2, 3);
@@ -1425,7 +1425,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $share->getExpirationDate());
}
- public function testValidateExpirationDateNoDateNoDefault() {
+ public function testValidateExpirationDateNoDateNoDefault(): void {
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
$hookListener->expects($this->once())->method('listener')->with($this->callback(function ($data) {
@@ -1440,7 +1440,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertNull($share->getExpirationDate());
}
- public function testValidateExpirationDateNoDateDefault() {
+ public function testValidateExpirationDateNoDateDefault(): void {
$share = $this->manager->newShare();
$expected = new \DateTime('now', $this->timezone);
@@ -1466,7 +1466,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $share->getExpirationDate());
}
- public function testValidateExpirationDateDefault() {
+ public function testValidateExpirationDateDefault(): void {
$future = new \DateTime('now', $this->timezone);
$future->add(new \DateInterval('P5D'));
$future->setTime(1, 2, 3);
@@ -1496,7 +1496,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $share->getExpirationDate());
}
- public function testValidateExpirationNegativeOffsetTimezone() {
+ public function testValidateExpirationNegativeOffsetTimezone(): void {
$this->timezone = new \DateTimeZone('Pacific/Tahiti');
$future = new \DateTime();
$future->add(new \DateInterval('P5D'));
@@ -1527,7 +1527,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals($expected, $share->getExpirationDate());
}
- public function testValidateExpirationDateHookModification() {
+ public function testValidateExpirationDateHookModification(): void {
$nextWeek = new \DateTime('now', $this->timezone);
$nextWeek->add(new \DateInterval('P7D'));
@@ -1550,7 +1550,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals($save, $share->getExpirationDate());
}
- public function testValidateExpirationDateHookException() {
+ public function testValidateExpirationDateHookException(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Invalid date!');
@@ -1571,7 +1571,7 @@ class ManagerTest extends \Test\TestCase {
self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
}
- public function testValidateExpirationDateExistingShareNoDefault() {
+ public function testValidateExpirationDateExistingShareNoDefault(): void {
$share = $this->manager->newShare();
$share->setId('42')->setProviderId('foo');
@@ -1587,7 +1587,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals(null, $share->getExpirationDate());
}
- public function testUserCreateChecksShareWithGroupMembersOnlyDifferentGroups() {
+ public function testUserCreateChecksShareWithGroupMembersOnlyDifferentGroups(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Sharing is only allowed with group members');
@@ -1621,7 +1621,7 @@ class ManagerTest extends \Test\TestCase {
self::invokePrivate($this->manager, 'userCreateChecks', [$share]);
}
- public function testUserCreateChecksShareWithGroupMembersOnlySharedGroup() {
+ public function testUserCreateChecksShareWithGroupMembersOnlySharedGroup(): void {
$share = $this->manager->newShare();
$sharedBy = $this->createMock(IUser::class);
@@ -1662,7 +1662,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testUserCreateChecksIdenticalShareExists() {
+ public function testUserCreateChecksIdenticalShareExists(): void {
$this->expectException(AlreadySharedException::class);
$this->expectExceptionMessage('Sharing name.txt failed, because this item is already shared with the account user');
@@ -1691,7 +1691,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testUserCreateChecksIdenticalPathSharedViaGroup() {
+ public function testUserCreateChecksIdenticalPathSharedViaGroup(): void {
$this->expectException(AlreadySharedException::class);
$this->expectExceptionMessage('Sharing name2.txt failed, because this item is already shared with the account userName');
@@ -1736,7 +1736,7 @@ class ManagerTest extends \Test\TestCase {
self::invokePrivate($this->manager, 'userCreateChecks', [$share]);
}
- public function testUserCreateChecksIdenticalPathSharedViaDeletedGroup() {
+ public function testUserCreateChecksIdenticalPathSharedViaDeletedGroup(): void {
$share = $this->manager->newShare();
$sharedWith = $this->createMock(IUser::class);
@@ -1769,7 +1769,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertNull($this->invokePrivate($this->manager, 'userCreateChecks', [$share]));
}
- public function testUserCreateChecksIdenticalPathNotSharedWithUser() {
+ public function testUserCreateChecksIdenticalPathNotSharedWithUser(): void {
$share = $this->manager->newShare();
$sharedWith = $this->createMock(IUser::class);
$path = $this->createMock(Node::class);
@@ -1806,7 +1806,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testGroupCreateChecksShareWithGroupMembersGroupSharingNotAllowed() {
+ public function testGroupCreateChecksShareWithGroupMembersGroupSharingNotAllowed(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Group sharing is now allowed');
@@ -1822,7 +1822,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testGroupCreateChecksShareWithGroupMembersOnlyNotInGroup() {
+ public function testGroupCreateChecksShareWithGroupMembersOnlyNotInGroup(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Sharing is only allowed within your own groups');
@@ -1849,7 +1849,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testGroupCreateChecksShareWithGroupMembersOnlyNullGroup() {
+ public function testGroupCreateChecksShareWithGroupMembersOnlyNullGroup(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Sharing is only allowed within your own groups');
@@ -1872,7 +1872,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertNull($this->invokePrivate($this->manager, 'groupCreateChecks', [$share]));
}
- public function testGroupCreateChecksShareWithGroupMembersOnlyInGroup() {
+ public function testGroupCreateChecksShareWithGroupMembersOnlyInGroup(): void {
$share = $this->manager->newShare();
$user = $this->createMock(IUser::class);
@@ -1904,7 +1904,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testGroupCreateChecksPathAlreadySharedWithSameGroup() {
+ public function testGroupCreateChecksPathAlreadySharedWithSameGroup(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Path is already shared with this group');
@@ -1934,7 +1934,7 @@ class ManagerTest extends \Test\TestCase {
self::invokePrivate($this->manager, 'groupCreateChecks', [$share]);
}
- public function testGroupCreateChecksPathAlreadySharedWithDifferentGroup() {
+ public function testGroupCreateChecksPathAlreadySharedWithDifferentGroup(): void {
$share = $this->manager->newShare();
$share->setSharedWith('sharedWith');
@@ -1960,7 +1960,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testLinkCreateChecksNoLinkSharesAllowed() {
+ public function testLinkCreateChecksNoLinkSharesAllowed(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Link sharing is not allowed');
@@ -1976,7 +1976,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testFileLinkCreateChecksNoPublicUpload() {
+ public function testFileLinkCreateChecksNoPublicUpload(): void {
$share = $this->manager->newShare();
$share->setPermissions(\OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE);
@@ -1993,7 +1993,7 @@ class ManagerTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testFolderLinkCreateChecksNoPublicUpload() {
+ public function testFolderLinkCreateChecksNoPublicUpload(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Public upload is not allowed');
@@ -2012,7 +2012,7 @@ class ManagerTest extends \Test\TestCase {
self::invokePrivate($this->manager, 'linkCreateChecks', [$share]);
}
- public function testLinkCreateChecksPublicUpload() {
+ public function testLinkCreateChecksPublicUpload(): void {
$share = $this->manager->newShare();
$share->setPermissions(\OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE);
@@ -2031,7 +2031,7 @@ class ManagerTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testLinkCreateChecksReadOnly() {
+ public function testLinkCreateChecksReadOnly(): void {
$share = $this->manager->newShare();
$share->setPermissions(\OCP\Constants::PERMISSION_READ);
@@ -2051,7 +2051,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testPathCreateChecksContainsSharedMount() {
+ public function testPathCreateChecksContainsSharedMount(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Path contains files shared with you');
@@ -2068,7 +2068,7 @@ class ManagerTest extends \Test\TestCase {
self::invokePrivate($this->manager, 'pathCreateChecks', [$path]);
}
- public function testPathCreateChecksContainsNoSharedMount() {
+ public function testPathCreateChecksContainsNoSharedMount(): void {
$path = $this->createMock(Folder::class);
$path->method('getPath')->willReturn('path');
@@ -2083,7 +2083,7 @@ class ManagerTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function testPathCreateChecksContainsNoFolder() {
+ public function testPathCreateChecksContainsNoFolder(): void {
$path = $this->createMock(File::class);
self::invokePrivate($this->manager, 'pathCreateChecks', [$path]);
@@ -2136,7 +2136,7 @@ class ManagerTest extends \Test\TestCase {
* @param string[] $groupIds
* @param bool $expected
*/
- public function testIsSharingDisabledForUser($excludeGroups, $groupList, $setList, $groupIds, $expected) {
+ public function testIsSharingDisabledForUser($excludeGroups, $groupList, $setList, $groupIds, $expected): void {
$user = $this->createMock(IUser::class);
$this->config->method('getAppValue')
@@ -2186,7 +2186,7 @@ class ManagerTest extends \Test\TestCase {
* @param string $sharingEnabled
* @param bool $disabledForUser
*/
- public function testCanShare($expected, $sharingEnabled, $disabledForUser) {
+ public function testCanShare($expected, $sharingEnabled, $disabledForUser): void {
$this->config->method('getAppValue')
->willReturnMap([
['core', 'shareapi_enabled', 'yes', $sharingEnabled],
@@ -2213,7 +2213,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals($expected, !$exception);
}
- public function testCreateShareUser() {
+ public function testCreateShareUser(): void {
$manager = $this->createManagerMock()
->setMethods(['canShare', 'generalCreateChecks', 'userCreateChecks', 'pathCreateChecks'])
->getMock();
@@ -2268,7 +2268,7 @@ class ManagerTest extends \Test\TestCase {
$manager->createShare($share);
}
- public function testCreateShareGroup() {
+ public function testCreateShareGroup(): void {
$manager = $this->createManagerMock()
->setMethods(['canShare', 'generalCreateChecks', 'groupCreateChecks', 'pathCreateChecks'])
->getMock();
@@ -2323,7 +2323,7 @@ class ManagerTest extends \Test\TestCase {
$manager->createShare($share);
}
- public function testCreateShareLink() {
+ public function testCreateShareLink(): void {
$manager = $this->createManagerMock()
->setMethods([
'canShare',
@@ -2443,7 +2443,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertEquals('hashed', $share->getPassword());
}
- public function testCreateShareMail() {
+ public function testCreateShareMail(): void {
$manager = $this->createManagerMock()
->setMethods([
'canShare',
@@ -2547,7 +2547,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testCreateShareHookError() {
+ public function testCreateShareHookError(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('I won\'t let you share');
@@ -2615,7 +2615,7 @@ class ManagerTest extends \Test\TestCase {
$manager->createShare($share);
}
- public function testCreateShareOfIncomingFederatedShare() {
+ public function testCreateShareOfIncomingFederatedShare(): void {
$manager = $this->createManagerMock()
->setMethods(['canShare', 'generalCreateChecks', 'userCreateChecks', 'pathCreateChecks'])
->getMock();
@@ -2689,7 +2689,7 @@ class ManagerTest extends \Test\TestCase {
$manager->createShare($share);
}
- public function testGetSharesBy() {
+ public function testGetSharesBy(): void {
$share = $this->manager->newShare();
$node = $this->createMock(Folder::class);
@@ -2719,7 +2719,7 @@ class ManagerTest extends \Test\TestCase {
* have received share 1,2 and 7. And from the manager. Share 3-6 should be
* deleted (as they are evaluated). but share 8 should still be there.
*/
- public function testGetSharesByExpiredLinkShares() {
+ public function testGetSharesByExpiredLinkShares(): void {
$manager = $this->createManagerMock()
->setMethods(['deleteShare'])
->getMock();
@@ -2792,7 +2792,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertSame($today, $shares[3]->getExpirationDate());
}
- public function testGetShareByToken() {
+ public function testGetShareByToken(): void {
$this->config
->expects($this->exactly(2))
->method('getAppValue')
@@ -2821,7 +2821,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertSame($share, $ret);
}
- public function testGetShareByTokenRoom() {
+ public function testGetShareByTokenRoom(): void {
$this->config
->expects($this->exactly(2))
->method('getAppValue')
@@ -2857,7 +2857,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertSame($share, $ret);
}
- public function testGetShareByTokenWithException() {
+ public function testGetShareByTokenWithException(): void {
$this->config
->expects($this->exactly(2))
->method('getAppValue')
@@ -2893,7 +2893,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testGetShareByTokenHideDisabledUser() {
+ public function testGetShareByTokenHideDisabledUser(): void {
$this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
$this->expectExceptionMessage('The requested share comes from a disabled user');
@@ -2948,7 +2948,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testGetShareByTokenExpired() {
+ public function testGetShareByTokenExpired(): void {
$this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
$this->expectExceptionMessage('The requested share does not exist anymore');
@@ -2983,7 +2983,7 @@ class ManagerTest extends \Test\TestCase {
$manager->getShareByToken('expiredToken');
}
- public function testGetShareByTokenNotExpired() {
+ public function testGetShareByTokenNotExpired(): void {
$this->config
->expects($this->exactly(2))
->method('getAppValue')
@@ -3009,7 +3009,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testGetShareByTokenWithPublicLinksDisabled() {
+ public function testGetShareByTokenWithPublicLinksDisabled(): void {
$this->expectException(\OCP\Share\Exceptions\ShareNotFound::class);
$this->config
@@ -3020,7 +3020,7 @@ class ManagerTest extends \Test\TestCase {
$this->manager->getShareByToken('validToken');
}
- public function testGetShareByTokenPublicUploadDisabled() {
+ public function testGetShareByTokenPublicUploadDisabled(): void {
$this->config
->expects($this->exactly(3))
->method('getAppValue')
@@ -3047,13 +3047,13 @@ class ManagerTest extends \Test\TestCase {
$this->assertSame(\OCP\Constants::PERMISSION_READ, $res->getPermissions());
}
- public function testCheckPasswordNoLinkShare() {
+ public function testCheckPasswordNoLinkShare(): void {
$share = $this->createMock(IShare::class);
$share->method('getShareType')->willReturn(IShare::TYPE_USER);
$this->assertFalse($this->manager->checkPassword($share, 'password'));
}
- public function testCheckPasswordNoPassword() {
+ public function testCheckPasswordNoPassword(): void {
$share = $this->createMock(IShare::class);
$share->method('getShareType')->willReturn(IShare::TYPE_LINK);
$this->assertFalse($this->manager->checkPassword($share, 'password'));
@@ -3062,7 +3062,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertFalse($this->manager->checkPassword($share, null));
}
- public function testCheckPasswordInvalidPassword() {
+ public function testCheckPasswordInvalidPassword(): void {
$share = $this->createMock(IShare::class);
$share->method('getShareType')->willReturn(IShare::TYPE_LINK);
$share->method('getPassword')->willReturn('password');
@@ -3072,7 +3072,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertFalse($this->manager->checkPassword($share, 'invalidpassword'));
}
- public function testCheckPasswordValidPassword() {
+ public function testCheckPasswordValidPassword(): void {
$share = $this->createMock(IShare::class);
$share->method('getShareType')->willReturn(IShare::TYPE_LINK);
$share->method('getPassword')->willReturn('passwordHash');
@@ -3082,7 +3082,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertTrue($this->manager->checkPassword($share, 'password'));
}
- public function testCheckPasswordUpdateShare() {
+ public function testCheckPasswordUpdateShare(): void {
$share = $this->manager->newShare();
$share->setShareType(IShare::TYPE_LINK)
->setPassword('passwordHash');
@@ -3104,7 +3104,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testUpdateShareCantChangeShareType() {
+ public function testUpdateShareCantChangeShareType(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Cannot change share type');
@@ -3132,7 +3132,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testUpdateShareCantChangeRecipientForGroupShare() {
+ public function testUpdateShareCantChangeRecipientForGroupShare(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Can only update recipient on user shares');
@@ -3160,7 +3160,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testUpdateShareCantShareWithOwner() {
+ public function testUpdateShareCantShareWithOwner(): void {
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Cannot share with the share owner');
@@ -3188,7 +3188,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testUpdateShareUser() {
+ public function testUpdateShareUser(): void {
$this->userManager->expects($this->any())->method('userExists')->willReturn(true);
$manager = $this->createManagerMock()
@@ -3254,7 +3254,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testUpdateShareGroup() {
+ public function testUpdateShareGroup(): void {
$manager = $this->createManagerMock()
->setMethods([
'canShare',
@@ -3300,7 +3300,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testUpdateShareLink() {
+ public function testUpdateShareLink(): void {
$manager = $this->createManagerMock()
->setMethods([
'canShare',
@@ -3378,7 +3378,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testUpdateShareLinkEnableSendPasswordByTalkWithNoPassword() {
+ public function testUpdateShareLinkEnableSendPasswordByTalkWithNoPassword(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot enable sending the password by Talk with an empty password');
@@ -3447,7 +3447,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testUpdateShareMail() {
+ public function testUpdateShareMail(): void {
$manager = $this->createManagerMock()
->setMethods([
'canShare',
@@ -3527,7 +3527,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testUpdateShareMailEnableSendPasswordByTalk() {
+ public function testUpdateShareMailEnableSendPasswordByTalk(): void {
$manager = $this->createManagerMock()
->setMethods([
'canShare',
@@ -3610,7 +3610,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testUpdateShareMailEnableSendPasswordByTalkWithDifferentPassword() {
+ public function testUpdateShareMailEnableSendPasswordByTalkWithDifferentPassword(): void {
$manager = $this->createManagerMock()
->setMethods([
'canShare',
@@ -3698,7 +3698,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testUpdateShareMailEnableSendPasswordByTalkWithNoPassword() {
+ public function testUpdateShareMailEnableSendPasswordByTalkWithNoPassword(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot enable sending the password by Talk with an empty password');
@@ -3771,7 +3771,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testUpdateShareMailEnableSendPasswordByTalkRemovingPassword() {
+ public function testUpdateShareMailEnableSendPasswordByTalkRemovingPassword(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot enable sending the password by Talk with an empty password');
@@ -3844,7 +3844,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testUpdateShareMailEnableSendPasswordByTalkRemovingPasswordWithEmptyString() {
+ public function testUpdateShareMailEnableSendPasswordByTalkRemovingPasswordWithEmptyString(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot enable sending the password by Talk with an empty password');
@@ -3917,7 +3917,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testUpdateShareMailEnableSendPasswordByTalkWithPreviousPassword() {
+ public function testUpdateShareMailEnableSendPasswordByTalkWithPreviousPassword(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot enable sending the password by Talk without setting a new password');
@@ -3991,7 +3991,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testUpdateShareMailDisableSendPasswordByTalkWithPreviousPassword() {
+ public function testUpdateShareMailDisableSendPasswordByTalkWithPreviousPassword(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot disable sending the password by Talk without setting a new password');
@@ -4065,7 +4065,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testUpdateShareMailDisableSendPasswordByTalkWithoutChangingPassword() {
+ public function testUpdateShareMailDisableSendPasswordByTalkWithoutChangingPassword(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot disable sending the password by Talk without setting a new password');
@@ -4139,7 +4139,7 @@ class ManagerTest extends \Test\TestCase {
$manager->updateShare($share);
}
- public function testMoveShareLink() {
+ public function testMoveShareLink(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot change target of link share');
@@ -4152,7 +4152,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testMoveShareUserNotRecipient() {
+ public function testMoveShareUserNotRecipient(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid recipient');
@@ -4164,7 +4164,7 @@ class ManagerTest extends \Test\TestCase {
$this->manager->moveShare($share, 'recipient');
}
- public function testMoveShareUser() {
+ public function testMoveShareUser(): void {
$share = $this->manager->newShare();
$share->setShareType(IShare::TYPE_USER)
->setId('42')
@@ -4179,7 +4179,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testMoveShareGroupNotRecipient() {
+ public function testMoveShareGroupNotRecipient(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid recipient');
@@ -4199,7 +4199,7 @@ class ManagerTest extends \Test\TestCase {
}
- public function testMoveShareGroupNull() {
+ public function testMoveShareGroupNull(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Group "shareWith" does not exist');
@@ -4215,7 +4215,7 @@ class ManagerTest extends \Test\TestCase {
$this->manager->moveShare($share, 'recipient');
}
- public function testMoveShareGroup() {
+ public function testMoveShareGroup(): void {
$share = $this->manager->newShare();
$share->setShareType(IShare::TYPE_GROUP)
->setId('42')
@@ -4239,7 +4239,7 @@ class ManagerTest extends \Test\TestCase {
/**
* @dataProvider dataTestShareProviderExists
*/
- public function testShareProviderExists($shareType, $expected) {
+ public function testShareProviderExists($shareType, $expected): void {
$factory = $this->getMockBuilder('OCP\Share\IProviderFactory')->getMock();
$factory->expects($this->any())->method('getProviderForType')
->willReturnCallback(function ($id) {
@@ -4262,7 +4262,7 @@ class ManagerTest extends \Test\TestCase {
];
}
- public function testGetSharesInFolder() {
+ public function testGetSharesInFolder(): void {
$factory = new DummyFactory2($this->createMock(IServerContainer::class));
$manager = $this->createManager($factory);
@@ -4309,7 +4309,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertSame($expects, $result);
}
- public function testGetAccessList() {
+ public function testGetAccessList(): void {
$factory = new DummyFactory2($this->createMock(IServerContainer::class));
$manager = $this->createManager($factory);
@@ -4408,7 +4408,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertSame($expected['users'], $result['users']);
}
- public function testGetAccessListWithCurrentAccess() {
+ public function testGetAccessListWithCurrentAccess(): void {
$factory = new DummyFactory2($this->createMock(IServerContainer::class));
$manager = $this->createManager($factory);
@@ -4516,7 +4516,7 @@ class ManagerTest extends \Test\TestCase {
$this->assertSame($expected['users'], $result['users']);
}
- public function testGetAllShares() {
+ public function testGetAllShares(): void {
$factory = new DummyFactory2($this->createMock(IServerContainer::class));
$manager = $this->createManager($factory);
diff --git a/tests/lib/Share20/ShareByMailProviderTest.php b/tests/lib/Share20/ShareByMailProviderTest.php
index 7e3eee106e8..01029e421e0 100644
--- a/tests/lib/Share20/ShareByMailProviderTest.php
+++ b/tests/lib/Share20/ShareByMailProviderTest.php
@@ -189,7 +189,7 @@ class ShareByMailProviderTest extends TestCase {
return $qb->getLastInsertId();
}
- public function testGetSharesByWithResharesAndNoNode() {
+ public function testGetSharesByWithResharesAndNoNode(): void {
$this->addShareToDB(
IShare::TYPE_EMAIL,
'external.one@domain.tld',
@@ -236,7 +236,7 @@ class ShareByMailProviderTest extends TestCase {
$this->assertEquals('external.one@domain.tld', $actual[0]->getSharedWith());
}
- public function testGetSharesByWithResharesAndNode() {
+ public function testGetSharesByWithResharesAndNode(): void {
$this->addShareToDB(
IShare::TYPE_EMAIL,
'external.one@domain.tld',
diff --git a/tests/lib/Share20/ShareHelperTest.php b/tests/lib/Share20/ShareHelperTest.php
index 04a079db0e9..8aaa8350ea9 100644
--- a/tests/lib/Share20/ShareHelperTest.php
+++ b/tests/lib/Share20/ShareHelperTest.php
@@ -51,7 +51,7 @@ class ShareHelperTest extends TestCase {
/**
* @dataProvider dataGetPathsForAccessList
*/
- public function testGetPathsForAccessList(array $userList, array $userMap, $resolveUsers, array $remoteList, array $remoteMap, $resolveRemotes, array $expected) {
+ public function testGetPathsForAccessList(array $userList, array $userMap, $resolveUsers, array $remoteList, array $remoteMap, $resolveRemotes, array $expected): void {
$this->manager->expects($this->once())
->method('getAccessList')
->willReturn([
@@ -107,7 +107,7 @@ class ShareHelperTest extends TestCase {
* @param array $nodes
* @param array $expected
*/
- public function testGetPathsForUsers(array $users, array $nodes, array $expected) {
+ public function testGetPathsForUsers(array $users, array $nodes, array $expected): void {
$lastNode = null;
foreach ($nodes as $nodeId => $nodeName) {
/** @var Node|\PHPUnit\Framework\MockObject\MockObject $node */
@@ -164,7 +164,7 @@ class ShareHelperTest extends TestCase {
* @param array $nodes
* @param array $expected
*/
- public function testGetPathsForRemotes(array $remotes, array $nodes, array $expected) {
+ public function testGetPathsForRemotes(array $remotes, array $nodes, array $expected): void {
$lastNode = null;
foreach ($nodes as $nodeId => $nodePath) {
/** @var Node|\PHPUnit\Framework\MockObject\MockObject $node */
@@ -202,7 +202,7 @@ class ShareHelperTest extends TestCase {
* @param string $path
* @param string $expected
*/
- public function testGetMountedPath($path, $expected) {
+ public function testGetMountedPath($path, $expected): void {
/** @var Node|\PHPUnit\Framework\MockObject\MockObject $node */
$node = $this->createMock(Node::class);
$node->expects($this->once())
diff --git a/tests/lib/Share20/ShareTest.php b/tests/lib/Share20/ShareTest.php
index 6769683aafe..72f3b46190c 100644
--- a/tests/lib/Share20/ShareTest.php
+++ b/tests/lib/Share20/ShareTest.php
@@ -31,26 +31,26 @@ class ShareTest extends \Test\TestCase {
}
- public function testSetIdInvalid() {
+ public function testSetIdInvalid(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('String expected.');
$this->share->setId(1.2);
}
- public function testSetIdInt() {
+ public function testSetIdInt(): void {
$this->share->setId(42);
$this->assertEquals('42', $this->share->getId());
}
- public function testSetIdString() {
+ public function testSetIdString(): void {
$this->share->setId('foo');
$this->assertEquals('foo', $this->share->getId());
}
- public function testSetIdOnce() {
+ public function testSetIdOnce(): void {
$this->expectException(\OCP\Share\Exceptions\IllegalIDChangeException::class);
$this->expectExceptionMessage('Not allowed to assign a new internal id to a share');
@@ -59,7 +59,7 @@ class ShareTest extends \Test\TestCase {
}
- public function testSetProviderIdInt() {
+ public function testSetProviderIdInt(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('String expected.');
@@ -67,14 +67,14 @@ class ShareTest extends \Test\TestCase {
}
- public function testSetProviderIdString() {
+ public function testSetProviderIdString(): void {
$this->share->setProviderId('foo');
$this->share->setId('bar');
$this->assertEquals('foo:bar', $this->share->getFullId());
}
- public function testSetProviderIdOnce() {
+ public function testSetProviderIdOnce(): void {
$this->expectException(\OCP\Share\Exceptions\IllegalIDChangeException::class);
$this->expectExceptionMessage('Not allowed to assign a new provider id to a share');
diff --git a/tests/lib/SubAdminTest.php b/tests/lib/SubAdminTest.php
index a4138fa922b..2827fe84d78 100644
--- a/tests/lib/SubAdminTest.php
+++ b/tests/lib/SubAdminTest.php
@@ -94,7 +94,7 @@ class SubAdminTest extends \Test\TestCase {
->execute();
}
- public function testCreateSubAdmin() {
+ public function testCreateSubAdmin(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$subAdmin->createSubAdmin($this->users[0], $this->groups[0]);
@@ -119,7 +119,7 @@ class SubAdminTest extends \Test\TestCase {
->execute();
}
- public function testDeleteSubAdmin() {
+ public function testDeleteSubAdmin(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$subAdmin->createSubAdmin($this->users[0], $this->groups[0]);
$subAdmin->deleteSubAdmin($this->users[0], $this->groups[0]);
@@ -135,7 +135,7 @@ class SubAdminTest extends \Test\TestCase {
$this->assertEmpty($result);
}
- public function testGetSubAdminsGroups() {
+ public function testGetSubAdminsGroups(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$subAdmin->createSubAdmin($this->users[0], $this->groups[0]);
$subAdmin->createSubAdmin($this->users[0], $this->groups[1]);
@@ -151,7 +151,7 @@ class SubAdminTest extends \Test\TestCase {
$subAdmin->deleteSubAdmin($this->users[0], $this->groups[1]);
}
- public function testGetGroupsSubAdmins() {
+ public function testGetGroupsSubAdmins(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$subAdmin->createSubAdmin($this->users[0], $this->groups[0]);
$subAdmin->createSubAdmin($this->users[1], $this->groups[0]);
@@ -167,7 +167,7 @@ class SubAdminTest extends \Test\TestCase {
$subAdmin->deleteSubAdmin($this->users[1], $this->groups[0]);
}
- public function testGetAllSubAdmin() {
+ public function testGetAllSubAdmin(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$subAdmin->createSubAdmin($this->users[0], $this->groups[0]);
@@ -182,7 +182,7 @@ class SubAdminTest extends \Test\TestCase {
$this->assertNotContains(['user' => null, 'group' => null], $result);
}
- public function testIsSubAdminofGroup() {
+ public function testIsSubAdminofGroup(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$subAdmin->createSubAdmin($this->users[0], $this->groups[0]);
@@ -193,7 +193,7 @@ class SubAdminTest extends \Test\TestCase {
$subAdmin->deleteSubAdmin($this->users[0], $this->groups[0]);
}
- public function testIsSubAdmin() {
+ public function testIsSubAdmin(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$subAdmin->createSubAdmin($this->users[0], $this->groups[0]);
@@ -203,14 +203,14 @@ class SubAdminTest extends \Test\TestCase {
$subAdmin->deleteSubAdmin($this->users[0], $this->groups[0]);
}
- public function testIsSubAdminAsAdmin() {
+ public function testIsSubAdminAsAdmin(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$this->groupManager->get('admin')->addUser($this->users[0]);
$this->assertTrue($subAdmin->isSubAdmin($this->users[0]));
}
- public function testIsUserAccessible() {
+ public function testIsUserAccessible(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$this->groups[0]->addUser($this->users[1]);
$this->groups[1]->addUser($this->users[1]);
@@ -226,12 +226,12 @@ class SubAdminTest extends \Test\TestCase {
$subAdmin->deleteSubAdmin($this->users[2], $this->groups[2]);
}
- public function testIsUserAccessibleAsUser() {
+ public function testIsUserAccessibleAsUser(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$this->assertFalse($subAdmin->isUserAccessible($this->users[0], $this->users[1]));
}
- public function testIsUserAccessibleAdmin() {
+ public function testIsUserAccessibleAdmin(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$subAdmin->createSubAdmin($this->users[0], $this->groups[0]);
$this->groupManager->get('admin')->addUser($this->users[1]);
@@ -239,7 +239,7 @@ class SubAdminTest extends \Test\TestCase {
$this->assertFalse($subAdmin->isUserAccessible($this->users[0], $this->users[1]));
}
- public function testPostDeleteUser() {
+ public function testPostDeleteUser(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$user = array_shift($this->users);
@@ -251,7 +251,7 @@ class SubAdminTest extends \Test\TestCase {
$this->assertEmpty($subAdmin->getAllSubAdmins());
}
- public function testPostDeleteGroup() {
+ public function testPostDeleteGroup(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$group = array_shift($this->groups);
@@ -263,7 +263,7 @@ class SubAdminTest extends \Test\TestCase {
$this->assertEmpty($subAdmin->getAllSubAdmins());
}
- public function testHooks() {
+ public function testHooks(): void {
$subAdmin = new \OC\SubAdmin($this->userManager, $this->groupManager, $this->dbConn, $this->eventDispatcher);
$test = $this;
diff --git a/tests/lib/Support/Subscription/RegistryTest.php b/tests/lib/Support/Subscription/RegistryTest.php
index de7f7600496..869c1498c41 100644
--- a/tests/lib/Support/Subscription/RegistryTest.php
+++ b/tests/lib/Support/Subscription/RegistryTest.php
@@ -66,13 +66,13 @@ class RegistryTest extends TestCase {
/**
* Doesn't assert anything, just checks whether anything "explodes"
*/
- public function testDelegateToNone() {
+ public function testDelegateToNone(): void {
$this->registry->delegateHasValidSubscription();
$this->addToAssertionCount(1);
}
- public function testDoubleRegistration() {
+ public function testDoubleRegistration(): void {
$this->expectException(\OCP\Support\Subscription\Exception\AlreadyRegisteredException::class);
/* @var ISubscription $subscription1 */
@@ -83,12 +83,12 @@ class RegistryTest extends TestCase {
$this->registry->register($subscription2);
}
- public function testNoSupportApp() {
+ public function testNoSupportApp(): void {
$this->assertSame([], $this->registry->delegateGetSupportedApps());
$this->assertSame(false, $this->registry->delegateHasValidSubscription());
}
- public function testDelegateHasValidSubscription() {
+ public function testDelegateHasValidSubscription(): void {
/* @var ISubscription|\PHPUnit\Framework\MockObject\MockObject $subscription */
$subscription = $this->createMock(ISubscription::class);
$subscription->expects($this->once())
@@ -99,7 +99,7 @@ class RegistryTest extends TestCase {
$this->assertSame(true, $this->registry->delegateHasValidSubscription());
}
- public function testDelegateHasValidSubscriptionConfig() {
+ public function testDelegateHasValidSubscriptionConfig(): void {
/* @var ISubscription|\PHPUnit\Framework\MockObject\MockObject $subscription */
$this->config->expects($this->once())
->method('getSystemValueBool')
@@ -109,7 +109,7 @@ class RegistryTest extends TestCase {
$this->assertSame(true, $this->registry->delegateHasValidSubscription());
}
- public function testDelegateHasExtendedSupport() {
+ public function testDelegateHasExtendedSupport(): void {
/* @var ISubscription|\PHPUnit\Framework\MockObject\MockObject $subscription */
$subscription = $this->createMock(ISubscription::class);
$subscription->expects($this->once())
@@ -121,7 +121,7 @@ class RegistryTest extends TestCase {
}
- public function testDelegateGetSupportedApps() {
+ public function testDelegateGetSupportedApps(): void {
/* @var ISupportedApps|\PHPUnit\Framework\MockObject\MockObject $subscription */
$subscription = $this->createMock(ISupportedApps::class);
$subscription->expects($this->once())
@@ -132,7 +132,7 @@ class RegistryTest extends TestCase {
$this->assertSame(['abc'], $this->registry->delegateGetSupportedApps());
}
- public function testSubscriptionService() {
+ public function testSubscriptionService(): void {
$this->serverContainer->method('query')
->with(DummySubscription::class)
->willReturn(new DummySubscription(true, false, false));
@@ -142,7 +142,7 @@ class RegistryTest extends TestCase {
$this->assertFalse($this->registry->delegateHasExtendedSupport());
}
- public function testDelegateIsHardUserLimitReached() {
+ public function testDelegateIsHardUserLimitReached(): void {
/* @var ISubscription|\PHPUnit\Framework\MockObject\MockObject $subscription */
$subscription = $this->createMock(ISubscription::class);
$subscription->expects($this->once())
@@ -163,7 +163,7 @@ class RegistryTest extends TestCase {
$this->assertSame(true, $this->registry->delegateIsHardUserLimitReached($this->notificationManager));
}
- public function testDelegateIsHardUserLimitReachedWithoutSupportApp() {
+ public function testDelegateIsHardUserLimitReachedWithoutSupportApp(): void {
$this->config->expects($this->once())
->method('getSystemValueBool')
->with('one-click-instance')
@@ -185,7 +185,7 @@ class RegistryTest extends TestCase {
/**
* @dataProvider dataForUserLimitCheck
*/
- public function testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount($userLimit, $userCount, $disabledUsers, $expectedResult) {
+ public function testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount($userLimit, $userCount, $disabledUsers, $expectedResult): void {
$this->config->expects($this->once())
->method('getSystemValueBool')
->with('one-click-instance')
diff --git a/tests/lib/SystemTag/SystemTagManagerTest.php b/tests/lib/SystemTag/SystemTagManagerTest.php
index 5029eaa7df6..7b93d900bee 100644
--- a/tests/lib/SystemTag/SystemTagManagerTest.php
+++ b/tests/lib/SystemTag/SystemTagManagerTest.php
@@ -102,7 +102,7 @@ class SystemTagManagerTest extends TestCase {
/**
* @dataProvider getAllTagsDataProvider
*/
- public function testGetAllTags($testTags) {
+ public function testGetAllTags($testTags): void {
$testTagsById = [];
foreach ($testTags as $testTag) {
$tag = $this->tagManager->createTag($testTag[0], $testTag[1], $testTag[2]);
@@ -211,7 +211,7 @@ class SystemTagManagerTest extends TestCase {
/**
* @dataProvider getAllTagsFilteredDataProvider
*/
- public function testGetAllTagsFiltered($testTags, $visibilityFilter, $nameSearch, $expectedResults) {
+ public function testGetAllTagsFiltered($testTags, $visibilityFilter, $nameSearch, $expectedResults): void {
foreach ($testTags as $testTag) {
$this->tagManager->createTag($testTag[0], $testTag[1], $testTag[2]);
}
@@ -244,7 +244,7 @@ class SystemTagManagerTest extends TestCase {
/**
* @dataProvider oneTagMultipleFlagsProvider
*/
- public function testCreateDuplicate($name, $userVisible, $userAssignable) {
+ public function testCreateDuplicate($name, $userVisible, $userAssignable): void {
$this->expectException(\OCP\SystemTag\TagAlreadyExistsException::class);
try {
@@ -255,7 +255,7 @@ class SystemTagManagerTest extends TestCase {
$this->tagManager->createTag($name, $userVisible, $userAssignable);
}
- public function testCreateOverlongName() {
+ public function testCreateOverlongName(): void {
$tag = $this->tagManager->createTag('Zona circundante do Palácio Nacional da Ajuda (Jardim das Damas, Salão de Física, Torre Sineira, Paço Velho e Jardim Botânico)', true, true);
$this->assertSame('Zona circundante do Palácio Nacional da Ajuda (Jardim das Damas', $tag->getName()); // 63 characters but 64 bytes due to "á"
}
@@ -263,14 +263,14 @@ class SystemTagManagerTest extends TestCase {
/**
* @dataProvider oneTagMultipleFlagsProvider
*/
- public function testGetExistingTag($name, $userVisible, $userAssignable) {
+ public function testGetExistingTag($name, $userVisible, $userAssignable): void {
$tag1 = $this->tagManager->createTag($name, $userVisible, $userAssignable);
$tag2 = $this->tagManager->getTag($name, $userVisible, $userAssignable);
$this->assertSameTag($tag1, $tag2);
}
- public function testGetExistingTagById() {
+ public function testGetExistingTagById(): void {
$tag1 = $this->tagManager->createTag('one', true, false);
$tag2 = $this->tagManager->createTag('two', false, true);
@@ -283,14 +283,14 @@ class SystemTagManagerTest extends TestCase {
}
- public function testGetNonExistingTag() {
+ public function testGetNonExistingTag(): void {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);
$this->tagManager->getTag('nonexist', false, false);
}
- public function testGetNonExistingTagsById() {
+ public function testGetNonExistingTagsById(): void {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);
$tag1 = $this->tagManager->createTag('one', true, false);
@@ -298,7 +298,7 @@ class SystemTagManagerTest extends TestCase {
}
- public function testGetInvalidTagIdFormat() {
+ public function testGetInvalidTagIdFormat(): void {
$this->expectException(\InvalidArgumentException::class);
$tag1 = $this->tagManager->createTag('one', true, false);
@@ -333,7 +333,7 @@ class SystemTagManagerTest extends TestCase {
/**
* @dataProvider updateTagProvider
*/
- public function testUpdateTag($tagCreate, $tagUpdated) {
+ public function testUpdateTag($tagCreate, $tagUpdated): void {
$tag1 = $this->tagManager->createTag(
$tagCreate[0],
$tagCreate[1],
@@ -360,7 +360,7 @@ class SystemTagManagerTest extends TestCase {
/**
* @dataProvider updateTagProvider
*/
- public function testUpdateTagDuplicate($tagCreate, $tagUpdated) {
+ public function testUpdateTagDuplicate($tagCreate, $tagUpdated): void {
$this->expectException(\OCP\SystemTag\TagAlreadyExistsException::class);
$this->tagManager->createTag(
@@ -383,7 +383,7 @@ class SystemTagManagerTest extends TestCase {
);
}
- public function testDeleteTags() {
+ public function testDeleteTags(): void {
$tag1 = $this->tagManager->createTag('one', true, false);
$tag2 = $this->tagManager->createTag('two', false, true);
@@ -393,13 +393,13 @@ class SystemTagManagerTest extends TestCase {
}
- public function testDeleteNonExistingTag() {
+ public function testDeleteNonExistingTag(): void {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);
$this->tagManager->deleteTags([100]);
}
- public function testDeleteTagRemovesRelations() {
+ public function testDeleteTagRemovesRelations(): void {
$tag1 = $this->tagManager->createTag('one', true, false);
$tag2 = $this->tagManager->createTag('two', true, true);
@@ -434,7 +434,7 @@ class SystemTagManagerTest extends TestCase {
/**
* @dataProvider visibilityCheckProvider
*/
- public function testVisibilityCheck($userVisible, $userAssignable, $isAdmin, $expectedResult) {
+ public function testVisibilityCheck($userVisible, $userAssignable, $isAdmin, $expectedResult): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$user->expects($this->any())
->method('getUID')
@@ -481,7 +481,7 @@ class SystemTagManagerTest extends TestCase {
/**
* @dataProvider assignabilityCheckProvider
*/
- public function testAssignabilityCheck($userVisible, $userAssignable, $isAdmin, $expectedResult, $userGroupIds = [], $tagGroupIds = []) {
+ public function testAssignabilityCheck($userVisible, $userAssignable, $isAdmin, $expectedResult, $userGroupIds = [], $tagGroupIds = []): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$user->expects($this->any())
->method('getUID')
@@ -501,7 +501,7 @@ class SystemTagManagerTest extends TestCase {
$this->assertEquals($expectedResult, $this->tagManager->canUserAssignTag($tag1, $user));
}
- public function testTagGroups() {
+ public function testTagGroups(): void {
$tag1 = $this->tagManager->createTag('tag1', true, false);
$tag2 = $this->tagManager->createTag('tag2', true, false);
$this->tagManager->setTagGroups($tag1, ['group1', 'group2']);
@@ -521,7 +521,7 @@ class SystemTagManagerTest extends TestCase {
/**
* empty groupIds should be ignored
*/
- public function testEmptyTagGroup() {
+ public function testEmptyTagGroup(): void {
$tag1 = $this->tagManager->createTag('tag1', true, false);
$this->tagManager->setTagGroups($tag1, ['']);
$this->assertEquals([], $this->tagManager->getTagGroups($tag1));
diff --git a/tests/lib/SystemTag/SystemTagObjectMapperTest.php b/tests/lib/SystemTag/SystemTagObjectMapperTest.php
index 7beb1c1f1e1..3569c98b5bc 100644
--- a/tests/lib/SystemTag/SystemTagObjectMapperTest.php
+++ b/tests/lib/SystemTag/SystemTagObjectMapperTest.php
@@ -113,7 +113,7 @@ class SystemTagObjectMapperTest extends TestCase {
$query->delete(SystemTagManager::TAG_TABLE)->execute();
}
- public function testGetTagIdsForObjects() {
+ public function testGetTagIdsForObjects(): void {
$tagIdMapping = $this->tagMapper->getTagIdsForObjects(
['1', '2', '3', '4'],
'testtype'
@@ -127,7 +127,7 @@ class SystemTagObjectMapperTest extends TestCase {
], $tagIdMapping);
}
- public function testGetTagIdsForNoObjects() {
+ public function testGetTagIdsForNoObjects(): void {
$tagIdMapping = $this->tagMapper->getTagIdsForObjects(
[],
'testtype'
@@ -136,7 +136,7 @@ class SystemTagObjectMapperTest extends TestCase {
$this->assertEquals([], $tagIdMapping);
}
- public function testGetTagIdsForALotOfObjects() {
+ public function testGetTagIdsForALotOfObjects(): void {
$ids = range(1, 10500);
$tagIdMapping = $this->tagMapper->getTagIdsForObjects(
$ids,
@@ -147,7 +147,7 @@ class SystemTagObjectMapperTest extends TestCase {
$this->assertEquals([$this->tag1->getId(), $this->tag2->getId()], $tagIdMapping[1]);
}
- public function testGetObjectsForTags() {
+ public function testGetObjectsForTags(): void {
$objectIds = $this->tagMapper->getObjectIdsForTags(
[$this->tag1->getId(), $this->tag2->getId(), $this->tag3->getId()],
'testtype'
@@ -160,7 +160,7 @@ class SystemTagObjectMapperTest extends TestCase {
], $objectIds);
}
- public function testGetObjectsForTagsLimit() {
+ public function testGetObjectsForTagsLimit(): void {
$objectIds = $this->tagMapper->getObjectIdsForTags(
[$this->tag1->getId()],
'testtype',
@@ -173,7 +173,7 @@ class SystemTagObjectMapperTest extends TestCase {
}
- public function testGetObjectsForTagsLimitWithMultipleTags() {
+ public function testGetObjectsForTagsLimitWithMultipleTags(): void {
$this->expectException(\InvalidArgumentException::class);
$this->tagMapper->getObjectIdsForTags(
@@ -183,7 +183,7 @@ class SystemTagObjectMapperTest extends TestCase {
);
}
- public function testGetObjectsForTagsLimitOffset() {
+ public function testGetObjectsForTagsLimitOffset(): void {
$objectIds = $this->tagMapper->getObjectIdsForTags(
[$this->tag1->getId()],
'testtype',
@@ -197,7 +197,7 @@ class SystemTagObjectMapperTest extends TestCase {
}
- public function testGetObjectsForNonExistingTag() {
+ public function testGetObjectsForNonExistingTag(): void {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);
$this->tagMapper->getObjectIdsForTags(
@@ -206,7 +206,7 @@ class SystemTagObjectMapperTest extends TestCase {
);
}
- public function testAssignUnassignTags() {
+ public function testAssignUnassignTags(): void {
$this->tagMapper->unassignTags('1', 'testtype', [$this->tag1->getId()]);
$tagIdMapping = $this->tagMapper->getTagIdsForObjects('1', 'testtype');
@@ -224,7 +224,7 @@ class SystemTagObjectMapperTest extends TestCase {
], $tagIdMapping);
}
- public function testReAssignUnassignTags() {
+ public function testReAssignUnassignTags(): void {
// reassign tag1
$this->tagMapper->assignTags('1', 'testtype', [$this->tag1->getId()]);
@@ -235,13 +235,13 @@ class SystemTagObjectMapperTest extends TestCase {
}
- public function testAssignNonExistingTags() {
+ public function testAssignNonExistingTags(): void {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);
$this->tagMapper->assignTags('1', 'testtype', [100]);
}
- public function testAssignNonExistingTagInArray() {
+ public function testAssignNonExistingTagInArray(): void {
$caught = false;
try {
$this->tagMapper->assignTags('1', 'testtype', [100, $this->tag3->getId()]);
@@ -262,13 +262,13 @@ class SystemTagObjectMapperTest extends TestCase {
}
- public function testUnassignNonExistingTags() {
+ public function testUnassignNonExistingTags(): void {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);
$this->tagMapper->unassignTags('1', 'testtype', [100]);
}
- public function testUnassignNonExistingTagsInArray() {
+ public function testUnassignNonExistingTagsInArray(): void {
$caught = false;
try {
$this->tagMapper->unassignTags('1', 'testtype', [100, $this->tag1->getId()]);
@@ -288,7 +288,7 @@ class SystemTagObjectMapperTest extends TestCase {
], $tagIdMapping, 'None of the tags got unassigned');
}
- public function testHaveTagAllMatches() {
+ public function testHaveTagAllMatches(): void {
$this->assertTrue(
$this->tagMapper->haveTag(
['1'],
@@ -340,7 +340,7 @@ class SystemTagObjectMapperTest extends TestCase {
);
}
- public function testHaveTagAtLeastOneMatch() {
+ public function testHaveTagAtLeastOneMatch(): void {
$this->assertTrue(
$this->tagMapper->haveTag(
['1'],
@@ -393,7 +393,7 @@ class SystemTagObjectMapperTest extends TestCase {
}
- public function testHaveTagNonExisting() {
+ public function testHaveTagNonExisting(): void {
$this->expectException(\OCP\SystemTag\TagNotFoundException::class);
$this->tagMapper->haveTag(
diff --git a/tests/lib/TagsTest.php b/tests/lib/TagsTest.php
index a3e0c8f750f..18768970954 100644
--- a/tests/lib/TagsTest.php
+++ b/tests/lib/TagsTest.php
@@ -59,7 +59,7 @@ class TagsTest extends \Test\TestCase {
parent::tearDown();
}
- public function testTagManagerWithoutUserReturnsNull() {
+ public function testTagManagerWithoutUserReturnsNull(): void {
$this->userSession = $this->createMock(IUserSession::class);
$this->userSession
->expects($this->any())
@@ -69,7 +69,7 @@ class TagsTest extends \Test\TestCase {
$this->assertNull($this->tagMgr->load($this->objectType));
}
- public function testInstantiateWithDefaults() {
+ public function testInstantiateWithDefaults(): void {
$defaultTags = ['Friends', 'Family', 'Work', 'Other'];
$tagger = $this->tagMgr->load($this->objectType, $defaultTags);
@@ -77,7 +77,7 @@ class TagsTest extends \Test\TestCase {
$this->assertEquals(4, count($tagger->getTags()));
}
- public function testAddTags() {
+ public function testAddTags(): void {
$tags = ['Friends', 'Family', 'Work', 'Other'];
$tagger = $this->tagMgr->load($this->objectType);
@@ -94,7 +94,7 @@ class TagsTest extends \Test\TestCase {
$this->assertCount(4, $tagger->getTags(), 'Wrong number of added tags');
}
- public function testAddMultiple() {
+ public function testAddMultiple(): void {
$tags = ['Friends', 'Family', 'Work', 'Other'];
$tagger = $this->tagMgr->load($this->objectType);
@@ -142,7 +142,7 @@ class TagsTest extends \Test\TestCase {
$this->assertCount(4, $tagger->getTags(), 'Not all previously saved tags found');
}
- public function testIsEmpty() {
+ public function testIsEmpty(): void {
$tagger = $this->tagMgr->load($this->objectType);
$this->assertEquals(0, count($tagger->getTags()));
@@ -154,7 +154,7 @@ class TagsTest extends \Test\TestCase {
$this->assertFalse($tagger->isEmpty());
}
- public function testGetTagsForObjects() {
+ public function testGetTagsForObjects(): void {
$defaultTags = ['Friends', 'Family', 'Work', 'Other'];
$tagger = $this->tagMgr->load($this->objectType, $defaultTags);
@@ -184,7 +184,7 @@ class TagsTest extends \Test\TestCase {
);
}
- public function testGetTagsForObjectsMassiveResults() {
+ public function testGetTagsForObjectsMassiveResults(): void {
$defaultTags = ['tag1'];
$tagger = $this->tagMgr->load($this->objectType, $defaultTags);
$tagData = $tagger->getTags();
@@ -209,7 +209,7 @@ class TagsTest extends \Test\TestCase {
$this->assertEquals(1500, count($tags));
}
- public function testDeleteTags() {
+ public function testDeleteTags(): void {
$defaultTags = ['Friends', 'Family', 'Work', 'Other'];
$tagger = $this->tagMgr->load($this->objectType, $defaultTags);
@@ -222,7 +222,7 @@ class TagsTest extends \Test\TestCase {
$this->assertEquals(0, count($tagger->getTags()));
}
- public function testRenameTag() {
+ public function testRenameTag(): void {
$defaultTags = ['Friends', 'Family', 'Wrok', 'Other'];
$tagger = $this->tagMgr->load($this->objectType, $defaultTags);
@@ -233,7 +233,7 @@ class TagsTest extends \Test\TestCase {
$this->assertFalse($tagger->rename('Work', 'Family')); // Collide with existing tag.
}
- public function testTagAs() {
+ public function testTagAs(): void {
$objids = [1, 2, 3, 4, 5, 6, 7, 8, 9];
$tagger = $this->tagMgr->load($this->objectType);
@@ -249,7 +249,7 @@ class TagsTest extends \Test\TestCase {
/**
* @depends testTagAs
*/
- public function testUnTag() {
+ public function testUnTag(): void {
$objIds = [1, 2, 3, 4, 5, 6, 7, 8, 9];
// Is this "legal"?
@@ -266,7 +266,7 @@ class TagsTest extends \Test\TestCase {
$this->assertEquals(0, count($tagger->getIdsForTag('Family')));
}
- public function testFavorite() {
+ public function testFavorite(): void {
$tagger = $this->tagMgr->load($this->objectType);
$this->assertTrue($tagger->addToFavorites(1));
$this->assertEquals([1], $tagger->getFavorites());
diff --git a/tests/lib/TaskProcessing/TaskProcessingTest.php b/tests/lib/TaskProcessing/TaskProcessingTest.php
index 624f09ae2d8..38675e826bf 100644
--- a/tests/lib/TaskProcessing/TaskProcessingTest.php
+++ b/tests/lib/TaskProcessing/TaskProcessingTest.php
@@ -484,7 +484,7 @@ class TaskProcessingTest extends \Test\TestCase {
return $file;
}
- public function testShouldNotHaveAnyProviders() {
+ public function testShouldNotHaveAnyProviders(): void {
$this->registrationContext->expects($this->any())->method('getTaskProcessingProviders')->willReturn([]);
self::assertCount(0, $this->manager->getAvailableTaskTypes());
self::assertFalse($this->manager->hasProviders());
@@ -492,7 +492,7 @@ class TaskProcessingTest extends \Test\TestCase {
$this->manager->scheduleTask(new Task(TextToText::ID, ['input' => 'Hello'], 'test', null));
}
- public function testProviderShouldBeRegisteredAndTaskFailValidation() {
+ public function testProviderShouldBeRegisteredAndTaskFailValidation(): void {
$this->registrationContext->expects($this->any())->method('getTaskProcessingProviders')->willReturn([
new ServiceRegistration('test', BrokenSyncProvider::class)
]);
@@ -504,7 +504,7 @@ class TaskProcessingTest extends \Test\TestCase {
$this->manager->scheduleTask($task);
}
- public function testProviderShouldBeRegisteredAndTaskWithFilesFailValidation() {
+ public function testProviderShouldBeRegisteredAndTaskWithFilesFailValidation(): void {
$this->registrationContext->expects($this->any())->method('getTaskProcessingTaskTypes')->willReturn([
new ServiceRegistration('test', AudioToImage::class)
]);
@@ -528,7 +528,7 @@ class TaskProcessingTest extends \Test\TestCase {
$this->manager->scheduleTask($task);
}
- public function testProviderShouldBeRegisteredAndFail() {
+ public function testProviderShouldBeRegisteredAndFail(): void {
$this->registrationContext->expects($this->any())->method('getTaskProcessingProviders')->willReturn([
new ServiceRegistration('test', FailingSyncProvider::class)
]);
@@ -556,7 +556,7 @@ class TaskProcessingTest extends \Test\TestCase {
self::assertEquals(FailingSyncProvider::ERROR_MESSAGE, $task->getErrorMessage());
}
- public function testProviderShouldBeRegisteredAndFailOutputValidation() {
+ public function testProviderShouldBeRegisteredAndFailOutputValidation(): void {
$this->registrationContext->expects($this->any())->method('getTaskProcessingProviders')->willReturn([
new ServiceRegistration('test', BrokenSyncProvider::class)
]);
@@ -584,7 +584,7 @@ class TaskProcessingTest extends \Test\TestCase {
self::assertEquals('The task was processed successfully but the provider\'s output doesn\'t pass validation against the task type\'s outputShape spec and/or the provider\'s own optionalOutputShape spec', $task->getErrorMessage());
}
- public function testProviderShouldBeRegisteredAndRun() {
+ public function testProviderShouldBeRegisteredAndRun(): void {
$this->registrationContext->expects($this->any())->method('getTaskProcessingProviders')->willReturn([
new ServiceRegistration('test', SuccessfulSyncProvider::class)
]);
@@ -630,7 +630,7 @@ class TaskProcessingTest extends \Test\TestCase {
self::assertEquals(1, $task->getProgress());
}
- public function testAsyncProviderWithFilesShouldBeRegisteredAndRunReturningRawFileData() {
+ public function testAsyncProviderWithFilesShouldBeRegisteredAndRunReturningRawFileData(): void {
$this->registrationContext->expects($this->any())->method('getTaskProcessingTaskTypes')->willReturn([
new ServiceRegistration('test', AudioToImage::class)
]);
@@ -682,7 +682,7 @@ class TaskProcessingTest extends \Test\TestCase {
self::assertEquals('World', $node->getContent());
}
- public function testAsyncProviderWithFilesShouldBeRegisteredAndRunReturningFileIds() {
+ public function testAsyncProviderWithFilesShouldBeRegisteredAndRunReturningFileIds(): void {
$this->registrationContext->expects($this->any())->method('getTaskProcessingTaskTypes')->willReturn([
new ServiceRegistration('test', AudioToImage::class)
]);
@@ -734,12 +734,12 @@ class TaskProcessingTest extends \Test\TestCase {
self::assertEquals('World', $node->getContent());
}
- public function testNonexistentTask() {
+ public function testNonexistentTask(): void {
$this->expectException(\OCP\TaskProcessing\Exception\NotFoundException::class);
$this->manager->getTask(2147483646);
}
- public function testOldTasksShouldBeCleanedUp() {
+ public function testOldTasksShouldBeCleanedUp(): void {
$currentTime = new \DateTime('now');
$timeFactory = $this->createMock(ITimeFactory::class);
$timeFactory->expects($this->any())->method('getDateTime')->willReturnCallback(fn () => $currentTime);
@@ -785,7 +785,7 @@ class TaskProcessingTest extends \Test\TestCase {
$this->manager->getTask($task->getId());
}
- public function testShouldTransparentlyHandleTextProcessingProviders() {
+ public function testShouldTransparentlyHandleTextProcessingProviders(): void {
$this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([
new ServiceRegistration('test', SuccessfulTextProcessingSummaryProvider::class)
]);
@@ -816,7 +816,7 @@ class TaskProcessingTest extends \Test\TestCase {
self::assertTrue($this->providers[SuccessfulTextProcessingSummaryProvider::class]->ran);
}
- public function testShouldTransparentlyHandleFailingTextProcessingProviders() {
+ public function testShouldTransparentlyHandleFailingTextProcessingProviders(): void {
$this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([
new ServiceRegistration('test', FailingTextProcessingSummaryProvider::class)
]);
@@ -846,7 +846,7 @@ class TaskProcessingTest extends \Test\TestCase {
self::assertTrue($this->providers[FailingTextProcessingSummaryProvider::class]->ran);
}
- public function testShouldTransparentlyHandleText2ImageProviders() {
+ public function testShouldTransparentlyHandleText2ImageProviders(): void {
$this->registrationContext->expects($this->any())->method('getTextToImageProviders')->willReturn([
new ServiceRegistration('test', SuccessfulTextToImageProvider::class)
]);
@@ -882,7 +882,7 @@ class TaskProcessingTest extends \Test\TestCase {
self::assertEquals('test', $node->getContent());
}
- public function testShouldTransparentlyHandleFailingText2ImageProviders() {
+ public function testShouldTransparentlyHandleFailingText2ImageProviders(): void {
$this->registrationContext->expects($this->any())->method('getTextToImageProviders')->willReturn([
new ServiceRegistration('test', FailingTextToImageProvider::class)
]);
diff --git a/tests/lib/TempManagerTest.php b/tests/lib/TempManagerTest.php
index c66690b9656..a981338f42a 100644
--- a/tests/lib/TempManagerTest.php
+++ b/tests/lib/TempManagerTest.php
@@ -55,7 +55,7 @@ class TempManagerTest extends \Test\TestCase {
return $manager;
}
- public function testGetFile() {
+ public function testGetFile(): void {
$manager = $this->getManager();
$file = $manager->getTemporaryFile('txt');
$this->assertStringEndsWith('.txt', $file);
@@ -66,7 +66,7 @@ class TempManagerTest extends \Test\TestCase {
$this->assertEquals('bar', file_get_contents($file));
}
- public function testGetFolder() {
+ public function testGetFolder(): void {
$manager = $this->getManager();
$folder = $manager->getTemporaryFolder();
$this->assertStringEndsWith('/', $folder);
@@ -77,7 +77,7 @@ class TempManagerTest extends \Test\TestCase {
$this->assertEquals('bar', file_get_contents($folder . 'foo.txt'));
}
- public function testCleanFiles() {
+ public function testCleanFiles(): void {
$manager = $this->getManager();
$file1 = $manager->getTemporaryFile('txt');
$file2 = $manager->getTemporaryFile('txt');
@@ -90,7 +90,7 @@ class TempManagerTest extends \Test\TestCase {
$this->assertFalse(file_exists($file2));
}
- public function testCleanFolder() {
+ public function testCleanFolder(): void {
$manager = $this->getManager();
$folder1 = $manager->getTemporaryFolder();
$folder2 = $manager->getTemporaryFolder();
@@ -109,7 +109,7 @@ class TempManagerTest extends \Test\TestCase {
$this->assertFalse(file_exists($folder1 . 'bar.txt'));
}
- public function testCleanOld() {
+ public function testCleanOld(): void {
$manager = $this->getManager();
$oldFile = $manager->getTemporaryFile('txt');
$newFile = $manager->getTemporaryFile('txt');
@@ -130,7 +130,7 @@ class TempManagerTest extends \Test\TestCase {
$this->assertTrue(file_exists($newFile));
}
- public function testLogCantCreateFile() {
+ public function testLogCantCreateFile(): void {
$this->markTestSkipped('TODO: Disable because fails on drone');
$logger = $this->createMock(LoggerInterface::class);
@@ -142,7 +142,7 @@ class TempManagerTest extends \Test\TestCase {
$this->assertFalse($manager->getTemporaryFile('txt'));
}
- public function testLogCantCreateFolder() {
+ public function testLogCantCreateFolder(): void {
$this->markTestSkipped('TODO: Disable because fails on drone');
$logger = $this->createMock(LoggerInterface::class);
@@ -154,7 +154,7 @@ class TempManagerTest extends \Test\TestCase {
$this->assertFalse($manager->getTemporaryFolder());
}
- public function testBuildFileNameWithPostfix() {
+ public function testBuildFileNameWithPostfix(): void {
$logger = $this->createMock(LoggerInterface::class);
$tmpManager = self::invokePrivate(
$this->getManager($logger),
@@ -165,7 +165,7 @@ class TempManagerTest extends \Test\TestCase {
$this->assertEquals('/tmp/myTemporaryFile-.postfix', $tmpManager);
}
- public function testBuildFileNameWithoutPostfix() {
+ public function testBuildFileNameWithoutPostfix(): void {
$logger = $this->createMock(LoggerInterface::class);
$tmpManager = self::invokePrivate(
$this->getManager($logger),
@@ -176,7 +176,7 @@ class TempManagerTest extends \Test\TestCase {
$this->assertEquals('/tmp/myTemporaryFile', $tmpManager);
}
- public function testBuildFileNameWithSuffixPathTraversal() {
+ public function testBuildFileNameWithSuffixPathTraversal(): void {
$logger = $this->createMock(LoggerInterface::class);
$tmpManager = self::invokePrivate(
$this->getManager($logger),
@@ -188,7 +188,7 @@ class TempManagerTest extends \Test\TestCase {
$this->assertStringEndsWith('.Traversal..FileName', $tmpManager);
}
- public function testGetTempBaseDirFromConfig() {
+ public function testGetTempBaseDirFromConfig(): void {
$dir = $this->getManager()->getTemporaryFolder();
$config = $this->createMock(IConfig::class);
diff --git a/tests/lib/Template/CSSResourceLocatorTest.php b/tests/lib/Template/CSSResourceLocatorTest.php
index 64c31d9c94c..ed02358a8c9 100644
--- a/tests/lib/Template/CSSResourceLocatorTest.php
+++ b/tests/lib/Template/CSSResourceLocatorTest.php
@@ -77,7 +77,7 @@ class CSSResourceLocatorTest extends \Test\TestCase {
return sha1(uniqid(mt_rand(), true));
}
- public function testFindWithAppPathSymlink() {
+ public function testFindWithAppPathSymlink(): void {
// First create new apps path, and a symlink to it
$apps_dirname = $this->randomString();
$new_apps_path = sys_get_temp_dir() . '/' . $apps_dirname;
diff --git a/tests/lib/Template/JSCombinerTest.php b/tests/lib/Template/JSCombinerTest.php
index d9de4b088d1..63a52f34047 100644
--- a/tests/lib/Template/JSCombinerTest.php
+++ b/tests/lib/Template/JSCombinerTest.php
@@ -55,7 +55,7 @@ class JSCombinerTest extends \Test\TestCase {
);
}
- public function testProcessDebugMode() {
+ public function testProcessDebugMode(): void {
$this->config
->expects($this->once())
->method('getValue')
@@ -66,7 +66,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertFalse($actual);
}
- public function testProcessNotInstalled() {
+ public function testProcessNotInstalled(): void {
$this->config
->expects($this->exactly(2))
->method('getValue')
@@ -83,7 +83,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertFalse($actual);
}
- public function testProcessUncachedFileNoAppDataFolder() {
+ public function testProcessUncachedFileNoAppDataFolder(): void {
$this->config
->expects($this->exactly(2))
->method('getValue')
@@ -123,7 +123,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertTrue($actual);
}
- public function testProcessUncachedFile() {
+ public function testProcessUncachedFile(): void {
$this->config
->expects($this->exactly(2))
->method('getValue')
@@ -161,7 +161,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertTrue($actual);
}
- public function testProcessCachedFile() {
+ public function testProcessCachedFile(): void {
$this->config
->expects($this->exactly(2))
->method('getValue')
@@ -202,7 +202,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertTrue($actual);
}
- public function testProcessCachedFileMemcache() {
+ public function testProcessCachedFileMemcache(): void {
$this->config
->expects($this->exactly(2))
->method('getValue')
@@ -243,7 +243,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertTrue($actual);
}
- public function testIsCachedNoDepsFile() {
+ public function testIsCachedNoDepsFile(): void {
$fileName = 'combine.json';
$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
@@ -263,7 +263,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertFalse($actual);
}
- public function testIsCachedWithNotExistingFile() {
+ public function testIsCachedWithNotExistingFile(): void {
$fileName = 'combine.json';
$folder = $this->createMock(ISimpleFolder::class);
$folder->method('fileExists')
@@ -281,7 +281,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertFalse($actual);
}
- public function testIsCachedWithOlderMtime() {
+ public function testIsCachedWithOlderMtime(): void {
$fileName = 'combine.json';
$folder = $this->createMock(ISimpleFolder::class);
$folder->method('fileExists')
@@ -299,7 +299,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertFalse($actual);
}
- public function testIsCachedWithoutContent() {
+ public function testIsCachedWithoutContent(): void {
$fileName = 'combine.json';
$folder = $this->createMock(ISimpleFolder::class);
$folder->method('fileExists')
@@ -319,7 +319,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertFalse($actual);
}
- public function testCacheNoFile() {
+ public function testCacheNoFile(): void {
$fileName = 'combine.js';
$folder = $this->createMock(ISimpleFolder::class);
@@ -352,7 +352,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertTrue($actual);
}
- public function testCache() {
+ public function testCache(): void {
$fileName = 'combine.js';
$folder = $this->createMock(ISimpleFolder::class);
@@ -383,7 +383,7 @@ class JSCombinerTest extends \Test\TestCase {
$this->assertTrue($actual);
}
- public function testCacheNotPermittedException() {
+ public function testCacheNotPermittedException(): void {
$fileName = 'combine.js';
$folder = $this->createMock(ISimpleFolder::class);
@@ -429,7 +429,7 @@ var b = \'world\';
$this->assertFalse($actual);
}
- public function testCacheSuccess() {
+ public function testCacheSuccess(): void {
$fileName = 'combine.js';
$folder = $this->createMock(ISimpleFolder::class);
@@ -497,7 +497,7 @@ var b = \'world\';
* @param $result
* @dataProvider dataGetCachedSCSS
*/
- public function testGetCachedSCSS($appName, $fileName, $result) {
+ public function testGetCachedSCSS($appName, $fileName, $result): void {
$this->urlGenerator->expects($this->once())
->method('linkToRoute')
->with('core.Js.getJs', [
@@ -510,7 +510,7 @@ var b = \'world\';
$this->assertEquals(substr($result, 1), $actual);
}
- public function testGetContent() {
+ public function testGetContent(): void {
// Create temporary file with some content
$tmpFile = \OC::$server->getTempManager()->getTemporaryFile('JSCombinerTest');
$pathInfo = pathinfo($tmpFile);
@@ -525,7 +525,7 @@ var b = \'world\';
$this->assertEquals($expected, $this->jsCombiner->getContent($pathInfo['dirname'], $pathInfo['basename']));
}
- public function testGetContentInvalidJson() {
+ public function testGetContentInvalidJson(): void {
// Create temporary file with some content
$tmpFile = \OC::$server->getTempManager()->getTemporaryFile('JSCombinerTest');
$pathInfo = pathinfo($tmpFile);
@@ -534,7 +534,7 @@ var b = \'world\';
$this->assertEquals($expected, $this->jsCombiner->getContent($pathInfo['dirname'], $pathInfo['basename']));
}
- public function testResetCache() {
+ public function testResetCache(): void {
$file = $this->createMock(ISimpleFile::class);
$file->expects($this->once())
->method('delete');
diff --git a/tests/lib/Template/JSResourceLocatorTest.php b/tests/lib/Template/JSResourceLocatorTest.php
index c6f62990d9a..bb2c2bec6c4 100644
--- a/tests/lib/Template/JSResourceLocatorTest.php
+++ b/tests/lib/Template/JSResourceLocatorTest.php
@@ -72,7 +72,7 @@ class JSResourceLocatorTest extends \Test\TestCase {
return sha1(uniqid(mt_rand(), true));
}
- public function testFindWithAppPathSymlink() {
+ public function testFindWithAppPathSymlink(): void {
$appName = 'test-js-app';
// First create new apps path, and a symlink to it
@@ -123,7 +123,7 @@ class JSResourceLocatorTest extends \Test\TestCase {
$this->rrmdir($new_apps_path);
}
- public function testNotExistingTranslationHandledSilent() {
+ public function testNotExistingTranslationHandledSilent(): void {
$this->appManager->expects($this->once())
->method('getAppPath')
->with('core')
@@ -144,7 +144,7 @@ class JSResourceLocatorTest extends \Test\TestCase {
$this->assertCount(0, $resources);
}
- public function testFindModuleJSWithFallback() {
+ public function testFindModuleJSWithFallback(): void {
// First create new apps path, and a symlink to it
$apps_dirname = $this->randomString();
$new_apps_path = sys_get_temp_dir() . '/' . $apps_dirname;
diff --git a/tests/lib/Template/ResourceLocatorTest.php b/tests/lib/Template/ResourceLocatorTest.php
index e74e72014c5..65d4c7938f9 100644
--- a/tests/lib/Template/ResourceLocatorTest.php
+++ b/tests/lib/Template/ResourceLocatorTest.php
@@ -37,7 +37,7 @@ class ResourceLocatorTest extends \Test\TestCase {
'', true, true, true, []);
}
- public function testFind() {
+ public function testFind(): void {
$locator = $this->getResourceLocator('theme');
$locator->expects($this->once())
->method('doFind')
@@ -49,7 +49,7 @@ class ResourceLocatorTest extends \Test\TestCase {
$locator->find(['foo']);
}
- public function testFindNotFound() {
+ public function testFindNotFound(): void {
$systemConfig = $this->createMock(SystemConfig::class);
$systemConfig->method('getValue')
->with('theme', '')
@@ -72,7 +72,7 @@ class ResourceLocatorTest extends \Test\TestCase {
$locator->find(['foo']);
}
- public function testAppendIfExist() {
+ public function testAppendIfExist(): void {
$locator = $this->getResourceLocator('theme');
/** @var \OC\Template\ResourceLocator $locator */
$method = new \ReflectionMethod($locator, 'appendIfExist');
diff --git a/tests/lib/TemplateFunctionsTest.php b/tests/lib/TemplateFunctionsTest.php
index 754551a415b..a693a39c580 100644
--- a/tests/lib/TemplateFunctionsTest.php
+++ b/tests/lib/TemplateFunctionsTest.php
@@ -14,50 +14,50 @@ class TemplateFunctionsTest extends \Test\TestCase {
require_once \OC::$SERVERROOT . '/lib/private/legacy/OC_Template.php';
}
- public function testPJavaScript() {
+ public function testPJavaScript(): void {
$this->expectOutputString('&lt;img onload=&quot;alert(1)&quot; /&gt;');
p('<img onload="alert(1)" />');
}
- public function testPJavaScriptWithScriptTags() {
+ public function testPJavaScriptWithScriptTags(): void {
$this->expectOutputString('&lt;script&gt;alert(&#039;Hacked!&#039;);&lt;/script&gt;');
p("<script>alert('Hacked!');</script>");
}
- public function testPNormalString() {
+ public function testPNormalString(): void {
$string = 'This is a good string without HTML.';
$this->expectOutputString($string);
p($string);
}
- public function testPrintUnescaped() {
+ public function testPrintUnescaped(): void {
$htmlString = "<script>alert('xss');</script>";
$this->expectOutputString($htmlString);
print_unescaped($htmlString);
}
- public function testPrintUnescapedNormalString() {
+ public function testPrintUnescapedNormalString(): void {
$string = 'This is a good string!';
$this->expectOutputString($string);
print_unescaped($string);
}
- public function testEmitScriptTagWithContent() {
+ public function testEmitScriptTagWithContent(): void {
$this->expectOutputRegex('/<script nonce="[^"]+">\nalert\(\)\n<\/script>\n?/');
emit_script_tag('', 'alert()');
}
- public function testEmitScriptTagWithSource() {
+ public function testEmitScriptTagWithSource(): void {
$this->expectOutputRegex('/<script nonce=".*" defer src="some.js"><\/script>/');
emit_script_tag('some.js');
}
- public function testEmitScriptTagWithModuleSource() {
+ public function testEmitScriptTagWithModuleSource(): void {
$this->expectOutputRegex('/<script nonce=".*" defer src="some.mjs" type="module"><\/script>/');
emit_script_tag('some.mjs', '', 'module');
}
- public function testEmitScriptLoadingTags() {
+ public function testEmitScriptLoadingTags(): void {
// Test mjs js and inline content
$pattern = '/src="some\.mjs"[^>]+type="module"[^>]*>.+\n'; // some.mjs with type = module
$pattern .= '<script[^>]+src="other\.js"[^>]*>.+\n'; // other.js as plain javascript
@@ -71,7 +71,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
]);
}
- public function testEmitScriptLoadingTagsWithVersion() {
+ public function testEmitScriptLoadingTagsWithVersion(): void {
// Test mjs js and inline content
$pattern = '/src="some\.mjs\?v=ab123cd"[^>]+type="module"[^>]*>.+\n'; // some.mjs with type = module
$pattern .= '<script[^>]+src="other\.js\?v=12abc34"[^>]*>.+\n'; // other.js as plain javascript
@@ -86,7 +86,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
// ---------------------------------------------------------------------------
// Test relative_modified_date with dates only
// ---------------------------------------------------------------------------
- public function testRelativeDateToday() {
+ public function testRelativeDateToday(): void {
$currentTime = 1380703592;
$elementTime = $currentTime;
$result = (string)relative_modified_date($elementTime, $currentTime, true);
@@ -100,7 +100,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('today', $result);
}
- public function testRelativeDateYesterday() {
+ public function testRelativeDateYesterday(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 24 * 3600;
$result = (string)relative_modified_date($elementTime, $currentTime, true);
@@ -114,7 +114,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('yesterday', $result);
}
- public function testRelativeDate2DaysAgo() {
+ public function testRelativeDate2DaysAgo(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 48 * 3600;
$result = (string)relative_modified_date($elementTime, $currentTime, true);
@@ -128,7 +128,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('2 days ago', $result);
}
- public function testRelativeDateLastMonth() {
+ public function testRelativeDateLastMonth(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 86400 * 31;
$result = (string)relative_modified_date($elementTime, $currentTime, true);
@@ -141,7 +141,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('last month', $result);
}
- public function testRelativeDateMonthsAgo() {
+ public function testRelativeDateMonthsAgo(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 86400 * 65;
$result = (string)relative_modified_date($elementTime, $currentTime, true);
@@ -154,7 +154,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('4 months ago', $result);
}
- public function testRelativeDateLastYear() {
+ public function testRelativeDateLastYear(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 86400 * 365;
$result = (string)relative_modified_date($elementTime, $currentTime, true);
@@ -167,7 +167,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('last year', $result);
}
- public function testRelativeDateYearsAgo() {
+ public function testRelativeDateYearsAgo(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 86400 * 365.25 * 2;
$result = (string)relative_modified_date($elementTime, $currentTime, true);
@@ -184,7 +184,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
// Test relative_modified_date with timestamps only (date + time value)
// ---------------------------------------------------------------------------
- public function testRelativeTimeSecondsAgo() {
+ public function testRelativeTimeSecondsAgo(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 5;
$result = (string)relative_modified_date($elementTime, $currentTime, false);
@@ -192,7 +192,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('seconds ago', $result);
}
- public function testRelativeTimeMinutesAgo() {
+ public function testRelativeTimeMinutesAgo(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 190;
$result = (string)relative_modified_date($elementTime, $currentTime, false);
@@ -200,7 +200,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('3 minutes ago', $result);
}
- public function testRelativeTimeHoursAgo() {
+ public function testRelativeTimeHoursAgo(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 7500;
$result = (string)relative_modified_date($elementTime, $currentTime, false);
@@ -208,7 +208,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('2 hours ago', $result);
}
- public function testRelativeTime2DaysAgo() {
+ public function testRelativeTime2DaysAgo(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 48 * 3600;
$result = (string)relative_modified_date($elementTime, $currentTime, false);
@@ -222,7 +222,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('2 days ago', $result);
}
- public function testRelativeTimeLastMonth() {
+ public function testRelativeTimeLastMonth(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 86400 * 31;
$result = (string)relative_modified_date($elementTime, $currentTime, false);
@@ -235,7 +235,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('last month', $result);
}
- public function testRelativeTimeMonthsAgo() {
+ public function testRelativeTimeMonthsAgo(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 86400 * 65;
$result = (string)relative_modified_date($elementTime, $currentTime, false);
@@ -248,7 +248,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('4 months ago', $result);
}
- public function testRelativeTimeLastYear() {
+ public function testRelativeTimeLastYear(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 86400 * 365;
$result = (string)relative_modified_date($elementTime, $currentTime, false);
@@ -261,7 +261,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
$this->assertEquals('last year', $result);
}
- public function testRelativeTimeYearsAgo() {
+ public function testRelativeTimeYearsAgo(): void {
$currentTime = 1380703592;
$elementTime = $currentTime - 86400 * 365.25 * 2;
$result = (string)relative_modified_date($elementTime, $currentTime, false);
diff --git a/tests/lib/TextProcessing/TextProcessingTest.php b/tests/lib/TextProcessing/TextProcessingTest.php
index 9c759e52458..84c5492a4a2 100644
--- a/tests/lib/TextProcessing/TextProcessingTest.php
+++ b/tests/lib/TextProcessing/TextProcessingTest.php
@@ -184,7 +184,7 @@ class TextProcessingTest extends \Test\TestCase {
);
}
- public function testShouldNotHaveAnyProviders() {
+ public function testShouldNotHaveAnyProviders(): void {
$this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([]);
$this->assertCount(0, $this->manager->getAvailableTaskTypes());
$this->assertFalse($this->manager->hasProviders());
@@ -192,7 +192,7 @@ class TextProcessingTest extends \Test\TestCase {
$this->manager->runTask(new \OCP\TextProcessing\Task(FreePromptTaskType::class, 'Hello', 'test', null));
}
- public function testProviderShouldBeRegisteredAndRun() {
+ public function testProviderShouldBeRegisteredAndRun(): void {
$this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([
new ServiceRegistration('test', SuccessfulSummaryProvider::class)
]);
@@ -205,7 +205,7 @@ class TextProcessingTest extends \Test\TestCase {
$this->manager->runTask(new Task(FreePromptTaskType::class, 'Hello', 'test', null));
}
- public function testProviderShouldBeRegisteredAndScheduled() {
+ public function testProviderShouldBeRegisteredAndScheduled(): void {
// register provider
$this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([
new ServiceRegistration('test', SuccessfulSummaryProvider::class)
@@ -256,7 +256,7 @@ class TextProcessingTest extends \Test\TestCase {
$this->assertEquals(Task::STATUS_SUCCESSFUL, $task3->getStatus());
}
- public function testMultipleProvidersShouldBeRegisteredAndRunCorrectly() {
+ public function testMultipleProvidersShouldBeRegisteredAndRunCorrectly(): void {
$this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([
new ServiceRegistration('test', SuccessfulSummaryProvider::class),
new ServiceRegistration('test', FreePromptProvider::class),
@@ -275,12 +275,12 @@ class TextProcessingTest extends \Test\TestCase {
$this->manager->runTask(new Task(TopicsTaskType::class, 'Hello', 'test', null));
}
- public function testNonexistentTask() {
+ public function testNonexistentTask(): void {
$this->expectException(NotFoundException::class);
$this->manager->getTask(2147483646);
}
- public function testTaskFailure() {
+ public function testTaskFailure(): void {
// register provider
$this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([
new ServiceRegistration('test', FailingSummaryProvider::class),
@@ -331,7 +331,7 @@ class TextProcessingTest extends \Test\TestCase {
$this->assertEquals(Task::STATUS_FAILED, $task3->getStatus());
}
- public function testOldTasksShouldBeCleanedUp() {
+ public function testOldTasksShouldBeCleanedUp(): void {
$this->registrationContext->expects($this->any())->method('getTextProcessingProviders')->willReturn([
new ServiceRegistration('test', SuccessfulSummaryProvider::class)
]);
diff --git a/tests/lib/Updater/ChangesCheckTest.php b/tests/lib/Updater/ChangesCheckTest.php
index 26da6579d33..81eaa95d1fe 100644
--- a/tests/lib/Updater/ChangesCheckTest.php
+++ b/tests/lib/Updater/ChangesCheckTest.php
@@ -54,7 +54,7 @@ class ChangesCheckTest extends TestCase {
/**
* @dataProvider statusCodeProvider
*/
- public function testEvaluateResponse(int $statusCode, int $expected) {
+ public function testEvaluateResponse(int $statusCode, int $expected): void {
$response = $this->createMock(IResponse::class);
$response->expects($this->atLeastOnce())
->method('getStatusCode')
@@ -69,7 +69,7 @@ class ChangesCheckTest extends TestCase {
$this->assertSame($expected, $evaluation);
}
- public function testCacheResultInsert() {
+ public function testCacheResultInsert(): void {
$version = '13.0.4';
$entry = $this->createMock(Changes::class);
$entry->expects($this->exactly(2))
@@ -85,7 +85,7 @@ class ChangesCheckTest extends TestCase {
$this->invokePrivate($this->checker, 'cacheResult', [$entry, $version]);
}
- public function testCacheResultUpdate() {
+ public function testCacheResultUpdate(): void {
$version = '13.0.4';
$entry = $this->createMock(Changes::class);
$entry->expects($this->once())
@@ -272,7 +272,7 @@ class ChangesCheckTest extends TestCase {
/**
* @dataProvider changesXMLProvider
*/
- public function testExtractData(string $body, array $expected) {
+ public function testExtractData(string $body, array $expected): void {
$actual = $this->invokePrivate($this->checker, 'extractData', [$body]);
$this->assertSame($expected, $actual);
}
@@ -287,7 +287,7 @@ class ChangesCheckTest extends TestCase {
/**
* @dataProvider etagProvider
*/
- public function testQueryChangesServer(string $etag) {
+ public function testQueryChangesServer(string $etag): void {
$uri = 'https://changes.nextcloud.server/?13.0.5';
$entry = $this->createMock(Changes::class);
$entry->expects($this->any())
@@ -324,7 +324,7 @@ class ChangesCheckTest extends TestCase {
/**
* @dataProvider versionProvider
*/
- public function testNormalizeVersion(string $input, string $expected) {
+ public function testNormalizeVersion(string $input, string $expected): void {
$normalized = $this->checker->normalizeVersion($input);
$this->assertSame($expected, $normalized);
}
@@ -344,7 +344,7 @@ class ChangesCheckTest extends TestCase {
* @dataProvider changeDataProvider
*
*/
- public function testGetChangesForVersion(string $inputVersion, string $normalizedVersion, bool $isFound) {
+ public function testGetChangesForVersion(string $inputVersion, string $normalizedVersion, bool $isFound): void {
$mocker = $this->mapper->expects($this->once())
->method('getChanges')
->with($normalizedVersion);
@@ -368,7 +368,7 @@ class ChangesCheckTest extends TestCase {
$this->assertTrue(isset($data['changelogURL']));
}
- public function testGetChangesForVersionEmptyData() {
+ public function testGetChangesForVersionEmptyData(): void {
$entry = $this->createMock(Changes::class);
$entry->expects($this->once())
->method('__call')
diff --git a/tests/lib/Updater/ReleaseMetadataTest.php b/tests/lib/Updater/ReleaseMetadataTest.php
index 5191d1f6c3c..72c6da5064d 100644
--- a/tests/lib/Updater/ReleaseMetadataTest.php
+++ b/tests/lib/Updater/ReleaseMetadataTest.php
@@ -22,7 +22,7 @@ class ReleaseMetadataTest extends \Test\TestCase {
->getMock();
}
- public function testDownloadMetadata() {
+ public function testDownloadMetadata(): void {
$client = $this->createMock(IClient::class);
$response = $this->createMock(IResponse::class);
$this->clientService->expects($this->once())
@@ -48,7 +48,7 @@ class ReleaseMetadataTest extends \Test\TestCase {
* @param string $version
* @param string $url
*/
- public function testGetMetadata(string $version, string $url) {
+ public function testGetMetadata(string $version, string $url): void {
$client = $this->createMock(IClient::class);
$response = $this->createMock(IResponse::class);
$this->clientService->expects($this->once())
diff --git a/tests/lib/Updater/VersionCheckTest.php b/tests/lib/Updater/VersionCheckTest.php
index b8a32680fb0..b33829a2155 100644
--- a/tests/lib/Updater/VersionCheckTest.php
+++ b/tests/lib/Updater/VersionCheckTest.php
@@ -66,7 +66,7 @@ class VersionCheckTest extends \Test\TestCase {
return $baseUrl . '?version='.implode('x', Util::getVersion()).'xinstalledatx' . time() . 'x'.\OC_Util::getChannel().'xxx'.PHP_MAJOR_VERSION.'x'.PHP_MINOR_VERSION.'x'.PHP_RELEASE_VERSION.'x0x0';
}
- public function testCheckInCache() {
+ public function testCheckInCache(): void {
$expectedResult = [
'version' => '8.0.4.2',
'versionstring' => 'ownCloud 8.0.4',
@@ -94,7 +94,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame($expectedResult, $this->updater->check());
}
- public function testCheckWithoutUpdateUrl() {
+ public function testCheckWithoutUpdateUrl(): void {
$expectedResult = [
'version' => '8.0.4.2',
'versionstring' => 'ownCloud 8.0.4',
@@ -155,7 +155,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame($expectedResult, $this->updater->check());
}
- public function testCheckWithInvalidXml() {
+ public function testCheckWithInvalidXml(): void {
$this->config
->expects($this->once())
->method('getSystemValueBool')
@@ -198,7 +198,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame([], $this->updater->check());
}
- public function testCheckWithEmptyValidXmlResponse() {
+ public function testCheckWithEmptyValidXmlResponse(): void {
$expectedResult = [
'version' => '',
'versionstring' => '',
@@ -258,7 +258,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame($expectedResult, $this->updater->check());
}
- public function testCheckWithEmptyInvalidXmlResponse() {
+ public function testCheckWithEmptyInvalidXmlResponse(): void {
$expectedResult = [];
$this->config
@@ -303,7 +303,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame($expectedResult, $this->updater->check());
}
- public function testCheckWithMissingAttributeXmlResponse() {
+ public function testCheckWithMissingAttributeXmlResponse(): void {
$expectedResult = [
'version' => '',
'versionstring' => '',
@@ -363,7 +363,7 @@ class VersionCheckTest extends \Test\TestCase {
$this->assertSame($expectedResult, $this->updater->check());
}
- public function testNoInternet() {
+ public function testNoInternet(): void {
$this->config
->expects($this->once())
->method('getSystemValueBool')
diff --git a/tests/lib/UpdaterTest.php b/tests/lib/UpdaterTest.php
index 118cb1b6d41..da48e581fbc 100644
--- a/tests/lib/UpdaterTest.php
+++ b/tests/lib/UpdaterTest.php
@@ -95,7 +95,7 @@ class UpdaterTest extends TestCase {
* @param bool $debug
* @param string $vendor
*/
- public function testIsUpgradePossible($oldVersion, $newVersion, $allowedVersions, $result, $debug = false, $vendor = 'nextcloud') {
+ public function testIsUpgradePossible($oldVersion, $newVersion, $allowedVersions, $result, $debug = false, $vendor = 'nextcloud'): void {
$this->config->expects($this->any())
->method('getSystemValueBool')
->with('debug', false)
diff --git a/tests/lib/UrlGeneratorTest.php b/tests/lib/UrlGeneratorTest.php
index d54698b7a0a..0f5e2984ce9 100644
--- a/tests/lib/UrlGeneratorTest.php
+++ b/tests/lib/UrlGeneratorTest.php
@@ -71,7 +71,7 @@ class UrlGeneratorTest extends \Test\TestCase {
* test linkTo URL construction
* @dataProvider provideDocRootAppUrlParts
*/
- public function testLinkToDocRoot($app, $file, $args, $expectedResult) {
+ public function testLinkToDocRoot($app, $file, $args, $expectedResult): void {
\OC::$WEBROOT = '';
$result = $this->urlGenerator->linkTo($app, $file, $args);
$this->assertEquals($expectedResult, $result);
@@ -82,7 +82,7 @@ class UrlGeneratorTest extends \Test\TestCase {
* test linkTo URL construction in sub directory
* @dataProvider provideSubDirAppUrlParts
*/
- public function testLinkToSubDir($app, $file, $args, $expectedResult) {
+ public function testLinkToSubDir($app, $file, $args, $expectedResult): void {
\OC::$WEBROOT = '/nextcloud';
$result = $this->urlGenerator->linkTo($app, $file, $args);
$this->assertEquals($expectedResult, $result);
@@ -91,7 +91,7 @@ class UrlGeneratorTest extends \Test\TestCase {
/**
* @dataProvider provideRoutes
*/
- public function testLinkToRouteAbsolute($route, $expected) {
+ public function testLinkToRouteAbsolute($route, $expected): void {
$this->mockBaseUrl();
\OC::$WEBROOT = '/nextcloud';
$this->router->expects($this->once())
@@ -135,7 +135,7 @@ class UrlGeneratorTest extends \Test\TestCase {
* test absolute URL construction
* @dataProvider provideDocRootURLs
*/
- public function testGetAbsoluteURLDocRoot($url, $expectedResult) {
+ public function testGetAbsoluteURLDocRoot($url, $expectedResult): void {
$this->mockBaseUrl();
\OC::$WEBROOT = '';
$result = $this->urlGenerator->getAbsoluteURL($url);
@@ -147,7 +147,7 @@ class UrlGeneratorTest extends \Test\TestCase {
* test absolute URL construction
* @dataProvider provideSubDirURLs
*/
- public function testGetAbsoluteURLSubDir($url, $expectedResult) {
+ public function testGetAbsoluteURLSubDir($url, $expectedResult): void {
$this->mockBaseUrl();
\OC::$WEBROOT = '/nextcloud';
$result = $this->urlGenerator->getAbsoluteURL($url);
@@ -174,7 +174,7 @@ class UrlGeneratorTest extends \Test\TestCase {
];
}
- public function testGetBaseUrl() {
+ public function testGetBaseUrl(): void {
$this->mockBaseUrl();
\OC::$WEBROOT = '/nextcloud';
$actual = $this->urlGenerator->getBaseUrl();
@@ -182,7 +182,7 @@ class UrlGeneratorTest extends \Test\TestCase {
$this->assertEquals($expected, $actual);
}
- public function testGetWebroot() {
+ public function testGetWebroot(): void {
\OC::$WEBROOT = '/nextcloud';
$actual = $this->urlGenerator->getWebroot();
$this->assertEquals(\OC::$WEBROOT, $actual);
@@ -234,14 +234,14 @@ class UrlGeneratorTest extends \Test\TestCase {
->willReturn($ignoreFrontControllerConfig);
}
- public function testLinkToDefaultPageUrlWithRedirectUrlWithoutFrontController() {
+ public function testLinkToDefaultPageUrlWithRedirectUrlWithoutFrontController(): void {
$this->mockBaseUrl();
$_REQUEST['redirect_url'] = 'myRedirectUrl.com';
$this->assertSame('http://localhost' . \OC::$WEBROOT . '/myRedirectUrl.com', $this->urlGenerator->linkToDefaultPageUrl());
}
- public function testLinkToDefaultPageUrlWithRedirectUrlRedirectBypassWithoutFrontController() {
+ public function testLinkToDefaultPageUrlWithRedirectUrlRedirectBypassWithoutFrontController(): void {
$this->mockBaseUrl();
$this->mockLinkToDefaultPageUrl();
putenv('front_controller_active=false');
@@ -250,7 +250,7 @@ class UrlGeneratorTest extends \Test\TestCase {
$this->assertSame('http://localhost' . \OC::$WEBROOT . '/index.php/apps/dashboard/', $this->urlGenerator->linkToDefaultPageUrl());
}
- public function testLinkToDefaultPageUrlWithRedirectUrlRedirectBypassWithFrontController() {
+ public function testLinkToDefaultPageUrlWithRedirectUrlRedirectBypassWithFrontController(): void {
$this->mockBaseUrl();
$this->mockLinkToDefaultPageUrl();
putenv('front_controller_active=true');
@@ -259,7 +259,7 @@ class UrlGeneratorTest extends \Test\TestCase {
$this->assertSame('http://localhost' . \OC::$WEBROOT . '/apps/dashboard/', $this->urlGenerator->linkToDefaultPageUrl());
}
- public function testLinkToDefaultPageUrlWithRedirectUrlWithIgnoreFrontController() {
+ public function testLinkToDefaultPageUrlWithRedirectUrlWithIgnoreFrontController(): void {
$this->mockBaseUrl();
$this->mockLinkToDefaultPageUrl(true);
putenv('front_controller_active=false');
diff --git a/tests/lib/User/Backend.php b/tests/lib/User/Backend.php
index 7efba2eaeb6..ed17776476a 100644
--- a/tests/lib/User/Backend.php
+++ b/tests/lib/User/Backend.php
@@ -32,7 +32,7 @@ abstract class Backend extends \Test\TestCase {
return $this->getUniqueID('test_');
}
- public function testAddRemove() {
+ public function testAddRemove(): void {
//get the number of groups we start with, in case there are exising groups
$startCount = count($this->backend->getUsers());
@@ -56,7 +56,7 @@ abstract class Backend extends \Test\TestCase {
$this->assertFalse((array_search($name2, $this->backend->getUsers()) !== false));
}
- public function testLogin() {
+ public function testLogin(): void {
$name1 = $this->getUser();
$name2 = $this->getUser();
@@ -84,7 +84,7 @@ abstract class Backend extends \Test\TestCase {
$this->assertFalse($this->backend->checkPassword($name2, 'newpass1'));
}
- public function testSearch() {
+ public function testSearch(): void {
$name1 = 'foobarbaz';
$name2 = 'bazbarfoo';
$name3 = 'notme';
diff --git a/tests/lib/User/DatabaseTest.php b/tests/lib/User/DatabaseTest.php
index 16b223aaaba..bd74ab333fb 100644
--- a/tests/lib/User/DatabaseTest.php
+++ b/tests/lib/User/DatabaseTest.php
@@ -49,7 +49,7 @@ class DatabaseTest extends Backend {
parent::tearDown();
}
- public function testVerifyPasswordEvent() {
+ public function testVerifyPasswordEvent(): void {
$user = $this->getUser();
$this->backend->createUser($user, 'pass1');
@@ -67,7 +67,7 @@ class DatabaseTest extends Backend {
}
- public function testVerifyPasswordEventFail() {
+ public function testVerifyPasswordEventFail(): void {
$this->expectException(\OCP\HintException::class);
$this->expectExceptionMessage('password change failed');
@@ -88,14 +88,14 @@ class DatabaseTest extends Backend {
$this->assertSame($user, $this->backend->checkPassword($user, 'newpass'));
}
- public function testCreateUserInvalidatesCache() {
+ public function testCreateUserInvalidatesCache(): void {
$user1 = $this->getUniqueID('test_');
$this->assertFalse($this->backend->userExists($user1));
$this->backend->createUser($user1, 'pw');
$this->assertTrue($this->backend->userExists($user1));
}
- public function testDeleteUserInvalidatesCache() {
+ public function testDeleteUserInvalidatesCache(): void {
$user1 = $this->getUniqueID('test_');
$this->backend->createUser($user1, 'pw');
$this->assertTrue($this->backend->userExists($user1));
@@ -105,7 +105,7 @@ class DatabaseTest extends Backend {
$this->assertTrue($this->backend->userExists($user1));
}
- public function testSearch() {
+ public function testSearch(): void {
parent::testSearch();
$user1 = $this->getUser();
diff --git a/tests/lib/User/ManagerTest.php b/tests/lib/User/ManagerTest.php
index c516b1de945..302cba4ea2b 100644
--- a/tests/lib/User/ManagerTest.php
+++ b/tests/lib/User/ManagerTest.php
@@ -47,7 +47,7 @@ class ManagerTest extends TestCase {
->willReturn($this->cache);
}
- public function testGetBackends() {
+ public function testGetBackends(): void {
$userDummyBackend = $this->createMock(\Test\Util\User\Dummy::class);
$manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
$manager->registerBackend($userDummyBackend);
@@ -58,7 +58,7 @@ class ManagerTest extends TestCase {
}
- public function testUserExistsSingleBackendExists() {
+ public function testUserExistsSingleBackendExists(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -74,7 +74,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($manager->userExists('foo'));
}
- public function testUserExistsSingleBackendNotExists() {
+ public function testUserExistsSingleBackendNotExists(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -90,13 +90,13 @@ class ManagerTest extends TestCase {
$this->assertFalse($manager->userExists('foo'));
}
- public function testUserExistsNoBackends() {
+ public function testUserExistsNoBackends(): void {
$manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
$this->assertFalse($manager->userExists('foo'));
}
- public function testUserExistsTwoBackendsSecondExists() {
+ public function testUserExistsTwoBackendsSecondExists(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend1
*/
@@ -122,7 +122,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($manager->userExists('foo'));
}
- public function testUserExistsTwoBackendsFirstExists() {
+ public function testUserExistsTwoBackendsFirstExists(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend1
*/
@@ -146,7 +146,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($manager->userExists('foo'));
}
- public function testCheckPassword() {
+ public function testCheckPassword(): void {
/**
* @var \OC\User\Backend | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -173,7 +173,7 @@ class ManagerTest extends TestCase {
$this->assertTrue($user instanceof \OC\User\User);
}
- public function testCheckPasswordNotSupported() {
+ public function testCheckPasswordNotSupported(): void {
/**
* @var \OC\User\Backend | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -191,7 +191,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($manager->checkPassword('foo', 'bar'));
}
- public function testGetOneBackendExists() {
+ public function testGetOneBackendExists(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -209,7 +209,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('foo', $manager->get('foo')->getUID());
}
- public function testGetOneBackendNotExists() {
+ public function testGetOneBackendNotExists(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -225,7 +225,7 @@ class ManagerTest extends TestCase {
$this->assertEquals(null, $manager->get('foo'));
}
- public function testGetOneBackendDoNotTranslateLoginNames() {
+ public function testGetOneBackendDoNotTranslateLoginNames(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -243,7 +243,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('bLeNdEr', $manager->get('bLeNdEr')->getUID());
}
- public function testSearchOneBackend() {
+ public function testSearchOneBackend(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -266,7 +266,7 @@ class ManagerTest extends TestCase {
$this->assertEquals('foo', array_shift($result)->getUID());
}
- public function testSearchTwoBackendLimitOffset() {
+ public function testSearchTwoBackendLimitOffset(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend1
*/
@@ -334,7 +334,7 @@ class ManagerTest extends TestCase {
/**
* @dataProvider dataCreateUserInvalid
*/
- public function testCreateUserInvalid($uid, $password, $exception) {
+ public function testCreateUserInvalid($uid, $password, $exception): void {
/** @var \Test\Util\User\Dummy|\PHPUnit\Framework\MockObject\MockObject $backend */
$backend = $this->createMock(\Test\Util\User\Dummy::class);
$backend->expects($this->once())
@@ -350,7 +350,7 @@ class ManagerTest extends TestCase {
$manager->createUser($uid, $password);
}
- public function testCreateUserSingleBackendNotExists() {
+ public function testCreateUserSingleBackendNotExists(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -378,7 +378,7 @@ class ManagerTest extends TestCase {
}
- public function testCreateUserSingleBackendExists() {
+ public function testCreateUserSingleBackendExists(): void {
$this->expectException(\Exception::class);
/**
@@ -403,7 +403,7 @@ class ManagerTest extends TestCase {
$manager->createUser('foo', 'bar');
}
- public function testCreateUserSingleBackendNotSupported() {
+ public function testCreateUserSingleBackendNotSupported(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -424,14 +424,14 @@ class ManagerTest extends TestCase {
$this->assertFalse($manager->createUser('foo', 'bar'));
}
- public function testCreateUserNoBackends() {
+ public function testCreateUserNoBackends(): void {
$manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
$this->assertFalse($manager->createUser('foo', 'bar'));
}
- public function testCreateUserFromBackendWithBackendError() {
+ public function testCreateUserFromBackendWithBackendError(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Could not create account');
@@ -450,7 +450,7 @@ class ManagerTest extends TestCase {
}
- public function testCreateUserTwoBackendExists() {
+ public function testCreateUserTwoBackendExists(): void {
$this->expectException(\Exception::class);
/**
@@ -492,7 +492,7 @@ class ManagerTest extends TestCase {
$manager->createUser('foo', 'bar');
}
- public function testCountUsersNoBackend() {
+ public function testCountUsersNoBackend(): void {
$manager = new \OC\User\Manager($this->config, $this->cacheFactory, $this->eventDispatcher);
$result = $manager->countUsers();
@@ -500,7 +500,7 @@ class ManagerTest extends TestCase {
$this->assertTrue(empty($result));
}
- public function testCountUsersOneBackend() {
+ public function testCountUsersOneBackend(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -529,7 +529,7 @@ class ManagerTest extends TestCase {
$this->assertEquals(7, $users);
}
- public function testCountUsersTwoBackends() {
+ public function testCountUsersTwoBackends(): void {
/**
* @var \Test\Util\User\Dummy | \PHPUnit\Framework\MockObject\MockObject $backend
*/
@@ -574,7 +574,7 @@ class ManagerTest extends TestCase {
$this->assertEquals(7 + 16, $users);
}
- public function testCountUsersOnlyDisabled() {
+ public function testCountUsersOnlyDisabled(): void {
$manager = \OC::$server->getUserManager();
// count other users in the db before adding our own
$countBefore = $manager->countDisabledUsers();
@@ -599,7 +599,7 @@ class ManagerTest extends TestCase {
$user4->delete();
}
- public function testCountUsersOnlySeen() {
+ public function testCountUsersOnlySeen(): void {
$manager = \OC::$server->getUserManager();
// count other users in the db before adding our own
$countBefore = $manager->countSeenUsers();
@@ -625,7 +625,7 @@ class ManagerTest extends TestCase {
$user4->delete();
}
- public function testCallForSeenUsers() {
+ public function testCallForSeenUsers(): void {
$manager = \OC::$server->getUserManager();
// count other users in the db before adding our own
$count = 0;
@@ -659,7 +659,7 @@ class ManagerTest extends TestCase {
$user4->delete();
}
- public function testDeleteUser() {
+ public function testDeleteUser(): void {
$config = $this->getMockBuilder(AllConfig::class)
->disableOriginalConstructor()
->getMock();
@@ -682,7 +682,7 @@ class ManagerTest extends TestCase {
$this->assertFalse($manager->userExists('foo'));
}
- public function testGetByEmail() {
+ public function testGetByEmail(): void {
$config = $this->getMockBuilder(AllConfig::class)
->disableOriginalConstructor()
->getMock();
diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php
index 84af7f552a7..fad5d11565c 100644
--- a/tests/lib/User/SessionTest.php
+++ b/tests/lib/User/SessionTest.php
@@ -113,7 +113,7 @@ class SessionTest extends \Test\TestCase {
/**
* @dataProvider isLoggedInData
*/
- public function testIsLoggedIn($isLoggedIn) {
+ public function testIsLoggedIn($isLoggedIn): void {
$session = $this->createMock(Memory::class);
$manager = $this->createMock(Manager::class);
@@ -131,7 +131,7 @@ class SessionTest extends \Test\TestCase {
$this->assertEquals($isLoggedIn, $userSession->isLoggedIn());
}
- public function testSetUser() {
+ public function testSetUser(): void {
$session = $this->createMock(Memory::class);
$session->expects($this->once())
->method('set')
@@ -150,7 +150,7 @@ class SessionTest extends \Test\TestCase {
$userSession->setUser($user);
}
- public function testLoginValidPasswordEnabled() {
+ public function testLoginValidPasswordEnabled(): void {
$session = $this->createMock(Memory::class);
$session->expects($this->once())
->method('regenerateId');
@@ -225,7 +225,7 @@ class SessionTest extends \Test\TestCase {
}
- public function testLoginValidPasswordDisabled() {
+ public function testLoginValidPasswordDisabled(): void {
$this->expectException(LoginException::class);
$session = $this->createMock(Memory::class);
@@ -269,7 +269,7 @@ class SessionTest extends \Test\TestCase {
$userSession->login('foo', 'bar');
}
- public function testLoginInvalidPassword() {
+ public function testLoginInvalidPassword(): void {
$session = $this->createMock(Memory::class);
$managerMethods = get_class_methods(Manager::class);
//keep following methods intact in order to ensure hooks are working
@@ -386,7 +386,7 @@ class SessionTest extends \Test\TestCase {
$userSession->login('foo', 'app-password');
}
- public function testLoginNonExisting() {
+ public function testLoginNonExisting(): void {
$session = $this->createMock(Memory::class);
$manager = $this->createMock(Manager::class);
$userSession = new Session($manager, $session, $this->timeFactory, $this->tokenProvider, $this->config, $this->random, $this->lockdownManager, $this->logger, $this->dispatcher);
@@ -408,7 +408,7 @@ class SessionTest extends \Test\TestCase {
$userSession->login('foo', 'bar');
}
- public function testLogClientInNoTokenPasswordWith2fa() {
+ public function testLogClientInNoTokenPasswordWith2fa(): void {
$this->expectException(PasswordLoginForbiddenException::class);
$manager = $this->createMock(Manager::class);
@@ -446,7 +446,7 @@ class SessionTest extends \Test\TestCase {
$userSession->logClientIn('john', 'doe', $request, $this->throttler);
}
- public function testLogClientInUnexist() {
+ public function testLogClientInUnexist(): void {
$manager = $this->createMock(Manager::class);
$session = $this->createMock(ISession::class);
$request = $this->createMock(IRequest::class);
@@ -472,7 +472,7 @@ class SessionTest extends \Test\TestCase {
$this->assertFalse($userSession->logClientIn('unexist', 'doe', $request, $this->throttler));
}
- public function testLogClientInWithTokenPassword() {
+ public function testLogClientInWithTokenPassword(): void {
$manager = $this->createMock(Manager::class);
$session = $this->createMock(ISession::class);
$request = $this->createMock(IRequest::class);
@@ -512,7 +512,7 @@ class SessionTest extends \Test\TestCase {
}
- public function testLogClientInNoTokenPasswordNo2fa() {
+ public function testLogClientInNoTokenPasswordNo2fa(): void {
$this->expectException(PasswordLoginForbiddenException::class);
$manager = $this->createMock(Manager::class);
@@ -606,7 +606,7 @@ class SessionTest extends \Test\TestCase {
self::assertFalse($loginResult);
}
- public function testRememberLoginValidToken() {
+ public function testRememberLoginValidToken(): void {
$session = $this->createMock(Memory::class);
$managerMethods = get_class_methods(Manager::class);
//keep following methods intact in order to ensure hooks are working
@@ -695,7 +695,7 @@ class SessionTest extends \Test\TestCase {
$this->assertTrue($granted);
}
- public function testRememberLoginInvalidSessionToken() {
+ public function testRememberLoginInvalidSessionToken(): void {
$session = $this->createMock(Memory::class);
$managerMethods = get_class_methods(Manager::class);
//keep following methods intact in order to ensure hooks are working
@@ -759,7 +759,7 @@ class SessionTest extends \Test\TestCase {
$this->assertFalse($granted);
}
- public function testRememberLoginInvalidToken() {
+ public function testRememberLoginInvalidToken(): void {
$session = $this->createMock(Memory::class);
$managerMethods = get_class_methods(Manager::class);
//keep following methods intact in order to ensure hooks are working
@@ -811,7 +811,7 @@ class SessionTest extends \Test\TestCase {
$this->assertFalse($granted);
}
- public function testRememberLoginInvalidUser() {
+ public function testRememberLoginInvalidUser(): void {
$session = $this->createMock(Memory::class);
$managerMethods = get_class_methods(Manager::class);
//keep following methods intact in order to ensure hooks are working
@@ -856,7 +856,7 @@ class SessionTest extends \Test\TestCase {
$this->assertFalse($granted);
}
- public function testActiveUserAfterSetSession() {
+ public function testActiveUserAfterSetSession(): void {
$users = [
'foo' => new User('foo', null, $this->createMock(IEventDispatcher::class)),
'bar' => new User('bar', null, $this->createMock(IEventDispatcher::class))
@@ -891,7 +891,7 @@ class SessionTest extends \Test\TestCase {
$this->assertEquals($users['bar'], $userSession->getUser());
}
- public function testCreateSessionToken() {
+ public function testCreateSessionToken(): void {
$manager = $this->createMock(Manager::class);
$session = $this->createMock(ISession::class);
$user = $this->createMock(IUser::class);
@@ -932,7 +932,7 @@ class SessionTest extends \Test\TestCase {
$this->assertTrue($userSession->createSessionToken($request, $uid, $loginName, $password));
}
- public function testCreateRememberedSessionToken() {
+ public function testCreateRememberedSessionToken(): void {
$manager = $this->createMock(Manager::class);
$session = $this->createMock(ISession::class);
$user = $this->createMock(IUser::class);
@@ -973,7 +973,7 @@ class SessionTest extends \Test\TestCase {
$this->assertTrue($userSession->createSessionToken($request, $uid, $loginName, $password, true));
}
- public function testCreateSessionTokenWithTokenPassword() {
+ public function testCreateSessionTokenWithTokenPassword(): void {
$manager = $this->getMockBuilder(Manager::class)
->disableOriginalConstructor()
->getMock();
@@ -1022,7 +1022,7 @@ class SessionTest extends \Test\TestCase {
$this->assertTrue($userSession->createSessionToken($request, $uid, $loginName, $password));
}
- public function testCreateSessionTokenWithNonExistentUser() {
+ public function testCreateSessionTokenWithNonExistentUser(): void {
$manager = $this->getMockBuilder(Manager::class)
->disableOriginalConstructor()
->getMock();
@@ -1042,7 +1042,7 @@ class SessionTest extends \Test\TestCase {
$this->assertFalse($userSession->createSessionToken($request, $uid, $loginName, $password));
}
- public function testCreateRememberMeToken() {
+ public function testCreateRememberMeToken(): void {
$user = $this->createMock(IUser::class);
$user
->expects($this->exactly(2))
@@ -1065,7 +1065,7 @@ class SessionTest extends \Test\TestCase {
$this->userSession->createRememberMeToken($user);
}
- public function testTryBasicAuthLoginValid() {
+ public function testTryBasicAuthLoginValid(): void {
$request = $this->createMock(Request::class);
$request->method('__get')
->willReturn([
@@ -1135,7 +1135,7 @@ class SessionTest extends \Test\TestCase {
$this->assertSame(1000, $lastPasswordConfirmSet);
}
- public function testTryBasicAuthLoginNoLogin() {
+ public function testTryBasicAuthLoginNoLogin(): void {
$request = $this->createMock(Request::class);
$request->method('__get')
->willReturn([]);
@@ -1170,7 +1170,7 @@ class SessionTest extends \Test\TestCase {
$this->assertFalse($userSession->tryBasicAuthLogin($request, $this->throttler));
}
- public function testUpdateTokens() {
+ public function testUpdateTokens(): void {
$this->tokenProvider->expects($this->once())
->method('updatePasswords')
->with('uid', 'pass');
@@ -1178,7 +1178,7 @@ class SessionTest extends \Test\TestCase {
$this->userSession->updateTokens('uid', 'pass');
}
- public function testLogClientInThrottlerUsername() {
+ public function testLogClientInThrottlerUsername(): void {
$manager = $this->createMock(Manager::class);
$session = $this->createMock(ISession::class);
$request = $this->createMock(IRequest::class);
@@ -1224,7 +1224,7 @@ class SessionTest extends \Test\TestCase {
$this->assertFalse($userSession->logClientIn('john', 'I-AM-AN-PASSWORD', $request, $this->throttler));
}
- public function testLogClientInThrottlerEmail() {
+ public function testLogClientInThrottlerEmail(): void {
$manager = $this->createMock(Manager::class);
$session = $this->createMock(ISession::class);
$request = $this->createMock(IRequest::class);
diff --git a/tests/lib/User/UserTest.php b/tests/lib/User/UserTest.php
index 06ea98e72cd..55230b83667 100644
--- a/tests/lib/User/UserTest.php
+++ b/tests/lib/User/UserTest.php
@@ -41,7 +41,7 @@ class UserTest extends TestCase {
$this->dispatcher = Server::get(IEventDispatcher::class);
}
- public function testDisplayName() {
+ public function testDisplayName(): void {
/**
* @var \OC\User\Backend | MockObject $backend
*/
@@ -63,7 +63,7 @@ class UserTest extends TestCase {
/**
* if the display name contain whitespaces only, we expect the uid as result
*/
- public function testDisplayNameEmpty() {
+ public function testDisplayNameEmpty(): void {
/**
* @var \OC\User\Backend | MockObject $backend
*/
@@ -82,7 +82,7 @@ class UserTest extends TestCase {
$this->assertEquals('foo', $user->getDisplayName());
}
- public function testDisplayNameNotSupported() {
+ public function testDisplayNameNotSupported(): void {
/**
* @var \OC\User\Backend | MockObject $backend
*/
@@ -99,7 +99,7 @@ class UserTest extends TestCase {
$this->assertEquals('foo', $user->getDisplayName());
}
- public function testSetPassword() {
+ public function testSetPassword(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -122,7 +122,7 @@ class UserTest extends TestCase {
$this->assertTrue($user->setPassword('bar', ''));
}
- public function testSetPasswordNotSupported() {
+ public function testSetPasswordNotSupported(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -138,7 +138,7 @@ class UserTest extends TestCase {
$this->assertFalse($user->setPassword('bar', ''));
}
- public function testChangeAvatarSupportedYes() {
+ public function testChangeAvatarSupportedYes(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -162,7 +162,7 @@ class UserTest extends TestCase {
$this->assertTrue($user->canChangeAvatar());
}
- public function testChangeAvatarSupportedNo() {
+ public function testChangeAvatarSupportedNo(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -186,7 +186,7 @@ class UserTest extends TestCase {
$this->assertFalse($user->canChangeAvatar());
}
- public function testChangeAvatarNotSupported() {
+ public function testChangeAvatarNotSupported(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -202,7 +202,7 @@ class UserTest extends TestCase {
$this->assertTrue($user->canChangeAvatar());
}
- public function testDelete() {
+ public function testDelete(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -215,7 +215,7 @@ class UserTest extends TestCase {
$this->assertTrue($user->delete());
}
- public function testDeleteWithDifferentHome() {
+ public function testDeleteWithDifferentHome(): void {
/** @var ObjectHomeMountProvider $homeProvider */
$homeProvider = \OC::$server->get(ObjectHomeMountProvider::class);
$user = $this->createMock(IUser::class);
@@ -256,7 +256,7 @@ class UserTest extends TestCase {
$this->assertTrue($user->delete());
}
- public function testGetHome() {
+ public function testGetHome(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -280,14 +280,14 @@ class UserTest extends TestCase {
$this->assertEquals('/home/foo', $user->getHome());
}
- public function testGetBackendClassName() {
+ public function testGetBackendClassName(): void {
$user = new User('foo', new \Test\Util\User\Dummy(), $this->dispatcher);
$this->assertEquals('Dummy', $user->getBackendClassName());
$user = new User('foo', new \OC\User\Database(), $this->dispatcher);
$this->assertEquals('Database', $user->getBackendClassName());
}
- public function testGetHomeNotSupported() {
+ public function testGetHomeNotSupported(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -314,7 +314,7 @@ class UserTest extends TestCase {
$this->assertEquals('arbitrary/path/foo', $user->getHome());
}
- public function testCanChangePassword() {
+ public function testCanChangePassword(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -334,7 +334,7 @@ class UserTest extends TestCase {
$this->assertTrue($user->canChangePassword());
}
- public function testCanChangePasswordNotSupported() {
+ public function testCanChangePasswordNotSupported(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -348,7 +348,7 @@ class UserTest extends TestCase {
$this->assertFalse($user->canChangePassword());
}
- public function testCanChangeDisplayName() {
+ public function testCanChangeDisplayName(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -373,7 +373,7 @@ class UserTest extends TestCase {
$this->assertTrue($user->canChangeDisplayName());
}
- public function testCanChangeDisplayNameNotSupported() {
+ public function testCanChangeDisplayNameNotSupported(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -387,7 +387,7 @@ class UserTest extends TestCase {
$this->assertFalse($user->canChangeDisplayName());
}
- public function testSetDisplayNameSupported() {
+ public function testSetDisplayNameSupported(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -416,7 +416,7 @@ class UserTest extends TestCase {
/**
* don't allow display names containing whitespaces only
*/
- public function testSetDisplayNameEmpty() {
+ public function testSetDisplayNameEmpty(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -437,7 +437,7 @@ class UserTest extends TestCase {
$this->assertEquals('foo', $user->getDisplayName());
}
- public function testSetDisplayNameNotSupported() {
+ public function testSetDisplayNameNotSupported(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -455,7 +455,7 @@ class UserTest extends TestCase {
$this->assertEquals('foo', $user->getDisplayName());
}
- public function testSetPasswordHooks() {
+ public function testSetPasswordHooks(): void {
$hooksCalled = 0;
$test = $this;
@@ -508,7 +508,7 @@ class UserTest extends TestCase {
* @param bool $result
* @param int $expectedHooks
*/
- public function testDeleteHooks($result, $expectedHooks) {
+ public function testDeleteHooks($result, $expectedHooks): void {
$hooksCalled = 0;
$test = $this;
@@ -618,7 +618,7 @@ class UserTest extends TestCase {
$this->assertEquals($cloudId, $user->getCloudId());
}
- public function testSetEMailAddressEmpty() {
+ public function testSetEMailAddressEmpty(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -654,7 +654,7 @@ class UserTest extends TestCase {
$user->setEMailAddress('');
}
- public function testSetEMailAddress() {
+ public function testSetEMailAddress(): void {
/**
* @var UserInterface | MockObject $backend
*/
@@ -691,7 +691,7 @@ class UserTest extends TestCase {
$user->setEMailAddress('foo@bar.com');
}
- public function testSetEMailAddressNoChange() {
+ public function testSetEMailAddressNoChange(): void {
/**
* @var UserInterface | MockObject $backend
*/
@@ -717,7 +717,7 @@ class UserTest extends TestCase {
$user->setEMailAddress('foo@bar.com');
}
- public function testSetQuota() {
+ public function testSetQuota(): void {
/**
* @var UserInterface | MockObject $backend
*/
@@ -754,7 +754,7 @@ class UserTest extends TestCase {
$user->setQuota('23 TB');
}
- public function testGetDefaultUnlimitedQuota() {
+ public function testGetDefaultUnlimitedQuota(): void {
/**
* @var UserInterface | MockObject $backend
*/
@@ -785,7 +785,7 @@ class UserTest extends TestCase {
$this->assertEquals('none', $quota);
}
- public function testGetDefaultUnlimitedQuotaForbidden() {
+ public function testGetDefaultUnlimitedQuotaForbidden(): void {
/**
* @var UserInterface | MockObject $backend
*/
@@ -819,7 +819,7 @@ class UserTest extends TestCase {
$this->assertEquals('1 GB', $quota);
}
- public function testSetQuotaAddressNoChange() {
+ public function testSetQuotaAddressNoChange(): void {
/**
* @var UserInterface | MockObject $backend
*/
@@ -841,7 +841,7 @@ class UserTest extends TestCase {
$user->setQuota('23 TB');
}
- public function testGetLastLogin() {
+ public function testGetLastLogin(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -861,7 +861,7 @@ class UserTest extends TestCase {
$this->assertSame(42, $user->getLastLogin());
}
- public function testSetEnabled() {
+ public function testSetEnabled(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -881,7 +881,7 @@ class UserTest extends TestCase {
$user->setEnabled(true);
}
- public function testSetDisabled() {
+ public function testSetDisabled(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -921,7 +921,7 @@ class UserTest extends TestCase {
$user->setEnabled(false);
}
- public function testSetDisabledAlreadyDisabled() {
+ public function testSetDisabledAlreadyDisabled(): void {
/**
* @var Backend | MockObject $backend
*/
@@ -951,7 +951,7 @@ class UserTest extends TestCase {
$user->setEnabled(false);
}
- public function testGetEMailAddress() {
+ public function testGetEMailAddress(): void {
/**
* @var Backend | MockObject $backend
*/
diff --git a/tests/lib/UtilCheckServerTest.php b/tests/lib/UtilCheckServerTest.php
index 23da44b6e84..ca4cd7d108f 100644
--- a/tests/lib/UtilCheckServerTest.php
+++ b/tests/lib/UtilCheckServerTest.php
@@ -52,7 +52,7 @@ class UtilCheckServerTest extends \Test\TestCase {
/**
* Test that checkServer() returns no errors in the regular case.
*/
- public function testCheckServer() {
+ public function testCheckServer(): void {
$result = \OC_Util::checkServer($this->getConfig([
'installed' => true
]));
@@ -64,7 +64,7 @@ class UtilCheckServerTest extends \Test\TestCase {
* when the server is not installed yet (else the setup cannot
* be run...)
*/
- public function testCheckServerSkipDataDirValidityOnSetup() {
+ public function testCheckServerSkipDataDirValidityOnSetup(): void {
// simulate old version that didn't have it
unlink($this->datadir . '/.ncdata');
@@ -81,7 +81,7 @@ class UtilCheckServerTest extends \Test\TestCase {
* when an upgrade is required (else the upgrade cannot be
* performed...)
*/
- public function testCheckServerSkipDataDirValidityOnUpgrade() {
+ public function testCheckServerSkipDataDirValidityOnUpgrade(): void {
// simulate old version that didn't have it
unlink($this->datadir . '/.ncdata');
@@ -107,7 +107,7 @@ class UtilCheckServerTest extends \Test\TestCase {
* Test that checkDataDirectoryValidity returns no error
* when ".ncdata" is present.
*/
- public function testCheckDataDirValidity() {
+ public function testCheckDataDirValidity(): void {
$result = \OC_Util::checkDataDirectoryValidity($this->datadir);
$this->assertEmpty($result);
}
@@ -116,7 +116,7 @@ class UtilCheckServerTest extends \Test\TestCase {
* Test that checkDataDirectoryValidity and checkServer
* both return an error when ".ncdata" is missing.
*/
- public function testCheckDataDirValidityWhenFileMissing() {
+ public function testCheckDataDirValidityWhenFileMissing(): void {
unlink($this->datadir . '/.ncdata');
$result = \OC_Util::checkDataDirectoryValidity($this->datadir);
$this->assertEquals(1, count($result));
@@ -131,7 +131,7 @@ class UtilCheckServerTest extends \Test\TestCase {
/**
* Tests that no error is given when the datadir is writable
*/
- public function testDataDirWritable() {
+ public function testDataDirWritable(): void {
$result = \OC_Util::checkServer($this->getConfig([
'installed' => true,
'version' => implode('.', \OCP\Util::getVersion())
@@ -142,7 +142,7 @@ class UtilCheckServerTest extends \Test\TestCase {
/**
* Tests an error is given when the datadir is not writable
*/
- public function testDataDirNotWritable() {
+ public function testDataDirNotWritable(): void {
$this->markTestSkipped('TODO: Disable because fails on drone');
chmod($this->datadir, 0300);
@@ -156,7 +156,7 @@ class UtilCheckServerTest extends \Test\TestCase {
/**
* Tests no error is given when the datadir is not writable during setup
*/
- public function testDataDirNotWritableSetup() {
+ public function testDataDirNotWritableSetup(): void {
chmod($this->datadir, 0300);
$result = \OC_Util::checkServer($this->getConfig([
'installed' => false,
diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php
index 68c56675425..064b73d0b7e 100644
--- a/tests/lib/UtilTest.php
+++ b/tests/lib/UtilTest.php
@@ -16,7 +16,7 @@ use OC_Util;
* @group DB
*/
class UtilTest extends \Test\TestCase {
- public function testGetVersion() {
+ public function testGetVersion(): void {
$version = \OCP\Util::getVersion();
$this->assertTrue(is_array($version));
foreach ($version as $num) {
@@ -24,17 +24,17 @@ class UtilTest extends \Test\TestCase {
}
}
- public function testGetVersionString() {
+ public function testGetVersionString(): void {
$version = \OC_Util::getVersionString();
$this->assertTrue(is_string($version));
}
- public function testGetEditionString() {
+ public function testGetEditionString(): void {
$edition = \OC_Util::getEditionString();
$this->assertTrue(is_string($edition));
}
- public function testSanitizeHTML() {
+ public function testSanitizeHTML(): void {
$badArray = [
'While it is unusual to pass an array',
'this function actually <blink>supports</blink> it.',
@@ -67,13 +67,13 @@ class UtilTest extends \Test\TestCase {
$this->assertEquals('This is a good string without HTML.', $result);
}
- public function testEncodePath() {
+ public function testEncodePath(): void {
$component = '/§#@test%&^ä/-child';
$result = OC_Util::encodePath($component);
$this->assertEquals('/%C2%A7%23%40test%25%26%5E%C3%A4/-child', $result);
}
- public function testIsNonUTF8Locale() {
+ public function testIsNonUTF8Locale(): void {
// OC_Util::isNonUTF8Locale() assumes escapeshellcmd('§') returns '' with non-UTF-8 locale.
$locale = setlocale(LC_CTYPE, 0);
setlocale(LC_CTYPE, 'C');
@@ -85,7 +85,7 @@ class UtilTest extends \Test\TestCase {
setlocale(LC_CTYPE, $locale);
}
- public function testFileInfoLoaded() {
+ public function testFileInfoLoaded(): void {
$expected = function_exists('finfo_open');
$this->assertEquals($expected, \OC_Util::fileInfoLoaded());
}
@@ -95,7 +95,7 @@ class UtilTest extends \Test\TestCase {
* but not for default strict email verification that requires a top level domain.
* So we check that with strict email verification we fallback to the default
*/
- public function testGetDefaultEmailAddressStrict() {
+ public function testGetDefaultEmailAddressStrict(): void {
$email = \OCP\Util::getDefaultEmailAddress('no-reply');
$this->assertEquals('no-reply@localhost.localdomain', $email);
}
@@ -103,7 +103,7 @@ class UtilTest extends \Test\TestCase {
/**
* If no strict email check is enabled "localhost" should validate as a valid email domain
*/
- public function testGetDefaultEmailAddress() {
+ public function testGetDefaultEmailAddress(): void {
$config = \OC::$server->getConfig();
$config->setAppValue('core', 'enforce_strict_email_check', 'no');
$email = \OCP\Util::getDefaultEmailAddress('no-reply');
@@ -111,7 +111,7 @@ class UtilTest extends \Test\TestCase {
$config->deleteAppValue('core', 'enforce_strict_email_check');
}
- public function testGetDefaultEmailAddressFromConfig() {
+ public function testGetDefaultEmailAddressFromConfig(): void {
$config = \OC::$server->getConfig();
$config->setSystemValue('mail_domain', 'example.com');
$email = \OCP\Util::getDefaultEmailAddress('no-reply');
@@ -119,7 +119,7 @@ class UtilTest extends \Test\TestCase {
$config->deleteSystemValue('mail_domain');
}
- public function testGetConfiguredEmailAddressFromConfig() {
+ public function testGetConfiguredEmailAddressFromConfig(): void {
$config = \OC::$server->getConfig();
$config->setSystemValue('mail_domain', 'example.com');
$config->setSystemValue('mail_from_address', 'owncloud');
@@ -129,7 +129,7 @@ class UtilTest extends \Test\TestCase {
$config->deleteSystemValue('mail_from_address');
}
- public function testGetInstanceIdGeneratesValidId() {
+ public function testGetInstanceIdGeneratesValidId(): void {
\OC::$server->getConfig()->deleteSystemValue('instanceid');
$instanceId = OC_Util::getInstanceId();
$this->assertStringStartsWith('oc', $instanceId);
@@ -140,7 +140,7 @@ class UtilTest extends \Test\TestCase {
/**
* Test needUpgrade() when the core version is increased
*/
- public function testNeedUpgradeCore() {
+ public function testNeedUpgradeCore(): void {
$config = \OC::$server->getConfig();
$oldConfigVersion = $config->getSystemValue('version', '0.0.0');
$oldSessionVersion = \OC::$server->getSession()->get('OC_Version');
@@ -160,7 +160,7 @@ class UtilTest extends \Test\TestCase {
$this->assertFalse(\OCP\Util::needUpgrade());
}
- public function testCheckDataDirectoryValidity() {
+ public function testCheckDataDirectoryValidity(): void {
$dataDir = \OC::$server->getTempManager()->getTemporaryFolder();
touch($dataDir . '/.ncdata');
$errors = \OC_Util::checkDataDirectoryValidity($dataDir);
@@ -194,7 +194,7 @@ class UtilTest extends \Test\TestCase {
self::invokePrivate(\OCP\Util::class, 'scriptDeps', [[]]);
}
- public function testAddScript() {
+ public function testAddScript(): void {
\OCP\Util::addScript('first', 'myFirstJSFile');
\OCP\Util::addScript('core', 'myFancyJSFile1');
\OCP\Util::addScript('files', 'myFancyJSFile2', 'core');
@@ -287,7 +287,7 @@ class UtilTest extends \Test\TestCase {
}
}
- public function testAddScriptCircularDependency() {
+ public function testAddScriptCircularDependency(): void {
\OCP\Util::addScript('circular', 'file1', 'dependency');
\OCP\Util::addScript('dependency', 'file2', 'circular');
@@ -296,7 +296,7 @@ class UtilTest extends \Test\TestCase {
$this->assertContains('dependency/js/file2', $scripts);
}
- public function testAddVendorScript() {
+ public function testAddVendorScript(): void {
\OC_Util::addVendorScript('core', 'myFancyJSFile1');
\OC_Util::addVendorScript('myApp', 'myFancyJSFile2');
\OC_Util::addVendorScript('core', 'myFancyJSFile0', true);
@@ -313,7 +313,7 @@ class UtilTest extends \Test\TestCase {
$this->assertEquals([], \OC_Util::$styles);
}
- public function testAddTranslations() {
+ public function testAddTranslations(): void {
\OC_Util::addTranslations('appId', 'de');
$this->assertEquals([
@@ -322,7 +322,7 @@ class UtilTest extends \Test\TestCase {
$this->assertEquals([], \OC_Util::$styles);
}
- public function testAddStyle() {
+ public function testAddStyle(): void {
\OC_Util::addStyle('core', 'myFancyCSSFile1');
\OC_Util::addStyle('myApp', 'myFancyCSSFile2');
\OC_Util::addStyle('core', 'myFancyCSSFile0', true);
@@ -339,7 +339,7 @@ class UtilTest extends \Test\TestCase {
], \OC_Util::$styles);
}
- public function testAddVendorStyle() {
+ public function testAddVendorStyle(): void {
\OC_Util::addVendorStyle('core', 'myFancyCSSFile1');
\OC_Util::addVendorStyle('myApp', 'myFancyCSSFile2');
\OC_Util::addVendorStyle('core', 'myFancyCSSFile0', true);
@@ -356,7 +356,7 @@ class UtilTest extends \Test\TestCase {
], \OC_Util::$styles);
}
- public function testShortenMultibyteString() {
+ public function testShortenMultibyteString(): void {
$this->assertEquals('Short nuff', \OCP\Util::shortenMultibyteString('Short nuff', 255));
$this->assertEquals('ABC', \OCP\Util::shortenMultibyteString('ABCDEF', 3));
// each of the characters is 12 bytes