28
28
use Symfony \AI \Platform \PlatformInterface ;
29
29
use Symfony \AI \Platform \Result \RawResultInterface ;
30
30
use Symfony \AI \Platform \Result \ResultInterface ;
31
- use Symfony \AI \Platform \Result \ResultPromise ;
31
+ use Symfony \AI \Platform \Result \DeferredResult ;
32
+ use Symfony \AI \Platform \Test \PlainConverter ;
32
33
33
34
final class AgentTest extends TestCase
34
35
{
@@ -120,7 +121,7 @@ public function testCallProcessesInputThroughProcessors()
120
121
->with ($ this ->isInstanceOf (Input::class));
121
122
122
123
$ rawResult = $ this ->createMock (RawResultInterface::class);
123
- $ response = new ResultPromise ( fn () => $ result , $ rawResult , []);
124
+ $ response = new DeferredResult ( new PlainConverter ( $ result) , $ rawResult , []);
124
125
125
126
$ platform ->expects ($ this ->once ())
126
127
->method ('invoke ' )
@@ -146,7 +147,7 @@ public function testCallProcessesOutputThroughProcessors()
146
147
->with ($ this ->isInstanceOf (Output::class));
147
148
148
149
$ rawResult = $ this ->createMock (RawResultInterface::class);
149
- $ response = new ResultPromise ( fn () => $ result , $ rawResult , []);
150
+ $ response = new DeferredResult ( new PlainConverter ( $ result) , $ rawResult , []);
150
151
151
152
$ platform ->expects ($ this ->once ())
152
153
->method ('invoke ' )
@@ -166,7 +167,7 @@ public function testCallAllowsAudioInputWithSupport()
166
167
$ result = $ this ->createMock (ResultInterface::class);
167
168
168
169
$ rawResult = $ this ->createMock (RawResultInterface::class);
169
- $ response = new ResultPromise ( fn () => $ result , $ rawResult , []);
170
+ $ response = new DeferredResult ( new PlainConverter ( $ result) , $ rawResult , []);
170
171
171
172
$ platform ->expects ($ this ->once ())
172
173
->method ('invoke ' )
@@ -186,7 +187,7 @@ public function testCallAllowsImageInputWithSupport()
186
187
$ result = $ this ->createMock (ResultInterface::class);
187
188
188
189
$ rawResult = $ this ->createMock (RawResultInterface::class);
189
- $ response = new ResultPromise ( fn () => $ result , $ rawResult , []);
190
+ $ response = new DeferredResult ( new PlainConverter ( $ result) , $ rawResult , []);
190
191
191
192
$ platform ->expects ($ this ->once ())
192
193
->method ('invoke ' )
@@ -207,7 +208,7 @@ public function testCallPassesOptionsToInvoke()
207
208
$ result = $ this ->createMock (ResultInterface::class);
208
209
209
210
$ rawResult = $ this ->createMock (RawResultInterface::class);
210
- $ response = new ResultPromise ( fn () => $ result , $ rawResult , []);
211
+ $ response = new DeferredResult ( new PlainConverter ( $ result) , $ rawResult , []);
211
212
212
213
$ platform ->expects ($ this ->once ())
213
214
->method ('invoke ' )
0 commit comments