Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/lib/App/DependencyAnalyzerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class DependencyAnalyzerTest extends TestCase {

#[\Override]
protected function setUp(): void {
parent::setUp();

$this->platformMock = $this->getMockBuilder(Platform::class)
->disableOriginalConstructor()
->getMock();
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/AppFramework/Db/QBMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class QBMapperTest extends \Test\TestCase {
*/
#[\Override]
protected function setUp(): void {
parent::setUp();

$this->db = $this->getMockBuilder(IDBConnection::class)
->disableOriginalConstructor()
->getMock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/AppFramework/Routing/RouteParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class RouteParserTest extends \Test\TestCase {

#[\Override]
protected function setUp(): void {
parent::setUp();

$this->parser = new RouteParser();
}

Expand Down
2 changes: 2 additions & 0 deletions tests/lib/AppFramework/Utility/SimpleContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class SimpleContainerTest extends \Test\TestCase {

#[\Override]
protected function setUp(): void {
parent::setUp();

$this->container = new SimpleContainer();
}

Expand Down
2 changes: 2 additions & 0 deletions tests/lib/AppFramework/Utility/TimeFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class TimeFactoryTest extends \Test\TestCase {

#[\Override]
protected function setUp(): void {
parent::setUp();

$this->timeFactory = new TimeFactory();
}

Expand Down
2 changes: 2 additions & 0 deletions tests/lib/Command/AsyncBusTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ abstract protected function createBus();

#[\Override]
protected function setUp(): void {
parent::setUp();

self::$lastCommand = '';
}

Expand Down
2 changes: 2 additions & 0 deletions tests/lib/Command/BackgroundModeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class BackgroundModeTest extends TestCase {

#[\Override]
public function setUp(): void {
parent::setUp();

$this->appConfig = $this->createMock(IAppConfig::class);

$inputDefinition = new InputDefinition([
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/DB/AdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/Files/Type/LoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/Preview/PostscriptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/Repair/NC29/SanitizeAccountPropertiesJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/Repair/NC29/SanitizeAccountPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/Share20/DefaultShareProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/Share20/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/Share20/ShareByMailProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/Share20/ShareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/Snowflake/APCuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class APCuTest extends ISequenceBase {

#[\Override]
public function setUp():void {
parent::setUp();

$this->sequence = new APCuSequence();
}
}
2 changes: 2 additions & 0 deletions tests/lib/Snowflake/DecoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class DecoderTest extends TestCase {

#[\Override]
public function setUp():void {
parent::setUp();

$this->decoder = new SnowflakeDecoder();
}

Expand Down
4 changes: 4 additions & 0 deletions tests/lib/Snowflake/FileSequenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -32,5 +34,7 @@ public function tearDown():void {
foreach (glob($lockDirectory . '/*') as $file) {
unlink($file);
}

parent::tearDown();
}
}
2 changes: 2 additions & 0 deletions tests/lib/Snowflake/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading