Skip to content

Commit 88d271c

Browse files
committed
Fix: Properly fix tests
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent cd0a8c2 commit 88d271c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/TaskProcessing/TextToSpeechProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function process(?string $userId, array $input, callable $reportProgress,
124124
$prompt = $input['input'];
125125

126126
if ($includeWatermark) {
127-
$prompt .= "\n\n" . 'This was generated using Artificial Intelligence.';
127+
$prompt .= "\n\n" . $this->l->t('This was generated using Artificial Intelligence.');
128128
}
129129

130130
if (isset($input['model']) && is_string($input['model'])) {

tests/unit/Providers/OpenAiProviderTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,15 @@ public function testTranslationProvider(): void {
579579
public function testTextToSpeechProvider(): void {
580580
$TTSProvider = new TextToSpeechProvider(
581581
$this->openAiApiService,
582-
$this->createMock(\OCP\IL10N::class),
582+
$l10n = $this->createMock(\OCP\IL10N::class),
583583
$this->createMock(\Psr\Log\LoggerInterface::class),
584584
\OCP\Server::get(IAppConfig::class),
585585
self::TEST_USER1,
586586
\OCP\Server::get(WatermarkingService::class),
587587
);
588588

589+
$l10n->method('t')->willReturn('This was generated using Artificial Intelligence.');
590+
589591
$inputText = 'This is a test prompt';
590592

591593
$response = file_get_contents(__DIR__ . '/../../res/speech.mp3');

0 commit comments

Comments
 (0)