InteractsWithFakeAgents
trait InteractsWithFakeAgents
Properties
| protected array | $fakeAgentGateways | All of the registered fake agent gateways. |
|
| protected array | $recordedPrompts | All of the recorded agent prompts. |
|
| protected array | $recordedQueuedPrompts | All of the recorded agent prompts that were queued. |
Methods
Assert that a prompt was received matching a given truth test.
Assert that a certain number of prompts were received.
Assert that a prompt was received matching a given truth test.
Assert that a prompt was not received matching a given truth test.
Assert that a queued prompt was not received matching a given truth test.
Assert that no prompts were received.
Assert that no queued prompts were received.
Details
at line 40
FakeTextGateway
fakeAgent(string $agent, Closure|array $responses = [])
Fake the responses returned by the given agent.
On the shared manager, the fake gateway affects every request.
at line 52
bool
hasFakeGatewayFor(Agent|string $agent)
Determine if the given agent has been faked.
at line 63
FakeTextGateway
fakeGatewayFor(Agent $agent)
Get a fake gateway instance for the given agent.
at line 75
InteractsWithFakeAgents
recordPrompt(AgentPrompt|QueuedAgentPrompt $prompt)
Record the given prompt for the faked agent.
Recorded prompts remain on the worker-shared manager.
at line 90
InteractsWithFakeAgents
assertAgentWasPrompted(string $agent, Closure|string $callback, array|null $prompts = null, string|null $message = null)
Assert that a prompt was received matching a given truth test.
at line 111
InteractsWithFakeAgents
assertAgentWasPromptedTimes(string $agent, int $times = 1)
Assert that a certain number of prompts were received.
at line 131
InteractsWithFakeAgents
assertAgentWasQueued(string $agent, Closure|string $callback)
Assert that a prompt was received matching a given truth test.
at line 144
InteractsWithFakeAgents
assertAgentNotPrompted(string $agent, Closure|string $callback, array|null $prompts = null, string|null $message = null)
Assert that a prompt was not received matching a given truth test.
at line 165
InteractsWithFakeAgents
assertAgentNotQueued(string $agent, Closure|string $callback)
Assert that a queued prompt was not received matching a given truth test.
at line 178
InteractsWithFakeAgents
assertAgentNeverPrompted(string $agent)
Assert that no prompts were received.
at line 191
InteractsWithFakeAgents
assertAgentNeverQueued(string $agent)
Assert that no queued prompts were received.