aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2025-05-29 11:51:28 +0200
committerJoas Schilling <coding@schilljs.com>2025-05-29 12:20:20 +0200
commit89a7778f87c7eda848d026cc575fa4f6c8d1ceb5 (patch)
tree3df633382e1462b767c9c3ff684c82808e1ecd96
parentfa645663a891eb121fe275a203b881e0f12df4ba (diff)
downloadnextcloud-server-89a7778f87c7eda848d026cc575fa4f6c8d1ceb5.tar.gz
nextcloud-server-89a7778f87c7eda848d026cc575fa4f6c8d1ceb5.zip
test: Mock ITaskManager to remove test interactions
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php2
-rw-r--r--tests/lib/TextProcessing/TextProcessingTest.php14
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index c3b829825c2..95ad129c466 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -157,7 +157,7 @@ class RegistrationContext {
/** @var ServiceRegistration<\OCP\Files\Conversion\IConversionProvider>[] */
private array $fileConversionProviders = [];
-
+
/** @var ServiceRegistration<IMailProvider>[] */
private $mailProviders = [];
diff --git a/tests/lib/TextProcessing/TextProcessingTest.php b/tests/lib/TextProcessing/TextProcessingTest.php
index 84c5492a4a2..1bbb9cf527e 100644
--- a/tests/lib/TextProcessing/TextProcessingTest.php
+++ b/tests/lib/TextProcessing/TextProcessingTest.php
@@ -118,7 +118,7 @@ class TextProcessingTest extends \Test\TestCase {
$this->eventDispatcher = new EventDispatcher(
new \Symfony\Component\EventDispatcher\EventDispatcher(),
$this->serverContainer,
- \OC::$server->get(LoggerInterface::class),
+ \OCP\Server::get(LoggerInterface::class),
);
$this->registrationContext = $this->createMock(RegistrationContext::class);
@@ -176,11 +176,11 @@ class TextProcessingTest extends \Test\TestCase {
$this->manager = new Manager(
$this->serverContainer,
$this->coordinator,
- \OC::$server->get(LoggerInterface::class),
+ \OCP\Server::get(LoggerInterface::class),
$this->jobList,
$this->taskMapper,
$config,
- \OC::$server->get(\OCP\TaskProcessing\IManager::class),
+ $this->createMock(\OCP\TaskProcessing\IManager::class),
);
}
@@ -239,7 +239,7 @@ class TextProcessingTest extends \Test\TestCase {
// run background job
$bgJob = new TaskBackgroundJob(
- \OC::$server->get(ITimeFactory::class),
+ \OCP\Server::get(ITimeFactory::class),
$this->manager,
$this->eventDispatcher,
);
@@ -314,7 +314,7 @@ class TextProcessingTest extends \Test\TestCase {
// run background job
$bgJob = new TaskBackgroundJob(
- \OC::$server->get(ITimeFactory::class),
+ \OCP\Server::get(ITimeFactory::class),
$this->manager,
$this->eventDispatcher,
);
@@ -343,9 +343,9 @@ class TextProcessingTest extends \Test\TestCase {
$this->currentTime = $this->currentTime->add(new \DateInterval('P1Y'));
// run background job
$bgJob = new RemoveOldTasksBackgroundJob(
- \OC::$server->get(ITimeFactory::class),
+ \OCP\Server::get(ITimeFactory::class),
$this->taskMapper,
- \OC::$server->get(LoggerInterface::class),
+ \OCP\Server::get(LoggerInterface::class),
);
$bgJob->setArgument([]);
$bgJob->start($this->jobList);