From 405d250aef7e2b57b1e73ad81411484211723be6 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Wed, 10 Jun 2026 18:07:52 +0200 Subject: [PATCH] test: Add missing calls to the parent setUp method Signed-off-by: provokateurin --- tests/lib/App/DependencyAnalyzerTest.php | 2 ++ tests/lib/AppFramework/Db/QBMapperTest.php | 2 ++ .../Security/PasswordConfirmationMiddlewareTest.php | 2 ++ tests/lib/AppFramework/Routing/RouteParserTest.php | 2 ++ tests/lib/AppFramework/Utility/SimpleContainerTest.php | 2 ++ tests/lib/AppFramework/Utility/TimeFactoryTest.php | 2 ++ tests/lib/Command/AsyncBusTestCase.php | 2 ++ tests/lib/Command/BackgroundModeTest.php | 2 ++ tests/lib/DB/AdapterTest.php | 4 ++++ .../QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php | 2 ++ tests/lib/DB/QueryBuilder/Sharded/SharedQueryBuilderTest.php | 2 ++ tests/lib/Files/Type/LoaderTest.php | 4 ++++ tests/lib/Preview/PostscriptTest.php | 2 ++ tests/lib/Repair/NC29/SanitizeAccountPropertiesJobTest.php | 2 ++ tests/lib/Repair/NC29/SanitizeAccountPropertiesTest.php | 2 ++ .../Security/CSP/ContentSecurityPolicyNonceManagerTest.php | 2 ++ tests/lib/Share20/DefaultShareProviderTest.php | 2 ++ tests/lib/Share20/ManagerTest.php | 2 ++ tests/lib/Share20/ShareByMailProviderTest.php | 2 ++ tests/lib/Share20/ShareTest.php | 2 ++ tests/lib/Snowflake/APCuTest.php | 2 ++ tests/lib/Snowflake/DecoderTest.php | 2 ++ tests/lib/Snowflake/FileSequenceTest.php | 4 ++++ tests/lib/Snowflake/GeneratorTest.php | 2 ++ 24 files changed, 54 insertions(+) diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php index d4e68f10a23ed..c78b1ca78335e 100644 --- a/tests/lib/App/DependencyAnalyzerTest.php +++ b/tests/lib/App/DependencyAnalyzerTest.php @@ -22,6 +22,8 @@ class DependencyAnalyzerTest extends TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->platformMock = $this->getMockBuilder(Platform::class) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/lib/AppFramework/Db/QBMapperTest.php b/tests/lib/AppFramework/Db/QBMapperTest.php index e64d1fbe414ff..09cfee14720d7 100644 --- a/tests/lib/AppFramework/Db/QBMapperTest.php +++ b/tests/lib/AppFramework/Db/QBMapperTest.php @@ -81,6 +81,8 @@ class QBMapperTest extends \Test\TestCase { */ #[\Override] protected function setUp(): void { + parent::setUp(); + $this->db = $this->getMockBuilder(IDBConnection::class) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php index e33f65fa68249..ed37e6f327920 100644 --- a/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php @@ -47,6 +47,8 @@ class PasswordConfirmationMiddlewareTest extends TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->reflector = new ControllerMethodReflector(Server::get(LoggerInterface::class)); $this->session = $this->createMock(ISession::class); $this->userSession = $this->createMock(IUserSession::class); diff --git a/tests/lib/AppFramework/Routing/RouteParserTest.php b/tests/lib/AppFramework/Routing/RouteParserTest.php index fb09bcd36221b..772d00b57b5ee 100644 --- a/tests/lib/AppFramework/Routing/RouteParserTest.php +++ b/tests/lib/AppFramework/Routing/RouteParserTest.php @@ -19,6 +19,8 @@ class RouteParserTest extends \Test\TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->parser = new RouteParser(); } diff --git a/tests/lib/AppFramework/Utility/SimpleContainerTest.php b/tests/lib/AppFramework/Utility/SimpleContainerTest.php index 03e31cbb19dce..6ad23c9506c81 100644 --- a/tests/lib/AppFramework/Utility/SimpleContainerTest.php +++ b/tests/lib/AppFramework/Utility/SimpleContainerTest.php @@ -63,6 +63,8 @@ class SimpleContainerTest extends \Test\TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->container = new SimpleContainer(); } diff --git a/tests/lib/AppFramework/Utility/TimeFactoryTest.php b/tests/lib/AppFramework/Utility/TimeFactoryTest.php index 71ac75fa92da5..67a02377dd484 100644 --- a/tests/lib/AppFramework/Utility/TimeFactoryTest.php +++ b/tests/lib/AppFramework/Utility/TimeFactoryTest.php @@ -16,6 +16,8 @@ class TimeFactoryTest extends \Test\TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->timeFactory = new TimeFactory(); } diff --git a/tests/lib/Command/AsyncBusTestCase.php b/tests/lib/Command/AsyncBusTestCase.php index 2b8decabe931e..7682a27abea8c 100644 --- a/tests/lib/Command/AsyncBusTestCase.php +++ b/tests/lib/Command/AsyncBusTestCase.php @@ -75,6 +75,8 @@ abstract protected function createBus(); #[\Override] protected function setUp(): void { + parent::setUp(); + self::$lastCommand = ''; } diff --git a/tests/lib/Command/BackgroundModeTest.php b/tests/lib/Command/BackgroundModeTest.php index 32ab2598ae9b1..144af11f6a092 100644 --- a/tests/lib/Command/BackgroundModeTest.php +++ b/tests/lib/Command/BackgroundModeTest.php @@ -25,6 +25,8 @@ class BackgroundModeTest extends TestCase { #[\Override] public function setUp(): void { + parent::setUp(); + $this->appConfig = $this->createMock(IAppConfig::class); $inputDefinition = new InputDefinition([ diff --git a/tests/lib/DB/AdapterTest.php b/tests/lib/DB/AdapterTest.php index f5ca19c1ce9e7..0bea929e0a7fa 100644 --- a/tests/lib/DB/AdapterTest.php +++ b/tests/lib/DB/AdapterTest.php @@ -9,14 +9,18 @@ use OCP\IDBConnection; use OCP\Server; +use PHPUnit\Framework\Attributes\Group; use Test\TestCase; +#[Group('DB')] class AdapterTest extends TestCase { private string $appId; private $connection; #[\Override] public function setUp(): void { + parent::setUp(); + $this->connection = Server::get(IDBConnection::class); $this->appId = substr(uniqid('test_db_adapter', true), 0, 32); } diff --git a/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php b/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php index c0867e42aedaa..10d86d95fb069 100644 --- a/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php +++ b/tests/lib/DB/QueryBuilder/Partitioned/PartitionedQueryBuilderTest.php @@ -26,6 +26,8 @@ class PartitionedQueryBuilderTest extends TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + if (PHP_INT_SIZE < 8) { $this->markTestSkipped('Test requires 64bit'); return; diff --git a/tests/lib/DB/QueryBuilder/Sharded/SharedQueryBuilderTest.php b/tests/lib/DB/QueryBuilder/Sharded/SharedQueryBuilderTest.php index 6a7555cdcd0eb..318932651fc14 100644 --- a/tests/lib/DB/QueryBuilder/Sharded/SharedQueryBuilderTest.php +++ b/tests/lib/DB/QueryBuilder/Sharded/SharedQueryBuilderTest.php @@ -26,6 +26,8 @@ class SharedQueryBuilderTest extends TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + if (PHP_INT_SIZE < 8) { $this->markTestSkipped('Test requires 64bit'); } diff --git a/tests/lib/Files/Type/LoaderTest.php b/tests/lib/Files/Type/LoaderTest.php index e5c7e00f59bf3..35c549f321e94 100644 --- a/tests/lib/Files/Type/LoaderTest.php +++ b/tests/lib/Files/Type/LoaderTest.php @@ -11,14 +11,18 @@ use OC\Files\Type\Loader; use OCP\IDBConnection; use OCP\Server; +use PHPUnit\Framework\Attributes\Group; use Test\TestCase; +#[Group('DB')] class LoaderTest extends TestCase { protected IDBConnection $db; protected Loader $loader; #[\Override] protected function setUp(): void { + parent::setUp(); + $this->db = Server::get(IDBConnection::class); $this->loader = new Loader($this->db); } diff --git a/tests/lib/Preview/PostscriptTest.php b/tests/lib/Preview/PostscriptTest.php index 733bae31b5aab..4437bfae6cf9c 100644 --- a/tests/lib/Preview/PostscriptTest.php +++ b/tests/lib/Preview/PostscriptTest.php @@ -18,6 +18,8 @@ class PostscriptTest extends Provider { #[\Override] protected function setUp(): void { + parent::setUp(); + if (\Imagick::queryFormats('EPS') === false || \Imagick::queryFormats('PS') === false) { $this->markTestSkipped('Imagick does not support postscript.'); } diff --git a/tests/lib/Repair/NC29/SanitizeAccountPropertiesJobTest.php b/tests/lib/Repair/NC29/SanitizeAccountPropertiesJobTest.php index 8c03c29afc8f3..2847a6070a942 100644 --- a/tests/lib/Repair/NC29/SanitizeAccountPropertiesJobTest.php +++ b/tests/lib/Repair/NC29/SanitizeAccountPropertiesJobTest.php @@ -30,6 +30,8 @@ class SanitizeAccountPropertiesJobTest extends TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->userManager = $this->createMock(IUserManager::class); $this->accountManager = $this->createMock(IAccountManager::class); $this->logger = $this->createMock(LoggerInterface::class); diff --git a/tests/lib/Repair/NC29/SanitizeAccountPropertiesTest.php b/tests/lib/Repair/NC29/SanitizeAccountPropertiesTest.php index 924dc241149cc..66f202b29fdbe 100644 --- a/tests/lib/Repair/NC29/SanitizeAccountPropertiesTest.php +++ b/tests/lib/Repair/NC29/SanitizeAccountPropertiesTest.php @@ -21,6 +21,8 @@ class SanitizeAccountPropertiesTest extends TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->jobList = $this->createMock(IJobList::class); $this->repairStep = new SanitizeAccountProperties($this->jobList); diff --git a/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php b/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php index d0b063d49f173..72ad4e89d503c 100644 --- a/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php +++ b/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php @@ -26,6 +26,8 @@ class ContentSecurityPolicyNonceManagerTest extends TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->CSRFTokenManager = $this->createMock(CsrfTokenManager::class); $this->request = $this->createMock(Request::class); $this->nonceManager = new ContentSecurityPolicyNonceManager( diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index ea4a9f7f811b0..8917f0abaa290 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -86,6 +86,8 @@ class DefaultShareProviderTest extends \Test\TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->dbConn = Server::get(IDBConnection::class); $this->userManager = $this->createMock(IUserManager::class); $this->groupManager = $this->createMock(IGroupManager::class); diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index b29638856b810..2bf67744a4dfe 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -106,6 +106,8 @@ class ManagerTest extends \Test\TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->logger = $this->createMock(LoggerInterface::class); $this->config = $this->createMock(IConfig::class); $this->secureRandom = $this->createMock(ISecureRandom::class); diff --git a/tests/lib/Share20/ShareByMailProviderTest.php b/tests/lib/Share20/ShareByMailProviderTest.php index f37e5fb9f9ff7..50ed5a53445ee 100644 --- a/tests/lib/Share20/ShareByMailProviderTest.php +++ b/tests/lib/Share20/ShareByMailProviderTest.php @@ -90,6 +90,8 @@ class ShareByMailProviderTest extends TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->dbConn = Server::get(IDBConnection::class); $this->userManager = $this->createMock(IUserManager::class); $this->rootFolder = $this->createMock(IRootFolder::class); diff --git a/tests/lib/Share20/ShareTest.php b/tests/lib/Share20/ShareTest.php index c3f198503f2ee..23f5a70e2a475 100644 --- a/tests/lib/Share20/ShareTest.php +++ b/tests/lib/Share20/ShareTest.php @@ -27,6 +27,8 @@ class ShareTest extends \Test\TestCase { #[\Override] protected function setUp(): void { + parent::setUp(); + $this->rootFolder = $this->createMock(IRootFolder::class); $this->userManager = $this->createMock(IUserManager::class); $this->share = new Share($this->rootFolder, $this->userManager); diff --git a/tests/lib/Snowflake/APCuTest.php b/tests/lib/Snowflake/APCuTest.php index ab797a5e9b4f3..e67fa73b92f54 100644 --- a/tests/lib/Snowflake/APCuTest.php +++ b/tests/lib/Snowflake/APCuTest.php @@ -19,6 +19,8 @@ class APCuTest extends ISequenceBase { #[\Override] public function setUp():void { + parent::setUp(); + $this->sequence = new APCuSequence(); } } diff --git a/tests/lib/Snowflake/DecoderTest.php b/tests/lib/Snowflake/DecoderTest.php index 4a1ea423c8bc4..7ec3a5d8e13c1 100644 --- a/tests/lib/Snowflake/DecoderTest.php +++ b/tests/lib/Snowflake/DecoderTest.php @@ -19,6 +19,8 @@ class DecoderTest extends TestCase { #[\Override] public function setUp():void { + parent::setUp(); + $this->decoder = new SnowflakeDecoder(); } diff --git a/tests/lib/Snowflake/FileSequenceTest.php b/tests/lib/Snowflake/FileSequenceTest.php index ed3f4e79a9f9d..bec2dab7b7ce5 100644 --- a/tests/lib/Snowflake/FileSequenceTest.php +++ b/tests/lib/Snowflake/FileSequenceTest.php @@ -20,6 +20,8 @@ class FileSequenceTest extends ISequenceBase { #[\Override] public function setUp():void { + parent::setUp(); + $tempManager = $this->createMock(ITempManager::class); $this->path = sys_get_temp_dir(); $tempManager->method('getTempBaseDir')->willReturn($this->path); @@ -32,5 +34,7 @@ public function tearDown():void { foreach (glob($lockDirectory . '/*') as $file) { unlink($file); } + + parent::tearDown(); } } diff --git a/tests/lib/Snowflake/GeneratorTest.php b/tests/lib/Snowflake/GeneratorTest.php index 1f0153e0d9c7d..c8fbc25da5f1a 100644 --- a/tests/lib/Snowflake/GeneratorTest.php +++ b/tests/lib/Snowflake/GeneratorTest.php @@ -30,6 +30,8 @@ class GeneratorTest extends TestCase { #[\Override] public function setUp(): void { + parent::setUp(); + $this->decoder = new SnowflakeDecoder(); $this->config = $this->createMock(IConfig::class);