16
16
use Symfony \AI \Platform \Bridge \Anthropic \Claude ;
17
17
use Symfony \AI \Platform \Bridge \Anthropic \ModelClient ;
18
18
use Symfony \Component \HttpClient \MockHttpClient ;
19
- use Symfony \Component \HttpClient \Response \MockResponse ;
19
+ use Symfony \Component \HttpClient \Response \JsonMockResponse ;
20
20
21
21
#[CoversClass(ModelClient::class)]
22
22
class ModelClientTest extends TestCase
@@ -53,7 +53,7 @@ public function testAnthropicBetaHeaderIsSetWithSingleBetaFeature(): void
53
53
$ this ->assertArrayHasKey ('anthropic-beta ' , $ headers );
54
54
$ this ->assertEquals ('feature-1 ' , $ headers ['anthropic-beta ' ]);
55
55
56
- return new MockResponse ('{"success": true} ' );
56
+ return new JsonMockResponse ('{"success": true} ' );
57
57
});
58
58
59
59
$ this ->modelClient = new ModelClient ($ this ->httpClient , 'test-api-key ' );
@@ -70,7 +70,7 @@ public function testAnthropicBetaHeaderIsSetWithMultipleBetaFeatures(): void
70
70
$ this ->assertArrayHasKey ('anthropic-beta ' , $ headers );
71
71
$ this ->assertEquals ('feature-1,feature-2,feature-3 ' , $ headers ['anthropic-beta ' ]);
72
72
73
- return new MockResponse ('{"success": true} ' );
73
+ return new JsonMockResponse ('{"success": true} ' );
74
74
});
75
75
76
76
$ this ->modelClient = new ModelClient ($ this ->httpClient , 'test-api-key ' , '2023-06-01 ' );
@@ -86,7 +86,7 @@ public function testAnthropicBetaHeaderIsNotSetWhenBetaFeaturesIsEmpty(): void
86
86
87
87
$ this ->assertArrayNotHasKey ('anthropic-beta ' , $ headers );
88
88
89
- return new MockResponse ('{"success": true} ' );
89
+ return new JsonMockResponse ('{"success": true} ' );
90
90
});
91
91
92
92
$ this ->modelClient = new ModelClient ($ this ->httpClient , 'test-api-key ' , '2023-06-01 ' );
@@ -102,7 +102,7 @@ public function testAnthropicBetaHeaderIsNotSetWhenBetaFeaturesIsNotProvided():
102
102
103
103
$ this ->assertArrayNotHasKey ('anthropic-beta ' , $ headers );
104
104
105
- return new MockResponse ('{"success": true} ' );
105
+ return new JsonMockResponse ('{"success": true} ' );
106
106
});
107
107
108
108
$ this ->modelClient = new ModelClient ($ this ->httpClient , 'test-api-key ' , '2023-06-01 ' );
0 commit comments