Skip to content

Commit 63b272f

Browse files
committed
Forgot to run composer cs:fix and rebased updating emojiprovider test to pass
Signed-off-by: Lukas Schaefer <[email protected]>
1 parent f6d0af3 commit 63b272f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/TaskProcessing/TextToSpeechProvider.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111

1212
use OCA\OpenAi\AppInfo\Application;
1313
use OCA\OpenAi\Service\OpenAiAPIService;
14-
use OCP\Http\Client\IClientService;
1514
use OCP\IAppConfig;
1615
use OCP\IL10N;
1716
use OCP\TaskProcessing\EShapeType;
1817
use OCP\TaskProcessing\ISynchronousProvider;
1918
use OCP\TaskProcessing\ShapeDescriptor;
2019
use OCP\TaskProcessing\ShapeEnumValue;
21-
use OCP\TaskProcessing\TaskTypes\TextToSpeech;
2220
use Psr\Log\LoggerInterface;
2321
use RuntimeException;
2422

@@ -44,7 +42,10 @@ public function getName(): string {
4442
}
4543

4644
public function getTaskTypeId(): string {
47-
return TextToSpeech::ID;
45+
if (class_exists('OCP\\TaskProcessing\\TaskTypes\\TextToTextChangeTone')) {
46+
return \OCP\TaskProcessing\TaskTypes\TextToSpeech::ID;
47+
}
48+
return TextToSpeechTaskType::ID;
4849
}
4950

5051
public function getExpectedRuntime(): int {

tests/unit/Providers/OpenAiProviderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ public function testEmojiProvider(): void {
213213
$iResponse = $this->createMock(\OCP\Http\Client\IResponse::class);
214214
$iResponse->method('getBody')->willReturn($response);
215215
$iResponse->method('getStatusCode')->willReturn(200);
216+
$iResponse->method('getHeader')->with('Content-Type')->willReturn('application/json');
216217

217218
$this->iClient->expects($this->once())->method('post')->with($url, $options)->willReturn($iResponse);
218219

0 commit comments

Comments
 (0)