Copilot::fake()
Copilot::fake() mocks behavior exposed through the Copilot facade. It does not mock every internal component.
Copilot::start():
Assertions
Verify a specific prompt was called:Prevent stray requests
Block all JSON-RPC requests. If a request is sent,Revolution\Copilot\Exceptions\StrayRequestException is thrown.
Client::start() is not blocked.
Cases that may not work as expected
When you use Copilot inside an Artisan command,fake() works, but assertions such as assertPrompt() may not always behave as expected.
shouldReceive() / expects()
You can also use familiar Mockery-style methods such asshouldReceive() and expects() via the facade.
For the latest updates, see the GitHub repository.