Repository navigation
1.13.0
What's Changed
ClientFakeanswers each call with its method's default fake until you queue a response.preventStrayRequests()makes an unanswered call throw instead.respondTo()answers calls by resource, method or a closure, beside the queue.assertSentTimes(),assertSentInOrder()andsent()are public, and under Pestexpect($fake)->toHaveSent(),toHaveSentTimes(),toHaveSentOn(),toHaveSentInOrder()andtoHaveSentNothing()work too.- Every API exception has a
fake()with its status, type and request ID, andTransporterException::fake()stands for a request that got no answer. CreateStreamedResponse::fake()takes a list of events or aCreateResponse, andBatchResultResponse::fake()a list of results. Both carry the same rate-limit headers and request ID as the other fakes.Testing\Blocksbuilds text, tool use, thinking and web search blocks.Testing\Recorder, a client middleware, records a test's API calls once and replays them from a file afterwards, with no key.batches()->wait()polls a batch until it ends.BatchResponsehasisEnded(), and batch results havesucceeded(),errored(),canceled()andexpired().messages()->fits()checks a request against a token limit, andtrimToFit()drops the oldest turns until it fits.
UPGRADING.md lists the changes that can affect code written against 1.12, such as a fake with no responses no longer throwing.
Full Changelog: 1.12.0...1.13.0