Skip to content

A Guzzle 4/5/6 plugin to record and replay client responses

Notifications You must be signed in to change notification settings

gsaulmon/GuzzleRecorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GuzzleRecorder

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.

About

A Guzzle 4/5/6 plugin to record and replay client responses

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages