Skip to content

Conversation

GaryPEGEOT
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets partially #30502
License MIT
Doc PR TODO

Allow to record & replay responses for test / dev purpose:

<?php

$recorder = new FilesystemResponseRecorder('var/fixtures/http');
$callback = new RecordAndReplayCallback($myNamingStrategy, $recorder, RecordAndReplayCallback::MODE_REPLAY_OR_RECORD, $httpClient)

$mockClient = new MockHttpClient($callback);

// Will make an actual HTTP request
$client->request('POST', 'https://example.org/whatever');

// Will replay the previous response
$client->request('POST', 'https://example.org/whatever');

TODO:

  • Provide a default naming strategy
  • Create the PR for the documentation
  • Integrate with Framework bundle for easy config

@GaryPEGEOT
Copy link
Contributor Author

Close in favor of #35677

@GaryPEGEOT GaryPEGEOT deleted the feature/record-replay branch February 14, 2020 13:10
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants