22
33declare (strict_types=1 );
44
5- use App \Contracts \GeneratesAiResponse ;
5+ use App \Contracts \ProcessesAdvisorMessage ;
66use App \Contracts \ParsesHealthData ;
77use App \Enums \HealthEntryType ;
88use App \Enums \Sex ;
@@ -249,12 +249,12 @@ function sendWebhook(mixed $test, string $text): Illuminate\Testing\TestResponse
249249 'conversation_id ' => 'old-conv-id ' ,
250250 ]);
251251
252- $ mock = Mockery::mock (GeneratesAiResponse ::class);
252+ $ mock = Mockery::mock (ProcessesAdvisorMessage ::class);
253253 $ mock ->shouldReceive ('resetConversation ' )
254254 ->once ()
255255 ->with (Mockery::on (fn (User $ u ): bool => $ u ->id === $ user ->id ))
256256 ->andReturn ('new-conv-id ' );
257- app ()->instance (GeneratesAiResponse ::class, $ mock );
257+ app ()->instance (ProcessesAdvisorMessage ::class, $ mock );
258258
259259 sendWebhook ($ this , '/new ' );
260260
@@ -271,9 +271,9 @@ function sendWebhook(mixed $test, string $text): Illuminate\Testing\TestResponse
271271 'telegraph_chat_id ' => $ this ->telegraphChat ->id ,
272272 ]);
273273
274- $ mock = Mockery::mock (GeneratesAiResponse ::class);
274+ $ mock = Mockery::mock (ProcessesAdvisorMessage ::class);
275275 $ mock ->shouldReceive ('resetConversation ' )->once ()->andReturn ('reset-conv-id ' );
276- app ()->instance (GeneratesAiResponse ::class, $ mock );
276+ app ()->instance (ProcessesAdvisorMessage ::class, $ mock );
277277
278278 sendWebhook ($ this , '/reset ' );
279279
@@ -296,7 +296,7 @@ function sendWebhook(mixed $test, string $text): Illuminate\Testing\TestResponse
296296 'conversation_id ' => 'existing-conv ' ,
297297 ]);
298298
299- $ mock = Mockery::mock (GeneratesAiResponse ::class);
299+ $ mock = Mockery::mock (ProcessesAdvisorMessage ::class);
300300 $ mock ->shouldReceive ('handle ' )
301301 ->once ()
302302 ->with (
@@ -308,7 +308,7 @@ function sendWebhook(mixed $test, string $text): Illuminate\Testing\TestResponse
308308 'response ' => 'Here are some breakfast suggestions... ' ,
309309 'conversation_id ' => 'existing-conv ' ,
310310 ]);
311- app ()->instance (GeneratesAiResponse ::class, $ mock );
311+ app ()->instance (ProcessesAdvisorMessage ::class, $ mock );
312312
313313 sendWebhook ($ this , 'What should I eat for breakfast? ' );
314314
@@ -323,7 +323,7 @@ function sendWebhook(mixed $test, string $text): Illuminate\Testing\TestResponse
323323 'conversation_id ' => null ,
324324 ]);
325325
326- $ mock = Mockery::mock (GeneratesAiResponse ::class);
326+ $ mock = Mockery::mock (ProcessesAdvisorMessage ::class);
327327 $ mock ->shouldReceive ('handle ' )
328328 ->once ()
329329 ->with (
@@ -335,7 +335,7 @@ function sendWebhook(mixed $test, string $text): Illuminate\Testing\TestResponse
335335 'response ' => 'Welcome! ' ,
336336 'conversation_id ' => 'first-conv-id ' ,
337337 ]);
338- app ()->instance (GeneratesAiResponse ::class, $ mock );
338+ app ()->instance (ProcessesAdvisorMessage ::class, $ mock );
339339
340340 sendWebhook ($ this , 'Hello! ' );
341341
@@ -350,14 +350,14 @@ function sendWebhook(mixed $test, string $text): Illuminate\Testing\TestResponse
350350 'conversation_id ' => 'existing-conv ' ,
351351 ]);
352352
353- $ mock = Mockery::mock (GeneratesAiResponse ::class);
353+ $ mock = Mockery::mock (ProcessesAdvisorMessage ::class);
354354 $ mock ->shouldReceive ('handle ' )
355355 ->once ()
356356 ->andReturn ([
357357 'response ' => 'Response ' ,
358358 'conversation_id ' => 'some-new-conv ' ,
359359 ]);
360- app ()->instance (GeneratesAiResponse ::class, $ mock );
360+ app ()->instance (ProcessesAdvisorMessage ::class, $ mock );
361361
362362 sendWebhook ($ this , 'Follow-up message ' );
363363
@@ -371,10 +371,10 @@ function sendWebhook(mixed $test, string $text): Illuminate\Testing\TestResponse
371371 'telegraph_chat_id ' => $ this ->telegraphChat ->id ,
372372 ]);
373373
374- $ mock = Mockery::mock (GeneratesAiResponse ::class);
374+ $ mock = Mockery::mock (ProcessesAdvisorMessage ::class);
375375 $ mock ->shouldReceive ('handle ' )
376376 ->andThrow (new Exception ('AI service unavailable ' ));
377- app ()->instance (GeneratesAiResponse ::class, $ mock );
377+ app ()->instance (ProcessesAdvisorMessage ::class, $ mock );
378378
379379 sendWebhook ($ this , 'Hello ' );
380380
0 commit comments