diff options
author | Joas Schilling <coding@schilljs.com> | 2025-05-15 08:48:13 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2025-05-15 08:48:13 +0200 |
commit | 5f9117b9391f970d3acce3f0e6c0ddc5d1c9b626 (patch) | |
tree | 1295a1f573095d6011c456f23a98a471eba3543b /tests | |
parent | 57a49a50aa769450436f4ba617423848a9beaa0e (diff) | |
download | nextcloud-server-ci/noid/update-phpunit10.tar.gz nextcloud-server-ci/noid/update-phpunit10.zip |
test: Fix coding standardsci/noid/update-phpunit10
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
16 files changed, 25 insertions, 25 deletions
diff --git a/tests/lib/AppConfigTest.php b/tests/lib/AppConfigTest.php index 6cbc683afde..faeaa4c4560 100644 --- a/tests/lib/AppConfigTest.php +++ b/tests/lib/AppConfigTest.php @@ -33,7 +33,7 @@ class AppConfigTest extends TestCase { /** * @var array<string, array<string, array<string, string, int, bool, bool>>> - * [appId => [configKey, configValue, valueType, lazy, sensitive]] + * [appId => [configKey, configValue, valueType, lazy, sensitive]] */ private static array $baseStruct = [ diff --git a/tests/lib/AppFramework/Db/QBMapperTest.php b/tests/lib/AppFramework/Db/QBMapperTest.php index 903098d76d5..c1d8bf07234 100644 --- a/tests/lib/AppFramework/Db/QBMapperTest.php +++ b/tests/lib/AppFramework/Db/QBMapperTest.php @@ -127,7 +127,7 @@ class QBMapperTest extends \Test\TestCase { ]; $this->qb->expects($this->exactly(6)) ->method('createNamedParameter') - ->willReturnCallback(function() use (&$createNamedParameterCalls) { + ->willReturnCallback(function () use (&$createNamedParameterCalls) { $expected = array_shift($createNamedParameterCalls); $this->assertEquals($expected, func_get_args()); }); @@ -142,7 +142,7 @@ class QBMapperTest extends \Test\TestCase { ]; $this->qb->expects($this->exactly(6)) ->method('setValue') - ->willReturnCallback(function() use (&$setValueCalls) { + ->willReturnCallback(function () use (&$setValueCalls) { $expected = array_shift($setValueCalls); $this->assertEquals($expected, func_get_args()); }); @@ -184,7 +184,7 @@ class QBMapperTest extends \Test\TestCase { ]; $this->qb->expects($this->exactly(8)) ->method('createNamedParameter') - ->willReturnCallback(function() use (&$createNamedParameterCalls) { + ->willReturnCallback(function () use (&$createNamedParameterCalls) { $expected = array_shift($createNamedParameterCalls); $this->assertEquals($expected, func_get_args()); }); @@ -200,7 +200,7 @@ class QBMapperTest extends \Test\TestCase { ]; $this->qb->expects($this->exactly(7)) ->method('set') - ->willReturnCallback(function() use (&$setCalls) { + ->willReturnCallback(function () use (&$setCalls) { $expected = array_shift($setCalls); $this->assertEquals($expected, func_get_args()); }); diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php index c4f778fe2da..404d3f4c90b 100644 --- a/tests/lib/AppFramework/Http/DispatcherTest.php +++ b/tests/lib/AppFramework/Http/DispatcherTest.php @@ -8,6 +8,7 @@ namespace Test\AppFramework\Http; +use OC\AppFramework\DependencyInjection\DIContainer; use OC\AppFramework\Http\Dispatcher; use OC\AppFramework\Http\Request; use OC\AppFramework\Middleware\MiddlewareDispatcher; @@ -26,7 +27,6 @@ use OCP\IRequestId; use PHPUnit\Framework\MockObject\MockObject; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; -use OC\AppFramework\DependencyInjection\DIContainer; class TestController extends Controller { /** diff --git a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php index 4b1e44e586e..a8273be362b 100644 --- a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php +++ b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php @@ -86,7 +86,8 @@ class TestMiddleware extends Middleware { } class TestController extends Controller { - public function method(): void {} + public function method(): void { + } } class MiddlewareDispatcherTest extends \Test\TestCase { diff --git a/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php index 5108f4db08b..c516c1e6c89 100644 --- a/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php @@ -106,7 +106,7 @@ class BruteForceMiddlewareTest extends TestCase { $this->throttler ->expects($this->exactly(2)) ->method('sleepDelayOrThrowOnMax') - ->willReturnCallback(function() use (&$calls) { + ->willReturnCallback(function () use (&$calls) { $expected = array_shift($calls); $this->assertEquals($expected, func_get_args()); return 0; @@ -235,7 +235,7 @@ class BruteForceMiddlewareTest extends TestCase { $this->throttler ->expects($this->exactly(2)) ->method('sleepDelayOrThrowOnMax') - ->willReturnCallback(function() use (&$sleepCalls) { + ->willReturnCallback(function () use (&$sleepCalls) { $expected = array_shift($sleepCalls); $this->assertEquals($expected, func_get_args()); return 0; @@ -248,7 +248,7 @@ class BruteForceMiddlewareTest extends TestCase { $this->throttler ->expects($this->exactly(2)) ->method('registerAttempt') - ->willReturnCallback(function() use (&$attemptCalls) { + ->willReturnCallback(function () use (&$attemptCalls) { $expected = array_shift($attemptCalls); $this->assertEquals($expected, func_get_args()); }); diff --git a/tests/lib/AppFramework/Routing/RoutingTest.php b/tests/lib/AppFramework/Routing/RoutingTest.php index 9381423b00c..703e613f790 100644 --- a/tests/lib/AppFramework/Routing/RoutingTest.php +++ b/tests/lib/AppFramework/Routing/RoutingTest.php @@ -360,7 +360,7 @@ class RoutingTest extends \Test\TestCase { $router ->expects($this->exactly(5)) ->method('create') - ->willReturnCallback(function(string $name, string $pattern) use (&$calls) { + ->willReturnCallback(function (string $name, string $pattern) use (&$calls) { $expected = array_shift($calls); $this->assertEquals($expected['name'], $name); $this->assertEquals($expected['pattern'], $pattern); @@ -414,7 +414,7 @@ class RoutingTest extends \Test\TestCase { $router ->expects($this->exactly(5)) ->method('create') - ->willReturnCallback(function(string $name, string $pattern) use (&$calls) { + ->willReturnCallback(function (string $name, string $pattern) use (&$calls) { $expected = array_shift($calls); $this->assertEquals($expected['name'], $name); $this->assertEquals($expected['pattern'], $pattern); diff --git a/tests/lib/Authentication/Listeners/UserDeletedTokenCleanupListenerTest.php b/tests/lib/Authentication/Listeners/UserDeletedTokenCleanupListenerTest.php index ad1193e5a96..a7590cdd244 100644 --- a/tests/lib/Authentication/Listeners/UserDeletedTokenCleanupListenerTest.php +++ b/tests/lib/Authentication/Listeners/UserDeletedTokenCleanupListenerTest.php @@ -91,7 +91,7 @@ class UserDeletedTokenCleanupListenerTest extends TestCase { ]; $this->manager->expects($this->exactly(3)) ->method('invalidateTokenById') - ->willReturnCallback(function() use (&$calls) { + ->willReturnCallback(function () use (&$calls) { $expected = array_shift($calls); $this->assertEquals($expected, func_get_args()); }); diff --git a/tests/lib/Authentication/Login/ALoginTestCommand.php b/tests/lib/Authentication/Login/ALoginTestCommand.php index dfc372d7e5a..502380bc3fe 100644 --- a/tests/lib/Authentication/Login/ALoginTestCommand.php +++ b/tests/lib/Authentication/Login/ALoginTestCommand.php @@ -8,7 +8,6 @@ declare(strict_types=1); namespace Test\Authentication\Login; -use OC\Authentication\Login\ALoginCommand; use OC\Authentication\Login\LoginData; use OCP\IRequest; use OCP\IUser; diff --git a/tests/lib/Authentication/Token/ManagerTest.php b/tests/lib/Authentication/Token/ManagerTest.php index 9b2d8d844bf..0f95d1d2f2c 100644 --- a/tests/lib/Authentication/Token/ManagerTest.php +++ b/tests/lib/Authentication/Token/ManagerTest.php @@ -382,7 +382,7 @@ class ManagerTest extends TestCase { $this->publicKeyTokenProvider ->expects($this->exactly(2)) ->method('invalidateTokenById') - ->willReturnCallback(function() use (&$calls) { + ->willReturnCallback(function () use (&$calls) { $expected = array_shift($calls); $this->assertEquals($expected, func_get_args()); }); diff --git a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php index e8de7012f2d..dc6ec7c7f3e 100644 --- a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php +++ b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php @@ -311,7 +311,7 @@ class PublicKeyTokenProviderTest extends TestCase { $this->mapper->expects($this->exactly(2)) ->method('invalidate') - ->willReturnCallback(function() use (&$calls) { + ->willReturnCallback(function () use (&$calls) { $expected = array_shift($calls); $this->assertEquals($expected, func_get_args()); }); @@ -350,7 +350,7 @@ class PublicKeyTokenProviderTest extends TestCase { ]; $this->mapper->expects($this->exactly(4)) ->method('invalidateOld') - ->willReturnCallback(function() use (&$calls) { + ->willReturnCallback(function () use (&$calls) { $expected = array_shift($calls); $this->assertEquals($expected, func_get_args()); }); diff --git a/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php b/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php index d9644b5a31b..252b57e7983 100644 --- a/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php +++ b/tests/lib/Authentication/TwoFactorAuth/RegistryTest.php @@ -126,7 +126,7 @@ class RegistryTest extends TestCase { ]; $this->dispatcher->expects($this->exactly(2)) ->method('dispatchTyped') - ->willReturnCallback(function() use (&$calls) { + ->willReturnCallback(function () use (&$calls) { $expected = array_shift($calls); $this->assertEquals($expected, func_get_args()); }); diff --git a/tests/lib/DateTimeFormatterTest.php b/tests/lib/DateTimeFormatterTest.php index 7b542ee422f..cfab1643beb 100644 --- a/tests/lib/DateTimeFormatterTest.php +++ b/tests/lib/DateTimeFormatterTest.php @@ -81,7 +81,7 @@ class DateTimeFormatterTest extends TestCase { $this->assertEquals((string)$expected, (string)$this->formatter->formatTimeSpan($timestamp, $compare, $locale)); } - public static function formatDateSpanData(): array{ + public static function formatDateSpanData(): array { $time = 1416916800; // Use a fixed timestamp so we don't switch days/years with the getTimestampAgo $deL10N = \OCP\Util::getL10N('lib', 'de'); return [ diff --git a/tests/lib/Encryption/EncryptionWrapperTest.php b/tests/lib/Encryption/EncryptionWrapperTest.php index e661b0481f9..342a7214e44 100644 --- a/tests/lib/Encryption/EncryptionWrapperTest.php +++ b/tests/lib/Encryption/EncryptionWrapperTest.php @@ -9,14 +9,14 @@ namespace Test\Encryption; use OC\Encryption\EncryptionWrapper; use OC\Encryption\Manager; +use OC\Files\Storage\Wrapper\Encryption; use OC\Memcache\ArrayCache; +use OCA\Files_Trashbin\Storage; use OCP\Files\Mount\IMountPoint; use OCP\Files\Storage\IDisableEncryptionStorage; use OCP\Files\Storage\IStorage; use Psr\Log\LoggerInterface; use Test\TestCase; -use OCA\Files_Trashbin\Storage; -use OC\Files\Storage\Wrapper\Encryption; class EncryptionWrapperTest extends TestCase { /** @var EncryptionWrapper */ diff --git a/tests/lib/Files/Node/NodeTestCase.php b/tests/lib/Files/Node/NodeTestCase.php index 255e5fd50d2..a2b8a3ddffe 100644 --- a/tests/lib/Files/Node/NodeTestCase.php +++ b/tests/lib/Files/Node/NodeTestCase.php @@ -9,6 +9,7 @@ namespace Test\Files\Node; use OC\Files\FileInfo; use OC\Files\Mount\Manager; +use OC\Files\Node\Root; use OC\Files\View; use OC\Memcache\ArrayCache; use OCP\EventDispatcher\IEventDispatcher; @@ -21,7 +22,6 @@ use OCP\ICacheFactory; use OCP\IUser; use OCP\IUserManager; use Psr\Log\LoggerInterface; -use OC\Files\Node\Root; /** * Class NodeTest diff --git a/tests/lib/Files/ObjectStore/ObjectStoreTestCase.php b/tests/lib/Files/ObjectStore/ObjectStoreTestCase.php index 71c9eb7d6d8..ecbfd9a37e6 100644 --- a/tests/lib/Files/ObjectStore/ObjectStoreTestCase.php +++ b/tests/lib/Files/ObjectStore/ObjectStoreTestCase.php @@ -13,7 +13,7 @@ abstract class ObjectStoreTestCase extends TestCase { /** @var string[] */ private $cleanup = []; - private $instance = nulL; + private $instance = null; /** * @return \OCP\Files\ObjectStore\IObjectStore diff --git a/tests/lib/Files/Stream/EncryptionTest.php b/tests/lib/Files/Stream/EncryptionTest.php index f51a6d3cb4e..c676358ad71 100644 --- a/tests/lib/Files/Stream/EncryptionTest.php +++ b/tests/lib/Files/Stream/EncryptionTest.php @@ -10,9 +10,11 @@ declare(strict_types=1); namespace Test\Files\Stream; use OC\Encryption\File; +use OC\Encryption\Util; use OC\Files\Cache\CacheEntry; use OC\Files\Storage\Storage; use OC\Files\Storage\Wrapper\Wrapper; +use OC\Files\Stream\Encryption; use OC\Files\View; use OC\Memcache\ArrayCache; use OCP\Encryption\IEncryptionModule; @@ -22,8 +24,6 @@ use OCP\ICacheFactory; use OCP\IConfig; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; -use OC\Files\Stream\Encryption; -use OC\Encryption\Util; class EncryptionTest extends \Test\TestCase { public const DEFAULT_WRAPPER = '\OC\Files\Stream\Encryption'; |