Skip to content

Commit

Permalink
test: add disabled task type unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Jana Peper <[email protected]>
  • Loading branch information
janepie committed Dec 11, 2024
1 parent 32fde91 commit 9fce3d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/lib/TaskProcessing/TaskProcessingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ protected function setUp(): void {
$config->method('getAppValue')
->with('core', 'ai.textprocessing_provider_preferences', '')
->willReturn('');
$config->method('getAppValue')
$config->method('getAppValue')
->with('core', 'ai.taskprocessing_type_preferences', '')
->willReturn(json_encode($taskProcessingTypeSettings));

Expand All @@ -468,7 +468,7 @@ protected function setUp(): void {
$this->userMountCache = $this->createMock(IUserMountCache::class);

$this->manager = new Manager(
\OC::$server->get(IConfig::class),
$config,
$this->coordinator,
$this->serverContainer,
\OC::$server->get(LoggerInterface::class),
Expand Down Expand Up @@ -510,7 +510,7 @@ public function testProviderShouldBeRegisteredAndTaskTypeDisabled(): void {
$this->config->method('getAppValue')
->with('core', 'ai.taskprocessing_type_preferences', '')
->willReturn(json_encode($taskProcessingTypeSettings));*/
self::assertCount(0, $this->manager->getAvailableTaskTypes());
self::assertCount(0, $this->manager->getAvailableTaskTypes());
self::assertCount(1, $this->manager->getAvailableTaskTypes(true));
self::assertFalse($this->manager->hasProviders());
self::expectException(\OCP\TaskProcessing\Exception\PreConditionNotMetException::class);
Expand Down

0 comments on commit 9fce3d3

Please sign in to comment.