Merge pull request #61169 from nextcloud/test/parent-setup

test: Add missing calls to the parent setUp method
This commit is contained in:
Kate 2026-06-10 22:12:55 +02:00 committed by GitHub
commit 8948e923e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 54 additions and 0 deletions

View file

@ -22,6 +22,8 @@ class DependencyAnalyzerTest extends TestCase {
#[\Override]
protected function setUp(): void {
parent::setUp();
$this->platformMock = $this->getMockBuilder(Platform::class)
->disableOriginalConstructor()
->getMock();

View file

@ -81,6 +81,8 @@ class QBMapperTest extends \Test\TestCase {
*/
#[\Override]
protected function setUp(): void {
parent::setUp();
$this->db = $this->getMockBuilder(IDBConnection::class)
->disableOriginalConstructor()
->getMock();

View file

@ -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);

View file

@ -19,6 +19,8 @@ class RouteParserTest extends \Test\TestCase {
#[\Override]
protected function setUp(): void {
parent::setUp();
$this->parser = new RouteParser();
}

View file

@ -63,6 +63,8 @@ class SimpleContainerTest extends \Test\TestCase {
#[\Override]
protected function setUp(): void {
parent::setUp();
$this->container = new SimpleContainer();
}

View file

@ -16,6 +16,8 @@ class TimeFactoryTest extends \Test\TestCase {
#[\Override]
protected function setUp(): void {
parent::setUp();
$this->timeFactory = new TimeFactory();
}

View file

@ -75,6 +75,8 @@ abstract class AsyncBusTestCase extends TestCase {
#[\Override]
protected function setUp(): void {
parent::setUp();
self::$lastCommand = '';
}

View file

@ -25,6 +25,8 @@ class BackgroundModeTest extends TestCase {
#[\Override]
public function setUp(): void {
parent::setUp();
$this->appConfig = $this->createMock(IAppConfig::class);
$inputDefinition = new InputDefinition([

View file

@ -9,14 +9,18 @@ namespace Test\DB;
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);
}

View file

@ -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;

View file

@ -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');
}

View file

@ -11,14 +11,18 @@ namespace Test\Files\Type;
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);
}

View file

@ -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.');
}

View file

@ -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);

View file

@ -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);

View file

@ -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(

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -19,6 +19,8 @@ class APCuTest extends ISequenceBase {
#[\Override]
public function setUp():void {
parent::setUp();
$this->sequence = new APCuSequence();
}
}

View file

@ -19,6 +19,8 @@ class DecoderTest extends TestCase {
#[\Override]
public function setUp():void {
parent::setUp();
$this->decoder = new SnowflakeDecoder();
}

View file

@ -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 @@ class FileSequenceTest extends ISequenceBase {
foreach (glob($lockDirectory . '/*') as $file) {
unlink($file);
}
parent::tearDown();
}
}

View file

@ -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);