aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/TextProcessing/TextProcessingTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/TextProcessing/TextProcessingTest.php')
-rw-r--r--tests/lib/TextProcessing/TextProcessingTest.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/lib/TextProcessing/TextProcessingTest.php b/tests/lib/TextProcessing/TextProcessingTest.php
index 1bbb9cf527e..7761e064834 100644
--- a/tests/lib/TextProcessing/TextProcessingTest.php
+++ b/tests/lib/TextProcessing/TextProcessingTest.php
@@ -23,6 +23,7 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IServerContainer;
use OCP\PreConditionNotMetException;
+use OCP\Server;
use OCP\TextProcessing\Events\TaskFailedEvent;
use OCP\TextProcessing\Events\TaskSuccessfulEvent;
use OCP\TextProcessing\FreePromptTaskType;
@@ -118,7 +119,7 @@ class TextProcessingTest extends \Test\TestCase {
$this->eventDispatcher = new EventDispatcher(
new \Symfony\Component\EventDispatcher\EventDispatcher(),
$this->serverContainer,
- \OCP\Server::get(LoggerInterface::class),
+ Server::get(LoggerInterface::class),
);
$this->registrationContext = $this->createMock(RegistrationContext::class);
@@ -158,14 +159,14 @@ class TextProcessingTest extends \Test\TestCase {
$this->taskMapper
->expects($this->any())
->method('deleteOlderThan')
- ->willReturnCallback(function (int $timeout) {
+ ->willReturnCallback(function (int $timeout): void {
$this->tasksDb = array_filter($this->tasksDb, function (array $task) use ($timeout) {
return $task['last_updated'] >= $this->currentTime->getTimestamp() - $timeout;
});
});
$this->jobList = $this->createPartialMock(DummyJobList::class, ['add']);
- $this->jobList->expects($this->any())->method('add')->willReturnCallback(function () {
+ $this->jobList->expects($this->any())->method('add')->willReturnCallback(function (): void {
});
$config = $this->createMock(IConfig::class);
@@ -176,7 +177,7 @@ class TextProcessingTest extends \Test\TestCase {
$this->manager = new Manager(
$this->serverContainer,
$this->coordinator,
- \OCP\Server::get(LoggerInterface::class),
+ Server::get(LoggerInterface::class),
$this->jobList,
$this->taskMapper,
$config,
@@ -239,7 +240,7 @@ class TextProcessingTest extends \Test\TestCase {
// run background job
$bgJob = new TaskBackgroundJob(
- \OCP\Server::get(ITimeFactory::class),
+ Server::get(ITimeFactory::class),
$this->manager,
$this->eventDispatcher,
);
@@ -314,7 +315,7 @@ class TextProcessingTest extends \Test\TestCase {
// run background job
$bgJob = new TaskBackgroundJob(
- \OCP\Server::get(ITimeFactory::class),
+ Server::get(ITimeFactory::class),
$this->manager,
$this->eventDispatcher,
);
@@ -343,9 +344,9 @@ class TextProcessingTest extends \Test\TestCase {
$this->currentTime = $this->currentTime->add(new \DateInterval('P1Y'));
// run background job
$bgJob = new RemoveOldTasksBackgroundJob(
- \OCP\Server::get(ITimeFactory::class),
+ Server::get(ITimeFactory::class),
$this->taskMapper,
- \OCP\Server::get(LoggerInterface::class),
+ Server::get(LoggerInterface::class),
);
$bgJob->setArgument([]);
$bgJob->start($this->jobList);