Skip to content

Commit b3c0838

Browse files
committed
Use JsonMockResponse instead of MockResponse in tests
1 parent 7f4a0e9 commit b3c0838

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/platform/tests/Bridge/Anthropic/ModelClientTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\AI\Platform\Bridge\Anthropic\Claude;
1717
use Symfony\AI\Platform\Bridge\Anthropic\ModelClient;
1818
use Symfony\Component\HttpClient\MockHttpClient;
19-
use Symfony\Component\HttpClient\Response\MockResponse;
19+
use Symfony\Component\HttpClient\Response\JsonMockResponse;
2020

2121
#[CoversClass(ModelClient::class)]
2222
class ModelClientTest extends TestCase
@@ -53,7 +53,7 @@ public function testAnthropicBetaHeaderIsSetWithSingleBetaFeature(): void
5353
$this->assertArrayHasKey('anthropic-beta', $headers);
5454
$this->assertEquals('feature-1', $headers['anthropic-beta']);
5555

56-
return new MockResponse('{"success": true}');
56+
return new JsonMockResponse('{"success": true}');
5757
});
5858

5959
$this->modelClient = new ModelClient($this->httpClient, 'test-api-key');
@@ -70,7 +70,7 @@ public function testAnthropicBetaHeaderIsSetWithMultipleBetaFeatures(): void
7070
$this->assertArrayHasKey('anthropic-beta', $headers);
7171
$this->assertEquals('feature-1,feature-2,feature-3', $headers['anthropic-beta']);
7272

73-
return new MockResponse('{"success": true}');
73+
return new JsonMockResponse('{"success": true}');
7474
});
7575

7676
$this->modelClient = new ModelClient($this->httpClient, 'test-api-key', '2023-06-01');
@@ -86,7 +86,7 @@ public function testAnthropicBetaHeaderIsNotSetWhenBetaFeaturesIsEmpty(): void
8686

8787
$this->assertArrayNotHasKey('anthropic-beta', $headers);
8888

89-
return new MockResponse('{"success": true}');
89+
return new JsonMockResponse('{"success": true}');
9090
});
9191

9292
$this->modelClient = new ModelClient($this->httpClient, 'test-api-key', '2023-06-01');
@@ -102,7 +102,7 @@ public function testAnthropicBetaHeaderIsNotSetWhenBetaFeaturesIsNotProvided():
102102

103103
$this->assertArrayNotHasKey('anthropic-beta', $headers);
104104

105-
return new MockResponse('{"success": true}');
105+
return new JsonMockResponse('{"success": true}');
106106
});
107107

108108
$this->modelClient = new ModelClient($this->httpClient, 'test-api-key', '2023-06-01');

0 commit comments

Comments
 (0)