Skip to content

Commit 0cba7ac

Browse files
committed
[Platform][ElevenLabs] Remove default hostUrl from test constructors
Remove the explicit 'https://api.elevenlabs.io/v1' parameter from all ElevenLabsClient constructor calls in tests since this is the default value and doesn't need to be specified. This makes the tests cleaner and reduces unnecessary boilerplate code.
1 parent 5e95335 commit 0cba7ac

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/platform/tests/Bridge/ElevenLabs/ElevenLabsClientTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public function testSupportsModel()
3030
$client = new ElevenLabsClient(
3131
new MockHttpClient(),
3232
'my-api-key',
33-
'https://api.elevenlabs.io/v1',
3433
);
3534

3635
$this->assertTrue($client->supports(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2)));
@@ -53,7 +52,6 @@ public function testClientCannotPerformWithInvalidModel()
5352
$client = new ElevenLabsClient(
5453
$mockHttpClient,
5554
'my-api-key',
56-
'https://api.elevenlabs.io/v1',
5755
);
5856

5957
$payload = $normalizer->normalize(Audio::fromFile(\dirname(__DIR__, 5).'/fixtures/audio.mp3'));
@@ -69,7 +67,6 @@ public function testClientCannotPerformSpeechToTextRequestWithInvalidPayload()
6967
$client = new ElevenLabsClient(
7068
new MockHttpClient(),
7169
'my-api-key',
72-
'https://api.elevenlabs.io/v1',
7370
);
7471

7572
$this->expectException(InvalidArgumentException::class);
@@ -90,7 +87,6 @@ public function testClientCanPerformSpeechToTextRequest()
9087
$client = new ElevenLabsClient(
9188
$httpClient,
9289
'my-api-key',
93-
'https://api.elevenlabs.io/v1',
9490
);
9591

9692
$payload = $normalizer->normalize(Audio::fromFile(\dirname(__DIR__, 5).'/fixtures/audio.mp3'));
@@ -112,7 +108,6 @@ public function testClientCanPerformSpeechToTextRequestWithExperimentalModel()
112108
$client = new ElevenLabsClient(
113109
$httpClient,
114110
'my-api-key',
115-
'https://api.elevenlabs.io/v1',
116111
);
117112

118113
$payload = $normalizer->normalize(Audio::fromFile(\dirname(__DIR__, 5).'/fixtures/audio.mp3'));
@@ -137,7 +132,6 @@ public function testClientCannotPerformTextToSpeechRequestWithoutValidPayload()
137132
$client = new ElevenLabsClient(
138133
$mockHttpClient,
139134
'my-api-key',
140-
'https://api.elevenlabs.io/v1',
141135
);
142136

143137
$this->expectException(InvalidArgumentException::class);
@@ -165,7 +159,6 @@ public function testClientCanPerformTextToSpeechRequest()
165159
$client = new ElevenLabsClient(
166160
$httpClient,
167161
'my-api-key',
168-
'https://api.elevenlabs.io/v1',
169162
);
170163

171164
$client->request(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2, [
@@ -194,7 +187,6 @@ public function testClientCanPerformTextToSpeechRequestWhenVoiceKeyIsProvidedAsR
194187
$client = new ElevenLabsClient(
195188
$httpClient,
196189
'my-api-key',
197-
'https://api.elevenlabs.io/v1',
198190
);
199191

200192
$client->request(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2), [
@@ -223,7 +215,6 @@ public function testClientCanPerformTextToSpeechRequestAsStream()
223215
$client = new ElevenLabsClient(
224216
$httpClient,
225217
'my-api-key',
226-
'https://api.elevenlabs.io/v1',
227218
);
228219

229220
$result = $client->request(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2, [
@@ -254,7 +245,6 @@ public function testClientCanPerformTextToSpeechRequestAsStreamVoiceKeyIsProvide
254245
$client = new ElevenLabsClient(
255246
$httpClient,
256247
'my-api-key',
257-
'https://api.elevenlabs.io/v1',
258248
);
259249

260250
$result = $client->request(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2), [

0 commit comments

Comments
 (0)