aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2023-07-07 02:52:39 +0100
committerfenn-cs <fenn25.fn@gmail.com>2023-08-13 11:37:34 +0100
commitdc8d25c2742220b3c199c31e0e703470799090f1 (patch)
tree4c06590e6827ec40e54d1366739601a1c70e0807 /apps/files/tests
parent4a2fbf72802e8b92422bccbfde8dc270f89be420 (diff)
downloadnextcloud-server-dc8d25c2742220b3c199c31e0e703470799090f1.tar.gz
nextcloud-server-dc8d25c2742220b3c199c31e0e703470799090f1.zip
Migrate parts of files app away from depecrated Ilogger
- Migrate some backgrounds jobs, `TransferOwnership` & `DeleteOrphanedItems` - Migrate `DirectEditingController` Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php b/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php
index f7562345d8a..fcc665a80ca 100644
--- a/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php
+++ b/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php
@@ -26,6 +26,8 @@ namespace OCA\Files\Tests\BackgroundJob;
use OCA\Files\BackgroundJob\DeleteOrphanedItems;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\DB\QueryBuilder\IQueryBuilder;
+use OCP\IDBConnection;
+use Psr\Log\LoggerInterface;
/**
* Class DeleteOrphanedItemsJobTest
@@ -35,15 +37,15 @@ use OCP\DB\QueryBuilder\IQueryBuilder;
* @package Test\BackgroundJob
*/
class DeleteOrphanedItemsJobTest extends \Test\TestCase {
- /** @var \OCP\IDBConnection */
- protected $connection;
-
+ protected IDBConnection $connection;
+ protected LoggerInterface $logger;
protected ITimeFactory $timeFactory;
protected function setUp(): void {
parent::setUp();
- $this->connection = \OC::$server->getDatabaseConnection();
+ $this->connection = \OC::$server->get(IDBConnection::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
+ $this->logger = \OC::$server->get(LoggerInterface::class);
}
protected function cleanMapping($table) {
@@ -98,7 +100,7 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase {
$mapping = $this->getMappings('systemtag_object_mapping');
$this->assertCount(2, $mapping);
- $job = new DeleteOrphanedItems($this->timeFactory);
+ $job = new DeleteOrphanedItems($this->timeFactory, $this->connection, $this->logger);
$this->invokePrivate($job, 'cleanSystemTags');
$mapping = $this->getMappings('systemtag_object_mapping');
@@ -147,7 +149,7 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase {
$mapping = $this->getMappings('vcategory_to_object');
$this->assertCount(2, $mapping);
- $job = new DeleteOrphanedItems($this->timeFactory);
+ $job = new DeleteOrphanedItems($this->timeFactory, $this->connection, $this->logger);
$this->invokePrivate($job, 'cleanUserTags');
$mapping = $this->getMappings('vcategory_to_object');
@@ -198,7 +200,7 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase {
$mapping = $this->getMappings('comments');
$this->assertCount(2, $mapping);
- $job = new DeleteOrphanedItems($this->timeFactory);
+ $job = new DeleteOrphanedItems($this->timeFactory, $this->connection, $this->logger);
$this->invokePrivate($job, 'cleanComments');
$mapping = $this->getMappings('comments');
@@ -247,7 +249,7 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase {
$mapping = $this->getMappings('comments_read_markers');
$this->assertCount(2, $mapping);
- $job = new DeleteOrphanedItems($this->timeFactory);
+ $job = new DeleteOrphanedItems($this->timeFactory, $this->connection, $this->logger);
$this->invokePrivate($job, 'cleanCommentMarkers');
$mapping = $this->getMappings('comments_read_markers');