Skip to content

svilborg/guzzle-file-mock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guzzle File Mock

Build Status Latest Stable Version License

Guzzle Mocking of Http calls to file system. On first call creates a snapshot and uses it afterwords.

Usage

$client = new GuzzleFileMock([
	            'file_mock' => __DIR__ . '/snapshots/',
	            'base_uri' => 'https://some.endpoint.org/'
	            ]);

$client->post("users", [
	            "form_params" => ["name" => "Peter"]
	        ]);

Php serializer and extension :

$client = new GuzzleFileMock([
	            'file_mock' => __DIR__ . '/snapshots/',
	            'file_mock_ext' => 'txt',
	            'file_mock_serializer' => '\GuzzleHttpMock\Serializer\PhpSerializer',
	            'base_uri' => 'https://some.endpoint.org/'
	            ]);

$client->post("users", [
	            "form_params" => ["name" => "Peter"]
	        ]);