|
55 | 55 | use OCP\TaskProcessing\TaskTypes\TextToTextSummary; |
56 | 56 | use OCP\TextProcessing\SummaryTaskType; |
57 | 57 | use PHPUnit\Framework\Constraint\IsInstanceOf; |
| 58 | +use PHPUnit\Framework\MockObject\MockObject; |
58 | 59 | use Psr\Log\LoggerInterface; |
59 | 60 | use Test\BackgroundJob\DummyJobList; |
60 | 61 |
|
@@ -572,18 +573,20 @@ public function getOutputShape(): array { |
572 | 573 |
|
573 | 574 | #[\PHPUnit\Framework\Attributes\Group('DB')] |
574 | 575 | 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> */ |
577 | 584 | 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; |
586 | 585 | private IAppConfig $appConfig; |
| 586 | + private IConfig $config; |
| 587 | + private IRootFolder $rootFolder; |
| 588 | + private TaskMapper $taskMapper; |
| 589 | + private IManager $manager; |
587 | 590 |
|
588 | 591 | public const TEST_USER = 'testuser'; |
589 | 592 |
|
@@ -617,18 +620,11 @@ protected function setUp(): void { |
617 | 620 | return $this->providers[$class]; |
618 | 621 | }); |
619 | 622 |
|
620 | | - $this->eventDispatcher = new EventDispatcher( |
621 | | - new \Symfony\Component\EventDispatcher\EventDispatcher(), |
622 | | - $this->serverContainer, |
623 | | - Server::get(LoggerInterface::class), |
624 | | - ); |
625 | | - |
626 | 623 | $this->registrationContext = $this->createMock(RegistrationContext::class); |
627 | 624 | $this->coordinator = $this->createMock(Coordinator::class); |
628 | 625 | $this->coordinator->expects($this->any())->method('getRegistrationContext')->willReturn($this->registrationContext); |
629 | 626 |
|
630 | 627 | $this->rootFolder = Server::get(IRootFolder::class); |
631 | | - |
632 | 628 | $this->taskMapper = Server::get(TaskMapper::class); |
633 | 629 |
|
634 | 630 | $this->jobList = $this->createPartialMock(DummyJobList::class, ['add']); |
|
0 commit comments