gsaulmon / guzzlerecorder
Records and plays back guzzle responses
Installs: 18 698
Dependents: 5
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- guzzlehttp/guzzle: >=6.0
Requires (Dev)
- phpunit/phpunit: 4.1.*
This package is not auto-updated.
Last update: 2024-11-20 04:37:36 UTC
README
This is an event listener plugin for Guzzle 4/5 aimed at setting up tests for complex responses a bit quicker.
Usage
Attach an instance of the recorder to any Guzzle Client
$client = new GuzzleHttp\Client(); $watcher = new Gsaulmon\GuzzleRecorder\GuzzleRecorder(__DIR__ . '/my_test_responses'); $client->getEmitter()->attach($watcher);
Then run your tests. The recorder will grab and store all Guzzle responses in the "my_test_responses" folder. All subsequent runs of the tests will have the Guzzle requests intercepted and will be injected with the stored response.
The responses store will be the full actual response. Make sure to edit out any information you may not want to share.