diff options
author | Joas Schilling <coding@schilljs.com> | 2023-11-23 10:22:34 +0100 |
---|---|---|
committer | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2023-11-23 10:36:13 +0100 |
commit | aa5f037af71c915424c6dcfd5ad2dc82797dc0d6 (patch) | |
tree | 843203cd1346158aab3515687e37a90e78c929e9 /tests | |
parent | 272719ed1cba6836ea0a597bb9767754eeb1e0d4 (diff) | |
download | nextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.tar.gz nextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.zip |
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'tests')
43 files changed, 150 insertions, 150 deletions
diff --git a/tests/Core/Command/Preview/RepairTest.php b/tests/Core/Command/Preview/RepairTest.php index fd4af615340..550dad1ef2f 100644 --- a/tests/Core/Command/Preview/RepairTest.php +++ b/tests/Core/Command/Preview/RepairTest.php @@ -10,11 +10,11 @@ use OCP\Files\Node; use OCP\IConfig; use OCP\Lock\ILockingProvider; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; -use Psr\Log\LoggerInterface; class RepairTest extends TestCase { /** @var IConfig|MockObject */ diff --git a/tests/Core/Command/User/AuthTokens/DeleteTest.php b/tests/Core/Command/User/AuthTokens/DeleteTest.php index 528d4c6869b..e11bf938dc9 100644 --- a/tests/Core/Command/User/AuthTokens/DeleteTest.php +++ b/tests/Core/Command/User/AuthTokens/DeleteTest.php @@ -22,8 +22,8 @@ */ namespace Tests\Core\Command\User\AuthTokens; -use OC\Core\Command\User\AuthTokens\Delete; use OC\Authentication\Token\IProvider; +use OC\Core\Command\User\AuthTokens\Delete; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Input\InputInterface; diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php index 333baf0aa86..7d82e256c17 100644 --- a/tests/Core/Controller/LoginControllerTest.php +++ b/tests/Core/Controller/LoginControllerTest.php @@ -314,7 +314,7 @@ class LoginControllerTest extends TestCase { * @dataProvider passwordResetDataProvider */ public function testShowLoginFormWithPasswordResetOption($canChangePassword, - $expectedResult) { + $expectedResult) { $this->userSession ->expects($this->once()) ->method('isLoggedIn') diff --git a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php index 57443ca1328..7ca389946d8 100644 --- a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php +++ b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php @@ -27,8 +27,8 @@ use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; use OC\Core\Data\LoginFlowV2Credentials; use OC\Core\Data\LoginFlowV2Tokens; -use OC\Core\Db\LoginFlowV2Mapper; use OC\Core\Db\LoginFlowV2; +use OC\Core\Db\LoginFlowV2Mapper; use OC\Core\Exception\LoginFlowV2NotFoundException; use OC\Core\Service\LoginFlowV2Service; use OCP\AppFramework\Db\DoesNotExistException; diff --git a/tests/lib/App/AppStore/Version/VersionParserTest.php b/tests/lib/App/AppStore/Version/VersionParserTest.php index edb48dc4130..a81dbecf32c 100644 --- a/tests/lib/App/AppStore/Version/VersionParserTest.php +++ b/tests/lib/App/AppStore/Version/VersionParserTest.php @@ -77,7 +77,7 @@ class VersionParserTest extends TestCase { * @param Version $expected */ public function testGetVersion($input, - Version $expected) { + Version $expected) { $this->assertEquals($expected, $this->versionParser->getVersion($input)); } diff --git a/tests/lib/App/InfoParserTest.php b/tests/lib/App/InfoParserTest.php index bc561611501..c34d2775faf 100644 --- a/tests/lib/App/InfoParserTest.php +++ b/tests/lib/App/InfoParserTest.php @@ -10,8 +10,8 @@ namespace Test\App; use OC; use OC\App\InfoParser; -use Test\TestCase; use OCP\Cache\CappedMemoryCache; +use Test\TestCase; class InfoParserTest extends TestCase { /** @var OCP\Cache\CappedMemoryCache */ diff --git a/tests/lib/AppFramework/Controller/ControllerTest.php b/tests/lib/AppFramework/Controller/ControllerTest.php index cb6fc777dee..e435bbc44e3 100644 --- a/tests/lib/AppFramework/Controller/ControllerTest.php +++ b/tests/lib/AppFramework/Controller/ControllerTest.php @@ -23,6 +23,7 @@ namespace Test\AppFramework\Controller; +use OC\AppFramework\DependencyInjection\DIContainer; use OC\AppFramework\Http\Request; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; @@ -30,7 +31,6 @@ use OCP\AppFramework\Http\JSONResponse; use OCP\IConfig; use OCP\IRequest; use OCP\IRequestId; -use OC\AppFramework\DependencyInjection\DIContainer; class ChildController extends Controller { public function __construct($appName, $request) { diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php index 7f81701a8b3..bb7541c4d22 100644 --- a/tests/lib/AppFramework/Http/DispatcherTest.php +++ b/tests/lib/AppFramework/Http/DispatcherTest.php @@ -35,10 +35,10 @@ use OCP\AppFramework\Http\Response; use OCP\Diagnostics\IEventLogger; use OCP\IConfig; use OCP\IRequest; +use OCP\IRequestId; use PHPUnit\Framework\MockObject\MockObject; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; -use OCP\IRequestId; class TestController extends Controller { /** diff --git a/tests/lib/AppFramework/Middleware/MiddlewareTest.php b/tests/lib/AppFramework/Middleware/MiddlewareTest.php index f9e775269d4..e4980009b09 100644 --- a/tests/lib/AppFramework/Middleware/MiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/MiddlewareTest.php @@ -23,13 +23,13 @@ namespace Test\AppFramework\Middleware; +use OC\AppFramework\DependencyInjection\DIContainer; use OC\AppFramework\Http\Request; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Middleware; use OCP\IConfig; use OCP\IRequestId; -use OC\AppFramework\DependencyInjection\DIContainer; class ChildMiddleware extends Middleware { }; diff --git a/tests/lib/AppFramework/Routing/RoutingTest.php b/tests/lib/AppFramework/Routing/RoutingTest.php index d7fde02dbcb..c9812a5dfb7 100644 --- a/tests/lib/AppFramework/Routing/RoutingTest.php +++ b/tests/lib/AppFramework/Routing/RoutingTest.php @@ -267,14 +267,14 @@ class RoutingTest extends \Test\TestCase { * @param string $postfix */ private function assertSimpleOCSRoute($routes, - $name, - $verb, - $url, - $controllerName, - $actionName, - array $requirements = [], - array $defaults = [], - $postfix = '') { + $name, + $verb, + $url, + $controllerName, + $actionName, + array $requirements = [], + array $defaults = [], + $postfix = '') { if ($postfix) { $name .= $postfix; } diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php index 7647e3bda7d..3c82878065e 100644 --- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php +++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php @@ -39,8 +39,8 @@ use OCP\ISession; use OCP\IUser; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; -use function reset; use Test\TestCase; +use function reset; class ManagerTest extends TestCase { /** @var IUser|MockObject */ diff --git a/tests/lib/Avatar/AvatarManagerTest.php b/tests/lib/Avatar/AvatarManagerTest.php index 06ff4086f72..b35fb2f23a8 100644 --- a/tests/lib/Avatar/AvatarManagerTest.php +++ b/tests/lib/Avatar/AvatarManagerTest.php @@ -29,6 +29,7 @@ use OC\Avatar\PlaceholderAvatar; use OC\Avatar\UserAvatar; use OC\KnownUser\KnownUserService; use OC\User\Manager; +use OC\User\User; use OCP\Accounts\IAccount; use OCP\Accounts\IAccountManager; use OCP\Accounts\IAccountProperty; @@ -37,7 +38,6 @@ use OCP\Files\SimpleFS\ISimpleFolder; use OCP\IConfig; use OCP\IL10N; use OCP\IUser; -use OC\User\User; use OCP\IUserSession; use Psr\Log\LoggerInterface; diff --git a/tests/lib/Collaboration/Collaborators/MailPluginTest.php b/tests/lib/Collaboration/Collaborators/MailPluginTest.php index 3cf76c562a1..804e5385a9d 100644 --- a/tests/lib/Collaboration/Collaborators/MailPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/MailPluginTest.php @@ -38,8 +38,8 @@ use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserManager; use OCP\IUserSession; -use OCP\Share\IShare; use OCP\Mail\IMailer; +use OCP\Share\IShare; use Test\TestCase; class MailPluginTest extends TestCase { diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php index 0d9d89c7f8b..6a8cf17111c 100644 --- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php @@ -23,6 +23,9 @@ namespace Test\Collaboration\Collaborators; +use OC\Collaboration\Collaborators\SearchResult; +use OC\Collaboration\Collaborators\UserPlugin; +use OC\KnownUser\KnownUserService; use OCP\Collaboration\Collaborators\ISearchResult; use OCP\IConfig; use OCP\IGroup; @@ -32,9 +35,6 @@ use OCP\IUserManager; use OCP\IUserSession; use OCP\Share\IShare; use OCP\UserStatus\IManager as IUserStatusManager; -use OC\Collaboration\Collaborators\SearchResult; -use OC\Collaboration\Collaborators\UserPlugin; -use OC\KnownUser\KnownUserService; use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; diff --git a/tests/lib/Diagnostics/EventLoggerTest.php b/tests/lib/Diagnostics/EventLoggerTest.php index 18cd3a91b1a..006d0b8b3ea 100644 --- a/tests/lib/Diagnostics/EventLoggerTest.php +++ b/tests/lib/Diagnostics/EventLoggerTest.php @@ -21,10 +21,10 @@ namespace Test\Diagnostics; -use Psr\Log\LoggerInterface; use OC\Diagnostics\EventLogger; use OC\Log; use OC\SystemConfig; +use Psr\Log\LoggerInterface; use Test\TestCase; class EventLoggerTest extends TestCase { diff --git a/tests/lib/Encryption/ManagerTest.php b/tests/lib/Encryption/ManagerTest.php index 4e354ad518c..5d8cf02f94d 100644 --- a/tests/lib/Encryption/ManagerTest.php +++ b/tests/lib/Encryption/ManagerTest.php @@ -193,63 +193,63 @@ class ManagerTest extends TestCase { $this->assertEquals('ID1', $this->manager->getDefaultEncryptionModuleId()); } -// /** -// * @expectedException \OC\Encryption\Exceptions\ModuleAlreadyExistsException -// * @expectedExceptionMessage Id "0" already used by encryption module "TestDummyModule0" -// */ -// public function testModuleRegistration() { -// $config = $this->createMock(IConfig::class); -// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); -// $em = $this->createMock(IEncryptionModule::class); -// $em->expects($this->any())->method('getId')->willReturn(0); -// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); -// $m = new Manager($config); -// $m->registerEncryptionModule($em); -// $this->assertTrue($m->isEnabled()); -// $m->registerEncryptionModule($em); -// } -// -// public function testModuleUnRegistration() { -// $config = $this->createMock(IConfig::class); -// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); -// $em = $this->createMock(IEncryptionModule::class); -// $em->expects($this->any())->method('getId')->willReturn(0); -// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); -// $m = new Manager($config); -// $m->registerEncryptionModule($em); -// $this->assertTrue($m->isEnabled()); -// $m->unregisterEncryptionModule($em); -// $this->assertFalse($m->isEnabled()); -// } -// -// /** -// * @expectedException \OC\Encryption\Exceptions\ModuleDoesNotExistsException -// * @expectedExceptionMessage Module with ID: unknown does not exist. -// */ -// public function testGetEncryptionModuleUnknown() { -// $config = $this->createMock(IConfig::class); -// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); -// $em = $this->createMock(IEncryptionModule::class); -// $em->expects($this->any())->method('getId')->willReturn(0); -// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); -// $m = new Manager($config); -// $m->registerEncryptionModule($em); -// $this->assertTrue($m->isEnabled()); -// $m->getEncryptionModule('unknown'); -// } -// -// public function testGetEncryptionModule() { -// $config = $this->createMock(IConfig::class); -// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); -// $em = $this->createMock(IEncryptionModule::class); -// $em->expects($this->any())->method('getId')->willReturn(0); -// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); -// $m = new Manager($config); -// $m->registerEncryptionModule($em); -// $this->assertTrue($m->isEnabled()); -// $en0 = $m->getEncryptionModule(0); -// $this->assertEquals(0, $en0->getId()); -// } + // /** + // * @expectedException \OC\Encryption\Exceptions\ModuleAlreadyExistsException + // * @expectedExceptionMessage Id "0" already used by encryption module "TestDummyModule0" + // */ + // public function testModuleRegistration() { + // $config = $this->createMock(IConfig::class); + // $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); + // $em = $this->createMock(IEncryptionModule::class); + // $em->expects($this->any())->method('getId')->willReturn(0); + // $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); + // $m = new Manager($config); + // $m->registerEncryptionModule($em); + // $this->assertTrue($m->isEnabled()); + // $m->registerEncryptionModule($em); + // } + // + // public function testModuleUnRegistration() { + // $config = $this->createMock(IConfig::class); + // $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); + // $em = $this->createMock(IEncryptionModule::class); + // $em->expects($this->any())->method('getId')->willReturn(0); + // $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); + // $m = new Manager($config); + // $m->registerEncryptionModule($em); + // $this->assertTrue($m->isEnabled()); + // $m->unregisterEncryptionModule($em); + // $this->assertFalse($m->isEnabled()); + // } + // + // /** + // * @expectedException \OC\Encryption\Exceptions\ModuleDoesNotExistsException + // * @expectedExceptionMessage Module with ID: unknown does not exist. + // */ + // public function testGetEncryptionModuleUnknown() { + // $config = $this->createMock(IConfig::class); + // $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); + // $em = $this->createMock(IEncryptionModule::class); + // $em->expects($this->any())->method('getId')->willReturn(0); + // $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); + // $m = new Manager($config); + // $m->registerEncryptionModule($em); + // $this->assertTrue($m->isEnabled()); + // $m->getEncryptionModule('unknown'); + // } + // + // public function testGetEncryptionModule() { + // $config = $this->createMock(IConfig::class); + // $config->expects($this->any())->method('getSystemValueBool')->willReturn(true); + // $em = $this->createMock(IEncryptionModule::class); + // $em->expects($this->any())->method('getId')->willReturn(0); + // $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0'); + // $m = new Manager($config); + // $m->registerEncryptionModule($em); + // $this->assertTrue($m->isEnabled()); + // $en0 = $m->getEncryptionModule(0); + // $this->assertEquals(0, $en0->getId()); + // } protected function addNewEncryptionModule(Manager $manager, $id) { $encryptionModule = $this->createMock(IEncryptionModule::class); diff --git a/tests/lib/Encryption/UpdateTest.php b/tests/lib/Encryption/UpdateTest.php index df7d137f0b6..209acbc7d47 100644 --- a/tests/lib/Encryption/UpdateTest.php +++ b/tests/lib/Encryption/UpdateTest.php @@ -21,14 +21,14 @@ namespace Test\Encryption; +use OC\Encryption\File; use OC\Encryption\Update; use OC\Encryption\Util; use OC\Files\Mount\Manager; use OC\Files\View; +use OCP\Encryption\IEncryptionModule; use Psr\Log\LoggerInterface; use Test\TestCase; -use OC\Encryption\File; -use OCP\Encryption\IEncryptionModule; class UpdateTest extends TestCase { /** @var \OC\Encryption\Update */ diff --git a/tests/lib/Files/Cache/UpdaterLegacyTest.php b/tests/lib/Files/Cache/UpdaterLegacyTest.php index be0390db15e..ad6e7cff123 100644 --- a/tests/lib/Files/Cache/UpdaterLegacyTest.php +++ b/tests/lib/Files/Cache/UpdaterLegacyTest.php @@ -262,14 +262,14 @@ class UpdaterLegacyTest extends \Test\TestCase { $this->assertIsString($cachedData['etag']); $this->assertNotSame($oldEtag, $cachedData['etag']); // rename can cause mtime change - invalid assert -// $this->assertEquals($mtime, $cachedData['mtime']); + // $this->assertEquals($mtime, $cachedData['mtime']); $cachedData = $view->getFileInfo('folder'); $this->assertIsString($folderCachedData['etag']); $this->assertIsString($cachedData['etag']); $this->assertNotSame($oldEtag, $cachedData['etag']); // rename can cause mtime change - invalid assert -// $this->assertEquals($mtime, $cachedData['mtime']); + // $this->assertEquals($mtime, $cachedData['mtime']); } public function testTouch() { diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php index 0a9355e9a46..50f57b48c0c 100644 --- a/tests/lib/Files/Config/UserMountCacheTest.php +++ b/tests/lib/Files/Config/UserMountCacheTest.php @@ -11,8 +11,8 @@ namespace Test\Files\Config; use OC\DB\QueryBuilder\Literal; use OC\Files\Mount\MountPoint; use OC\Files\Storage\Storage; -use OCP\Cache\CappedMemoryCache; use OC\User\Manager; +use OCP\Cache\CappedMemoryCache; use OCP\Diagnostics\IEventLogger; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Config\ICachedMountInfo; diff --git a/tests/lib/Files/EtagTest.php b/tests/lib/Files/EtagTest.php index b9583a6ac7c..a71bfa1e572 100644 --- a/tests/lib/Files/EtagTest.php +++ b/tests/lib/Files/EtagTest.php @@ -9,8 +9,8 @@ namespace Test\Files; use OC\Files\Filesystem; -use OCP\EventDispatcher\IEventDispatcher; use OCA\Files_Sharing\AppInfo\Application; +use OCP\EventDispatcher\IEventDispatcher; use Psr\Log\LoggerInterface; /** diff --git a/tests/lib/Files/FilesystemTest.php b/tests/lib/Files/FilesystemTest.php index 96fcab77474..5473f164cef 100644 --- a/tests/lib/Files/FilesystemTest.php +++ b/tests/lib/Files/FilesystemTest.php @@ -325,14 +325,14 @@ class FilesystemTest extends \Test\TestCase { $rootView->mkdir('/' . $user); $rootView->mkdir('/' . $user . '/files'); -// \OC\Files\Filesystem::file_put_contents('/foo', 'foo'); + // \OC\Files\Filesystem::file_put_contents('/foo', 'foo'); \OC\Files\Filesystem::mkdir('/bar'); -// \OC\Files\Filesystem::file_put_contents('/bar//foo', 'foo'); + // \OC\Files\Filesystem::file_put_contents('/bar//foo', 'foo'); $tmpFile = \OC::$server->getTempManager()->getTemporaryFile(); file_put_contents($tmpFile, 'foo'); $fh = fopen($tmpFile, 'r'); -// \OC\Files\Filesystem::file_put_contents('/bar//foo', $fh); + // \OC\Files\Filesystem::file_put_contents('/bar//foo', $fh); } /** diff --git a/tests/lib/Files/Node/RootTest.php b/tests/lib/Files/Node/RootTest.php index aab658c3c36..e24283f0931 100644 --- a/tests/lib/Files/Node/RootTest.php +++ b/tests/lib/Files/Node/RootTest.php @@ -8,11 +8,11 @@ namespace Test\Files\Node; -use OCP\Cache\CappedMemoryCache; use OC\Files\FileInfo; use OC\Files\Mount\Manager; use OC\Files\Node\Folder; use OC\Files\View; +use OCP\Cache\CappedMemoryCache; use OCP\EventDispatcher\IEventDispatcher; use OCP\IUser; use OCP\IUserManager; diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php index ec815950d3c..be5f191c6eb 100644 --- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php @@ -422,9 +422,9 @@ class EncryptionTest extends Storage { * @param boolean $renameKeysReturn */ public function testRename($source, - $target, - $encryptionEnabled, - $renameKeysReturn) { + $target, + $encryptionEnabled, + $renameKeysReturn) { if ($encryptionEnabled) { $this->keyStore ->expects($this->once()) @@ -790,10 +790,10 @@ class EncryptionTest extends Storage { ->method('isEnabled') ->willReturn($encryptionEnabled); // FIXME can not overwrite the return after definition -// $this->mount->expects($this->at(0)) -// ->method('getOption') -// ->with('encrypt', true) -// ->willReturn($mountPointEncryptionEnabled); + // $this->mount->expects($this->at(0)) + // ->method('getOption') + // ->with('encrypt', true) + // ->willReturn($mountPointEncryptionEnabled); global $mockedMountPointEncryptionEnabled; $mockedMountPointEncryptionEnabled = $mountPointEncryptionEnabled; diff --git a/tests/lib/Files/Stream/EncryptionTest.php b/tests/lib/Files/Stream/EncryptionTest.php index 8cdb379512a..3d45ff2fc3c 100644 --- a/tests/lib/Files/Stream/EncryptionTest.php +++ b/tests/lib/Files/Stream/EncryptionTest.php @@ -78,13 +78,13 @@ class EncryptionTest extends \Test\TestCase { * @dataProvider dataProviderStreamOpen() */ public function testStreamOpen($isMasterKeyUsed, - $mode, - $fullPath, - $fileExists, - $expectedSharePath, - $expectedSize, - $expectedUnencryptedSize, - $expectedReadOnly) { + $mode, + $fullPath, + $fileExists, + $expectedSharePath, + $expectedSize, + $expectedUnencryptedSize, + $expectedReadOnly) { // build mocks $encryptionModuleMock = $this->getMockBuilder('\OCP\Encryption\IEncryptionModule') ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 18629f69a13..b9dd49d71fe 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -7,8 +7,6 @@ namespace Test\Files; -use OC\Share20\ShareDisableChecker; -use OCP\Cache\CappedMemoryCache; use OC\Files\Cache\Watcher; use OC\Files\Filesystem; use OC\Files\Mount\MountPoint; @@ -17,6 +15,8 @@ use OC\Files\Storage\Common; use OC\Files\Storage\Storage; use OC\Files\Storage\Temporary; use OC\Files\View; +use OC\Share20\ShareDisableChecker; +use OCP\Cache\CappedMemoryCache; use OCP\Constants; use OCP\Files\Config\IMountProvider; use OCP\Files\FileInfo; diff --git a/tests/lib/Group/ManagerTest.php b/tests/lib/Group/ManagerTest.php index 06875f86536..142532a5f4f 100644 --- a/tests/lib/Group/ManagerTest.php +++ b/tests/lib/Group/ManagerTest.php @@ -24,11 +24,11 @@ namespace Test\Group; use OC\Group\Database; -use OC\User\User; use OC\User\Manager; +use OC\User\User; use OCP\EventDispatcher\IEventDispatcher; -use OCP\GroupInterface; use OCP\Group\Backend\ISearchableGroupBackend; +use OCP\GroupInterface; use OCP\ICacheFactory; use OCP\IUser; use PHPUnit\Framework\MockObject\MockObject; diff --git a/tests/lib/InitialStateServiceTest.php b/tests/lib/InitialStateServiceTest.php index 554478e123f..5af09afb4c0 100644 --- a/tests/lib/InitialStateServiceTest.php +++ b/tests/lib/InitialStateServiceTest.php @@ -25,14 +25,14 @@ declare(strict_types=1); namespace Test; +use JsonSerializable; use OC\AppFramework\Bootstrap\Coordinator; +use OC\InitialStateService; use OCP\IServerContainer; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; -use function json_encode; -use JsonSerializable; -use OC\InitialStateService; use stdClass; +use function json_encode; class InitialStateServiceTest extends TestCase { /** @var InitialStateService */ diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php index 5ffba939284..418bfe35c6e 100644 --- a/tests/lib/Mail/MailerTest.php +++ b/tests/lib/Mail/MailerTest.php @@ -21,13 +21,13 @@ use OCP\IL10N; use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Mail\Events\BeforeMessageSent; -use Psr\Log\LoggerInterface; -use Test\TestCase; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Symfony\Component\Mailer\Mailer as SymfonyMailer; -use Symfony\Component\Mime\Email; -use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; use Symfony\Component\Mailer\Transport\SendmailTransport; +use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport; +use Symfony\Component\Mime\Email; +use Test\TestCase; class MailerTest extends TestCase { /** @var IConfig|MockObject */ diff --git a/tests/lib/Mail/MessageTest.php b/tests/lib/Mail/MessageTest.php index 2becc4d2081..1d309ca742d 100644 --- a/tests/lib/Mail/MessageTest.php +++ b/tests/lib/Mail/MessageTest.php @@ -11,13 +11,13 @@ namespace Test\Mail; use OC\Mail\Message; use OCP\Mail\Headers\AutoSubmitted; use OCP\Mail\IEMailTemplate; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Mime\Address; use Symfony\Component\Mime\Email; use Symfony\Component\Mime\Exception\RfcComplianceException; use Symfony\Component\Mime\Header\HeaderInterface; use Symfony\Component\Mime\Header\Headers; use Test\TestCase; -use PHPUnit\Framework\MockObject\MockObject; class MessageTest extends TestCase { /** @var Email */ diff --git a/tests/lib/Memcache/FactoryTest.php b/tests/lib/Memcache/FactoryTest.php index 5f13a94eacd..e8bf519e1a9 100644 --- a/tests/lib/Memcache/FactoryTest.php +++ b/tests/lib/Memcache/FactoryTest.php @@ -22,8 +22,8 @@ namespace Test\Memcache; use OC\Memcache\NullCache; -use Psr\Log\LoggerInterface; use OCP\Profiler\IProfiler; +use Psr\Log\LoggerInterface; class Test_Factory_Available_Cache1 extends NullCache { public function __construct($prefix = '') { diff --git a/tests/lib/Migration/BackgroundRepairTest.php b/tests/lib/Migration/BackgroundRepairTest.php index 2e68924a96d..fbabaa09902 100644 --- a/tests/lib/Migration/BackgroundRepairTest.php +++ b/tests/lib/Migration/BackgroundRepairTest.php @@ -21,14 +21,14 @@ namespace Test\Migration; -use OCP\AppFramework\Utility\ITimeFactory; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\Migration\IOutput; -use OCP\Migration\IRepairStep; use OC\BackgroundJob\JobList; use OC\Migration\BackgroundRepair; use OC\NeedsUpdateException; use OC\Repair\Events\RepairStepEvent; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\Migration\IOutput; +use OCP\Migration\IRepairStep; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Test\TestCase; diff --git a/tests/lib/Repair/RepairDavSharesTest.php b/tests/lib/Repair/RepairDavSharesTest.php index 394fc985469..0e9fdca7cdd 100644 --- a/tests/lib/Repair/RepairDavSharesTest.php +++ b/tests/lib/Repair/RepairDavSharesTest.php @@ -32,9 +32,9 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IConfig; use OCP\IDBConnection; use OCP\IGroupManager; +use OCP\Migration\IOutput; use Psr\Log\LoggerInterface; use Test\TestCase; -use OCP\Migration\IOutput; use function in_array; class RepairDavSharesTest extends TestCase { diff --git a/tests/lib/RepairTest.php b/tests/lib/RepairTest.php index 1a2fd620e49..53bf9520a7c 100644 --- a/tests/lib/RepairTest.php +++ b/tests/lib/RepairTest.php @@ -8,13 +8,13 @@ namespace Test; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\Migration\IRepairStep; use OC\Repair; +use OC\Repair\Events\RepairErrorEvent; use OC\Repair\Events\RepairInfoEvent; use OC\Repair\Events\RepairStepEvent; use OC\Repair\Events\RepairWarningEvent; -use OC\Repair\Events\RepairErrorEvent; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\Migration\IRepairStep; use Psr\Log\LoggerInterface; class TestRepairStep implements IRepairStep { diff --git a/tests/lib/Security/Bruteforce/ThrottlerTest.php b/tests/lib/Security/Bruteforce/ThrottlerTest.php index e368a0912b1..473aa374d39 100644 --- a/tests/lib/Security/Bruteforce/ThrottlerTest.php +++ b/tests/lib/Security/Bruteforce/ThrottlerTest.php @@ -160,9 +160,9 @@ class ThrottlerTest extends TestCase { * @param bool $enabled */ private function isIpWhiteListedHelper($ip, - $whitelists, - $isWhiteListed, - $enabled) { + $whitelists, + $isWhiteListed, + $enabled) { $this->config->method('getAppKeys') ->with($this->equalTo('bruteForce')) ->willReturn(array_keys($whitelists)); @@ -197,8 +197,8 @@ class ThrottlerTest extends TestCase { * @param bool $isWhiteListed */ public function testIsIpWhiteListedWithEnabledProtection($ip, - $whitelists, - $isWhiteListed) { + $whitelists, + $isWhiteListed) { $this->isIpWhiteListedHelper( $ip, $whitelists, @@ -215,8 +215,8 @@ class ThrottlerTest extends TestCase { * @param bool $isWhiteListed */ public function testIsIpWhiteListedWithDisabledProtection($ip, - $whitelists, - $isWhiteListed) { + $whitelists, + $isWhiteListed) { $this->isIpWhiteListedHelper( $ip, $whitelists, diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php index 6ad8231a61d..08cbfa9e221 100644 --- a/tests/lib/Security/CertificateManagerTest.php +++ b/tests/lib/Security/CertificateManagerTest.php @@ -146,9 +146,9 @@ class CertificateManagerTest extends \Test\TestCase { * @param bool $expected */ public function testNeedRebundling($CaBundleMtime, - $targetBundleMtime, - $targetBundleExists, - $expected + $targetBundleMtime, + $targetBundleExists, + $expected ) { $view = $this->getMockBuilder(View::class) ->disableOriginalConstructor()->getMock(); diff --git a/tests/lib/Security/VerificationToken/VerificationTokenTest.php b/tests/lib/Security/VerificationToken/VerificationTokenTest.php index a71d2b09f71..182bd533f84 100644 --- a/tests/lib/Security/VerificationToken/VerificationTokenTest.php +++ b/tests/lib/Security/VerificationToken/VerificationTokenTest.php @@ -34,8 +34,8 @@ use OCP\IUser; use OCP\Security\ICrypto; use OCP\Security\ISecureRandom; use OCP\Security\VerificationToken\InvalidTokenException; -use Test\TestCase; use PHPUnit\Framework\MockObject\MockObject; +use Test\TestCase; class VerificationTokenTest extends TestCase { /** @var VerificationToken */ diff --git a/tests/lib/Settings/ManagerTest.php b/tests/lib/Settings/ManagerTest.php index cc13479b1d0..93d57c37806 100644 --- a/tests/lib/Settings/ManagerTest.php +++ b/tests/lib/Settings/ManagerTest.php @@ -34,9 +34,9 @@ use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Settings\ISettings; use OCP\Settings\ISubAdminSettings; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Test\TestCase; -use PHPUnit\Framework\MockObject\MockObject; class ManagerTest extends TestCase { /** @var Manager|MockObject */ diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index 0ce96102a30..f977619b7b2 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -133,8 +133,8 @@ class DefaultShareProviderTest extends \Test\TestCase { * @return int */ private function addShareToDB($shareType, $sharedWith, $sharedBy, $shareOwner, - $itemType, $fileSource, $fileTarget, $permissions, $token, $expiration, - $parent = null) { + $itemType, $fileSource, $fileTarget, $permissions, $token, $expiration, + $parent = null) { $qb = $this->dbConn->getQueryBuilder(); $qb->insert('share'); diff --git a/tests/lib/TextProcessing/TextProcessingTest.php b/tests/lib/TextProcessing/TextProcessingTest.php index 15f36cb2452..193c5d4c39d 100644 --- a/tests/lib/TextProcessing/TextProcessingTest.php +++ b/tests/lib/TextProcessing/TextProcessingTest.php @@ -24,13 +24,13 @@ use OCP\Common\Exception\NotFoundException; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IServerContainer; +use OCP\PreConditionNotMetException; use OCP\TextProcessing\Events\TaskFailedEvent; use OCP\TextProcessing\Events\TaskSuccessfulEvent; use OCP\TextProcessing\FreePromptTaskType; use OCP\TextProcessing\IManager; use OCP\TextProcessing\IProvider; use OCP\TextProcessing\SummaryTaskType; -use OCP\PreConditionNotMetException; use OCP\TextProcessing\Task; use OCP\TextProcessing\TopicsTaskType; use PHPUnit\Framework\Constraint\IsInstanceOf; diff --git a/tests/lib/Updater/ChangesCheckTest.php b/tests/lib/Updater/ChangesCheckTest.php index e96406622f4..4afb9f05a5b 100644 --- a/tests/lib/Updater/ChangesCheckTest.php +++ b/tests/lib/Updater/ChangesCheckTest.php @@ -26,15 +26,15 @@ declare(strict_types=1); namespace Test\Updater; +use OC\Updater\Changes; use OC\Updater\ChangesCheck; use OC\Updater\ChangesMapper; -use OC\Updater\Changes; use OCP\AppFramework\Db\DoesNotExistException; use OCP\Http\Client\IClient; use OCP\Http\Client\IClientService; use OCP\Http\Client\IResponse; -use Test\TestCase; use Psr\Log\LoggerInterface; +use Test\TestCase; class ChangesCheckTest extends TestCase { /** @var IClientService|\PHPUnit\Framework\MockObject\MockObject */ diff --git a/tests/lib/UpdaterTest.php b/tests/lib/UpdaterTest.php index 579761208db..02b2189cdcc 100644 --- a/tests/lib/UpdaterTest.php +++ b/tests/lib/UpdaterTest.php @@ -22,12 +22,12 @@ namespace Test; -use PHPUnit\Framework\MockObject\MockObject; -use Psr\Log\LoggerInterface; use OC\Installer; use OC\IntegrityCheck\Checker; use OC\Updater; use OCP\IConfig; +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; class UpdaterTest extends TestCase { /** @var IConfig|MockObject */ diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php index b6ac7a69fed..d6db17d9d45 100644 --- a/tests/lib/User/SessionTest.php +++ b/tests/lib/User/SessionTest.php @@ -14,6 +14,7 @@ use OC\Authentication\Exceptions\InvalidTokenException; use OC\Authentication\Exceptions\PasswordLoginForbiddenException; use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; +use OC\Security\CSRF\CsrfTokenManager; use OC\Session\Memory; use OC\User\LoginException; use OC\User\Manager; @@ -34,7 +35,6 @@ use OCP\Security\ISecureRandom; use OCP\User\Events\PostLoginEvent; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; -use OC\Security\CSRF\CsrfTokenManager; /** * @group DB diff --git a/tests/lib/Util/Group/Dummy.php b/tests/lib/Util/Group/Dummy.php index a864c8ce9d9..fd784e4fa46 100644 --- a/tests/lib/Util/Group/Dummy.php +++ b/tests/lib/Util/Group/Dummy.php @@ -29,13 +29,13 @@ namespace Test\Util\Group; -use Test\Util\User\Dummy as DummyUser; use OCP\Group\Backend\ABackend; -use OCP\Group\Backend\IDeleteGroupBackend; use OCP\Group\Backend\IAddToGroupBackend; -use OCP\Group\Backend\IRemoveFromGroupBackend; -use OCP\Group\Backend\ICreateGroupBackend; use OCP\Group\Backend\ICountUsersBackend; +use OCP\Group\Backend\ICreateGroupBackend; +use OCP\Group\Backend\IDeleteGroupBackend; +use OCP\Group\Backend\IRemoveFromGroupBackend; +use Test\Util\User\Dummy as DummyUser; /** * Dummy group backend, does not keep state, only for testing use |