svilborg / guzzle-file-snapshot
Guzzle File Snapshot Mock
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 2
Type:project
Requires
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- mockery/mockery: ^1.0
- nunomaduro/collision: ^2.0
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-11-19 22:31:02 UTC
README
Guzzle File Mock
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"] ]);