Skip to content

Respect MockClient::shouldBypassResponseCache()#18

Open
JonPurvis wants to merge 1 commit intosaloonphp:v3from
JonPurvis:fix/547-fake-without-cache
Open

Respect MockClient::shouldBypassResponseCache()#18
JonPurvis wants to merge 1 commit intosaloonphp:v3from
JonPurvis:fix/547-fake-without-cache

Conversation

@JonPurvis
Copy link
Copy Markdown

@JonPurvis JonPurvis commented Apr 12, 2026

Sister PR: saloonphp/saloon#548
Fixes: saloonphp/saloon#547

When a MockClient opts out via withoutCache(), the cache middleware should not return a cached fake response or register the cache recorder for that request. Otherwise the first faked response is stored and later sends ignore updated fixtures or mock sequences.

CacheMiddleware now returns early when the pending request’s mock client reports shouldBypassResponseCache() === true.

Adds feature tests that assert stale fixture behaviour without the opt-out, and fresh fixture reads when withoutCache() is used on the mock client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable caching in tests

1 participant