Skip to content

Commit 5583e71

Browse files
committed
test(TaskProcessing): use proper types
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 7a3ed09 commit 5583e71

1 file changed

Lines changed: 13 additions & 17 deletions

File tree

tests/lib/TaskProcessing/TaskProcessingTest.php

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
use OCP\TaskProcessing\TaskTypes\TextToTextSummary;
5656
use OCP\TextProcessing\SummaryTaskType;
5757
use PHPUnit\Framework\Constraint\IsInstanceOf;
58+
use PHPUnit\Framework\MockObject\MockObject;
5859
use Psr\Log\LoggerInterface;
5960
use Test\BackgroundJob\DummyJobList;
6061

@@ -572,18 +573,20 @@ public function getOutputShape(): array {
572573

573574
#[\PHPUnit\Framework\Attributes\Group('DB')]
574575
class TaskProcessingTest extends \Test\TestCase {
575-
private IManager $manager;
576-
private Coordinator $coordinator;
576+
private Coordinator&MockObject $coordinator;
577+
private IServerContainer&MockObject $serverContainer;
578+
private IEventDispatcher&MockObject $eventDispatcher;
579+
private IJobList&MockObject $jobList;
580+
private IUserMountCache&MockObject $userMountCache;
581+
private RegistrationContext&MockObject $registrationContext;
582+
583+
/** @var array<class-string, IProvider> */
577584
private array $providers;
578-
private IServerContainer $serverContainer;
579-
private IEventDispatcher $eventDispatcher;
580-
private RegistrationContext $registrationContext;
581-
private TaskMapper $taskMapper;
582-
private IJobList $jobList;
583-
private IUserMountCache $userMountCache;
584-
private IRootFolder $rootFolder;
585-
private IConfig $config;
586585
private IAppConfig $appConfig;
586+
private IConfig $config;
587+
private IRootFolder $rootFolder;
588+
private TaskMapper $taskMapper;
589+
private IManager $manager;
587590

588591
public const TEST_USER = 'testuser';
589592

@@ -617,18 +620,11 @@ protected function setUp(): void {
617620
return $this->providers[$class];
618621
});
619622

620-
$this->eventDispatcher = new EventDispatcher(
621-
new \Symfony\Component\EventDispatcher\EventDispatcher(),
622-
$this->serverContainer,
623-
Server::get(LoggerInterface::class),
624-
);
625-
626623
$this->registrationContext = $this->createMock(RegistrationContext::class);
627624
$this->coordinator = $this->createMock(Coordinator::class);
628625
$this->coordinator->expects($this->any())->method('getRegistrationContext')->willReturn($this->registrationContext);
629626

630627
$this->rootFolder = Server::get(IRootFolder::class);
631-
632628
$this->taskMapper = Server::get(TaskMapper::class);
633629

634630
$this->jobList = $this->createPartialMock(DummyJobList::class, ['add']);

0 commit comments

Comments
 (0)